From c9093f203c664cdbb9fe55f245f9936e5175280b Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Thu, 25 Dec 2025 15:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/common.js | 25 +- src/api/planMange/monthlyPlan.js | 10 +- src/store/modules/options.js | 4 + src/views/basicManage/businessType/index.vue | 3 + src/views/basicManage/planCategory/index.vue | 3 + .../basicManage/planProfessional/index.vue | 3 + .../basicManage/workloadCategory/index.vue | 3 + src/views/planMange/monthlyPlan/config.js | 38 +- src/views/planMange/monthlyPlan/edit.vue | 336 ++++++++++++------ src/views/planMange/monthlyPlan/index.vue | 10 +- 10 files changed, 318 insertions(+), 117 deletions(-) diff --git a/src/api/common.js b/src/api/common.js index afb3142..2c1d18e 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -18,14 +18,23 @@ export function getPersonNatureAndCategoryAndPositionSelectAPI(data) { }) } -// 公共下拉选数据 - 获取工作量类别 -// export function getWorkloadCategorySelectAPI(data) { -// return request({ -// url: '/workloadCategory/getWorkloadCategorySelect', -// method: 'GET', -// params: data, -// }) -// } +// 公共下拉选数据 - 获取专业,类型,类别 0 1 2 分别对应专业,类型,类别 +export function getMajorTypeCategorySelectAPI(data) { + return request({ + url: '/planMajor/getPlanMajorListSelect', + method: 'GET', + params: data, + }) +} + +// 获取工作量类别下拉 +export function getPlanMajorListSelectAPI(data = {}) { + return request({ + url: '/workloadCategory/getWorkloadCategoryListSelect', + method: 'GET', + params: data, + }) +} // 公共下拉选数据 - 获取人员列表 export function getPersonnelCommonListAPI(data) { diff --git a/src/api/planMange/monthlyPlan.js b/src/api/planMange/monthlyPlan.js index 7a9321e..5ef260d 100644 --- a/src/api/planMange/monthlyPlan.js +++ b/src/api/planMange/monthlyPlan.js @@ -21,11 +21,19 @@ export function addMonthlyPlanAPI(data) { // 月计划管理- 修改 export function updateMonthlyPlanAPI(data) { return request({ - url: '/monthlyPlan/updatePersonnel', + url: '/monthlyPlan/updateMonthlyPlan', method: 'POST', data, }) } +// 月计划管理- 获取详情 +export function getMonthlyPlanDetailAPI(data) { + return request({ + url: '/monthlyPlan/getMonthlyPlanById', + method: 'GET', + params: data, + }) +} // 月计划管理- 删除 export function delMonthlyPlanAPI(data) { diff --git a/src/store/modules/options.js b/src/store/modules/options.js index befcbd5..2e9d907 100644 --- a/src/store/modules/options.js +++ b/src/store/modules/options.js @@ -7,6 +7,10 @@ const useOptionsStore = defineStore('options', { personCategoryOptions: [], // 人员分类 inspectionStationOptions: [], // 运检站 personnelCommonOptions: [], // 人员列表 + majorTypeCategoryOptions: [], // 专业 + planBusinessTypeOptions: [], // 业务类型 + planCategoryOptions: [], // 类别 + planWorkLoadCategoryOptions: [], // 工作量类别 }), actions: { // 通用的设置方法,方便 Hook 调用 diff --git a/src/views/basicManage/businessType/index.vue b/src/views/basicManage/businessType/index.vue index 33bf5be..091fb4e 100644 --- a/src/views/basicManage/businessType/index.vue +++ b/src/views/basicManage/businessType/index.vue @@ -57,6 +57,7 @@ import { delBusinessTypeAPI, updateBusinessTypeAPI, } from '@/api/basicManage/businessType' +import { bus, BUS_EVENTS } from '@/utils/bus' import config from './config' import ComTable from '@/components/ComTable/index.vue' import ComButton from '@/components/ComButton/index.vue' @@ -111,6 +112,7 @@ const actionColumns = [ if (result.code === 200) { proxy.$modal.msgSuccess('删除成功') comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'planBusinessTypeOptions') // 刷新业务类型下拉缓存 } }) }, @@ -150,6 +152,7 @@ const onHandleSave = async () => { addAndEditFormRef.value.resetFields() // 重置表单 dialogConfig.outerVisible = false comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'planBusinessTypeOptions') // 刷新业务类型下拉缓存 } } catch (error) { console.error('表单校验失败或请求错误:', error) diff --git a/src/views/basicManage/planCategory/index.vue b/src/views/basicManage/planCategory/index.vue index dac0d1b..a35e729 100644 --- a/src/views/basicManage/planCategory/index.vue +++ b/src/views/basicManage/planCategory/index.vue @@ -66,6 +66,7 @@ import { delPlanCategoryAPI, updatePlanCategoryAPI, } from '@/api/basicManage/planCategory.js' +import { bus, BUS_EVENTS } from '@/utils/bus' import config from './config' import ComTable from '@/components/ComTable/index.vue' import ComButton from '@/components/ComButton/index.vue' @@ -120,6 +121,7 @@ const actionColumns = [ if (result.code === 200) { proxy.$modal.msgSuccess('删除成功') comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'planCategoryOptions') // 刷新类别下拉缓存 } }) }, @@ -159,6 +161,7 @@ const onHandleSave = async () => { addAndEditFormRef.value.resetFields() // 重置表单 dialogConfig.outerVisible = false comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'planCategoryOptions') // 刷新类别下拉缓存 } } catch (error) { console.error('表单校验失败或请求错误:', error) diff --git a/src/views/basicManage/planProfessional/index.vue b/src/views/basicManage/planProfessional/index.vue index 1818684..72b876b 100644 --- a/src/views/basicManage/planProfessional/index.vue +++ b/src/views/basicManage/planProfessional/index.vue @@ -66,6 +66,7 @@ import { delPlanProfessionalAPI, updatePlanProfessionalAPI, } from '@/api/basicManage/planProfessional' +import { bus, BUS_EVENTS } from '@/utils/bus' import config from './config' import ComTable from '@/components/ComTable/index.vue' import ComButton from '@/components/ComButton/index.vue' @@ -120,6 +121,7 @@ const actionColumns = [ if (result.code === 200) { proxy.$modal.msgSuccess('删除成功') comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'majorTypeCategoryOptions') // 刷新专业下拉缓存 } }) }, @@ -159,6 +161,7 @@ const onHandleSave = async () => { addAndEditFormRef.value.resetFields() // 重置表单 dialogConfig.outerVisible = false comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'majorTypeCategoryOptions') // 刷新专业下拉缓存 } } catch (error) { console.error('表单校验失败或请求错误:', error) diff --git a/src/views/basicManage/workloadCategory/index.vue b/src/views/basicManage/workloadCategory/index.vue index 06d1817..23b9b6c 100644 --- a/src/views/basicManage/workloadCategory/index.vue +++ b/src/views/basicManage/workloadCategory/index.vue @@ -84,6 +84,7 @@ import { updateWorkloadCategoryAPI, } from '@/api/basicManage/workloadCategory.js' import { yuanToFen, fenToYuan } from '@/utils/ruoyi' +import { bus, BUS_EVENTS } from '@/utils/bus' import config from './config' import ComTable from '@/components/ComTable/index.vue' import ComButton from '@/components/ComButton/index.vue' @@ -140,6 +141,7 @@ const actionColumns = [ if (result.code === 200) { proxy.$modal.msgSuccess('删除成功') comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'planWorkLoadCategoryOptions') // 刷新工作量类别下拉缓存 } }) }, @@ -180,6 +182,7 @@ const onHandleSave = async () => { addAndEditFormRef.value.resetFields() // 重置表单 dialogConfig.outerVisible = false comTableRef.value?.refresh() // 刷新表格 + bus.emit(BUS_EVENTS.REFRESH_OPTIONS, 'planWorkLoadCategoryOptions') // 刷新工作量类别下拉缓存 } } catch (error) { console.error('表单校验失败或请求错误:', error) diff --git a/src/views/planMange/monthlyPlan/config.js b/src/views/planMange/monthlyPlan/config.js index cd30bfc..d331b19 100644 --- a/src/views/planMange/monthlyPlan/config.js +++ b/src/views/planMange/monthlyPlan/config.js @@ -1,4 +1,5 @@ import { reactive } from 'vue' +import dayjs from 'dayjs' // 静态选项(可后续替换为接口下拉) const stationOptions = [ @@ -67,18 +68,45 @@ export const tableColumns = [ { prop: 'businessTypeId', label: '业务类型', fixed: true }, { prop: 'projectName', label: '项目名称', fixed: true }, { prop: 'workContent', label: '工作任务' }, - { prop: 'riskLevelName', label: '风险等级' }, + { prop: 'riskLevel', label: '风险等级' }, { prop: 'planCategoryId', label: '类别' }, - { prop: 'workAmount', label: '工作量', width: '140' }, + { prop: 'workAmount', label: '工作量', width: '180', slot: 'workAmount' }, { prop: 'towerBaseNumber', label: '基塔数' }, { prop: 'plannedStartTime', label: '计划开始时间', width: '140' }, { prop: 'plannedEndTime', label: '计划结束时间', width: '140' }, - { prop: 'planPersonnel', label: '计划投入管理人员数量' }, - { prop: 'planSkilledWorkerDay', label: '计划投入管理人员工日' }, + { + prop: 'planPersonnel', + label: '计划投入管理人员数量', + formatter: (row) => { + return row.personneltList?.length || 0 + }, + }, + { prop: 'planCarNum', label: '计划投入管理人员车辆数' }, { prop: 'planSkilledWorkerNum', label: '计划投入熟练工人员数量' }, + { + prop: 'planSkilledWorkerDay', + label: '计划投入熟练工人员工日', + // 使用dayjs 根据开始时间和结束时间计算出工日 * 计划投入熟练工人员工日 + formatter: (row) => { + return ( + (dayjs(row.plannedEndTime).diff(dayjs(row.plannedStartTime), 'day') + 1) * + row.planSkilledWorkerDay + ) + }, + }, { prop: 'planAuxiliaryWorkerNum', label: '计划投入辅助工人员数量' }, - { prop: 'planAuxiliaryWorkerDay', label: '计划投入施工人员工日' }, + { + prop: 'planAuxiliaryWorkerDay', + label: '计划投入辅助工人员工日', + // 使用dayjs 根据开始时间和结束时间计算出工日 * 计划投入熟练工人员工日 + formatter: (row) => { + return ( + (dayjs(row.plannedEndTime).diff(dayjs(row.plannedStartTime), 'day') + 1) * + row.planAuxiliaryWorkerDay + ) + }, + }, { prop: 'planSubCarNum', label: '计划投入分包车辆数' }, { prop: 'actualWorkingDay', label: '实际工作天数' }, ] diff --git a/src/views/planMange/monthlyPlan/edit.vue b/src/views/planMange/monthlyPlan/edit.vue index 9fde576..e262bd1 100644 --- a/src/views/planMange/monthlyPlan/edit.vue +++ b/src/views/planMange/monthlyPlan/edit.vue @@ -31,10 +31,10 @@ clearable > @@ -50,10 +50,10 @@ clearable > @@ -95,10 +95,10 @@ clearable > @@ -106,22 +106,23 @@ -