|
|
@ -234,6 +234,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
tableData.value = [...res.list] |
|
|
|
originTableData.value = [...res.list] |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('错误') |
|
|
@ -745,11 +746,16 @@ const clearSearchInput = (field)=>{ |
|
|
|
} |
|
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
|
const inputNumberChange = (field, val,row, index) => { |
|
|
|
console.log('inputNumberChange',formRef.value.formRef) |
|
|
|
if(field=='qty'){ |
|
|
|
if(row['subReturnedQty']<=0){ |
|
|
|
message.error(`发货记录单号${formRef.value.formRef.formModel['deliverRecordNumber']}物料${row['itemCode']}批次${row['batch']}被占用`) |
|
|
|
} |
|
|
|
if(row['subReturnedQty']!=null&&row['qty']>row['subReturnedQty']){ |
|
|
|
message.error(`物料${row['itemCode']}最大数量为${row['subReturnedQty']}`) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log('inputNumberChange',field, val,row, index) |
|
|
|
} |
|
|
|
// 主子数据 提交 |
|
|
@ -760,25 +766,20 @@ const submitForm = async (formType, submitData) => { |
|
|
|
} |
|
|
|
let flag = true |
|
|
|
tableData.value.forEach(item=>{ |
|
|
|
if(item['subReturnedQty']<=0){ |
|
|
|
flag = false |
|
|
|
message.error(`发货记录单号${data['deliverRecordNumber']}物料${item['itemCode']}批次${item['batch']}被占用`) |
|
|
|
} |
|
|
|
if(item['subReturnedQty']!=null&&item['qty']>item['subReturnedQty']){ |
|
|
|
flag = false |
|
|
|
message.error(`物料${item['itemCode']}最大数量为${item['subReturnedQty']}`) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if(!flag){ |
|
|
|
return |
|
|
|
} |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
data.subList.forEach(obj => { |
|
|
|
if(obj.qty == 0){ |
|
|
|
message.error(`数量不能为0!`) |
|
|
|
flag.value = true |
|
|
|
return; |
|
|
|
} |
|
|
|
}) |
|
|
|
if(flag.value){ |
|
|
|
return |
|
|
|
} |
|
|
|
formRef.value.formLoading = true |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|