提交 07baa605 authored 作者: lidongxu's avatar lidongxu

Merge branch 'ldx' into dev

...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"vue-cropper": "1.1.1", "vue-cropper": "1.1.1",
"vue-router": "4.4.0", "vue-router": "4.4.0",
"vue3-count-to": "^1.1.2", "vue3-count-to": "^1.1.2",
"vuedraggable": "4.1.0" "vuedraggable": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "5.0.5", "@vitejs/plugin-vue": "5.0.5",
......
...@@ -5,3 +5,12 @@ export function getReportListAPI() { ...@@ -5,3 +5,12 @@ export function getReportListAPI() {
url: '/report/share/list' url: '/report/share/list'
}) })
} }
// 提交其他报表超链接
export function submitOtherReportAPI(data) {
return request({
url: '/report/share',
method: 'post',
data
})
}
\ No newline at end of file
...@@ -91,7 +91,7 @@ export function addPlanByWebAPI(data) { ...@@ -91,7 +91,7 @@ export function addPlanByWebAPI(data) {
export function updatePlanByWebAPI(data) { export function updatePlanByWebAPI(data) {
return request({ return request({
baseURL: VITE_APP_PROMOTION, baseURL: VITE_APP_PROMOTION,
url: '/plan/v2/core/update', url: '/plan/v2/core/one',
method: 'PUT', method: 'PUT',
data data
}) })
...@@ -119,3 +119,13 @@ export function updatePlanAPI(data) { ...@@ -119,3 +119,13 @@ export function updatePlanAPI(data) {
data data
}) })
} }
// 批量修改计划归属人
export function batchUpdatePlanAPI(data) {
return request({
baseURL: VITE_APP_PROMOTION,
url: '/plan/v2/core/more',
method: 'PUT',
data
})
}
\ No newline at end of file
...@@ -3,33 +3,191 @@ ...@@ -3,33 +3,191 @@
<el-card class="container"> <el-card class="container">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>报表列表</span> <span>常用报表</span>
<el-button class="custom"
type="primary"
link
@click="visible = true">
自定义
</el-button>
</div> </div>
</template> </template>
<div v-for="item in reportList" <div v-for="item in groups"
class="item"> class="group_item">
<el-link icon="Document" <div>
:href="baseURL + item.previewUrl" <p class="group_name">
target="_blank">{{ item.name }}</el-link> <el-icon color="blue"
size="18">
<Folder />
</el-icon>
<span>
{{ item.name }}
</span>
</p>
<div class="link_wrap">
<div class="link_item"
v-for="obj in item.items">
<el-icon color="green"
size="16">
<Document></Document>
</el-icon>
<el-link :href="baseURL + obj.previewUrl"
target="_blank">{{ obj.name }}</el-link>
</div>
</div>
</div>
</div> </div>
</el-card> </el-card>
<el-dialog title="编辑常用报表"
v-model="visible">
<div class="wrap">
<div class="left">
<draggable v-model="reportList"
group="reports"
ghost-class="dragging-item-left"
item-key="id">
<template #item="{ element }">
<div class="link_item">
<el-icon color="green"
size="16">
<Document></Document>
</el-icon>
<el-link :href="baseURL + element.previewUrl"
target="_blank">{{ element.name }}</el-link>
</div>
</template>
</draggable>
</div>
<div class="right">
<div class="group-container">
<el-card v-for="group in groups"
:key="group.id"
class="group_card"
:style="{ width: '100%' }">
<template #header>
<div class="card-header">
<span>{{ group.name }}</span>
</div>
</template>
<draggable v-model="group.items"
group="reports"
ghost-class="dragging-item"
item-key="id">
<template #item="{ element }">
<div class="link_item">
<el-icon color="green"
size="16">
<Document></Document>
</el-icon>
<el-link :href="baseURL + element.previewUrl"
target="_blank">{{ element.name }}</el-link>
</div>
</template>
</draggable>
</el-card>
</div>
</div>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script setup> <script setup>
import { getReportListAPI } from '@/api' import { getReportListAPI } from '@/api'
import draggable from 'vuedraggable'
const visible = ref(false)
const groups = ref([
{ id: 1, name: '品控部', items: [] },
{ id: 2, name: '物流部', items: [] },
{ id: 3, name: '计划部', items: [] },
{ id: 4, name: '采购部', items: [] },
{ id: 5, name: '滁州工厂', items: [] },
])
const baseURL = ref(import.meta.env.VITE_APP_REPORT_URL + '/report') const baseURL = ref(import.meta.env.VITE_APP_REPORT_URL + '/report')
const reportList = ref([]) const reportList = ref([])
const getReportList = async () => { const getReportList = async () => {
const { data } = await getReportListAPI() const { data } = await getReportListAPI()
reportList.value = data reportList.value = data.concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data).concat(data)
} }
getReportList() getReportList()
</script> </script>
<style scoped <style scoped
lang="scss"> lang="scss">
.item { .el-card__header {
margin: 10px 0; .custom {
float: right;
padding: 3px 0;
}
}
.group_item {
.group_name {
display: flex;
align-items: center;
gap: 10px;
font-size: 16px;
font-weight: 800;
} }
.link_wrap {
display: flex;
flex-wrap: wrap;
padding: 0 0 0 20px;
.link_item {
padding: 10px 0;
width: 25%;
/* 超出宽度文字省略号 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.link_item {
padding: 5px 0;
display: flex;
align-items: center;
gap: 10px;
}
.group_card {
margin-top: 20px;
}
.wrap {
display: flex;
gap: 20px;
width: 100%;
height: 100%;
.left {
width: 100%;
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
}
.right {
width: 100%;
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
}
}
/* 添加拖拽时的样式 */
.dragging-item-left {
background-color: transparent;
}
.dragging-item {
background-color: transparent;
}
</style> </style>
\ No newline at end of file
...@@ -18,11 +18,12 @@ export default { ...@@ -18,11 +18,12 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss"
#jimuReportFrame { scoped>
#jimuReportFrame {
width: 100%; width: 100%;
// 为了隐藏积木报表顶部的广告栏 // 为了隐藏积木报表顶部的广告栏
// min-height: calc(100vh - 30px) !important; // min-height: calc(100vh - 30px) !important;
// margin-top: -60px; // margin-top: -60px;
} }
</style> </style>
\ No newline at end of file
<template>
<div class="app-container">
<el-card class="container">
<template #header>
<div class="card-header">
<span>新增报表</span>
</div>
</template>
<el-form :model="form"
label-width="100px">
<el-form-item label="报表名字"
prop="reportName">
<el-input v-model="form.reportName"
placeholder="请输入报表名字" />
</el-form-item>
<!-- 超链接输入 -->
<el-form-item label="超链接"
prop="link">
<el-input v-model="form.link"
placeholder="请输入超链接地址" />
</el-form-item>
<!-- 提交按钮 -->
<el-form-item>
<el-button type="primary"
@click="handleSubmit">提交</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import { submitOtherReportAPI } from '@/api' // 假设你的API接口
// 表单数据
const form = ref({
link: '',
remark: ''
})
// 提交处理
const handleSubmit = async () => {
try {
if (!form.value.group || !form.value.link) {
ElMessage.warning('请填写完整信息')
return
}
await submitOtherReportAPI(form.value)
ElMessage.success('提交成功')
// 清空表单
form.value = {
link: '',
remark: ''
}
} catch (error) {
ElMessage.error('提交失败')
}
}
</script>
<style scoped>
.app-container {
padding: 20px;
}
</style>
...@@ -140,6 +140,10 @@ ...@@ -140,6 +140,10 @@
plain plain
icon="Plus" icon="Plus"
@click="handleAdd">新增</el-button> @click="handleAdd">新增</el-button>
<el-button type="primary"
plain
icon="Edit"
@click="handleEditEmp">修改归属人</el-button>
<el-button type="warning" <el-button type="warning"
plain plain
icon="Download"> icon="Download">
...@@ -325,7 +329,6 @@ ...@@ -325,7 +329,6 @@
filterable filterable
clearable clearable
style="width: 95%" style="width: 95%"
:disabled="cityManagerPrivilege || !!addOrEditPlanForm.id"
@change="selEmployee"> @change="selEmployee">
<el-option v-for="item in managerList" <el-option v-for="item in managerList"
:key="item.employeeNo" :key="item.employeeNo"
...@@ -398,12 +401,50 @@ ...@@ -398,12 +401,50 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<!-- 修改计划归属人 -->
<el-dialog title="修改计划归属人"
v-model="editPlanEmpVisible"
width="60%">
<!-- 表单 -->
<el-form :model="editPlanEmpForm"
label-width="150px"
:rules="editPlanEmpRules"
ref="editPlanEmpRef"
inline>
<el-form-item label="归属人"
prop="employeeId">
<el-select v-model="editPlanEmpForm.employeeId"
placeholder="请选择归属人(搜索)"
filterable
clearable>
<el-option v-for="item in managerList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-form>
<!-- 取消确定 -->
<template #footer>
<div class="dialog-footer">
<el-button type="default"
@click="editPlanEmpVisible = false">
取消
</el-button>
<el-button type="primary"
@click="handleEditPlanEmp"
:disabled="!editPlanEmpForm.employeeId">
确定保存
</el-button>
</div>
</template>
</el-dialog>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { getPlanListAPI, uploadFileToOSSAPI, addPlanAPI, savePlanAPI, deletePlanAPI, addPlanByRoleAPI, getProCityAPI, getDealerListAPI, getWarZoneListAPI, getChargeListAPI, addPlanByWebAPI, updatePlanByWebAPI, getPlanStoreListAPI, updatePlanAPI } from '@/api' import { getPlanListAPI, uploadFileToOSSAPI, addPlanAPI, savePlanAPI, deletePlanAPI, addPlanByRoleAPI, getProCityAPI, getDealerListAPI, getWarZoneListAPI, getChargeListAPI, addPlanByWebAPI, updatePlanByWebAPI, getPlanStoreListAPI, updatePlanAPI, batchUpdatePlanAPI } from '@/api'
import { useDatePickerOptions } from '@/hooks' import { useDatePickerOptions } from '@/hooks'
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import store from '@/store' import store from '@/store'
...@@ -435,6 +476,7 @@ const taskStatusList = ref([ ...@@ -435,6 +476,7 @@ const taskStatusList = ref([
// 查询参数-区域查询 // 查询参数-区域查询
const provinceList = ref([]) const provinceList = ref([])
const cityList = ref([]) const cityList = ref([])
const getProCity = async () => { const getProCity = async () => {
const { data } = await getProCityAPI(queryParams) const { data } = await getProCityAPI(queryParams)
if (queryParams.provinceId) { if (queryParams.provinceId) {
...@@ -514,13 +556,13 @@ const regionChange = (val) => { ...@@ -514,13 +556,13 @@ const regionChange = (val) => {
getPlanList() getPlanList()
} }
// 等待被删除的数据 // 表格复选框的数据
const deleteList = ref([]) const checkedRowList = ref([])
// 全选 // 全选
const handleSelectionChange = (val) => { const handleSelectionChange = (val) => {
deleteList.value = val checkedRowList.value = val
multiple.value = !(deleteList.value.length > 0) multiple.value = !(checkedRowList.value.length > 0)
} }
// 任务列表 // 任务列表
...@@ -698,6 +740,38 @@ const tableRowTimeOutClassName = ({ row }) => { ...@@ -698,6 +740,38 @@ const tableRowTimeOutClassName = ({ row }) => {
} }
} }
// 批量修改归属人
const editPlanEmpVisible = ref(false)
const editPlanEmpForm = ref({
employeeId: null
})
const editPlanEmpRules = ref({
employeeId: [{
required: true,
message: '请选择归属人',
trigger: 'change'
}]
})
const handleEditEmp = () => {
editPlanEmpVisible.value = true
nextTick(() => {
editPlanEmpForm.value.employeeId = null
proxy.resetForm("editPlanEmpRef");
})
}
// 确定批量修改计划人
const handleEditPlanEmp = async () => {
const res = await batchUpdatePlanAPI({
employeeId: editPlanEmpForm.value.employeeId,
operName: store.state.value.user.userInfo.userName,
planIds: checkedRowList.value.map(item => item.id)
})
ElMessage.success(res.msg)
editPlanEmpVisible.value = false
getPlanList()
}
// 上传计划表格 // 上传计划表格
const uploadFile = async (file) => { const uploadFile = async (file) => {
proxy.$modal.loading("正在上传数据,请稍后..."); proxy.$modal.loading("正在上传数据,请稍后...");
...@@ -956,9 +1030,9 @@ const disabledDateFn = (time) => { ...@@ -956,9 +1030,9 @@ const disabledDateFn = (time) => {
const handleAdd = () => { const handleAdd = () => {
resetAddOrEditPlanForm() resetAddOrEditPlanForm()
// 只有城市经理情况下,默认填充当前登录人为归属人 // 只有城市经理情况下,默认填充当前登录人为归属人
if (cityManagerPrivilege.value) { // if (cityManagerPrivilege.value) {
addOrEditPlanForm.value.employeeNo = store.state.value.user.userInfo.userName // addOrEditPlanForm.value.employeeNo = store.state.value.user.userInfo.userName
} // }
addOrEditPlanVisible.value = true addOrEditPlanVisible.value = true
} }
const activityModeList = ref([ const activityModeList = ref([
...@@ -1017,6 +1091,10 @@ const handleAddOrEditPlan = async () => { ...@@ -1017,6 +1091,10 @@ const handleAddOrEditPlan = async () => {
addOrEditPlanForm.value.operName = store.state.value.user.userInfo.nickName addOrEditPlanForm.value.operName = store.state.value.user.userInfo.nickName
addOrEditPlanForm.value.operId = store.state.value.user.userInfo.userId addOrEditPlanForm.value.operId = store.state.value.user.userInfo.userId
if (addOrEditPlanForm.value.id) { if (addOrEditPlanForm.value.id) {
// 根据归属人 employeeId 查询它的 id 和名字
const employeeInfo = managerList.value.find(item => item.employeeNo === addOrEditPlanForm.value.employeeNo)
addOrEditPlanForm.value.employeeId = employeeInfo.value
addOrEditPlanForm.value.employeeName = employeeInfo.label
await updatePlanByWebAPI(addOrEditPlanForm.value) await updatePlanByWebAPI(addOrEditPlanForm.value)
} else { } else {
await addPlanByWebAPI(addOrEditPlanForm.value) await addPlanByWebAPI(addOrEditPlanForm.value)
...@@ -1029,7 +1107,7 @@ const handleAddOrEditPlan = async () => { ...@@ -1029,7 +1107,7 @@ const handleAddOrEditPlan = async () => {
// 删除计划 // 删除计划
const deletePlane = (row) => { const deletePlane = (row) => {
deleteList.value = [row] checkedRowList.value = [row]
handleDelete() handleDelete()
} }
const handleDelete = async () => { const handleDelete = async () => {
...@@ -1040,7 +1118,7 @@ const handleDelete = async () => { ...@@ -1040,7 +1118,7 @@ const handleDelete = async () => {
type: 'warning' type: 'warning'
}) })
await deletePlanAPI({ await deletePlanAPI({
planIds: deleteList.value.map(o => o.id), planIds: checkedRowList.value.map(o => o.id),
employeeNo: store.state.value.user.userInfo.userName employeeNo: store.state.value.user.userInfo.userName
}) })
ElMessage.success('删除成功') ElMessage.success('删除成功')
......
...@@ -245,7 +245,8 @@ ...@@ -245,7 +245,8 @@
prop="nickName"> prop="nickName">
<el-input v-model="form.nickName" <el-input v-model="form.nickName"
placeholder="请输入用户昵称" placeholder="请输入用户昵称"
maxlength="30" /> maxlength="30"
:disabled="!!form.userId" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -253,7 +254,8 @@ ...@@ -253,7 +254,8 @@
prop="phonenumber"> prop="phonenumber">
<el-input v-model="form.phonenumber" <el-input v-model="form.phonenumber"
placeholder="请输入手机号码" placeholder="请输入手机号码"
maxlength="11" /> maxlength="11"
:disabled="!!form.userId" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -277,7 +279,8 @@ ...@@ -277,7 +279,8 @@
:props="{ value: 'id', label: 'label', children: 'children' }" :props="{ value: 'id', label: 'label', children: 'children' }"
value-key="id" value-key="id"
placeholder="请选择归属部门" placeholder="请选择归属部门"
check-strictly /> check-strictly
:disabled="!!form.userId" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12"> <!-- <el-col :span="12">
...@@ -685,8 +688,8 @@ ...@@ -685,8 +688,8 @@
sex: undefined, sex: undefined,
status: "0", status: "0",
remark: undefined, remark: undefined,
postId: undefined, postId: null,
roleId: undefined, roleId: null,
proStatus: false, // 促销权限 proStatus: false, // 促销权限
privilegeId: undefined, privilegeId: undefined,
workCityList: [] // 工作城市 workCityList: [] // 工作城市
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论