From 0af512576647df4b4c9d64351f0f4b7f5e49f1cb Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Wed, 17 Sep 2025 16:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=90=8E=E6=B8=85=E9=99=A4hu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/recv/recv.vue | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/views/modules/recv/recv.vue b/src/views/modules/recv/recv.vue index ffbb11d..e4d5046 100644 --- a/src/views/modules/recv/recv.vue +++ b/src/views/modules/recv/recv.vue @@ -103,8 +103,8 @@ - - + + @@ -203,7 +203,7 @@ export default { ...row, poNo: row.poNumber || this.scanCode, dueinQty: row.qtyToReceive || row.invQtyToReceive, - transQty: row.invQtyToReceive || 0, + transQty: row.needHandlingUnit==='Y'?0:row.invQtyToReceive || 0, batchNo: row.partNo+'-'+row.lineNo+'-'+row.releaseNo+'-'+1, deliveryDate: row.plannedDeliveryDate || '', arrivalDate: this.getCurrentDate(), @@ -241,6 +241,16 @@ export default { this.handlingUnit.splice(index, 1); localStorage.setItem(this.huKey, JSON.stringify(this.handlingUnit)); }, + // 清除所有handlingUnit缓存 + clearAllHandlingUnitCache() { + this.hanlingItem = { code: '', qty: '', perQty: '', packageQty: '' }; + const keys = Object.keys(localStorage); + keys.forEach(key => { + if (key.startsWith('hu_')) { + localStorage.removeItem(key); + } + }); + }, receivePo() { if (this.fullscreenLoading) return; // 防止重复点 this.fullscreenLoading = true; @@ -285,14 +295,14 @@ export default { manufactureDate: item.manufactureDate, // 处理单元列表 handlingUnitList: item.needHandlingUnit === 'Y' ? this.handlingUnit.map(hu => ({ - perQty: hu.qty, - packageQty: 1 + perQty: hu.perQty, + packageQty: hu.packageQty })) : [] }; receivePo(receiveData).then(({ data }) => { if (data.code === 0) { this.$message.success("操作成功"); - localStorage.removeItem(this.huKey); + this.clearAllHandlingUnitCache(); this.processFlag = 1; this.scanCode = ''; this.poList = [];