From 41136b5e53102a5e12686137188d9113b2de2efe Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Mon, 22 Jul 2024 16:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../saleShipmentMainRequest/index.vue | 7 +++++++ .../purchasereceipt/purchasereceiptRequestMain/index.vue | 7 +++++++ .../purchasereceiptRequestOrderMTypeMain/index.vue | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/src/views/wms/deliversettlementManage/saleShipmentMainRequest/index.vue b/src/views/wms/deliversettlementManage/saleShipmentMainRequest/index.vue index e0eecb53b..9fd7dda33 100644 --- a/src/views/wms/deliversettlementManage/saleShipmentMainRequest/index.vue +++ b/src/views/wms/deliversettlementManage/saleShipmentMainRequest/index.vue @@ -111,6 +111,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => nextTick(() => { if (type == 'tableForm') { if(formField == 'soLine') { + let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['soLine']==item['lineNumber']&&item1['soNumber']==item['number']&&item1['itemCode']==item['itemCode'])) + if(itemCodes.length>0){ + itemCodes = itemCodes.map(item=>(item.itemCode)) + message.warning(`物料${itemCodes.join(',')}已经存在`) + } + val = val.filter(item=>!tableData.value.find(item1=>item1['soLine']==item['lineNumber']&&item1['soNumber']==item['number']&&item1['itemCode']==item['itemCode'])) + if(val.length==0) return val.forEach(item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow['soLine'] = item['lineNumber'] diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue index 761fe31c3..47aba1611 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue @@ -510,6 +510,13 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r } const updateTableData = (tableList)=>{ + let itemCodes = tableList.filter(item=>tableData.value.find(item1=>item1['poNumber']==item['number']&&item1['supplierCode']==item['supplierCode']&&item1['poLine']==item['lineNumber']&&item1['itemCode']==item['itemCode'])) + if(itemCodes.length>0){ + itemCodes = itemCodes.map(item=>(item.itemCode)) + message.warning(`物料${itemCodes.join(',')}已经存在`) + } + tableList = tableList.filter(item=>!tableData.value.find(item1=>item1['poNumber']==item['number']&&item1['supplierCode']==item['supplierCode']&&item1['poLine']==item['lineNumber']&&item1['itemCode']==item['itemCode'])) + if(tableList.length==0) return tableList.forEach(row=>{ //poNumber poLine itemCode batch const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue index 8863f857d..3aececbe4 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue @@ -487,6 +487,13 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r } const updateTableData = (tableList)=>{ + let itemCodes = tableList.filter(item=>tableData.value.find(item1=>item1['poNumber']==item['number']&&item1['supplierCode']==item['supplierCode']&&item1['poLine']==item['lineNumber']&&item1['itemCode']==item['itemCode'])) + if(itemCodes.length>0){ + itemCodes = itemCodes.map(item=>(item.itemCode)) + message.warning(`物料${itemCodes.join(',')}已经存在`) + } + tableList = tableList.filter(item=>!tableData.value.find(item1=>item1['poNumber']==item['number']&&item1['supplierCode']==item['supplierCode']&&item1['poLine']==item['lineNumber']&&item1['itemCode']==item['itemCode'])) + if(tableList.length==0) return tableList.forEach(row=>{ //poNumber poLine itemCode batch const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))