From d626e8a7fc8379ebc040f31cf03e85c7aed8783b Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Fri, 16 Aug 2024 16:59:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E9=87=87=E8=B4=AD=E9=80=80?= =?UTF-8?q?=E8=B4=A7=E7=94=B3=E8=AF=B7-=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchasereturnRequestMainNew/index.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue index d6fee3548..9d09dcd75 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue @@ -809,7 +809,7 @@ const onChangeForm = async (field, cur, formRef)=>{ 'batch':item['batch'], 'status':item['inventoryStatus'], 'inventoryBalance':item['qty'], - 'qty':1, + 'qty':0, 'reason_type':'', 'reason':'' })) @@ -904,11 +904,19 @@ const submitForm = async (formType, submitData) => { // message.warning("退货数量不能大于收获数量") // return; // } - if (tableData.value.find((item) => item['qty']> item['inventoryBalance'])) { + if (tableData.value.find((item) => Number(item['qty'])> Number(item['inventoryBalance']))) { message.warning('退货数量不能大于库存余额') return } - data.subList = tableData.value.filter(item=>item['qty']>0) // 拼接子表数据参数 + console.log(tableData.value) + data.subList = tableData.value.filter(item=>Number(item['qty'])>0) // 拼接子表数据参数 + console.log('data.subList') + console.log(data.subList) + + if(data.subList.length<1){ + message.warning('至少有一条数据') + return + } formRef.value.formLoading = true try { if (formType === 'create') { @@ -917,7 +925,7 @@ const submitForm = async (formType, submitData) => { message.success(t('common.createSuccess')) } else { data.returnSourceType='1' - await PurchasereturnRequestMainApi.updatePurchasereturnRequestMain(data) + await PurchasereturnRequestMainApi.updatePurchasereturnRequestMainNew(data) message.success(t('common.updateSuccess')) } formRef.value.dialogVisible = false