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 1be5a9ede..94a5f5cbf 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,6 +55,30 @@ 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 f02ccc350..254c030a9 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,6 +62,30 @@ 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 61569a24a..1cbd5a1a3 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,8 +1,6 @@ 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; @@ -25,7 +23,7 @@ public class EqpMaintenancePlanDetailVo { /** * 明细ID */ - @ExcelProperty(value = "明细ID") + @ExcelProperty(value = "编号") private Long detailId; /** @@ -35,71 +33,66 @@ public class EqpMaintenancePlanDetailVo { private Long planId; /** - * 产线名称 + * 时间 */ - @ExcelProperty(value = "产线名称") - private String productionLine; - - /** - * 设备部件名称 - */ - @ExcelProperty(value = "设备部件名称") - private String componentName; - - /** - * 单条维修项计划执行日期 - */ - @ExcelProperty(value = "单条维修项计划执行日期") + @ExcelProperty(value = "时间") private Date itemPlanDate; /** * 明细类型:0=保养 1=维修 */ - @ExcelProperty(value = "明细类型:0=保养 1=维修") + @ExcelProperty(value = "明细类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=保养,1=维修") private Long maintenanceCategory; /** - * 明细完成状态:0=未开始 1=进行中 2=已完成 + * 具体工作内容 */ - @ExcelProperty(value = "明细完成状态:0=未开始 1=进行中 2=已完成") - private Long detailStatus; - - /** - * 维修内容描述 - */ - @ExcelProperty(value = "维修内容描述") + @ExcelProperty(value = "具体工作内容") private String repairContent; /** - * 维修负责人 + * 产线执行人员 */ - @ExcelProperty(value = "维修负责人") - private String repairUser; + @ExcelProperty(value = "产线执行人员") + private String lineExecutor; /** - * 完成时间(打勾时记录) + * 设备执行人员 */ - @ExcelProperty(value = "完成时间", converter = ExcelDictConvert.class) - @ExcelDictFormat(readConverterExp = "打=勾时记录") - private Date completeTime; + @ExcelProperty(value = "设备执行人员") + private String equipmentExecutor; /** - * 实际支出金额(元) + * 预计完成时间 */ - @ExcelProperty(value = "实际支出金额(元)") - private BigDecimal actualCost; + @ExcelProperty(value = "预计完成时间") + private String plannedCompleteTime; /** - * 完成进度百分比(0-100) + * 实际完成时间 */ - @ExcelProperty(value = "完成进度百分比(0-100)") - private Long progressRate; + @ExcelProperty(value = "实际完成时间") + private String actualCompleteTime; /** - * 目标厂家 + * 总耗时(h) */ - @ExcelProperty(value = "目标厂家") - private String targetManufacturer; + @ExcelProperty(value = "总耗时(h)") + private String totalHours; + + /** + * 验收人 + */ + @ExcelProperty(value = "验收人") + private String acceptanceUser; + + /** + * 是否完成 + */ + @ExcelProperty(value = "是否完成", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=否,1=否,2=是") + private Long detailStatus; /** * 备注 diff --git a/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml b/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml index a51a88805..6732e384d 100644 --- a/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml +++ b/klp-flow/src/main/resources/mapper/flow/EqpMaintenancePlanDetailMapper.xml @@ -13,6 +13,12 @@ + + + + + + diff --git a/klp-ui/src/utils/enum.js b/klp-ui/src/utils/enum.js index ea440f4fc..fe5fe8652 100644 --- a/klp-ui/src/utils/enum.js +++ b/klp-ui/src/utils/enum.js @@ -12,4 +12,12 @@ export const MemoInputStorageKey = { packagingRequirement: 'packagingRequirement', // 打包要求 coilSpec: 'coilSpec', // 钢卷规格 coatingType: 'coatingType', // 钢卷镀层种类 -} \ No newline at end of file + maintenanceRepairContent: 'maintenanceRepairContent', // 维修明细-具体工作内容 + maintenanceLineExecutor: 'maintenanceLineExecutor', // 维修明细-产线执行人员 + maintenanceEquipmentExecutor: 'maintenanceEquipmentExecutor', // 维修明细-设备执行人员 + maintenancePlannedCompleteTime: 'maintenancePlannedCompleteTime', // 维修明细-预计完成时间 + maintenanceActualCompleteTime: 'maintenanceActualCompleteTime', // 维修明细-实际完成时间 + maintenanceTotalHours: 'maintenanceTotalHours', // 维修明细-总耗时 + maintenanceAcceptanceUser: 'maintenanceAcceptanceUser', // 维修明细-验收人 + maintenanceRemark: 'maintenanceRemark', // 维修明细-备注 +} diff --git a/klp-ui/src/views/wms/post/eqp/approval.vue b/klp-ui/src/views/wms/post/eqp/approval.vue index 5cdfa9ab2..8ec3ac0a6 100644 --- a/klp-ui/src/views/wms/post/eqp/approval.vue +++ b/klp-ui/src/views/wms/post/eqp/approval.vue @@ -103,20 +103,23 @@ 维修明细 · 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 ddb6af688..9d7467632 100644 --- a/klp-ui/src/views/wms/post/eqp/execute.vue +++ b/klp-ui/src/views/wms/post/eqp/execute.vue @@ -92,16 +92,22 @@ 维修明细进度 · Detail Progress - - - - + + + + + + + + + + + + + + + - - @@ -273,11 +354,7 @@ export default { inspectionQueried: false, selectedInspectionRows: [], // 维修明细 - detailList: [], - detailDialogVisible: false, - detailDialogTitle: "", - detailForm: {}, - editingDetailId: null + detailList: [] }; }, created() { @@ -324,7 +401,9 @@ export default { loadDetailList(planId) { var self = this; listMaintenancePlanDetail({ planId: planId, pageNum: 1, pageSize: 999 }).then(function(r) { - self.detailList = r.rows || []; + self.detailList = (r.rows || []).map(function(item) { + return self.decorateDetailRow(item); + }); }); }, // ---- 检修记录查询 ---- @@ -373,9 +452,17 @@ 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 + detailStatus: 0, + remark: rec.remark || '' }); }); Promise.all(promises).then(function() { @@ -463,45 +550,122 @@ export default { }).catch(function() { }).finally(function() { self.loading = false; }); }, // ---- 明细管理 ---- - handleAddDetail() { - this.detailForm = { - planId: this.currentRow.planId, + getDefaultDetailRow() { + return { + detailId: undefined, + planId: this.currentRow ? this.currentRow.planId : undefined, componentName: '', - productionLine: this.currentRow.productionLine || '', + productionLine: this.currentRow ? (this.currentRow.productionLine || '') : '', maintenanceCategory: 1, + itemPlanDate: parseTime(new Date(), '{y}-{m}-{d}'), repairContent: '', + lineExecutor: '', + equipmentExecutor: '', + plannedCompleteTime: '', + actualCompleteTime: '', + totalHours: '', + acceptanceUser: '', repairUser: '', - itemPlanDate: undefined, targetManufacturer: '', - detailStatus: 0 + detailStatus: 0, + remark: '' }; - this.editingDetailId = null; - this.detailDialogTitle = "添加维修明细"; - this.detailDialogVisible = true; + }, + 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); }, handleEditDetail(row) { - this.detailForm = Object.assign({}, row); - this.editingDetailId = row.detailId; - this.detailDialogTitle = "编辑维修明细"; - this.detailDialogVisible = true; + const editingRow = this.getEditingDetailRow(); + if (editingRow && editingRow._rowKey !== row._rowKey) { + this.$modal.msgWarning("请先保存或取消当前正在编辑的维修明细"); + return; + } + if (row._editing) return; + this.beginDetailEdit(row); }, - submitDetailForm() { - if (!this.detailForm.componentName) { - this.$modal.msgWarning("请输入设备部件名称"); + 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("请选择时间"); return; } var self = this; + var payload = this.buildDetailPayload(row); this.detailButtonLoading = true; - if (this.editingDetailId) { - updateMaintenancePlanDetail(this.detailForm).then(function() { + if (row.detailId) { + updateMaintenancePlanDetail(payload).then(function() { self.$modal.msgSuccess("修改成功"); - self.detailDialogVisible = false; self.loadDetailList(self.currentRow.planId); }).finally(function() { self.detailButtonLoading = false; }); } else { - addMaintenancePlanDetail(this.detailForm).then(function() { + addMaintenancePlanDetail(payload).then(function() { self.$modal.msgSuccess("添加成功"); - self.detailDialogVisible = false; self.loadDetailList(self.currentRow.planId); }).finally(function() { self.detailButtonLoading = false; }); } @@ -530,6 +694,11 @@ 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; } @@ -546,7 +715,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; display: flex; flex-direction: column; overflow: hidden; padding: 12px 16px; } +.right-content { flex: 1; min-height: 0; 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; } @@ -563,10 +732,25 @@ 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 new file mode 100644 index 000000000..ae8c0009f --- /dev/null +++ b/script/sql/mysql/update/update_20260707_eqp_maintenance_plan_detail_fields.sql @@ -0,0 +1,7 @@ +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`;