From bce66a01c8ab1eee3b47addaae2ae06bd3676d42 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 14 Oct 2025 11:13:21 +0800 Subject: [PATCH] =?UTF-8?q?2025-10-14=20=E7=AE=B1=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E8=A3=85=E7=AE=B1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boxManage/com_saleBoxManage_boxing.vue | 2 +- src/views/modules/boxManage/saleBoxManage.vue | 38 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/views/modules/boxManage/com_saleBoxManage_boxing.vue b/src/views/modules/boxManage/com_saleBoxManage_boxing.vue index db60690..76a45db 100644 --- a/src/views/modules/boxManage/com_saleBoxManage_boxing.vue +++ b/src/views/modules/boxManage/com_saleBoxManage_boxing.vue @@ -463,7 +463,7 @@ export default { this.$message.error('请扫描标签!'); } const inData = { - site: this.boxData.site, + site: this.boxData.site, buNo: this.boxData.buNo, finalRollNo: this.scanRollNo, boxNo: this.boxData.boxNo, diff --git a/src/views/modules/boxManage/saleBoxManage.vue b/src/views/modules/boxManage/saleBoxManage.vue index b0d009a..eefaa94 100644 --- a/src/views/modules/boxManage/saleBoxManage.vue +++ b/src/views/modules/boxManage/saleBoxManage.vue @@ -845,18 +845,30 @@ export default { try { const {data} = await validateAndScanCaseRoll(this.caseForm) - if(data && data.code === 0 && data.rollInfo){ - // 校验通过,将卷信息添加到列表最前面(后扫描的在上面) - this.caseRollList.unshift({ - casesNo: this.caseForm.casesNo, - rollNo: data.rollInfo.rollNo, - rollQty: data.rollInfo.rollQty, - partNo: data.rollInfo.partNo, - partDesc: data.rollInfo.partDesc, - batchNo: data.rollInfo.batchNo, - notifyNo: this.caseForm.notifyNo, - site: this.caseForm.site, - buNo: this.caseForm.buNo + if(data && data.code === 0){ + // 后端现在返回的是集合,需要遍历所有记录 + const rollList = data.rollInfo || [] + + if(rollList.length === 0){ + this.$message.warning('未查询到卷数据') + this.caseForm.rollNo = '' + this.$refs.rollNoInput.focus() + return + } + + // 将所有查询到的卷信息添加到列表最前面(后扫描的在上面) + rollList.forEach(rollInfo => { + this.caseRollList.unshift({ + casesNo: this.caseForm.casesNo, + rollNo: rollInfo.rollNo, + rollQty: rollInfo.rollQty, + partNo: rollInfo.partNo, + partDesc: rollInfo.partDesc, + batchNo: rollInfo.batchNo, + notifyNo: this.caseForm.notifyNo, + site: this.caseForm.site, + buNo: this.caseForm.buNo + }) }) // 更新统计信息 @@ -871,7 +883,7 @@ export default { this.$refs.caseNoInput.focus() }) - this.$message.success('扫描成功') + this.$message.success(`扫描成功,添加了 ${rollList.length} 条记录`) } else { this.$message.error(data.msg || '扫描失败') }