Browse Source

新版采购退货申请-编辑功能

hella_online_20240819
wangyufei 4 months ago
parent
commit
d626e8a7fc
  1. 16
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

16
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

@ -809,7 +809,7 @@ const onChangeForm = async (field, cur, formRef)=>{
'batch':item['batch'], 'batch':item['batch'],
'status':item['inventoryStatus'], 'status':item['inventoryStatus'],
'inventoryBalance':item['qty'], 'inventoryBalance':item['qty'],
'qty':1, 'qty':0,
'reason_type':'', 'reason_type':'',
'reason':'' 'reason':''
})) }))
@ -904,11 +904,19 @@ const submitForm = async (formType, submitData) => {
// message.warning("退") // message.warning("退")
// return; // return;
// } // }
if (tableData.value.find((item) => item['qty']> item['inventoryBalance'])) { if (tableData.value.find((item) => Number(item['qty'])> Number(item['inventoryBalance']))) {
message.warning('退货数量不能大于库存余额') message.warning('退货数量不能大于库存余额')
return 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 formRef.value.formLoading = true
try { try {
if (formType === 'create') { if (formType === 'create') {
@ -917,7 +925,7 @@ const submitForm = async (formType, submitData) => {
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
data.returnSourceType='1' data.returnSourceType='1'
await PurchasereturnRequestMainApi.updatePurchasereturnRequestMain(data) await PurchasereturnRequestMainApi.updatePurchasereturnRequestMainNew(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.value.dialogVisible = false formRef.value.dialogVisible = false

Loading…
Cancel
Save