Revert "设备维保调整字段和操作逻辑"

This reverts commit d1af1c28a6.
This commit is contained in:
朱昊天
2026-07-08 10:49:00 +08:00
parent eadac22094
commit 1a3de775c8
9 changed files with 148 additions and 403 deletions

View File

@@ -55,30 +55,6 @@ public class EqpMaintenancePlanDetail extends BaseEntity {
* 维修内容描述 * 维修内容描述
*/ */
private String repairContent; private String repairContent;
/**
* 产线执行人员
*/
private String lineExecutor;
/**
* 设备执行人员
*/
private String equipmentExecutor;
/**
* 预计完成时间
*/
private String plannedCompleteTime;
/**
* 实际完成时间
*/
private String actualCompleteTime;
/**
* 总耗时h
*/
private String totalHours;
/**
* 验收人
*/
private String acceptanceUser;
/** /**
* 维修负责人 * 维修负责人
*/ */

View File

@@ -62,30 +62,6 @@ public class EqpMaintenancePlanDetailBo extends BaseEntity {
* 维修内容描述 * 维修内容描述
*/ */
private String repairContent; private String repairContent;
/**
* 产线执行人员
*/
private String lineExecutor;
/**
* 设备执行人员
*/
private String equipmentExecutor;
/**
* 预计完成时间
*/
private String plannedCompleteTime;
/**
* 实际完成时间
*/
private String actualCompleteTime;
/**
* 总耗时h
*/
private String totalHours;
/**
* 验收人
*/
private String acceptanceUser;
/** /**
* 维修负责人 * 维修负责人

View File

@@ -1,6 +1,8 @@
package com.klp.flow.domain.vo; package com.klp.flow.domain.vo;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.klp.common.annotation.ExcelDictFormat; import com.klp.common.annotation.ExcelDictFormat;
@@ -23,7 +25,7 @@ public class EqpMaintenancePlanDetailVo {
/** /**
* 明细ID * 明细ID
*/ */
@ExcelProperty(value = "编号") @ExcelProperty(value = "明细ID")
private Long detailId; private Long detailId;
/** /**
@@ -33,66 +35,71 @@ public class EqpMaintenancePlanDetailVo {
private Long planId; private Long planId;
/** /**
* 时间 * 产线名称
*/ */
@ExcelProperty(value = "时间") @ExcelProperty(value = "产线名称")
private String productionLine;
/**
* 设备部件名称
*/
@ExcelProperty(value = "设备部件名称")
private String componentName;
/**
* 单条维修项计划执行日期
*/
@ExcelProperty(value = "单条维修项计划执行日期")
private Date itemPlanDate; private Date itemPlanDate;
/** /**
* 明细类型0=保养 1=维修 * 明细类型0=保养 1=维修
*/ */
@ExcelProperty(value = "明细类型", converter = ExcelDictConvert.class) @ExcelProperty(value = "明细类型0=保养 1=维修")
@ExcelDictFormat(readConverterExp = "0=保养,1=维修")
private Long maintenanceCategory; private Long maintenanceCategory;
/** /**
* 具体工作内容 * 明细完成状态0=未开始 1=进行中 2=已完成
*/ */
@ExcelProperty(value = "具体工作内容") @ExcelProperty(value = "明细完成状态0=未开始 1=进行中 2=已完成")
private Long detailStatus;
/**
* 维修内容描述
*/
@ExcelProperty(value = "维修内容描述")
private String repairContent; private String repairContent;
/** /**
* 产线执行人员 * 维修负责人
*/ */
@ExcelProperty(value = "产线执行人员") @ExcelProperty(value = "维修负责人")
private String lineExecutor; private String repairUser;
/** /**
* 设备执行人员 * 完成时间(打勾时记录)
*/ */
@ExcelProperty(value = "设备执行人员") @ExcelProperty(value = "完成时间", converter = ExcelDictConvert.class)
private String equipmentExecutor; @ExcelDictFormat(readConverterExp = "打=勾时记录")
private Date completeTime;
/** /**
* 预计完成时间 * 实际支出金额(元)
*/ */
@ExcelProperty(value = "预计完成时间") @ExcelProperty(value = "实际支出金额(元)")
private String plannedCompleteTime; private BigDecimal actualCost;
/** /**
* 实际完成时间 * 完成进度百分比(0-100)
*/ */
@ExcelProperty(value = "实际完成时间") @ExcelProperty(value = "完成进度百分比(0-100)")
private String actualCompleteTime; private Long progressRate;
/** /**
* 总耗时(h) * 目标厂家
*/ */
@ExcelProperty(value = "总耗时h") @ExcelProperty(value = "目标厂家")
private String totalHours; private String targetManufacturer;
/**
* 验收人
*/
@ExcelProperty(value = "验收人")
private String acceptanceUser;
/**
* 是否完成
*/
@ExcelProperty(value = "是否完成", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=否,1=否,2=是")
private Long detailStatus;
/** /**
* 备注 * 备注

View File

@@ -13,12 +13,6 @@
<result property="maintenanceCategory" column="maintenance_category"/> <result property="maintenanceCategory" column="maintenance_category"/>
<result property="detailStatus" column="detail_status"/> <result property="detailStatus" column="detail_status"/>
<result property="repairContent" column="repair_content"/> <result property="repairContent" column="repair_content"/>
<result property="lineExecutor" column="line_executor"/>
<result property="equipmentExecutor" column="equipment_executor"/>
<result property="plannedCompleteTime" column="planned_complete_time"/>
<result property="actualCompleteTime" column="actual_complete_time"/>
<result property="totalHours" column="total_hours"/>
<result property="acceptanceUser" column="acceptance_user"/>
<result property="repairUser" column="repair_user"/> <result property="repairUser" column="repair_user"/>
<result property="completeTime" column="complete_time"/> <result property="completeTime" column="complete_time"/>
<result property="actualCost" column="actual_cost"/> <result property="actualCost" column="actual_cost"/>

View File

@@ -12,12 +12,4 @@ export const MemoInputStorageKey = {
packagingRequirement: 'packagingRequirement', // 打包要求 packagingRequirement: 'packagingRequirement', // 打包要求
coilSpec: 'coilSpec', // 钢卷规格 coilSpec: 'coilSpec', // 钢卷规格
coatingType: 'coatingType', // 钢卷镀层种类 coatingType: 'coatingType', // 钢卷镀层种类
maintenanceRepairContent: 'maintenanceRepairContent', // 维修明细-具体工作内容 }
maintenanceLineExecutor: 'maintenanceLineExecutor', // 维修明细-产线执行人员
maintenanceEquipmentExecutor: 'maintenanceEquipmentExecutor', // 维修明细-设备执行人员
maintenancePlannedCompleteTime: 'maintenancePlannedCompleteTime', // 维修明细-预计完成时间
maintenanceActualCompleteTime: 'maintenanceActualCompleteTime', // 维修明细-实际完成时间
maintenanceTotalHours: 'maintenanceTotalHours', // 维修明细-总耗时
maintenanceAcceptanceUser: 'maintenanceAcceptanceUser', // 维修明细-验收人
maintenanceRemark: 'maintenanceRemark', // 维修明细-备注
}

View File

@@ -103,23 +103,20 @@
<span>维修明细 <span class="en-sub">· Maintenance Details</span></span> <span>维修明细 <span class="en-sub">· Maintenance Details</span></span>
</div> </div>
<el-table :data="detailList" border size="small" style="width:100%"> <el-table :data="detailList" border size="small" style="width:100%">
<el-table-column label="编号" align="center" width="60"> <el-table-column label="设备部件" align="center" prop="componentName" width="130" />
<template slot-scope="scope">{{ scope.$index + 1 }}</template> <el-table-column label="产线" align="center" prop="productionLine" width="110" />
<el-table-column label="类型" align="center" width="70">
<template slot-scope="scope">
<el-tag v-if="scope.row.maintenanceCategory === 0" size="mini">保养</el-tag>
<el-tag v-else-if="scope.row.maintenanceCategory === 1" size="mini" type="warning">维修</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="时间" align="center" width="110"> <el-table-column label="维修内容" align="center" prop="repairContent" min-width="150" show-overflow-tooltip />
<template slot-scope="scope">{{ parseTime(scope.row.itemPlanDate, '{y}/{m}/{d}') }}</template> <el-table-column label="负责人" align="center" prop="repairUser" width="90" />
<el-table-column label="计划日期" align="center" width="100">
<template slot-scope="scope">{{ parseTime(scope.row.itemPlanDate, '{y}-{m}-{d}') }}</template>
</el-table-column> </el-table-column>
<el-table-column label="具体工作内容" align="center" prop="repairContent" min-width="180" show-overflow-tooltip /> <el-table-column label="目标厂家" align="center" prop="targetManufacturer" width="110" />
<el-table-column label="产线执行人员" align="center" prop="lineExecutor" min-width="130" show-overflow-tooltip />
<el-table-column label="设备执行人员" align="center" prop="equipmentExecutor" min-width="130" show-overflow-tooltip />
<el-table-column label="预计完成时间" align="center" prop="plannedCompleteTime" width="130" />
<el-table-column label="实际完成时间" align="center" prop="actualCompleteTime" width="130" />
<el-table-column label="总耗时h" align="center" prop="totalHours" width="100" />
<el-table-column label="验收人" align="center" prop="acceptanceUser" width="90" />
<el-table-column label="是否完成" align="center" width="80">
<template slot-scope="scope">{{ scope.row.detailStatus === 2 ? '是' : '否' }}</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" min-width="140" show-overflow-tooltip />
</el-table> </el-table>
<div v-if="detailList.length === 0" class="empty-data" style="margin-top:8px;">暂无维修明细</div> <div v-if="detailList.length === 0" class="empty-data" style="margin-top:8px;">暂无维修明细</div>

View File

@@ -92,22 +92,16 @@
<span>维修明细进度 <span class="en-sub">· Detail Progress</span></span> <span>维修明细进度 <span class="en-sub">· Detail Progress</span></span>
</div> </div>
<el-table :data="detailList" border size="small" style="width:100%"> <el-table :data="detailList" border size="small" style="width:100%">
<el-table-column label="编号" align="center" width="60"> <el-table-column label="设备部件" align="center" prop="componentName" width="120" />
<template slot-scope="scope">{{ scope.$index + 1 }}</template> <el-table-column label="产线" align="center" prop="productionLine" width="100" />
</el-table-column> <el-table-column label="类型" align="center" width="60">
<el-table-column label="时间" align="center" width="110"> <template slot-scope="scope">
<template slot-scope="scope">{{ parseTime(scope.row.itemPlanDate, '{y}/{m}/{d}') }}</template> <el-tag v-if="scope.row.maintenanceCategory === 0" size="mini">保养</el-tag>
</el-table-column> <el-tag v-else-if="scope.row.maintenanceCategory === 1" size="mini" type="warning">维修</el-tag>
<el-table-column label="具体工作内容" align="center" prop="repairContent" min-width="160" show-overflow-tooltip /> </template>
<el-table-column label="产线执行人员" align="center" prop="lineExecutor" min-width="130" show-overflow-tooltip />
<el-table-column label="设备执行人员" align="center" prop="equipmentExecutor" min-width="130" show-overflow-tooltip />
<el-table-column label="预计完成时间" align="center" prop="plannedCompleteTime" width="130" />
<el-table-column label="实际完成时间" align="center" prop="actualCompleteTime" width="130" />
<el-table-column label="总耗时h" align="center" prop="totalHours" width="100" />
<el-table-column label="验收人" align="center" prop="acceptanceUser" width="90" />
<el-table-column label="是否完成" align="center" width="80">
<template slot-scope="scope">{{ scope.row.detailStatus === 2 ? '是' : '否' }}</template>
</el-table-column> </el-table-column>
<el-table-column label="维修内容" align="center" prop="repairContent" min-width="130" show-overflow-tooltip />
<el-table-column label="负责人" align="center" prop="repairUser" width="80" />
<el-table-column label="进度" align="center" width="160"> <el-table-column label="进度" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-progress :percentage="scope.row.progressRate || 0" :status="scope.row.detailStatus === 2 ? 'success' : ''" :stroke-width="12" style="padding: 4px 0;" /> <el-progress :percentage="scope.row.progressRate || 0" :status="scope.row.detailStatus === 2 ? 'success' : ''" :stroke-width="12" style="padding: 4px 0;" />

View File

@@ -73,7 +73,7 @@
<span class="section-title">检修记录 <span class="en-sub">· Inspection Records</span></span> <span class="section-title">检修记录 <span class="en-sub">· Inspection Records</span></span>
<span class="section-count" v-if="inspectionRecords.length"> {{ inspectionTotal }} </span> <span class="section-count" v-if="inspectionRecords.length"> {{ inspectionTotal }} </span>
</div> </div>
<el-table :data="inspectionRecords" border size="small" v-loading="inspectionLoading" height="100%" <el-table :data="inspectionRecords" border size="small" v-loading="inspectionLoading" max-height="300"
@selection-change="handleInspectionSelectionChange" ref="inspectionTable"> @selection-change="handleInspectionSelectionChange" ref="inspectionTable">
<el-table-column type="selection" width="40" /> <el-table-column type="selection" width="40" />
<el-table-column label="设备部件" align="center" prop="partName" min-width="120" show-overflow-tooltip /> <el-table-column label="设备部件" align="center" prop="partName" min-width="120" show-overflow-tooltip />
@@ -113,141 +113,25 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<el-table :data="detailList" border size="small" v-loading="detailLoading" height="100%"> <el-table :data="detailList" border size="small" v-loading="detailLoading" max-height="300">
<el-table-column label="编号" align="center" width="60"> <el-table-column label="设备部件" align="center" prop="componentName" min-width="120" show-overflow-tooltip />
<template slot-scope="scope">{{ scope.$index + 1 }}</template> <el-table-column label="产线" align="center" prop="productionLine" width="110" />
</el-table-column> <el-table-column label="类型" align="center" width="70">
<el-table-column label="时间" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker <el-tag v-if="scope.row.maintenanceCategory === 0" size="mini">保养</el-tag>
v-if="scope.row._editing" <el-tag v-else-if="scope.row.maintenanceCategory === 1" size="mini" type="warning">维修</el-tag>
v-model="scope.row.itemPlanDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 118px;" />
<span v-else>{{ parseTime(scope.row.itemPlanDate, '{y}/{m}/{d}') || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="具体工作内容" align="center" min-width="220"> <el-table-column label="维修内容" align="center" prop="repairContent" min-width="150" show-overflow-tooltip />
<template slot-scope="scope"> <el-table-column label="负责人" align="center" prop="repairUser" width="90" />
<MemoInput <el-table-column label="计划日期" align="center" width="100">
v-if="scope.row._editing" <template slot-scope="scope">{{ parseTime(scope.row.itemPlanDate, '{y}-{m}-{d}') }}</template>
v-model="scope.row.repairContent"
storageKey="maintenanceRepairContent"
matchRule="contain"
triggerMode="focus"
placeholder="请输入具体工作内容" />
<div v-else class="cell-pre-wrap">{{ scope.row.repairContent || '-' }}</div>
</template>
</el-table-column> </el-table-column>
<el-table-column label="产线执行人员" align="center" min-width="150"> <el-table-column label="目标厂家" align="center" prop="targetManufacturer" width="110" />
<el-table-column label="操作" align="center" width="100" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<MemoInput <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEditDetail(scope.row)"></el-button>
v-if="scope.row._editing" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteDetail(scope.row)"></el-button>
v-model="scope.row.lineExecutor"
storageKey="maintenanceLineExecutor"
matchRule="contain"
triggerMode="focus"
placeholder="请输入产线执行人员" />
<div v-else class="cell-pre-wrap">{{ scope.row.lineExecutor || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="设备执行人员" align="center" min-width="150">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.equipmentExecutor"
storageKey="maintenanceEquipmentExecutor"
matchRule="contain"
triggerMode="focus"
placeholder="请输入设备执行人员" />
<div v-else class="cell-pre-wrap">{{ scope.row.equipmentExecutor || '无' }}</div>
</template>
</el-table-column>
<el-table-column label="预计完成时间" align="center" min-width="140">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.plannedCompleteTime"
storageKey="maintenancePlannedCompleteTime"
matchRule="contain"
triggerMode="focus"
placeholder="如 7:00-18:30" />
<span v-else>{{ scope.row.plannedCompleteTime || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center" min-width="140">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.actualCompleteTime"
storageKey="maintenanceActualCompleteTime"
matchRule="contain"
triggerMode="focus"
placeholder="如 7:00-18:30" />
<span v-else>{{ scope.row.actualCompleteTime || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="总耗时h" align="center" min-width="110">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.totalHours"
storageKey="maintenanceTotalHours"
matchRule="contain"
triggerMode="focus"
placeholder="如 9.5小时" />
<span v-else>{{ scope.row.totalHours || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="验收人" align="center" min-width="110">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.acceptanceUser"
storageKey="maintenanceAcceptanceUser"
matchRule="contain"
triggerMode="focus"
placeholder="请输入验收人" />
<span v-else>{{ scope.row.acceptanceUser || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="是否完成" align="center" width="100">
<template slot-scope="scope">
<el-select
v-if="scope.row._editing"
v-model="scope.row.detailStatus"
placeholder="请选择"
style="width: 80px;">
<el-option label="否" :value="0" />
<el-option label="是" :value="2" />
</el-select>
<span v-else>{{ scope.row.detailStatus === 2 ? '' : '' }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" min-width="180">
<template slot-scope="scope">
<MemoInput
v-if="scope.row._editing"
v-model="scope.row.remark"
storageKey="maintenanceRemark"
matchRule="contain"
triggerMode="focus"
placeholder="请输入备注" />
<div v-else class="cell-pre-wrap">{{ scope.row.remark || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="140" fixed="right">
<template slot-scope="scope">
<template v-if="scope.row._editing">
<el-button size="mini" type="text" icon="el-icon-check" @click="saveDetailRow(scope.row)">保存</el-button>
<el-button size="mini" type="text" icon="el-icon-close" @click="cancelEditDetail(scope.row)">取消</el-button>
</template>
<template v-else>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleEditDetail(scope.row)">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteDetail(scope.row)">删除</el-button>
</template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -312,6 +196,41 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 明细编辑弹窗 -->
<el-dialog :title="detailDialogTitle" :visible.sync="detailDialogVisible" width="550px" append-to-body>
<el-form ref="detailForm" :model="detailForm" label-width="110px">
<el-form-item label="设备部件" prop="componentName">
<el-input v-model="detailForm.componentName" placeholder="请输入设备部件名称" />
</el-form-item>
<el-form-item label="产线" prop="productionLine">
<el-select v-model="detailForm.productionLine" placeholder="请选择" clearable style="width:100%">
<el-option v-for="item in lineList" :key="item.lineId" :label="item.lineName" :value="item.lineName" />
</el-select>
</el-form-item>
<el-form-item label="明细类型" prop="maintenanceCategory">
<el-select v-model="detailForm.maintenanceCategory" placeholder="请选择" style="width:100%">
<el-option label="保养" :value="0" />
<el-option label="维修" :value="1" />
</el-select>
</el-form-item>
<el-form-item label="维修内容" prop="repairContent">
<el-input v-model="detailForm.repairContent" type="textarea" :rows="2" placeholder="请输入维修内容" />
</el-form-item>
<el-form-item label="负责人" prop="repairUser">
<el-input v-model="detailForm.repairUser" placeholder="请输入维修负责人" />
</el-form-item>
<el-form-item label="计划日期" prop="itemPlanDate">
<el-date-picker clearable v-model="detailForm.itemPlanDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择" style="width:100%" />
</el-form-item>
<el-form-item label="目标厂家" prop="targetManufacturer">
<el-input v-model="detailForm.targetManufacturer" placeholder="请输入目标厂家" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="detailDialogVisible = false"> </el-button>
<el-button type="primary" :loading="detailButtonLoading" @click="submitDetailForm"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@@ -354,7 +273,11 @@ export default {
inspectionQueried: false, inspectionQueried: false,
selectedInspectionRows: [], selectedInspectionRows: [],
// 维修明细 // 维修明细
detailList: [] detailList: [],
detailDialogVisible: false,
detailDialogTitle: "",
detailForm: {},
editingDetailId: null
}; };
}, },
created() { created() {
@@ -401,9 +324,7 @@ export default {
loadDetailList(planId) { loadDetailList(planId) {
var self = this; var self = this;
listMaintenancePlanDetail({ planId: planId, pageNum: 1, pageSize: 999 }).then(function(r) { listMaintenancePlanDetail({ planId: planId, pageNum: 1, pageSize: 999 }).then(function(r) {
self.detailList = (r.rows || []).map(function(item) { self.detailList = r.rows || [];
return self.decorateDetailRow(item);
});
}); });
}, },
// ---- 检修记录查询 ---- // ---- 检修记录查询 ----
@@ -452,17 +373,9 @@ export default {
componentName: rec.partName || '', componentName: rec.partName || '',
productionLine: self.currentRow.productionLine || rec.productionLine || '', productionLine: self.currentRow.productionLine || rec.productionLine || '',
maintenanceCategory: 1, maintenanceCategory: 1,
itemPlanDate: rec.inspectTime ? parseTime(rec.inspectTime, '{y}-{m}-{d}') : parseTime(new Date(), '{y}-{m}-{d}'),
repairContent: rec.abnormalDesc || '', repairContent: rec.abnormalDesc || '',
lineExecutor: rec.inspector || '',
equipmentExecutor: '',
plannedCompleteTime: '',
actualCompleteTime: '',
totalHours: '',
acceptanceUser: '',
repairUser: rec.inspector || '', repairUser: rec.inspector || '',
detailStatus: 0, detailStatus: 0
remark: rec.remark || ''
}); });
}); });
Promise.all(promises).then(function() { Promise.all(promises).then(function() {
@@ -550,122 +463,45 @@ export default {
}).catch(function() { }).finally(function() { self.loading = false; }); }).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() { handleAddDetail() {
if (!this.currentRow) { this.detailForm = {
this.$modal.msgWarning("请先选择检修单"); planId: this.currentRow.planId,
return; componentName: '',
} productionLine: this.currentRow.productionLine || '',
if (this.getEditingDetailRow()) { maintenanceCategory: 1,
this.$modal.msgWarning("请先保存或取消当前正在编辑的维修明细"); repairContent: '',
return; repairUser: '',
} itemPlanDate: undefined,
const row = this.decorateDetailRow(this.getDefaultDetailRow()); targetManufacturer: '',
this.beginDetailEdit(row, true); detailStatus: 0
this.detailList.unshift(row); };
this.editingDetailId = null;
this.detailDialogTitle = "添加维修明细";
this.detailDialogVisible = true;
}, },
handleEditDetail(row) { handleEditDetail(row) {
const editingRow = this.getEditingDetailRow(); this.detailForm = Object.assign({}, row);
if (editingRow && editingRow._rowKey !== row._rowKey) { this.editingDetailId = row.detailId;
this.$modal.msgWarning("请先保存或取消当前正在编辑维修明细"); this.detailDialogTitle = "编辑维修明细";
return; this.detailDialogVisible = true;
}
if (row._editing) return;
this.beginDetailEdit(row);
}, },
cancelEditDetail(row) { submitDetailForm() {
if (row._isNew) { if (!this.detailForm.componentName) {
this.detailList = this.detailList.filter(function(item) { return item._rowKey !== row._rowKey; }); this.$modal.msgWarning("请输入设备部件名称");
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; return;
} }
var self = this; var self = this;
var payload = this.buildDetailPayload(row);
this.detailButtonLoading = true; this.detailButtonLoading = true;
if (row.detailId) { if (this.editingDetailId) {
updateMaintenancePlanDetail(payload).then(function() { updateMaintenancePlanDetail(this.detailForm).then(function() {
self.$modal.msgSuccess("修改成功"); self.$modal.msgSuccess("修改成功");
self.detailDialogVisible = false;
self.loadDetailList(self.currentRow.planId); self.loadDetailList(self.currentRow.planId);
}).finally(function() { self.detailButtonLoading = false; }); }).finally(function() { self.detailButtonLoading = false; });
} else { } else {
addMaintenancePlanDetail(payload).then(function() { addMaintenancePlanDetail(this.detailForm).then(function() {
self.$modal.msgSuccess("添加成功"); self.$modal.msgSuccess("添加成功");
self.detailDialogVisible = false;
self.loadDetailList(self.currentRow.planId); self.loadDetailList(self.currentRow.planId);
}).finally(function() { self.detailButtonLoading = false; }); }).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 { display: flex; align-items: center; gap: 6px; padding: 0 14px 10px; background: #f5f7fa; }
.search-row .el-input { flex: 1; } .search-row .el-input { flex: 1; }
.list-body { flex: 1; overflow-y: auto; padding: 0 6px; } .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 { 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:hover { background: #ebeef5; }
.list-item.active { background: #d9ecff; } .list-item.active { background: #d9ecff; }
@@ -715,7 +546,7 @@ export default {
/* ========== 右侧面板 ========== */ /* ========== 右侧面板 ========== */
.right-panel { height: 100%; overflow: hidden; display: flex; flex-direction: column; background: #faf8f5; } .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; } .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; } .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-count { font-size: 12px; color: #909399; }
.section-actions { display: flex; align-items: center; gap: 6px; } .section-actions { display: flex; align-items: center; gap: 6px; }
.inspection-section .el-table { flex: 1; overflow-y: auto; } .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 { 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; } .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; } .empty-data { padding: 24px 0; text-align: center; color: #c0c4cc; font-size: 13px; }

View File

@@ -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`;