From 4d59cb23254329178038cc063b2c1159cd7f86f9 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 29 Dec 2025 18:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=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/planMange/dailyPlan.js | 9 ++ src/views/planMange/dailyPlan/config.js | 82 ++++++++++--- src/views/planMange/dailyPlan/edit.vue | 109 +++++++++++++----- .../planMange/dailyPlan/forms/repairForm.vue | 81 +++++++------ .../planMange/dailyPlan/forms/runForm.vue | 11 +- src/views/planMange/dailyPlan/index.vue | 76 ++++++++++-- 6 files changed, 271 insertions(+), 97 deletions(-) diff --git a/src/api/planMange/dailyPlan.js b/src/api/planMange/dailyPlan.js index da00969..84cf98f 100644 --- a/src/api/planMange/dailyPlan.js +++ b/src/api/planMange/dailyPlan.js @@ -44,3 +44,12 @@ export function delDailyPlanAPI(data) { data, }) } + +// 日计划管理- 获取日计划详情 +export function getDailyPlanDetailAPI(data) { + return request({ + url: '/dayPlan/getDayPlanById', + method: 'GET', + params: data, + }) +} diff --git a/src/views/planMange/dailyPlan/config.js b/src/views/planMange/dailyPlan/config.js index 84fca36..2ee202a 100644 --- a/src/views/planMange/dailyPlan/config.js +++ b/src/views/planMange/dailyPlan/config.js @@ -60,21 +60,77 @@ export const tableColumns = [ { prop: 'planMajorName', label: '专业', fixed: true }, { prop: 'projectName', label: '项目名称', fixed: true }, { prop: 'workContent', label: '工作任务' }, - { prop: 'riskLevelName', label: '风险等级' }, - { prop: 'categoryName', label: '计划工作量(基)' }, + { prop: 'riskLevel', label: '风险等级' }, + { prop: 'plannedWorkload', label: '计划工作量(基)' }, ] export const tableColumns_1 = [ - { prop: 'stationName', label: '拟投入作业人员数量', fixed: false }, - { prop: 'majorName', label: '拟投入作业人员姓名', fixed: false }, - { prop: 'businessTypeName', label: '拟投入车辆', fixed: false }, - { prop: 'projectName', label: '实际投入作业人员数量', fixed: false }, - { prop: 'workTask', label: '实际投入作业人员姓名', fixed: false }, - { prop: 'riskLevelName', label: '实际投入车辆', fixed: false }, - { prop: 'categoryName', label: '实际完成工作量明细', fixed: false }, - { prop: 'categoryName', label: '实际完成工作量(基)', fixed: false }, - { prop: 'categoryName', label: '完成比例', fixed: false }, - { prop: 'categoryName', label: '作业计划完成情况', fixed: false }, - { prop: 'categoryName', label: '计划变更及未完成情况说明', fixed: false }, + { + prop: 'stationName', + label: '拟投入作业人员数量', + fixed: false, + + formatter: (row) => { + return row.proposedPersonnelList?.filter((item) => item.dataSource == 0).length || '' + }, + }, + { + prop: 'majorName', + label: '拟投入作业人员姓名', + fixed: false, + width: '180', + formatter: (row) => { + return ( + row.proposedPersonnelList + ?.filter((item) => item.dataSource == 0) + .map((item) => item.name) + .join(',') || '' + ) + }, + }, + { + prop: 'proposedLongTimeCar', + label: '拟投入车辆', + fixed: false, + width: '180', + formatter: (row) => { + return `长租车${row.proposedLongTimeCar}辆,临租车${row.proposedTemporaryCar}辆` || '' + }, + }, + { + prop: 'projectName', + label: '实际投入作业人员数量', + fixed: false, + formatter: (row) => { + return row.proposedPersonnelList?.filter((item) => item.dataSource == 1).length || '' + }, + }, + { + prop: 'workTask', + label: '实际投入作业人员姓名', + fixed: false, + formatter: (row) => { + return ( + row.proposedPersonnelList + ?.filter((item) => item.dataSource == 1) + .map((item) => item.name) + .join(',') || '' + ) + }, + }, + { + prop: 'actualLongTimeCar', + label: '实际投入车辆', + fixed: false, + formatter: (row) => { + return `长租车${row.actualLongTimeCar}辆,临租车${row.actualTemporaryCar}辆` || '' + }, + }, + { prop: 'actualWorkContent', label: '实际完成工作内容', fixed: false }, + { prop: 'actualWorkload', label: '实际完成工作量(基)', fixed: false }, + { prop: 'completionPercentage', label: '完成比例', fixed: false }, + + { prop: 'planCompletionStatus', label: '作业计划完成情况', fixed: false }, + { prop: 'planChanges', label: '计划变更及未完成情况说明', fixed: false }, ] export const tableColumns_2 = [ { prop: 'stationName', label: '拟投入高处作业人员数量', fixed: false }, diff --git a/src/views/planMange/dailyPlan/edit.vue b/src/views/planMange/dailyPlan/edit.vue index c19a164..8fd9114 100644 --- a/src/views/planMange/dailyPlan/edit.vue +++ b/src/views/planMange/dailyPlan/edit.vue @@ -174,7 +174,7 @@ import { } from 'vue' import { useRoute, useRouter } from 'vue-router' import { getPersonnelCommonListAPI } from '@/api/common.js' -import { updateDailyPlanAPI } from '@/api/planMange/dailyPlan.js' +import { updateDailyPlanAPI, getDailyPlanDetailAPI } from '@/api/planMange/dailyPlan.js' import { Search } from '@element-plus/icons-vue' import { useOptions } from '@/hooks/useOptions' import ComButton from '@/components/ComButton/index.vue' @@ -278,21 +278,21 @@ const getRepairFormData = () => ({ plannedWorkload: null, // 计划工作量 highAltitudePersonnelList: [], // 拟投入高处作业人员(数组) groundPersonnelList: [], // 拟投入地面作业人员(数组) - skilledWorkerNum: null, // 计划投入熟练工人员数量 - skilledWorkerDay: null, // 计划投入工日(熟练工) - auxiliaryWorkerNum: null, // 计划投入辅助工人员数量 - auxiliaryWorkerDay: null, // 计划投入工日(辅助工) + proposedProficientPersonnel: null, // 计划投入熟练工人员数量 + proposedProficientDay: null, // 计划投入工日(熟练工) + proposedAssistancePersonnel: null, // 计划投入辅助工人员数量 + proposedAssistanceDay: null, // 计划投入工日(辅助工) proposedLongTimeCar: null, // 拟投入长租车 proposedTemporaryCar: null, // 拟投入临租车 - proposedSubcontractedCar: null, // 拟投入分包车 + proposedSubCar: null, // 拟投入分包车 // 实际完成情况 actualHighAltitudePersonnelList: [], // 实际投入高处作业人员(数组) actualGroundPersonnelList: [], // 实际投入地面作业人员(数组) - actualSkilledWorkerNum: null, // 实际投入检修熟练工数量 - actualAuxiliaryWorkerNum: null, // 实际投入检修辅助工数量 + actualProficientPersonnel: null, // 实际投入检修熟练工数量 + actualAssistancePersonnel: null, // 实际投入检修辅助工数量 actualLongTimeCar: null, // 实际投入长租车 actualTemporaryCar: null, // 实际投入临租车 - actualSubcontractedCar: null, // 实际投入分包车 + actualSubCar: null, // 实际投入分包车 actualWorkloadList: [ { workloadCategoryId: '', @@ -366,26 +366,69 @@ const onSubmit = async () => { // 校验通过,继续执行后续代码 const proposedPersonnelList = [] - formData.value.planPersonnelList.forEach((item) => { - proposedPersonnelList.push({ - dayPlanId: route.query.id, - inspectionStationName: item.inspectionStationName, - personnelld: item.id, - name: item.name, - dataSource: 0, - }) - }) - formData.value.actualPersonnelList.forEach((item) => { - proposedPersonnelList.push({ - dayPlanId: route.query.id, - inspectionStationName: item.inspectionStationName, - personnelld: item.id, - name: item.name, - dataSource: 1, - }) - }) + const type = dayPlanType.value - // 组装参数:排除基本信息字段,只提交投入资源情况 + if (type === '0' || type === 0) { + // 运行类型:拟投入/实际投入作业人员 + ;(formData.value.planPersonnelList || []).forEach((item) => { + proposedPersonnelList.push({ + dayPlanId: route.query.id, + inspectionStationName: item.inspectionStationName, + personnelld: item.id, + name: item.name, + dataSource: 0, // 拟投入作业人员 + }) + }) + ;(formData.value.actualPersonnelList || []).forEach((item) => { + proposedPersonnelList.push({ + dayPlanId: route.query.id, + inspectionStationName: item.inspectionStationName, + personnelld: item.id, + name: item.name, + dataSource: 1, // 实际入作业人员 + }) + }) + } else if (type === '1' || type === 1) { + // 检修类型:高处/地面,拟投入 & 实际投入 + ;(formData.value.highAltitudePersonnelList || []).forEach((item) => { + proposedPersonnelList.push({ + dayPlanId: route.query.id, + inspectionStationName: item.inspectionStationName, + personnelld: item.id, + name: item.name, + dataSource: 2, // 拟投入高处作业人员 + }) + }) + ;(formData.value.groundPersonnelList || []).forEach((item) => { + proposedPersonnelList.push({ + dayPlanId: route.query.id, + inspectionStationName: item.inspectionStationName, + personnelld: item.id, + name: item.name, + dataSource: 3, // 拟投入地面作业人员 + }) + }) + ;(formData.value.actualHighAltitudePersonnelList || []).forEach((item) => { + proposedPersonnelList.push({ + dayPlanId: route.query.id, + inspectionStationName: item.inspectionStationName, + personnelld: item.id, + name: item.name, + dataSource: 4, // 实际投入高处作业人员 + }) + }) + ;(formData.value.actualGroundPersonnelList || []).forEach((item) => { + proposedPersonnelList.push({ + dayPlanId: route.query.id, + inspectionStationName: item.inspectionStationName, + personnelld: item.id, + name: item.name, + dataSource: 5, // 实际投入地面作业人员 + }) + }) + } + + // 组装参数:排除基本信息和仅前端使用的字段 const { inspectionStationName, projectName, @@ -393,13 +436,21 @@ const onSubmit = async () => { dayPlan, planPersonnelList, actualPersonnelList, + highAltitudePersonnelList, + groundPersonnelList, + actualHighAltitudePersonnelList, + actualGroundPersonnelList, actualPersonnel, planPersonnel, - proposedLongTimeCar, + actualWorkloadList, ...submitData } = formData.value submitData.proposedPersonnelList = proposedPersonnelList + submitData.workloadList = formData.value.actualWorkloadList + + console.log('submitData(日计划提交参数)', submitData) + // 暂不调用接口,后续再接入: const result = await updateDailyPlanAPI(submitData) if (result.code === 200) { proxy.$modal.msgSuccess('保存成功') diff --git a/src/views/planMange/dailyPlan/forms/repairForm.vue b/src/views/planMange/dailyPlan/forms/repairForm.vue index b018d7b..da5dac0 100644 --- a/src/views/planMange/dailyPlan/forms/repairForm.vue +++ b/src/views/planMange/dailyPlan/forms/repairForm.vue @@ -72,7 +72,7 @@ - +