diff --git a/src/views/distribution/artery/AddVehicleStowage.vue b/src/views/distribution/artery/AddVehicleStowage.vue index 2b8480bb..d769cbe2 100644 --- a/src/views/distribution/artery/AddVehicleStowage.vue +++ b/src/views/distribution/artery/AddVehicleStowage.vue @@ -1902,6 +1902,19 @@ const handleAddWaybill = async (index: number) => { item.totalNum = item.totalNum || 20; item.planNum = item.stockNum; item.loadingNum = 0; + + let isContinue = false; + + for (let i = 0; i < details.orderCodeList.length; i++) { + const val = details.orderCodeList[i]; + + if (item.orderCode + ',' + item.waybillNo !== val) continue; + isContinue = true; + break; + } + + if (isContinue) continue; + _orderMap.push(item.orderCode + ',' + item.waybillNo); _node.lineCarsOrderList.push(item); } diff --git a/src/views/distribution/artery/addTripartiteTransfer.vue b/src/views/distribution/artery/addTripartiteTransfer.vue index 730349ed..07c9c458 100644 --- a/src/views/distribution/artery/addTripartiteTransfer.vue +++ b/src/views/distribution/artery/addTripartiteTransfer.vue @@ -1080,17 +1080,36 @@ const currentChange = pageNum => { /** 加入调度池 */ const handleAddWaybill = () => { - details.selectionList.forEach(val => { - val.planNum = val.stockNum; - val.loadingNum = 0; - details.newData.push(val); - }); - details.orderCodeList = [ - ...new Set([ - ...details.orderCodeList, - ...details.selectionList.map(val => val.orderCode + ',' + val.waybillNo), - ]), - ]; + const _orderMap = []; + + for (let i = 0; i < details.selectionList.length; i++) { + const item = details.selectionList[i]; + + item.planNum = item.stockNum; + item.loadingNum = 0; + + let isContinue = false; + + for (let i = 0; i < details.orderCodeList.length; i++) { + const val = details.orderCodeList[i]; + + if (item.orderCode + ',' + item.waybillNo !== val) continue; + isContinue = true; + break; + } + + if (isContinue) continue; + + _orderMap.push(item.orderCode + ',' + item.waybillNo); + details.newData.push(item); + } + + // details.selectionList.forEach(val => { + // val.planNum = val.stockNum; + // val.loadingNum = 0; + // details.newData.push(val); + // }); + details.orderCodeList = [...new Set([...details.orderCodeList, ..._orderMap])]; console.log('details.orderCodeList :>> ', details.orderCodeList); const orderCodes = details.selectionList.map(val => val.orderCode);