From e1c3e9d6fe41169fde9b0e18a259d1212cf59f42 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Mon, 23 Sep 2024 14:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=80=80=E8=B4=A7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=B7=BB=E5=8A=A0=E6=9C=80=E5=A4=A7=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E9=99=90=E5=88=B6subReturnedQty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerreturnRequestMain/index.vue | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue index 5c6c53ad1..de5efcccd 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue @@ -58,7 +58,7 @@ @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" @onEnter="onEnter" - + @inputNumberChange="inputNumberChange" /> @@ -729,14 +729,30 @@ const tableSelectionDelete = (selection) => { } //为true表示子表数据中存在数量为0的数据 -const flag = ref(false) - +const inputNumberChange = (field, val,row, index) => { + if(field=='qty'){ + if(row['subReturnedQty']!=null&&row['qty']>row['subReturnedQty']){ + message.error(`物料${row['itemCode']}最大数量为${row['subReturnedQty']}`) + } + } + console.log('inputNumberChange',field, val,row, index) +} // 主子数据 提交 const submitForm = async (formType, submitData) => { let data = {...submitData} if(data.masterId){ data.id = data.masterId } + let flag = true + tableData.value.forEach(item=>{ + if(item['subReturnedQty']!=null&&item['qty']>item['subReturnedQty']){ + flag = false + message.error(`物料${item['itemCode']}最大数量为${item['subReturnedQty']}`) + } + }) + if(!flag){ + return + } data.subList = tableData.value // 拼接子表数据参数 data.subList.forEach(obj => { if(obj.qty == 0){