Browse Source

新采购退货申请功能-数量过滤限制

hella_online_20240816
wangyufei 3 months ago
parent
commit
1b8cade949
  1. 16
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

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

@ -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'))

Loading…
Cancel
Save