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