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