diff --git a/klp-flow/src/main/java/com/klp/flow/domain/EqpMaintenancePlanDetail.java b/klp-flow/src/main/java/com/klp/flow/domain/EqpMaintenancePlanDetail.java index 94a5f5cbf..1be5a9ede 100644 --- a/klp-flow/src/main/java/com/klp/flow/domain/EqpMaintenancePlanDetail.java +++ b/klp-flow/src/main/java/com/klp/flow/domain/EqpMaintenancePlanDetail.java @@ -55,30 +55,6 @@ public class EqpMaintenancePlanDetail extends BaseEntity { * 维修内容描述 */ private String repairContent; - /** - * 产线执行人员 - */ - private String lineExecutor; - /** - * 设备执行人员 - */ - private String equipmentExecutor; - /** - * 预计完成时间 - */ - private String plannedCompleteTime; - /** - * 实际完成时间 - */ - private String actualCompleteTime; - /** - * 总耗时(h) - */ - private String totalHours; - /** - * 验收人 - */ - private String acceptanceUser; /** * 维修负责人 */ diff --git a/klp-flow/src/main/java/com/klp/flow/domain/bo/EqpMaintenancePlanDetailBo.java b/klp-flow/src/main/java/com/klp/flow/domain/bo/EqpMaintenancePlanDetailBo.java index 254c030a9..f02ccc350 100644 --- a/klp-flow/src/main/java/com/klp/flow/domain/bo/EqpMaintenancePlanDetailBo.java +++ b/klp-flow/src/main/java/com/klp/flow/domain/bo/EqpMaintenancePlanDetailBo.java @@ -62,30 +62,6 @@ public class EqpMaintenancePlanDetailBo extends BaseEntity { * 维修内容描述 */ private String repairContent; - /** - * 产线执行人员 - */ - private String lineExecutor; - /** - * 设备执行人员 - */ - private String equipmentExecutor; - /** - * 预计完成时间 - */ - private String plannedCompleteTime; - /** - * 实际完成时间 - */ - private String actualCompleteTime; - /** - * 总耗时(h) - */ - private String totalHours; - /** - * 验收人 - */ - private String acceptanceUser; /** * 维修负责人 diff --git a/klp-flow/src/main/java/com/klp/flow/domain/vo/EqpMaintenancePlanDetailVo.java b/klp-flow/src/main/java/com/klp/flow/domain/vo/EqpMaintenancePlanDetailVo.java index 1cbd5a1a3..61569a24a 100644 --- a/klp-flow/src/main/java/com/klp/flow/domain/vo/EqpMaintenancePlanDetailVo.java +++ b/klp-flow/src/main/java/com/klp/flow/domain/vo/EqpMaintenancePlanDetailVo.java @@ -1,6 +1,8 @@ package com.klp.flow.domain.vo; +import java.math.BigDecimal; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; import com.klp.common.annotation.ExcelDictFormat; @@ -23,7 +25,7 @@ public class EqpMaintenancePlanDetailVo { /** * 明细ID */ - @ExcelProperty(value = "编号") + @ExcelProperty(value = "明细ID") private Long detailId; /** @@ -33,66 +35,71 @@ public class EqpMaintenancePlanDetailVo { private Long planId; /** - * 时间 + * 产线名称 */ - @ExcelProperty(value = "时间") + @ExcelProperty(value = "产线名称") + private String productionLine; + + /** + * 设备部件名称 + */ + @ExcelProperty(value = "设备部件名称") + private String componentName; + + /** + * 单条维修项计划执行日期 + */ + @ExcelProperty(value = "单条维修项计划执行日期") private Date itemPlanDate; /** * 明细类型:0=保养 1=维修 */ - @ExcelProperty(value = "明细类型", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "0=保养,1=维修") + @ExcelProperty(value = "明细类型:0=保养 1=维修") private Long maintenanceCategory; /** - * 具体工作内容 + * 明细完成状态:0=未开始 1=进行中 2=已完成 */ - @ExcelProperty(value = "具体工作内容") + @ExcelProperty(value = "明细完成状态:0=未开始 1=进行中 2=已完成") + private Long detailStatus; + + /** + * 维修内容描述 + */ + @ExcelProperty(value = "维修内容描述") private String repairContent; /** - * 产线执行人员 + * 维修负责人 */ - @ExcelProperty(value = "产线执行人员") - private String lineExecutor; + @ExcelProperty(value = "维修负责人") + private String repairUser; /** - * 设备执行人员 + * 完成时间(打勾时记录) */ - @ExcelProperty(value = "设备执行人员") - private String equipmentExecutor; + @ExcelProperty(value = "完成时间", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "打=勾时记录") + private Date completeTime; /** - * 预计完成时间 + * 实际支出金额(元) */ - @ExcelProperty(value = "预计完成时间") - private String plannedCompleteTime; + @ExcelProperty(value = "实际支出金额(元)") + private BigDecimal actualCost; /** - * 实际完成时间 + * 完成进度百分比(0-100) */ - @ExcelProperty(value = "实际完成时间") - private String actualCompleteTime; + @ExcelProperty(value = "完成进度百分比(0-100)") + private Long progressRate; /** - * 总耗时(h) + * 目标厂家 */ - @ExcelProperty(value = "总耗时(h)") - private String totalHours; - - /** - * 验收人 - */ - @ExcelProperty(value = "验收人") - private String acceptanceUser; - - /** - * 是否完成 - */ - @ExcelProperty(value = "是否完成", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "0=否,1=否,2=是") - private Long detailStatus; + @ExcelProperty(value = "目标厂家") + private String targetManufacturer; /** * 备注 diff --git a/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml b/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml index 6732e384d..a51a88805 100644 --- a/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml +++ b/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml @@ -13,12 +13,6 @@ - - - - - - diff --git a/klp-ui/src/utils/enum.js b/klp-ui/src/utils/enum.js index fe5fe8652..ea440f4fc 100644 --- a/klp-ui/src/utils/enum.js +++ b/klp-ui/src/utils/enum.js @@ -12,12 +12,4 @@ export const MemoInputStorageKey = { packagingRequirement: 'packagingRequirement', // 打包要求 coilSpec: 'coilSpec', // 钢卷规格 coatingType: 'coatingType', // 钢卷镀层种类 - maintenanceRepairContent: 'maintenanceRepairContent', // 维修明细-具体工作内容 - maintenanceLineExecutor: 'maintenanceLineExecutor', // 维修明细-产线执行人员 - maintenanceEquipmentExecutor: 'maintenanceEquipmentExecutor', // 维修明细-设备执行人员 - maintenancePlannedCompleteTime: 'maintenancePlannedCompleteTime', // 维修明细-预计完成时间 - maintenanceActualCompleteTime: 'maintenanceActualCompleteTime', // 维修明细-实际完成时间 - maintenanceTotalHours: 'maintenanceTotalHours', // 维修明细-总耗时 - maintenanceAcceptanceUser: 'maintenanceAcceptanceUser', // 维修明细-验收人 - maintenanceRemark: 'maintenanceRemark', // 维修明细-备注 -} +} \ No newline at end of file diff --git a/klp-ui/src/views/wms/post/eqp/approval.vue b/klp-ui/src/views/wms/post/eqp/approval.vue index 8ec3ac0a6..5cdfa9ab2 100644 --- a/klp-ui/src/views/wms/post/eqp/approval.vue +++ b/klp-ui/src/views/wms/post/eqp/approval.vue @@ -103,23 +103,20 @@ 维修明细 · Maintenance Details - - + + + + - - + + + + - - - - - - - - - - - +
暂无维修明细
diff --git a/klp-ui/src/views/wms/post/eqp/execute.vue b/klp-ui/src/views/wms/post/eqp/execute.vue index 9d7467632..ddb6af688 100644 --- a/klp-ui/src/views/wms/post/eqp/execute.vue +++ b/klp-ui/src/views/wms/post/eqp/execute.vue @@ -92,22 +92,16 @@ 维修明细进度 · Detail Progress - - - - - - - - - - - - - - - + + + + + + @@ -354,7 +273,11 @@ export default { inspectionQueried: false, selectedInspectionRows: [], // 维修明细 - detailList: [] + detailList: [], + detailDialogVisible: false, + detailDialogTitle: "", + detailForm: {}, + editingDetailId: null }; }, created() { @@ -401,9 +324,7 @@ export default { loadDetailList(planId) { var self = this; listMaintenancePlanDetail({ planId: planId, pageNum: 1, pageSize: 999 }).then(function(r) { - self.detailList = (r.rows || []).map(function(item) { - return self.decorateDetailRow(item); - }); + self.detailList = r.rows || []; }); }, // ---- 检修记录查询 ---- @@ -452,17 +373,9 @@ export default { componentName: rec.partName || '', productionLine: self.currentRow.productionLine || rec.productionLine || '', maintenanceCategory: 1, - itemPlanDate: rec.inspectTime ? parseTime(rec.inspectTime, '{y}-{m}-{d}') : parseTime(new Date(), '{y}-{m}-{d}'), repairContent: rec.abnormalDesc || '', - lineExecutor: rec.inspector || '', - equipmentExecutor: '', - plannedCompleteTime: '', - actualCompleteTime: '', - totalHours: '', - acceptanceUser: '', repairUser: rec.inspector || '', - detailStatus: 0, - remark: rec.remark || '' + detailStatus: 0 }); }); Promise.all(promises).then(function() { @@ -550,122 +463,45 @@ export default { }).catch(function() { }).finally(function() { self.loading = false; }); }, // ---- 明细管理 ---- - getDefaultDetailRow() { - return { - detailId: undefined, - planId: this.currentRow ? this.currentRow.planId : undefined, - componentName: '', - productionLine: this.currentRow ? (this.currentRow.productionLine || '') : '', - maintenanceCategory: 1, - itemPlanDate: parseTime(new Date(), '{y}-{m}-{d}'), - repairContent: '', - lineExecutor: '', - equipmentExecutor: '', - plannedCompleteTime: '', - actualCompleteTime: '', - totalHours: '', - acceptanceUser: '', - repairUser: '', - targetManufacturer: '', - detailStatus: 0, - remark: '' - }; - }, - decorateDetailRow(row) { - const decorated = Object.assign({}, this.getDefaultDetailRow(), row); - decorated._editing = false; - decorated._isNew = false; - decorated._origin = null; - decorated._rowKey = row.detailId || `detail-${Date.now()}-${Math.random()}`; - return decorated; - }, - getEditingDetailRow() { - return this.detailList.find(function(item) { return item._editing; }); - }, - beginDetailEdit(row, isNew = false) { - if (isNew) { - row._isNew = true; - } - row._origin = JSON.parse(JSON.stringify(row)); - row._editing = true; - }, handleAddDetail() { - if (!this.currentRow) { - this.$modal.msgWarning("请先选择检修单"); - return; - } - if (this.getEditingDetailRow()) { - this.$modal.msgWarning("请先保存或取消当前正在编辑的维修明细"); - return; - } - const row = this.decorateDetailRow(this.getDefaultDetailRow()); - this.beginDetailEdit(row, true); - this.detailList.unshift(row); + this.detailForm = { + planId: this.currentRow.planId, + componentName: '', + productionLine: this.currentRow.productionLine || '', + maintenanceCategory: 1, + repairContent: '', + repairUser: '', + itemPlanDate: undefined, + targetManufacturer: '', + detailStatus: 0 + }; + this.editingDetailId = null; + this.detailDialogTitle = "添加维修明细"; + this.detailDialogVisible = true; }, handleEditDetail(row) { - const editingRow = this.getEditingDetailRow(); - if (editingRow && editingRow._rowKey !== row._rowKey) { - this.$modal.msgWarning("请先保存或取消当前正在编辑的维修明细"); - return; - } - if (row._editing) return; - this.beginDetailEdit(row); + this.detailForm = Object.assign({}, row); + this.editingDetailId = row.detailId; + this.detailDialogTitle = "编辑维修明细"; + this.detailDialogVisible = true; }, - cancelEditDetail(row) { - if (row._isNew) { - this.detailList = this.detailList.filter(function(item) { return item._rowKey !== row._rowKey; }); - return; - } - const restored = Object.assign({}, row._origin || {}); - Object.keys(row).forEach((key) => { - if (key.indexOf('_') === 0) return; - this.$set(row, key, restored[key]); - }); - row._editing = false; - row._isNew = false; - row._origin = null; - }, - buildDetailPayload(row) { - return { - detailId: row.detailId, - planId: this.currentRow.planId, - componentName: row.componentName || '', - productionLine: row.productionLine || this.currentRow.productionLine || '', - maintenanceCategory: row.maintenanceCategory == null ? 1 : row.maintenanceCategory, - itemPlanDate: row.itemPlanDate, - repairContent: row.repairContent, - lineExecutor: row.lineExecutor, - equipmentExecutor: row.equipmentExecutor, - plannedCompleteTime: row.plannedCompleteTime, - actualCompleteTime: row.actualCompleteTime, - totalHours: row.totalHours, - acceptanceUser: row.acceptanceUser, - repairUser: row.lineExecutor || row.repairUser || '', - targetManufacturer: row.targetManufacturer || '', - detailStatus: row.detailStatus === 2 ? 2 : 0, - remark: row.remark - }; - }, - saveDetailRow(row) { - if (!row.repairContent) { - this.$modal.msgWarning("请输入具体工作内容"); - return; - } - if (!row.itemPlanDate) { - this.$modal.msgWarning("请选择时间"); + submitDetailForm() { + if (!this.detailForm.componentName) { + this.$modal.msgWarning("请输入设备部件名称"); return; } var self = this; - var payload = this.buildDetailPayload(row); this.detailButtonLoading = true; - if (row.detailId) { - updateMaintenancePlanDetail(payload).then(function() { + if (this.editingDetailId) { + updateMaintenancePlanDetail(this.detailForm).then(function() { self.$modal.msgSuccess("修改成功"); + self.detailDialogVisible = false; self.loadDetailList(self.currentRow.planId); }).finally(function() { self.detailButtonLoading = false; }); } else { - addMaintenancePlanDetail(payload).then(function() { + addMaintenancePlanDetail(this.detailForm).then(function() { self.$modal.msgSuccess("添加成功"); + self.detailDialogVisible = false; self.loadDetailList(self.currentRow.planId); }).finally(function() { self.detailButtonLoading = false; }); } @@ -694,11 +530,6 @@ export default { .search-row { display: flex; align-items: center; gap: 6px; padding: 0 14px 10px; background: #f5f7fa; } .search-row .el-input { flex: 1; } .list-body { flex: 1; overflow-y: auto; padding: 0 6px; } -.list-body { scrollbar-width: thin; scrollbar-color: rgba(144, 147, 153, 0.45) transparent; } -.list-body::-webkit-scrollbar { width: 8px; height: 8px; } -.list-body::-webkit-scrollbar-track { background: transparent; } -.list-body::-webkit-scrollbar-thumb { background: rgba(144, 147, 153, 0.35); border-radius: 6px; } -.list-body::-webkit-scrollbar-thumb:hover { background: rgba(144, 147, 153, 0.55); } .list-item { display: flex; align-items: center; padding: 10px 12px; margin-bottom: 2px; cursor: pointer; border-radius: 6px; transition: all 0.15s; } .list-item:hover { background: #ebeef5; } .list-item.active { background: #d9ecff; } @@ -715,7 +546,7 @@ export default { /* ========== 右侧面板 ========== */ .right-panel { height: 100%; overflow: hidden; display: flex; flex-direction: column; background: #faf8f5; } .empty-tip { display: flex; align-items: center; justify-content: center; height: 100%; color: #909399; font-size: 14px; gap: 8px; } -.right-content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 12px 16px; } +.right-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 12px 16px; } /* 基本信息栏 */ .info-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: #fff; border: 1px solid #e4e7ed; border-radius: 4px; margin-bottom: 10px; flex-shrink: 0; } @@ -732,25 +563,10 @@ export default { .section-count { font-size: 12px; color: #909399; } .section-actions { display: flex; align-items: center; gap: 6px; } .inspection-section .el-table { flex: 1; overflow-y: auto; } -.inspection-section ::v-deep .el-table, -.detail-section ::v-deep .el-table { display: flex; flex-direction: column; height: 100%; } -.inspection-section ::v-deep .el-table__body-wrapper, -.detail-section ::v-deep .el-table__body-wrapper { flex: 1; min-height: 0; } -.inspection-section .el-table { scrollbar-width: thin; scrollbar-color: rgba(144, 147, 153, 0.45) transparent; } -.detail-section .el-table { scrollbar-width: thin; scrollbar-color: rgba(144, 147, 153, 0.45) transparent; } -.inspection-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar, -.detail-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar { width: 8px; height: 8px; } -.inspection-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar-track, -.detail-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar-track { background: transparent; } -.inspection-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb, -.detail-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb { background: rgba(144, 147, 153, 0.35); border-radius: 6px; } -.inspection-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb:hover, -.detail-section ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(144, 147, 153, 0.55); } /* 下半部分:维修明细 */ .detail-section { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid #e4e7ed; border-radius: 4px; } .detail-section .el-table { flex: 1; overflow-y: auto; } -.cell-pre-wrap { white-space: pre-wrap; word-break: break-all; line-height: 18px; } .empty-data { padding: 24px 0; text-align: center; color: #c0c4cc; font-size: 13px; } diff --git a/script/sql/mysql/update/update_20260707_eqp_maintenance_plan_detail_fields.sql b/script/sql/mysql/update/update_20260707_eqp_maintenance_plan_detail_fields.sql deleted file mode 100644 index ae8c0009f..000000000 --- a/script/sql/mysql/update/update_20260707_eqp_maintenance_plan_detail_fields.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE `eqp_maintenance_plan_detail` - ADD COLUMN `line_executor` varchar(255) DEFAULT NULL COMMENT '产线执行人员' AFTER `repair_content`, - ADD COLUMN `equipment_executor` varchar(255) DEFAULT NULL COMMENT '设备执行人员' AFTER `line_executor`, - ADD COLUMN `planned_complete_time` varchar(255) DEFAULT NULL COMMENT '预计完成时间' AFTER `equipment_executor`, - ADD COLUMN `actual_complete_time` varchar(255) DEFAULT NULL COMMENT '实际完成时间' AFTER `planned_complete_time`, - ADD COLUMN `total_hours` varchar(100) DEFAULT NULL COMMENT '总耗时(h)' AFTER `actual_complete_time`, - ADD COLUMN `acceptance_user` varchar(255) DEFAULT NULL COMMENT '验收人' AFTER `total_hours`;