|
@ -58,7 +58,7 @@ |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
@onEnter="onEnter" |
|
|
@onEnter="onEnter" |
|
|
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
/> |
|
|
/> |
|
|
<!-- 添加明细:采购收货记录单号 --> |
|
|
<!-- 添加明细:采购收货记录单号 --> |
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
@ -729,14 +729,30 @@ const tableSelectionDelete = (selection) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
const flag = ref(false) |
|
|
const inputNumberChange = (field, val,row, index) => { |
|
|
|
|
|
if(field=='qty'){ |
|
|
|
|
|
if(row['subReturnedQty']!=null&&row['qty']>row['subReturnedQty']){ |
|
|
|
|
|
message.error(`物料${row['itemCode']}最大数量为${row['subReturnedQty']}`) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
console.log('inputNumberChange',field, val,row, index) |
|
|
|
|
|
} |
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|
const submitForm = async (formType, submitData) => { |
|
|
const submitForm = async (formType, submitData) => { |
|
|
let data = {...submitData} |
|
|
let data = {...submitData} |
|
|
if(data.masterId){ |
|
|
if(data.masterId){ |
|
|
data.id = data.masterId |
|
|
data.id = data.masterId |
|
|
} |
|
|
} |
|
|
|
|
|
let flag = true |
|
|
|
|
|
tableData.value.forEach(item=>{ |
|
|
|
|
|
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 = tableData.value // 拼接子表数据参数 |
|
|
data.subList.forEach(obj => { |
|
|
data.subList.forEach(obj => { |
|
|
if(obj.qty == 0){ |
|
|
if(obj.qty == 0){ |
|
|