|
|
@ -890,26 +890,14 @@ const submitForm = async (formType, submitData) => { |
|
|
|
// message.warning("退货数量不能大于收获数量") |
|
|
|
// return; |
|
|
|
// } |
|
|
|
if (tableData.value.find((item) => Number(item.qty) > Number(item.inventoryBalance))) { |
|
|
|
if (tableData.value.find((item) => item['qty']> item['inventoryBalance'])) { |
|
|
|
message.warning('退货数量不能大于库存余额') |
|
|
|
return |
|
|
|
} |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
data.subList = tableData.value.filter(item=>item['qty']>0) // 拼接子表数据参数 |
|
|
|
formRef.value.formLoading = true |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
let flag = false |
|
|
|
data.subList.forEach((item) => { |
|
|
|
if (item.qty == 0) { |
|
|
|
message.warning('数量不能为0') |
|
|
|
flag = true |
|
|
|
return |
|
|
|
} |
|
|
|
}) |
|
|
|
if (flag) { |
|
|
|
formRef.value.formLoading = false |
|
|
|
return |
|
|
|
} |
|
|
|
data.returnSourceType='1' |
|
|
|
await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|