From ef1c796826db664a3397160338efd20eb41ec2e4 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Tue, 24 Sep 2024 10:13:40 +0800 Subject: [PATCH] =?UTF-8?q?HL-59571.=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=90=8C=E4=B8=80?= =?UTF-8?q?=E7=89=A9=E6=96=99=E9=87=8D=E5=A4=8D=E6=B7=BB=E5=8A=A0=EF=BC=8C?= =?UTF-8?q?=E6=9C=9F=E6=9C=9B=E5=90=8C=E4=B8=80=E7=89=A9=E6=96=99=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E9=87=8D=E5=A4=8D=E6=B7=BB=E5=8A=A0=202.=E5=85=88?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=8E=E7=BB=86=EF=BC=8C=E5=90=8E=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E6=88=96=E8=80=85=E6=9B=B4=E6=94=B9=E5=88=B0=E4=BB=93?= =?UTF-8?q?=E5=BA=93=EF=BC=8C=E4=BC=9A=E6=B8=85=E7=A9=BA=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=9C=9F=E6=9C=9B=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=B8=85=E7=A9=BA=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionreturnRequestMain/index.vue | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue index 79d3b6643..64ad37286 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue @@ -205,15 +205,15 @@ const clearSearchInput = (formField) => { // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { - console.log('searchTableSuccess',formRef.formModel) + console.log('searchTableSuccess',formField, searchField, val, formRef, type, row) nextTick(async () => { if (type == 'tableForm') { // 明细查询页赋值 if(formField == 'itemCode') { - if(tableData.value.find(item1=>item1['itemCode'] == val[0]['itemCode'])){ - message.warning(`物料${val[0]['itemCode']}已经存在`) - return - } + // if(tableData.value.find(item1=>item1['itemCode'] == val[0]['itemCode'])){ + // message.warning(`物料${val[0]['itemCode']}已经存在`) + // return + // } let enableBuy = val[0]['enableBuy'] if(tableData.value.length>0){ enableBuy = tableData.value[0]['enableBuy'] @@ -227,6 +227,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } val = val.filter(item=>item['enableBuy']==enableBuy) + let messageItemCodes = [] val.forEach(item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow['itemCode'] = item['itemCode'] @@ -242,8 +243,17 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } newRow['packUnit'] = item['packUnit'] newRow['packQty'] = item['packQty'] - tableData.value.push(newRow) + if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){ + messageItemCodes.push(item['itemCode']) + }else{ + tableData.value.push(newRow) + } }) + if(messageItemCodes.length>0){ + message.warning(`物料${messageItemCodes.join(',')}已经存在`) + } + + // HL-4885 聂喜婷:@邱晨 @王宇飞 先把数量的校验拿掉 // 修改 tableform 属性 数量最大值设置为库存余额中数量 @@ -291,8 +301,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // 来源工位代码 setV['workStationCode'] = val[0]['code'] setV['fromLocationCode'] = val[0]['rawLocationCode'] + tableData.value = [] // 重置明细数据 } - tableData.value = [] // 重置明细数据 formRef.setValues(setV) } })