From 4cd23c2ae6cf5f8a2e91130d917e3a9420b5465e Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期五, 22 九月 2023 13:11:03 +0800 Subject: [PATCH] 修改 新任务的工艺参数的bug修改 --- src/views/visualization.vue | 35 ++++++++++++++++++++++------------- 1 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/views/visualization.vue b/src/views/visualization.vue index 4ca6d69..0366efe 100644 --- a/src/views/visualization.vue +++ b/src/views/visualization.vue @@ -665,6 +665,7 @@ TaskCount:0, plcStatus:0, isTipShow:false, + isFinsh:0, }; }, mounted() { @@ -680,6 +681,13 @@ this.getDate2(); }, 5000); this.getTaskInfo(); + }, + watch:{ + isFinsh(){ + if(this.isFinsh==this.Tasks.length){ + this.getStartArr() + } + } }, methods: { taskClick(){ @@ -862,6 +870,14 @@ this.Tasks = res.data.Tasks ? res.data.Tasks : []; this.TaskCount=res.data.TaskCount?res.data.TaskCount:0 + if (this.Tasks.length == 0&&this.TaskCount==0) { + if (this.activeName == 1) { + this.Tasks.push(object); + } else { + this.Tasks.push(object); + this.Tasks.push(object); + } + } this.workers=res.data.workers?res.data.workers:[] for (let i in this.Tasks) { this.Tasks[i].procedureList = []; @@ -873,29 +889,30 @@ .procedure.workers ? this.Tasks[i].Procedure.procedure.workers : []; + this.Tasks[i].procedureList.push([ { name: "宸ュ簭", ...this.Tasks[i].Procedure.procedure, }, ]); - + if (this.Tasks[i].Procedure.ID) { startTask({ id: this.Tasks[i].Procedure.ID }).then((res) => { if (res.code == 200) { // res.data.number this.Tasks[i].procedureList[0].push({ number: res.data.Number, - name: "宸ヨ壓", - Arr:res.data.Params ? res.data.Params : [], }); + this.Tasks[i].Arr=res.data.Params ? res.data.Params : [] + this.isFinsh=Number(i)+1 } }); } this.setInterCard("inputMaterials", "cardBox1&" + i, i); this.setInterCard("outputMaterials", "cardBox3&" + i, i); } - this.getStartArr() + this.getProgressInfo(); if (!this.procInfoTimer) { this.procInfoTimer = setInterval(() => { @@ -903,14 +920,6 @@ }, 3000); } } - if (this.Tasks.length == 0) { - if (this.activeName == 1) { - this.Tasks.push(object); - } else { - this.Tasks.push(object); - this.Tasks.push(object); - } - } if (res.code != 200 || this.Tasks.length == 0) { this.getcountdown(); // 鎺у埗閲嶆柊璇锋眰getTaskInfo, 鍙紑鍚竴涓畾鏃跺櫒 @@ -928,7 +937,7 @@ getStartArr(){ for (let i in this.Tasks) { if (this.Tasks[i].Procedure.Status==1) { - this.Arr = this.Tasks[i].procedureList[0].Arr ?this.Tasks[i].procedureList[0].Arr: []; + this.Arr = this.Tasks[i].Arr ?this.Tasks[i].Arr: []; this.taskData=this.Tasks[i]; break; } -- Gitblit v1.8.0