Browse Source

2024-04-29 修复工艺路线配置中的工序BOM关联问题

master_hella_20240701
zhousq 7 months ago
parent
commit
73b12ba6d1
  1. 6
      src/api/mes/processroute/index.ts
  2. 33
      src/views/mes/processroute/components/configDialog.vue

6
src/api/mes/processroute/index.ts

@ -82,9 +82,9 @@ export const getPatternPage = async (code:String) => {
return await request.get({ url: `/mes/mes-process-pattern/pagePatternByProcessCode?pageSize=25&processCode=`+code }) return await request.get({ url: `/mes/mes-process-pattern/pagePatternByProcessCode?pageSize=25&processCode=`+code })
} }
// 查询物料列表 // 查询产品物料列表
export const getItembasicPage = async (code:String) => { export const getProcessBomList = async (params) => {
return await request.get({ url: `/mes/mes-process-itembasic/pageByProcessCode?pageSize=25&processCode=`+code}) return await request.get({ url: `/mes/common/getBomListByProductAndProcess`,params})
} }
export const getWorkstationPage = async (code:String) => { export const getWorkstationPage = async (code:String) => {

33
src/views/mes/processroute/components/configDialog.vue

@ -96,10 +96,11 @@
</div> </div>
</template> </template>
<el-table :data="materialData" ref="tableMaterial" style="width: 100%; height: 80%;overflow-y: auto;"> <el-table :data="materialData" ref="tableMaterial" style="width: 100%; height: 80%;overflow-y: auto;">
<el-table-column prop="name" label="物料名称"/> <!-- <el-table-column prop="name" label="物料名称"/> -->
= <el-table-column prop="componentItemCode" label="物料编码"/>
<el-table-column prop="code" label="物料编码"/> <el-table-column prop="version" label="版本号"/>
<el-table-column prop="desc1" label="是否替代"/> <el-table-column prop="componentQty" label="物料数量"/>
</el-table> </el-table>
</el-card></el-col </el-card></el-col
> >
@ -210,6 +211,7 @@ const deleteNode=(row)=>{
processData.value.splice(processData.value.indexOf(row),1) processData.value.splice(processData.value.indexOf(row),1)
graph.value.removeNode(row.code) graph.value.removeNode(row.code)
} }
const productCode=ref()
// //
const graph = ref<Graph>() const graph = ref<Graph>()
const rowData = ref() const rowData = ref()
@ -219,6 +221,7 @@ const openDetail = (row: any) => {
titleNameRef.value = rowData.value.processrouteCode titleNameRef.value = rowData.value.processrouteCode
titleValueRef.value = rowData.value.processName titleValueRef.value = rowData.value.processName
processRouteId.value = rowData.value.id processRouteId.value = rowData.value.id
productCode.value=rowData.value.productCode
routeVersion.value=rowData.value.routeVersion routeVersion.value=rowData.value.routeVersion
remarksData.data = { remarksData.data = {
tableId: rowData.value.id, tableId: rowData.value.id,
@ -261,11 +264,17 @@ const getProcessInfo = async (id: any) => {
/** 获取产品信息 */ /** 获取产品信息 */
const getItembasicInfo = async (code: String) => { const getItembasicInfo = async (code: String) => {
const res = await ProcessrouteApi.getProductInfo(code) const res = await ProcessrouteApi.getProductInfo(code)
console.log('productData',res)
productData.value = res productData.value = res
} }
/** 获取物料列表 */ /** 获取物料列表 */
const getItembasicPage = async (code) => { const getProcessBomList = async (pcode,processCode) => {
return await ProcessrouteApi.getItembasicPage(code); let params={
code:pcode ,//""
//version:version,//bom"
processCode:processCode
}
return await ProcessrouteApi.getProcessBomList(params);
} }
/** 查询模具基本信息列表 */ /** 查询模具基本信息列表 */
const getPatternPage = async (code) => { const getPatternPage = async (code) => {
@ -290,7 +299,7 @@ const getWorkstationPage = async (code) => {
// } // }
/**获取工艺路线定义的工序列表 */ /**获取工艺路线定义的工序列表 */
const getProcessList = async (code) => { const getProcessList = async (code) => {
console.log('code',code) //console.log('code',code)
const res = await ProcessrouteApi.getProcessrouteNodeList(code) const res = await ProcessrouteApi.getProcessrouteNodeList(code)
processData.value = res processData.value = res
//return res //return res
@ -299,15 +308,15 @@ const getProcessList = async (code) => {
const nodeClick = (e, x, y, node, view) => { const nodeClick = (e, x, y, node, view) => {
Promise.all([ Promise.all([
getProcessInfo(node.id), getProcessInfo(node.id),
getItembasicPage(node.id), getProcessBomList(productCode.value,node.id),
getPatternPage(node.id), getPatternPage(node.id),
getWorkstationPage(node.id) getWorkstationPage(node.id)
]).then(([processIndoList,itembasicPage, patternPage,workstationInfoList]) => { ]).then(([processIndoList,basicBom, patternPage,workstationInfoList]) => {
// //
message.info(JSON.stringify(processIndoList)) //message.info(JSON.stringify(processIndoList))
console.log(processIndoList) console.log('basicBom',basicBom)
// //
materialData.value = itembasicPage.list materialData.value = basicBom
// //
mouldData.value = patternPage.list mouldData.value = patternPage.list
// //

Loading…
Cancel
Save