From 125e07eed45cc1656b7ac7b6fa67467c8f4eb531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Fri, 29 May 2026 11:41:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes/eqp/check):=20=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E9=80=89=E5=9E=8B=E4=B8=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=BA=A7=E7=BA=BF=E4=B8=8B=E6=8B=89=E9=80=89=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 统一替换页面中原有的dict-select为通过接口获取的动态产线列表 2. 新增产线默认选中酸轧线的逻辑 3. 修复产线参数传递不匹配的问题,同步前后端参数字段 --- klp-ui/src/views/mes/eqp/check/day.vue | 32 ++++++++++++---- klp-ui/src/views/mes/eqp/check/index.vue | 46 ++++++++++++++++++----- klp-ui/src/views/mes/eqp/check/record.vue | 27 ++++++++----- 3 files changed, 79 insertions(+), 26 deletions(-) diff --git a/klp-ui/src/views/mes/eqp/check/day.vue b/klp-ui/src/views/mes/eqp/check/day.vue index 79a6d2b1..50d425d8 100644 --- a/klp-ui/src/views/mes/eqp/check/day.vue +++ b/klp-ui/src/views/mes/eqp/check/day.vue @@ -8,8 +8,9 @@ @change="handleQuery" style="width: 260px;" /> - + + + 查询 @@ -105,15 +106,16 @@ diff --git a/klp-ui/src/views/mes/eqp/check/index.vue b/klp-ui/src/views/mes/eqp/check/index.vue index cdc46068..2cc499ed 100644 --- a/klp-ui/src/views/mes/eqp/check/index.vue +++ b/klp-ui/src/views/mes/eqp/check/index.vue @@ -1,7 +1,8 @@ - + + {{ item.lineName }} + @@ -132,7 +133,9 @@ - + + + @@ -206,20 +209,21 @@ import html2canvas from 'html2canvas'; import { PDFDocument } from 'pdf-lib'; import { listEquipmentPart, getEquipmentPart, delEquipmentPart, addEquipmentPart, updateEquipmentPart } from "@/api/mes/eqp/equipmentPart"; import { listEquipmentChecklist, getEquipmentChecklist, delEquipmentChecklist, addEquipmentChecklist, updateEquipmentChecklist } from "@/api/mes/eqp/equipmentChecklist"; +import { listProductionLine } from '@/api/wms/productionLine' export default { name: "EquipmentPartChecklist", components: { DragResizePanel, QRCode }, - dicts: ['sys_lines'], data() { return { showSearch: true, // Shared query params (productionLine & lineSection) sharedQueryParams: { - productionLine: '酸轧线', + lineId: null, lineSection: undefined }, + lineList: [], // Part (left side) partLoading: false, @@ -285,13 +289,28 @@ export default { computed: { currentPartId() { return this.currentPart?.partId || ""; + }, + selectedLineName() { + const found = this.lineList.find(l => l.lineId === this.sharedQueryParams.lineId); + return found ? found.lineName : ''; } }, created() { - this.getPartList(); - this.getChecklistList(); + this.loadLineList(); }, methods: { + async loadLineList() { + try { + const res = await listProductionLine({ pageSize: 999 }); + if (res.rows) this.lineList = res.rows; + if (this.lineList.length > 0) { + const suanYa = this.lineList.find(l => l.lineName === '酸轧线'); + this.sharedQueryParams.productionLine = suanYa ? suanYa.lineId : this.lineList[0].lineId; + } + this.getPartList(); + this.getChecklistList(); + } catch (e) { console.error('加载产线列表失败', e); } + }, // ========== Shared ========== applySharedParams() { this.partQueryParams.productionLine = this.sharedQueryParams.productionLine; @@ -357,6 +376,7 @@ export default { partId: undefined, inspectPart: undefined, remark: undefined, + lineId: undefined, productionLine: undefined, lineSection: undefined }; @@ -368,8 +388,8 @@ export default { }, handlePartAdd() { this.resetPartForm(); - if (this.sharedQueryParams.productionLine) { - this.partForm.productionLine = this.sharedQueryParams.productionLine; + if (this.sharedQueryParams.lineId) { + this.partForm.lineId = this.sharedQueryParams.lineId; } if (this.sharedQueryParams.lineSection) { this.partForm.lineSection = this.sharedQueryParams.lineSection; @@ -384,6 +404,10 @@ export default { getEquipmentPart(partId).then(response => { this.partLoading = false; this.partForm = response.data; + if (this.partForm.productionLine && this.lineList.length) { + const line = this.lineList.find(l => l.lineName === this.partForm.productionLine); + if (line) this.$set(this.partForm, 'lineId', line.lineId); + } this.partOpen = true; this.partTitle = "修改检验部位"; }); @@ -392,6 +416,10 @@ export default { this.$refs["partForm"].validate(valid => { if (valid) { this.partButtonLoading = true; + if (this.partForm.lineId) { + const line = this.lineList.find(l => l.lineId === this.partForm.lineId); + if (line) this.partForm.productionLine = line.lineName; + } if (this.partForm.partId != null) { updateEquipmentPart(this.partForm).then(response => { this.$modal.msgSuccess("修改成功"); diff --git a/klp-ui/src/views/mes/eqp/check/record.vue b/klp-ui/src/views/mes/eqp/check/record.vue index 42c9f9b4..b413baf6 100644 --- a/klp-ui/src/views/mes/eqp/check/record.vue +++ b/klp-ui/src/views/mes/eqp/check/record.vue @@ -1,14 +1,11 @@ - + + + + + @@ -158,7 +155,7 @@ - + @@ -198,6 +195,7 @@