|
|
@ -97,6 +97,8 @@ |
|
|
|
@searchTableSuccess="searchTableBomSuccess" |
|
|
|
:footButttondata="footButttondata" |
|
|
|
@footButtonClick="buttonBaseClickBom" |
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
@ -229,13 +231,18 @@ const banchBomPage = async (fromLocationCode,item) => { |
|
|
|
} |
|
|
|
|
|
|
|
// 新增 tableform 按钮 |
|
|
|
const buttonOperationClick = async (row, label, index)=> { |
|
|
|
const buttonOperationClick = async (row, label, index,isSave = false)=> { |
|
|
|
console.log('buttonOperationClick',row, label, index) |
|
|
|
if (row.itemCode == '') { |
|
|
|
if(!isSave){ |
|
|
|
message.warning('请选择物料代码!') |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
if(row.qty <= 0){ |
|
|
|
if(!isSave){ |
|
|
|
message.warning('数量需要大于0!') |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
detatableDataBom.params.itemCode = row.itemCode |
|
|
@ -244,7 +251,7 @@ const buttonOperationClick = async (row, label, index)=> { |
|
|
|
bomModelVisible.value = true |
|
|
|
await getDetailListBom() |
|
|
|
console.log(row.fromLocationCode); |
|
|
|
detatableDataBom.tableList.forEach(async item => { |
|
|
|
detatableDataBom.tableList.forEach(async (item) => { |
|
|
|
console.log(333,item) |
|
|
|
ProdcutscrapBomScrap.allSchemas.tableFormColumns.map((bomItem) => { |
|
|
|
if (bomItem.field == 'batch') { |
|
|
@ -277,8 +284,12 @@ const buttonOperationClick = async (row, label, index)=> { |
|
|
|
const obj = await banchBomPage(row.fromLocationCode, item) |
|
|
|
item.batch = obj.batch |
|
|
|
}) |
|
|
|
if(isSave){ |
|
|
|
buttonBaseClickBom('save') |
|
|
|
}else{ |
|
|
|
detailBomRef.value.open('create', row, null,'viewDetail')//查看明细数据 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableBomSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
@ -358,10 +369,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
console.log(res) |
|
|
|
if(res?.list?.length>0){ |
|
|
|
row['bomVersion'] = res.list[0].version |
|
|
|
buttonOperationClick(row,'Bom',tableData.value.indexOf(row),true) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(formField == 'bomVersion'){ |
|
|
|
row['bomVersion'] = val[0]['version'] |
|
|
|
buttonOperationClick(row,'Bom',tableData.value.indexOf(row),true) |
|
|
|
|
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
@ -699,12 +713,14 @@ const submitForm = async (formType, submitData) => { |
|
|
|
if(data.masterId){ |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
|
|
|
|
console.log('tableData.value',tableData.value) |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
// 判断 bom 是否添加 |
|
|
|
let childListRs = true |
|
|
|
// 根据 填写的数量 为基准 不填写数量的忽略 |
|
|
|
tableData.value.forEach((item) => { |
|
|
|
if (!item.childList) { |
|
|
|
if (!item.childList||item.childList.length==0) { |
|
|
|
childListRs = false |
|
|
|
} |
|
|
|
item.productionLineCode = data.productionLineCode |
|
|
@ -763,6 +779,9 @@ const inputNumberChange = (field, index, row, val) => { |
|
|
|
if(field == 'qty' || field == 'singlePrice'){ |
|
|
|
row.amount = row.qty * row.singlePrice |
|
|
|
} |
|
|
|
if(field == 'qty'){ |
|
|
|
buttonOperationClick(row,'Bom',index,true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const qtyOnChange = (field,val) =>{ |
|
|
|