From 0bd4cc169672f82e6298bcf7a957f46d49d7825f Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 20 Oct 2025 16:04:29 +0800 Subject: [PATCH] =?UTF-8?q?2025-10-20=20pda=E7=94=9F=E4=BA=A7=E9=A2=86?= =?UTF-8?q?=E6=96=99=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/productionInboundStorage.vue | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/views/modules/production/productionInboundStorage.vue b/src/views/modules/production/productionInboundStorage.vue index 8a21061..e66e401 100644 --- a/src/views/modules/production/productionInboundStorage.vue +++ b/src/views/modules/production/productionInboundStorage.vue @@ -262,23 +262,28 @@ export default { }; validateLabelWithInbound(params).then(({ data }) => { if (data && data.code === 0) { - // 检查是否已经扫描过 - const exists = this.labelList.find(item => item.labelCode === labelCode); + const resultList = data.data; + + // 检查是否已经扫描过(检查父标签) + const exists = this.labelList.find(item => item.parentLabelCode === labelCode); if (exists) { this.$message.warning('该标签已扫描,请勿重复扫描'); return; } - // 添加到列表顶部(最后扫描的在最上面) - this.labelList.unshift({ - id: Date.now(), - labelCode: labelCode, - partNo: data.data.partNo, - quantity: data.data.quantity, - batchNo: data.data.batchNo + // 将所有子标签添加到列表 + resultList.forEach(result => { + this.labelList.unshift({ + id: Date.now() + Math.random(), // 确保ID唯一 + labelCode: result.labelCode, + parentLabelCode: labelCode, // 保存父标签编码 + partNo: result.partNo, + quantity: result.quantity, + batchNo: result.batchNo + }); }); - this.$message.success('操作成功'); + this.$message.success(`标签验证成功,共添加 ${resultList.length} 条记录`); } else { this.$message.error(data.msg || '该标签与入库单不符,请检查'); } @@ -403,7 +408,8 @@ export default { const params = { site: this.materialInfo.site, buNo: this.materialInfo.buNo, - inboundNo: this.inboundNo + inboundNo: this.inboundNo, + relatedOrderNo: this.relatedOrderNo, }; getMaterialList(params).then(({ data }) => { @@ -435,6 +441,7 @@ export default { buNo: this.buNo, warehouseId: getCurrentWarehouse(), site:localStorage.getItem('site'), + relatedOrderNo: this.relatedOrderNo }; getInboundDetails(params).then(({ data }) => { @@ -457,7 +464,7 @@ export default { this.relatedOrderNo = this.$route.params.relatedOrderNo || ''; this.relatedOrderLineNo = this.$route.params.relatedOrderLineNo || ''; this.partNo = this.$route.params.partNo || ''; - + if (!this.inboundNo || !this.buNo) { this.$message.error('参数错误'); this.$router.back();