diff --git a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue index 79694b38a..c659954a2 100644 --- a/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRequestMain/index.vue @@ -115,6 +115,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // 明细查询页赋值 if(formField=='itemCode'){ //物料代码 + let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['code'])) + if(itemCodes.length>0){ + itemCodes = itemCodes.map(item=>(item['code'])) + message.warning(`物料${itemCodes.join(',')}已经存在`) + } + val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['code'])) + if(val.length==0) return val.forEach(item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow[formField] = item[searchField]