|
|
@ -99,6 +99,9 @@ |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
:detailButtonIsShowAdd="false" |
|
|
|
:detailButtonIsShowEdit="false" |
|
|
|
:detailButtonIsShowDelete="false" |
|
|
|
:allSchemas="PurchasereturnRequestMain.allSchemas" |
|
|
|
:detailAllSchemas="PurchasereturnRequestDetail.allSchemas" |
|
|
|
:detailAllSchemasRules="PurchasereturnRequestDetailRules" |
|
|
@ -154,7 +157,7 @@ import { |
|
|
|
PurchasereturnRequestDetail, |
|
|
|
PurchasereturnRequestDetailRules, |
|
|
|
PurchasereReturnRequestDetailLabel |
|
|
|
} from '../purchasereturnRequestMain/purchasereturnRequestMain.data' |
|
|
|
} from './purchasereturnRequestMain.data' |
|
|
|
import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain' |
|
|
|
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' |
|
|
|
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' |
|
|
@ -807,12 +810,14 @@ const onChangeForm = async (field, cur, formRef)=>{ |
|
|
|
if(subList&&subList.length>0){ |
|
|
|
tableData.value = subList.map(item=>({ |
|
|
|
'batch':item['batch'], |
|
|
|
'status':item['inventoryStatus'], |
|
|
|
'inventoryStatus':item['inventoryStatus'], |
|
|
|
'inventoryBalance':item['qty'], |
|
|
|
'qty':1, |
|
|
|
'qty':0, |
|
|
|
'reason_type':'', |
|
|
|
'reason':'' |
|
|
|
})) |
|
|
|
}else{ |
|
|
|
tableData.value = [] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -904,11 +909,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 +930,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 |
|
|
|