From 8cc1c6158ad5b00267752b57fe5ccaa9f92b2a97 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Mon, 22 Jul 2024 19:08:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=AF=E4=B8=80=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deliverplan/deliverPlanMain/index.vue | 1 + .../containermanage/containerMainRequest/index.vue | 8 +++++++- .../containermanage/scrapContainerMainRequest/index.vue | 7 +++++++ .../productredress/productredressRequestMain/index.vue | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue index 20fdfe023..679089713 100644 --- a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue +++ b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue @@ -158,6 +158,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => if (type == 'tableForm') { if(formField == 'itemCode') { val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) + if(val.length==0) return val.forEach(item=>{ if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])) return const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) diff --git a/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue b/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue index 6226545d9..56c7fe1f9 100644 --- a/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue +++ b/src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue @@ -157,7 +157,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => nextTick(() => { if (type == 'tableForm') { if(formField == 'containerNumber') { - + let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['containerNumber']==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['containerNumber']==item['itemCode'])) + if(val.length==0) return val.forEach(item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow['containerNumber'] = item['itemCode'] diff --git a/src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue b/src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue index 1eaca15ea..2255710a7 100644 --- a/src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue +++ b/src/views/wms/inventoryjobManage/containermanage/scrapContainerMainRequest/index.vue @@ -133,6 +133,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => nextTick(() => { if (type == 'tableForm') { if(formField == 'containerNumber') { + let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['containerNumber']==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['containerNumber']==item['itemCode'])) + if(val.length==0) return val.forEach(item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow['containerNumber'] = item['itemCode'] diff --git a/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue b/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue index 086524541..85d9c1a37 100644 --- a/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue +++ b/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue @@ -131,6 +131,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // 明细查询页赋值 row[formField] = val[0][searchField] if (formField == 'itemCode') { + val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['batch']==item['batch']&&item1['packingNumber']==item['packingNumber']&&item1['locationCode']==item['locationCode']&&item1['inventoryStatus']==item['inventoryStatus'])) + if(val.length==0) return val.forEach(item=>{ if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode']&&item1['batch'] == item['batch']&&item1['packingNumber'] == item['packingNumber']&&item1['toLocationCode'] == item['locationCode']&&item1['inventoryStatus'] == item['inventoryStatus'])) return const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))