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