|
|
@ -12,8 +12,8 @@ |
|
|
|
<div class="font-size-18px"> |
|
|
|
<el-row :gutter="10"> |
|
|
|
<el-col :span="22"> |
|
|
|
{{ titleValueRef }} |
|
|
|
<el-tag type="info">[{{ titleNameRef }}]</el-tag> |
|
|
|
{{ titleNameRef }} |
|
|
|
<el-tag type="primary">[{{ titleValueRef }}]</el-tag> |
|
|
|
</el-col> |
|
|
|
<el-col :span="2"> |
|
|
|
<el-button size="primary" @click="saveResult()" style="width: 100%"> |
|
|
@ -37,7 +37,7 @@ |
|
|
|
>添加工序</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%;border: 1px;" @cell-dblclick="userAddNode"> |
|
|
|
<el-table :data="showProcessNodeData" ref="tableProcess" style="width: 100%; height: 80%;border: 1px;" @cell-dblclick="userAddNode"> |
|
|
|
<el-table-column prop="code" label="工序编码" /> |
|
|
|
<el-table-column prop="name" label="工序名称" /> |
|
|
|
<el-table-column prop="oper" label="操作" width="60"> |
|
|
@ -48,6 +48,17 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-pagination |
|
|
|
small |
|
|
|
hide-on-single-page="true" |
|
|
|
layout="prev, pager, next" |
|
|
|
:total="page.total" |
|
|
|
:page-size="page.size" |
|
|
|
:current-page="page.current" |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
@prev-click="handlePrevClick" |
|
|
|
@next-click="handleNextClick" |
|
|
|
/> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"><div ref="graphContainer" style="width: 90%; height: 90%"></div> |
|
|
@ -81,8 +92,9 @@ |
|
|
|
<span>工艺路线基本信息</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<p >工艺路线名称:<span v-if="productData!=null">{{ productData.name }}</span></p> |
|
|
|
<p >工艺路线编码:<span v-if="productData!=null">{{ productData.name }}</span></p> |
|
|
|
|
|
|
|
<p >工艺路线名称:<span >{{titleNameRef}}</span></p> |
|
|
|
<p >工艺路线编码:<span >{{titleValueRef}}</span></p> |
|
|
|
<p >产品名称:<span v-if="productData!=null">{{ productData.name }}</span></p> |
|
|
|
<p>产品编码:<span v-if="productData!=null">{{ productData.code }}</span></p> |
|
|
|
<p>产品描述:<span v-if="productData!=null">{{ productData.desc1 }}</span></p> |
|
|
@ -92,23 +104,34 @@ |
|
|
|
><el-card class="footer-card"> |
|
|
|
<template #header> |
|
|
|
<div class="card-header"> |
|
|
|
<span>物料信息</span> |
|
|
|
<span>物料信息</span><el-tag type="primary">[{{ currentNode.name }}]</el-tag> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<el-table :data="materialData" ref="tableMaterial" style="width: 100%; height: 80%;overflow-y: auto;"> |
|
|
|
<el-table :data="showMaterialsData" ref="tableMaterial" style="width: 100%; height: 80%;overflow-y: auto;"> |
|
|
|
<!-- <el-table-column prop="name" label="物料名称"/> --> |
|
|
|
<el-table-column prop="componentItemCode" label="物料编码"/> |
|
|
|
<el-table-column prop="version" label="版本号"/> |
|
|
|
<el-table-column prop="componentQty" label="物料数量"/> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
<el-pagination |
|
|
|
small |
|
|
|
hide-on-single-page="true" |
|
|
|
layout="prev, pager, next" |
|
|
|
:total="pageM.total" |
|
|
|
:page-size="pageM.size" |
|
|
|
:current-page="pageM.current" |
|
|
|
@current-change="handleCurrentChangeM" |
|
|
|
@prev-click="handlePrevClickM" |
|
|
|
@next-click="handleNextClickM" |
|
|
|
/> |
|
|
|
</el-card></el-col |
|
|
|
> |
|
|
|
<el-col :span="6" |
|
|
|
><el-card class="footer-card"> |
|
|
|
<template #header> |
|
|
|
<div class="card-header"> |
|
|
|
<span>模具信息</span> |
|
|
|
<span>模具信息</span><el-tag type="primary">[{{ currentNode.name }}]</el-tag> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<el-table :data="mouldData" ref="tableMould" style="width: 100%; height: 80%;overflow-y: auto;"> |
|
|
@ -121,7 +144,7 @@ |
|
|
|
><el-card class="footer-card"> |
|
|
|
<template #header> |
|
|
|
<div class="card-header"> |
|
|
|
<span>工位信息</span> |
|
|
|
<span>工位信息</span><el-tag type="primary">[{{ currentNode.name }}]</el-tag> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<el-table :data="workStationList" ref="tableWorkstation" style="width: 100%; height: 80%;overflow-y: auto;"> |
|
|
@ -154,6 +177,7 @@ const message = useMessage() // 消息弹窗 |
|
|
|
//const { t } = useI18n() // 国际化 |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
const currentNode=ref({code:'',name:''}) |
|
|
|
routeName.value = route.name |
|
|
|
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'ProcessRouteConfig' |
|
|
|
//const updateKey = ref(0) |
|
|
@ -165,6 +189,22 @@ const tableProcess = ref() |
|
|
|
const productData = ref({ name: '', code: '', desc1: '--' }) //产品数据 |
|
|
|
const materialData=ref() |
|
|
|
const mouldData = ref() |
|
|
|
const page=ref({ |
|
|
|
total:0, |
|
|
|
current:1, |
|
|
|
size:5 |
|
|
|
}) |
|
|
|
const pageM=ref({ |
|
|
|
total:0, |
|
|
|
current:1, |
|
|
|
size:5 |
|
|
|
}) |
|
|
|
const showProcessNodeData=ref() //工序分页数据展示 |
|
|
|
const showMaterialsData=ref() //物料信息分页展示 |
|
|
|
const productCode=ref() |
|
|
|
//初始化图形组件 |
|
|
|
const graph = ref<Graph>() |
|
|
|
const rowData = ref() |
|
|
|
const workStationList = ref() //工位数据 |
|
|
|
// 附件默认数据 |
|
|
|
const annexData = reactive({ |
|
|
@ -203,23 +243,25 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { |
|
|
|
if(val.length>0){ |
|
|
|
val.forEach(item=>{ |
|
|
|
if(processData.value.find(obj=>obj.code==item.code)==undefined){ |
|
|
|
processData.value.push({code:item.code,name:item.name})} |
|
|
|
processData.value.push({code:item.code,name:item.name}) |
|
|
|
page.value.total=processData.value.length |
|
|
|
showProcessNodeData.value=processData.value.slice((page.value.current-1)*page.value.size,page.value.size) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
const deleteNode=(row)=>{ |
|
|
|
processData.value.splice(processData.value.indexOf(row),1) |
|
|
|
page.value.total=processData.value.length |
|
|
|
page.value.current=1 |
|
|
|
graph.value.removeNode(row.code) |
|
|
|
} |
|
|
|
const productCode=ref() |
|
|
|
//初始化图形组件 |
|
|
|
const graph = ref<Graph>() |
|
|
|
const rowData = ref() |
|
|
|
|
|
|
|
const openDetail = (row: any) => { |
|
|
|
rowData.value = row |
|
|
|
console.log('rowData',rowData.value) |
|
|
|
titleNameRef.value = rowData.value.processrouteCode |
|
|
|
titleValueRef.value = rowData.value.processName |
|
|
|
titleNameRef.value = rowData.value.processName |
|
|
|
titleValueRef.value =rowData.value.processrouteCode |
|
|
|
processRouteId.value = rowData.value.id |
|
|
|
productCode.value=rowData.value.productCode |
|
|
|
routeVersion.value=rowData.value.routeVersion |
|
|
@ -264,7 +306,7 @@ const getProcessInfo = async (id: any) => { |
|
|
|
/** 获取产品信息 */ |
|
|
|
const getItembasicInfo = async (code: String) => { |
|
|
|
const res = await ProcessrouteApi.getProductInfo(code) |
|
|
|
console.log('productData',res) |
|
|
|
//console.log('productData',res) |
|
|
|
productData.value = res |
|
|
|
} |
|
|
|
/** 获取物料列表 */ |
|
|
@ -302,28 +344,37 @@ const getProcessList = async (code) => { |
|
|
|
//console.log('code',code) |
|
|
|
const res = await ProcessrouteApi.getProcessrouteNodeList(code) |
|
|
|
processData.value = res |
|
|
|
showProcessNodeData.value=processData.value.slice((page.value.current-1)*page.value.size,page.value.size) |
|
|
|
//return res |
|
|
|
} |
|
|
|
// 并行执行所有异步操作 |
|
|
|
const nodeClick = (e, x, y, node, view) => { |
|
|
|
currentNode.value.code=node.id |
|
|
|
currentNode.value.name=node.attrs.title.text |
|
|
|
Promise.all([ |
|
|
|
getProcessInfo(node.id), |
|
|
|
getProcessBomList(productCode.value,node.id), |
|
|
|
getPatternPage(node.id), |
|
|
|
getWorkstationPage(node.id) |
|
|
|
]).then(([processIndoList,basicBom, patternPage,workstationInfoList]) => { |
|
|
|
]).then(([processInfoList,basicBom, patternPage,workstationInfoList]) => { |
|
|
|
// 在这里处理所有异步操作的结果 |
|
|
|
//message.info(JSON.stringify(processIndoList)) |
|
|
|
console.log('basicBom',basicBom) |
|
|
|
//console.log('basicBom',basicBom) |
|
|
|
//获取绑定的物料信息 |
|
|
|
materialData.value = basicBom |
|
|
|
pageM.value.total=materialData.value.length |
|
|
|
pageM.value.current=1 |
|
|
|
showMaterialsData.value=materialData.value.slice((pageM.value.current-1)*pageM.value.size,pageM.value.size) |
|
|
|
//获取绑定的模具信息 |
|
|
|
mouldData.value = patternPage.list |
|
|
|
//获取绑定的工位信息 |
|
|
|
workStationList.value = workstationInfoList.list |
|
|
|
}).catch(error => { |
|
|
|
console.error("Error:", error); |
|
|
|
//console.error("Error:", error); |
|
|
|
materialData.value = [] |
|
|
|
showMaterialsData.value=[] |
|
|
|
pageM.value.total=materialData.value.length |
|
|
|
pageM.value.current=1 |
|
|
|
mouldData.value = [] |
|
|
|
workStationList.value = [] |
|
|
|
}); |
|
|
@ -362,6 +413,7 @@ const userAddNode = (row) => { |
|
|
|
// ] |
|
|
|
}) |
|
|
|
} |
|
|
|
nodeClick(undefined,undefined, undefined, node_template, graph.value) |
|
|
|
} |
|
|
|
} |
|
|
|
//------- |
|
|
@ -382,7 +434,7 @@ const saveResult = async () => { |
|
|
|
return |
|
|
|
} |
|
|
|
let gdata = { |
|
|
|
processrouteCode: titleNameRef.value, |
|
|
|
processrouteCode: titleValueRef.value, |
|
|
|
routeVersion:routeVersion.value, |
|
|
|
graphJson: graph.value.toJSON(), |
|
|
|
processrouteId: processRouteId.value |
|
|
@ -442,6 +494,58 @@ const deleteAnnexSuccess = async () => { |
|
|
|
getFileList() |
|
|
|
getChangeRecordList() |
|
|
|
} |
|
|
|
|
|
|
|
const handleCurrentChange=(value: number)=>{ |
|
|
|
let index=(value-1)*page.value.size |
|
|
|
page.value.current=value |
|
|
|
//console.log('index',index) |
|
|
|
showProcessNodeData.value=processData.value.slice(index,index+page.value.size) |
|
|
|
//console.log('processData.value-472',processData.value) |
|
|
|
//console.log('showProcessNodeData.value-472',showProcessNodeData.value) |
|
|
|
} |
|
|
|
const handlePrevClick=(value: number)=>{ |
|
|
|
page.value.current=value-1 |
|
|
|
if(page.value.current==0) { |
|
|
|
page.value.current=1 |
|
|
|
} |
|
|
|
// let index=(value-1)*page.value.size |
|
|
|
// showProcessNodeData.value=processData.value.slice(index,page.value.size) |
|
|
|
// console.log('showProcessNodeData.value-472',showProcessNodeData.value) |
|
|
|
} |
|
|
|
const handleNextClick=(value: number)=>{ |
|
|
|
page.value.current=value+1 |
|
|
|
if(page.value.current>page.value.total/page.value.size) { |
|
|
|
page.value.current=page.value.total/page.value.size -1 |
|
|
|
} |
|
|
|
// let index=(value+1)*page.value.size |
|
|
|
// showProcessNodeData.value=processData.value.slice(index,page.value.size) |
|
|
|
// console.log('showProcessNodeData.value-472',showProcessNodeData.value) |
|
|
|
} |
|
|
|
const handleCurrentChangeM=(value: number)=>{ |
|
|
|
let index=(value-1)*pageM.value.size |
|
|
|
pageM.value.current=value |
|
|
|
//console.log('index',index) |
|
|
|
showMaterialsData.value=materialData.value.slice(index,index+pageM.value.size) |
|
|
|
|
|
|
|
} |
|
|
|
const handlePrevClickM=(value: number)=>{ |
|
|
|
pageM.value.current=value-1 |
|
|
|
if(pageM.value.current==0) { |
|
|
|
pageM.value.current=1 |
|
|
|
} |
|
|
|
// let index=(value-1)*page.value.size |
|
|
|
// showProcessNodeData.value=processData.value.slice(index,page.value.size) |
|
|
|
// console.log('showProcessNodeData.value-472',showProcessNodeData.value) |
|
|
|
} |
|
|
|
const handleNextClickM=(value: number)=>{ |
|
|
|
pageM.value.current=value+1 |
|
|
|
if(pageM.value.current>pageM.value.total/page.value.size) { |
|
|
|
pageM.value.current=page.value.total/pageM.value.size -1 |
|
|
|
} |
|
|
|
// let index=(value+1)*page.value.size |
|
|
|
// showProcessNodeData.value=processData.value.slice(index,page.value.size) |
|
|
|
// console.log('showProcessNodeData.value-472',showProcessNodeData.value) |
|
|
|
} |
|
|
|
// 验证图形 |
|
|
|
onUnmounted?.(() => {}) |
|
|
|
const emit = defineEmits(['close']) |
|
|
|