diff --git a/src/common/detail.js b/src/common/detail.js index ac1b3ed2..47e53bb7 100644 --- a/src/common/detail.js +++ b/src/common/detail.js @@ -49,7 +49,7 @@ export function getDataSource(subList) { let items = []; subList.forEach(detail => { var item = items.find(r => - r.itemCode == detail.itemCode) + r.itemCode == detail.itemCode && r.batch == detail.batch ) if (item == undefined) { item = createItemInfo(detail); let newDetail = createDetailInfo(detail); // diff --git a/src/pages/productPutaway/job/productPutawayDetail.vue b/src/pages/productPutaway/job/productPutawayDetail.vue index bc151e08..22479ff0 100644 --- a/src/pages/productPutaway/job/productPutawayDetail.vue +++ b/src/pages/productPutaway/job/productPutawayDetail.vue @@ -334,15 +334,24 @@ var locationCode = result.balance.locationCode; var inventoryStatus = result.balance.inventoryStatus; var detail = this.detailSource.find(r => r.itemCode == itemCode); - if (detail == undefined) { this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { - var itemDetail = detail.subList.find(r => { - return r.batch == batch && - r.fromLocationCode == result.fromLocationCode - }) - if (itemDetail == undefined) { + // var itemDetail = detail.subList.find(r => { + // return r.batch == result.label.batch && + // r.fromLocationCode == result.fromLocationCode + // }) + let itemDetail = '' + this.detailSource.find(item => { + const itemDetail1 = item.subList.find(r => { + return r.batch == result.label.batch && r.fromLocationCode == result.fromLocationCode + }) + if(itemDetail1){ + itemDetail = itemDetail1 + } + console.log(99,itemDetail1) + }); + if (!itemDetail) { this.showErrorMessage("批次【" + batch + "】库位【" + result .fromLocationCode + "】不在列表中") } else { @@ -379,6 +388,7 @@ } } } catch (e) { + console.log(2333,e) this.showMessage(e.message) } },