diff --git a/src/pages/repleinsh/job/repleinshDetailBatch.vue b/src/pages/repleinsh/job/repleinshDetailBatch.vue index 49de2784..296cfc7e 100644 --- a/src/pages/repleinsh/job/repleinshDetailBatch.vue +++ b/src/pages/repleinsh/job/repleinshDetailBatch.vue @@ -354,6 +354,10 @@ } else { this.recommendQty = result.balance.qty } + if(result.label.qty ==0||!result.label.qty){ + this.showErrorMessage(`数量不能为0`) + return + } // this.managementType = managementTypeParams if (managementTypeParams == "BY_BATCH") { this.setDataBatch(result) @@ -429,8 +433,6 @@ toAreaCode:detail.subList[0].toAreaCode, } detail.subList.push(item) - //计算数量 - detail.handleQty = 0 } else { // itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty) itemDetail.packList = itemDetail.packList && itemDetail.packList.length > 0 ? itemDetail.packList : [] @@ -459,10 +461,10 @@ detail.subList.forEach(item => { item.handleQty = item.handleQty || 0 item.packList.forEach(cur => { - detail.handleQty = calc.add(detail.handleQty, cur.handleQty) + cur.handleQty = cur.handleQty || 0 + detail.handleQty = calc.add(parseFloat(detail.handleQty), parseFloat(cur.handleQty)) }) }) - console.log(333, this.detailSource) setTimeout(r => { that.resizeCollapse(); that.$forceUpdate() @@ -538,9 +540,6 @@ toAreaCode:detail.subList[0].toAreaCode, } detail.subList.push(item) - //计算数量 - detail.handleQty = 0 - detail.qty = 0 } else { // itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty) itemDetail.packList = itemDetail.packList && itemDetail.packList.length > 0 ? itemDetail.packList : [] @@ -569,7 +568,8 @@ detail.subList.forEach(item => { item.handleQty = item.handleQty || 0 item.packList.forEach(cur => { - detail.handleQty = calc.add(detail.handleQty, cur.handleQty) + cur.handleQty = cur.handleQty || 0 + detail.handleQty = calc.add(parseFloat(detail.handleQty), parseFloat(cur.handleQty)) }) }) // console.log(333, this.detailSource) @@ -803,7 +803,8 @@ detail.subList.forEach(item => { item.handleQty = item.handleQty || 0 item.packList.forEach(cur => { - detail.handleQty = calc.add(detail.handleQty, cur.handleQty) + cur.handleQty=cur.handleQty||0 + detail.handleQty = calc.add(parseFloat(detail.handleQty), parseFloat(cur.handleQty)) }) }) })