From 3198cf8d0879ec6342780a980639e48e994f00be Mon Sep 17 00:00:00 2001 From: zhousq Date: Tue, 30 Apr 2024 13:43:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?2024-04-30=20=E5=B7=A5=E8=89=BA=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=E9=85=8D=E7=BD=AE=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E9=A1=B5=EF=BC=8C=E8=81=94=E5=8A=A8=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processroute/components/configDialog.vue | 146 +++++++-- .../processroute/components/graphbase.data.ts | 6 +- .../mes/workScheduling/components/Detail.vue | 295 ++++++++++-------- src/views/mes/workScheduling/index.vue | 6 +- .../mes/workScheduling/workScheduling.data.ts | 18 +- 5 files changed, 309 insertions(+), 162 deletions(-) diff --git a/src/views/mes/processroute/components/configDialog.vue b/src/views/mes/processroute/components/configDialog.vue index c10f2af27..571e045fb 100644 --- a/src/views/mes/processroute/components/configDialog.vue +++ b/src/views/mes/processroute/components/configDialog.vue @@ -12,8 +12,8 @@
- {{ titleValueRef }} - [{{ titleNameRef }}] + {{ titleNameRef }} + [{{ titleValueRef }}] @@ -37,7 +37,7 @@ >添加工序
- + @@ -48,6 +48,17 @@ +
@@ -81,8 +92,9 @@ 工艺路线基本信息 -

工艺路线名称:{{ productData.name }}

-

工艺路线编码:{{ productData.name }}

+ +

工艺路线名称:{{titleNameRef}}

+

工艺路线编码:{{titleValueRef}}

产品名称:{{ productData.name }}

产品编码:{{ productData.code }}

产品描述:{{ productData.desc1 }}

@@ -92,23 +104,34 @@ > - + +
@@ -121,7 +144,7 @@ > @@ -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() +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() -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']) diff --git a/src/views/mes/processroute/components/graphbase.data.ts b/src/views/mes/processroute/components/graphbase.data.ts index cf14d8073..8426a4415 100644 --- a/src/views/mes/processroute/components/graphbase.data.ts +++ b/src/views/mes/processroute/components/graphbase.data.ts @@ -138,7 +138,7 @@ export const start_node = ref({ id: 'startNode', label: '开始', x: 50, - y: 200, + y: 100, attrs: { body: { rx: 20, @@ -151,8 +151,8 @@ export const start_node = ref({ //结束节点的定义 export const end_node = ref({ id: 'endNode', - x: 200, - y: 200, + x: 400, + y: 100, label: '结束', attrs: { body: { diff --git a/src/views/mes/workScheduling/components/Detail.vue b/src/views/mes/workScheduling/components/Detail.vue index c58a01025..b42ae5cd2 100644 --- a/src/views/mes/workScheduling/components/Detail.vue +++ b/src/views/mes/workScheduling/components/Detail.vue @@ -28,7 +28,16 @@
- + + - +