|
@ -140,6 +140,7 @@ const bomModelVisible = ref(false) |
|
|
const tableListBom = ref() |
|
|
const tableListBom = ref() |
|
|
const lsBomSave = ref() |
|
|
const lsBomSave = ref() |
|
|
const rowId = ref() |
|
|
const rowId = ref() |
|
|
|
|
|
const detailQty = ref() |
|
|
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ |
|
|
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ |
|
|
getListApi: BomDismantleApi.getProductscrapBomDismantlePage |
|
|
getListApi: BomDismantleApi.getProductscrapBomDismantlePage |
|
|
}) |
|
|
}) |
|
@ -156,7 +157,7 @@ const buttonBaseClickBom = (val) => { |
|
|
// 根据 填写的数量 为基准 不填写数量的忽略 |
|
|
// 根据 填写的数量 为基准 不填写数量的忽略 |
|
|
let flag = false; |
|
|
let flag = false; |
|
|
detatableDataBom.tableList.forEach((item) => { |
|
|
detatableDataBom.tableList.forEach((item) => { |
|
|
if(item.qty!=0 && item.bomQty < item.qty){ |
|
|
if(item.qty!=0 && (item.bomQty * detailQty.value < item.qty)){ |
|
|
flag = true; |
|
|
flag = true; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -165,7 +166,7 @@ const buttonBaseClickBom = (val) => { |
|
|
message.warning('数量需要小于Bom数量!') |
|
|
message.warning('数量需要小于Bom数量!') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && item.bomQty >= item.qty)) |
|
|
tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && (item.bomQty * detailQty.value >= item.qty))) |
|
|
if (lsBomSave.value) { |
|
|
if (lsBomSave.value) { |
|
|
tableData.value.forEach((item, index) => { |
|
|
tableData.value.forEach((item, index) => { |
|
|
if(tableListBom.value[0].rowId == index) { |
|
|
if(tableListBom.value[0].rowId == index) { |
|
@ -193,10 +194,12 @@ const buttonOperationClick = async (row, label, index)=> { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
detatableDataBom.params.itemCode = row.itemCode |
|
|
detatableDataBom.params.itemCode = row.itemCode |
|
|
|
|
|
detatableDataBom.params.bomVersion = row.bomVersion |
|
|
DialogTitle.value = '物品代码:【' + row.itemCode + '】 Bom 信息' |
|
|
DialogTitle.value = '物品代码:【' + row.itemCode + '】 Bom 信息' |
|
|
|
|
|
detailQty.value = row.qty |
|
|
bomModelVisible.value = true |
|
|
bomModelVisible.value = true |
|
|
await getDetailListBom() |
|
|
await getDetailListBom() |
|
|
detatableDataBom.tableList.map(item => { |
|
|
detatableDataBom.tableList.forEach(item => { |
|
|
item.rowId = index |
|
|
item.rowId = index |
|
|
if(tableData.value[index].childList) { |
|
|
if(tableData.value[index].childList) { |
|
|
tableData.value[index].childList.forEach(itemChild => { |
|
|
tableData.value[index].childList.forEach(itemChild => { |
|
@ -204,6 +207,8 @@ const buttonOperationClick = async (row, label, index)=> { |
|
|
item.qty = itemChild.qty |
|
|
item.qty = itemChild.qty |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
}else { |
|
|
|
|
|
item.qty = item.bomQty * row.qty |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -219,6 +224,7 @@ const tableFormButton = async (val , row) => { |
|
|
masterId: row.id |
|
|
masterId: row.id |
|
|
} |
|
|
} |
|
|
rowId.value = row.id |
|
|
rowId.value = row.id |
|
|
|
|
|
detailQty.value = row.qty |
|
|
await getDetailListBom() |
|
|
await getDetailListBom() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -242,7 +248,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
row['processCode'] = val[0]['code'] |
|
|
row['processCode'] = val[0]['code'] |
|
|
}else if(formField == 'itemCode'){ |
|
|
}else if(formField == 'itemCode'){ |
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
|
|
|
}else if(formField == 'bomVersion'){ |
|
|
|
|
|
row['bomVersion'] = val[0]['version'] |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
@ -266,6 +273,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
setV['processCode'] = val[0]['code'] |
|
|
setV['processCode'] = val[0]['code'] |
|
|
}else if(formField == 'itemCode'){ |
|
|
}else if(formField == 'itemCode'){ |
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
|
|
|
}else if(formField == 'bomVersion'){ |
|
|
|
|
|
setV['bomVersion'] = val[0]['version'] |
|
|
} |
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
}) |
|
@ -432,6 +441,11 @@ const openForm =async (type: string, row?: number) => { |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
detatableDataBom.params = []; // 重置Bom请求参数 |
|
|
detatableDataBom.params = []; // 重置Bom请求参数 |
|
|
lsBomSave.value = true |
|
|
lsBomSave.value = true |
|
|
|
|
|
mainStatus.value = '1' |
|
|
|
|
|
ButttondataBom.value = [ |
|
|
|
|
|
defaultButtons.formSaveBtn({ hide : mainStatus.value != 1 }), // 保存 |
|
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
|
|
] |
|
|
formRef.value.open(type, row) |
|
|
formRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|