From 7697f70fc6483f7c06d55133db6d7c11b38615fd Mon Sep 17 00:00:00 2001 From: zhousq Date: Tue, 30 Apr 2024 14:14:34 +0800 Subject: [PATCH] =?UTF-8?q?2024-4-30=20=E8=AE=A1=E5=88=92=E6=8E=92?= =?UTF-8?q?=E4=BA=A7=E5=A2=9E=E5=8A=A0=E7=89=A9=E6=96=99=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/orderDay/components/schedule.vue | 77 +++++++++++++++---- 1 file changed, 60 insertions(+), 17 deletions(-) diff --git a/src/views/mes/orderDay/components/schedule.vue b/src/views/mes/orderDay/components/schedule.vue index 3b31342b3..6b32831df 100644 --- a/src/views/mes/orderDay/components/schedule.vue +++ b/src/views/mes/orderDay/components/schedule.vue @@ -53,7 +53,7 @@
- 工序编码:{{currentNode.id}} -工序名称:{{currentNode.attrs.title.text }} + 工序编码:{{currentNode.id}} -工序名称:{{currentNode.name }} @@ -70,7 +70,7 @@ - + @@ -89,6 +89,17 @@ + 添加人员 @@ -262,13 +273,15 @@ const dialogVisible = ref(false) // 弹窗的是否展示 const dialogTitle = ref('') // 弹窗的标题 const graphJson =ref() const currentNode = ref({ - attrs:{ - title:{ - text:'' - } - }, + name:'', id:'' }) +const showMaterialsData=ref() //物料信息分页展示 +const page=ref({ + total:0, + current:1, + size:5 +}) /*班组数据*/ const teamData = ref([]) /*班组弹窗搜索条件*/ @@ -314,12 +327,15 @@ const searchTeamList = () => { } /** 打开弹窗 */ const open = async (type: string, row?: any, titleName?: any) => { - currentNode.value.attrs.title.text='' + currentNode.value.name='' currentNode.value.id='' //首次打开页面,将数据清空 workerData.value = [] equipmentData.value = [] materialsData.value = [] + showMaterialsData.value=[] + page.value.total = 0 + page.value.current = 1 workstationData.value = [] getOptions() dialogVisible.value = true @@ -377,20 +393,27 @@ const getProcessBom=async (code:any) => { queryParams.processCode=code let res = await orderDayconfigApi.getOrderDayBomByOrder(queryParams) materialsData.value=res + if(materialsData.value.length>0){ + page.value.total = materialsData.value.length + page.value.current = 1 + showMaterialsData.value=materialsData.value.slice(0,page.value.size) + } } -const currentStartNode = ref({ - id:'' -}) +// const currentStartNode = ref({ +// id:'' +// }) //获取配置的工艺路线信息 const getProcessroute = async () => { let res = await orderDayconfigApi.getConfigProcessRoute(queryParams) graphJson.value=JSON.parse(res.newGraphData) + graph.value?.fromJSON(graphJson.value.cells) //首次打开弹窗,默认打开一个工序的数据 - currentStartNode.value.id = graphJson.value.cells[0].id - // 手动触发点击事件 - nodeClick('','','',currentStartNode.value,'') + //currentStartNode.value = graphJson.value.cells[0] currentNode.value = graphJson.value.cells[0] - graph.value?.fromJSON(graphJson.value.cells) + // 手动触发点击事件 + nodeClick('','','',currentNode.value,'') + + } //获取配置的工序信息 const getConfigProcessRouteNode= async () => { @@ -419,7 +442,9 @@ const nodeClick = (e, x, y, node, view) => { getConfigProcessWorker(node.id) getConfigProcessEquipment(node.id) processCode.value = node.id - currentNode.value=node + currentNode.value.id=node.id + console.log(node) + currentNode.value.name=node.attrs.title.text } const searchTableRef = ref() @@ -685,7 +710,25 @@ const saveUser = async () =>{ const getTeamList = async (params:any) => { return TeamApi.getTeamPage(params) } - +const handleCurrentChangeM=(value: number)=>{ + let index=(value-1)*page.value.size + page.value.current=value + showMaterialsData.value=materialsData.value.slice(index,index+page.value.size) + +} +const handlePrevClickM=(value: number)=>{ + page.value.current=value-1 + if(page.value.current==0) { + page.value.current=1 + } + +} +const handleNextClickM=(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 + } +} defineOptions({ name: 'SechledDetail' }) defineExpose({ open }) // 提供 open 方法,用于打开弹窗 // 传递给父类