From 8a07b5ac3ac6a1f90ba5c15d1a132ff2b3651bf4 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 22 Nov 2024 13:21:02 +0800 Subject: [PATCH] =?UTF-8?q?YT-965=E6=88=90=E5=93=81=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E4=B8=80=E7=89=A9=E6=96=99=EF=BC=8C=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E6=89=B9=E6=AC=A1=EF=BC=8C=E6=89=AB=E6=8F=8F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E4=B8=AA=E6=89=B9=E6=AC=A1=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A6=82=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/deliver/job/deliverDetailBatch.vue | 39 +++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/pages/deliver/job/deliverDetailBatch.vue b/src/pages/deliver/job/deliverDetailBatch.vue index c643e04b..8c397885 100644 --- a/src/pages/deliver/job/deliverDetailBatch.vue +++ b/src/pages/deliver/job/deliverDetailBatch.vue @@ -89,6 +89,7 @@ getThreeDataSource, getDataSource, calcHandleQty, + getDataSourceBatch } from '@/common/detail.js'; import { getManagementPrecisions @@ -199,7 +200,7 @@ that.jobStatus = res.data.status; that.subList = res.data.subList; // that.detailSource = res.data; - that.detailSource = getThreeDataSource(that.jobContent) + that.detailSource = getDataSourceBatch(that.subList) that.toLocationCode = that.subList[0].toLocationCode that.allowBiggerQty = res.data.allowBiggerQty; that.resizeCollapse(); @@ -329,6 +330,7 @@ detail.handleQty = 0 detail.qty = 0 detail.subList.forEach(item=>{ + item.handleQty = item.handleQty || 0 detail.handleQty = calc.add(detail.handleQty,item.handleQty) detail.qty = calc.add(detail.qty,item.qty) // item.packList.forEach(cur=>{ @@ -357,6 +359,7 @@ detail.handleQty = 0 detail.balance = result.balance, detail.subList.forEach(item=>{ + item.handleQty = item.handleQty || 0 detail.handleQty = calc.add(detail.handleQty,item.handleQty) // item.packList.forEach(cur=>{ // cur.handleQty = calc.add(detail.handleQty,item.handleQty) @@ -385,6 +388,7 @@ itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty); detail.handleQty = 0 detail.subList.forEach(item=>{ + item.handleQty = item.handleQty || 0 detail.handleQty = calc.add(detail.handleQty,item.handleQty) }) } else { @@ -407,6 +411,7 @@ // }) detail.handleQty = 0 detail.subList.forEach(item=>{ + item.handleQty = item.handleQty || 0 detail.handleQty = calc.add(detail.handleQty,item.handleQty) // item.packList.forEach(cur=>{ // cur.handleQty = calc.add(detail.handleQty,item.handleQty) @@ -572,10 +577,12 @@ submitJob() { var params = this.setParams() console.log("提交参数", params); - const isTrue = params.subList.some(item=>{ - console.log(item.recordList.some(cur=>cur.scaned)) - return item.recordList.some(cur=>cur.scaned) == true - }) + console.log("提交参数", params.subList); + // const isTrue = params.subList.some(item=>{ + // console.log(item.recordList.some(cur=>cur.scaned)) + // return item.recordList.some(cur=>cur.scaned) == true + // }) + const isTrue = params.subList.some(item=>item.scaned) if(!isTrue){ uni.hideLoading() this.showErrorMessage("请扫描您需要提交的发货任务") @@ -616,15 +623,21 @@ var subList = [] var createTime = getCurrDateTime(); var creator = this.$store.state.user.id + console.log(this.detailSource) this.detailSource.forEach(toLocationCode => { - let obj = {...toLocationCode} - delete obj.subList - obj.recordList = [] + // let obj = {...toLocationCode} + // delete obj.subList + let recordList = [] let obj1 ={} let arr = toLocationCode.subList.filter(item=>item.scaned) + console.log(888,arr) + if(arr.length>0){ arr.forEach(record=>{ + obj1.itemCode =toLocationCode.itemCode; + obj1.itemName =toLocationCode.itemName; obj1.scaned =record.scaned; obj1.handleQty =record.handleQty; + obj1.qty =record.qty; obj1.fromLocationCode =record.fromLocationCode; obj1.fromInventoryStatus =record.fromInventoryStatus; obj1.copyContent =record.copyContent; @@ -639,9 +652,15 @@ obj1.toPackingNumber = ''; obj1.packingNumber = ''; obj1.fromPackingNumber =''; - obj.recordList.push(obj1) + // obj = {...obj1} + recordList.push(obj1) + }) + subList.push({ + ...obj1, + recordList: recordList }) - subList.push(obj) + } + }) this.jobContent.subList = subList this.jobContent.createTime = createTime;