From 274671f309b763d53f6e76a3dd200e0a6749a638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Sun, 21 Jun 2026 11:32:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms):=20=E6=96=B0=E5=A2=9E=E9=92=A2?= =?UTF-8?q?=E5=8D=B7=E5=90=88=E5=90=8C=E5=8F=B7=E8=87=AA=E5=8A=A8=E5=A1=AB?= =?UTF-8?q?=E5=85=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 在钢卷合并、分卷、打钢印、计划拆分、退火计划页面添加合同号自动拉取逻辑 2. 优化合同选择组件,补全不存在于列表的已选合同 3. 移除split.vue中冗余的注释代码 --- .../KLPService/ContractSelect/index.vue | 22 +++++++++++++ klp-ui/src/views/wms/anneal/plan/ctrl.vue | 10 ++++++ klp-ui/src/views/wms/coil/merge.vue | 9 +++++ .../src/views/wms/coil/panels/stepSplit.vue | 8 +++++ klp-ui/src/views/wms/coil/split.vue | 21 ++++++++++-- klp-ui/src/views/wms/coil/typing.vue | 33 ++++++++++++------- 6 files changed, 88 insertions(+), 15 deletions(-) diff --git a/klp-ui/src/components/KLPService/ContractSelect/index.vue b/klp-ui/src/components/KLPService/ContractSelect/index.vue index e6d366ef..a2afcc17 100644 --- a/klp-ui/src/components/KLPService/ContractSelect/index.vue +++ b/klp-ui/src/components/KLPService/ContractSelect/index.vue @@ -157,6 +157,17 @@ export default { } } }, + watch: { + value(val) { + if (val && !this.contractList.some(item => String(item.orderId) === String(val))) { + getOrder(val).then(res => { + if (res.data) { + this.contractList.unshift(res.data) + } + }).catch(() => {}) + } + } + }, mounted() { if (this.mode == "today") { this.loadFromLocalStorage(); @@ -211,6 +222,17 @@ export default { this.sortLastSelectedToFirst(); // 保存到localStorage this.saveToLocalStorage(); + // 确保已选中的合同在列表中 + if (this.value && !this.contractList.some(item => String(item.orderId) === String(this.value))) { + try { + const contract = await getOrder(this.value); + if (contract.data) { + this.contractList.unshift(contract.data); + } + } catch (e) { + console.error('Failed to fetch selected contract:', e); + } + } }, // 将上一次选择的合同排到列表第一位 diff --git a/klp-ui/src/views/wms/anneal/plan/ctrl.vue b/klp-ui/src/views/wms/anneal/plan/ctrl.vue index 6221f352..f6c37c36 100644 --- a/klp-ui/src/views/wms/anneal/plan/ctrl.vue +++ b/klp-ui/src/views/wms/anneal/plan/ctrl.vue @@ -238,6 +238,7 @@ import { listAnnealPlan, updateAnnealPlanCoil, getAnnealPlan, addAnnealPlan, updateAnnealPlan, delAnnealPlan, changeAnnealPlanStatus, inFurnace, completeAnnealPlan, listAnnealPlanCoils, bindAnnealPlanCoils, unbindAnnealPlanCoil } from "@/api/wms/annealPlan"; import { listAnnealFurnace } from "@/api/wms/annealFurnace"; import { listMaterialCoil } from "@/api/wms/coil"; +import { listCoilContractRel } from '@/api/wms/coilContractRel'; import { listWarehouse } from '@/api/wms/warehouse' import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; import { addAnnealOperateEvent } from "@/api/wms/annealOperateEvent"; @@ -398,6 +399,15 @@ export default { enterCoilNo: item.enterCoilNo, warehouseId: item.logicWarehouseId || null })); + // 查询每个钢卷绑定的合同号作为默认值 + for (const coil of this.completeCoils) { + listCoilContractRel({ coilId: coil.coilId }).then(res => { + const rows = res.rows || [] + if (rows.length > 0 && rows[0].contractId) { + this.$set(coil, 'contractId', rows[0].contractId) + } + }) + } this.completeLoading = false; }).catch(() => { this.completeLoading = false; diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue index 5dde05a8..5f0b8524 100644 --- a/klp-ui/src/views/wms/coil/merge.vue +++ b/klp-ui/src/views/wms/coil/merge.vue @@ -363,6 +363,7 @@