|
|
@ -61,6 +61,7 @@ |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
:isShowButton = isShowButton |
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
|
/> |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
@ -128,6 +129,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
|
newRow['projectCode'] = item['projectCode'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
newRow['subSettleQty'] = item['subSettleQty'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
|
|
|
@ -355,13 +357,31 @@ const openForm = (type: string, row?: any) => { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const inputNumberChange = (field, val,row, index) => { |
|
|
|
if(field=='qty'){ |
|
|
|
if(row['subSettleQty']&&row['qty']>row['subSettleQty']){ |
|
|
|
message.error(`物料${row['itemCode']}最大数量为${row['subSettleQty']}`) |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('inputNumberChange',field, val,row, index) |
|
|
|
} |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, submitData) => { |
|
|
|
let data = {...submitData} |
|
|
|
if(data.masterId){ |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
let flag = true |
|
|
|
tableData.value.forEach(item=>{ |
|
|
|
if(item['subSettleQty']&&item['qty']>item['subSettleQty']){ |
|
|
|
flag = false |
|
|
|
message.error(`物料${item['itemCode']}最大数量为${item['subSettleQty']}`) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(!flag){ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
let isExist = false |
|
|
|
tableData.value.forEach(item => { |
|
|
|