From 9da73a221e3bc79c1f972a1f99d52915e42134dd Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期日, 08 十月 2023 20:59:01 +0800
Subject: [PATCH] feat: 任务弹窗生产准备倒计时和下发失败提示时不允许翻页

---
 src/views/visualization.vue |   40 +++++++++++++++++++++++++++++++---------
 1 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/src/views/visualization.vue b/src/views/visualization.vue
index 4a0d6f3..c0e7cc3 100644
--- a/src/views/visualization.vue
+++ b/src/views/visualization.vue
@@ -150,7 +150,7 @@
                 <el-descriptions-item label="璐х墿鎻忚堪">{{
                   taskData.Order.orderAttr || "--"
                 }}</el-descriptions-item>
-                <el-descriptions-item label="瀹㈡埛鍚嶇О">{{
+                <el-descriptions-item label="瀹㈡埛缂栫爜">{{
                   taskData.Order.customer || "--"
                 }}</el-descriptions-item>
                 <el-descriptions-item label="鍙傛暟瑕佹眰">{{
@@ -787,7 +787,11 @@
       this.getDate3();
       this.getDate2();
     }, 5000);
-    this.getTaskInfo();
+
+    let channelType = this.getChannelTypeFromUrl()
+    channelType = channelType ?? 1
+    this.activeName = channelType
+    this.getTaskInfo(channelType);
     this.getTaskCountStatistics()
   },
   beforeDestroy() {
@@ -803,7 +807,6 @@
     // }
   },
   methods: {
-
     getModelList(){
       this.resResult=null
       for (let i in this.TasksCopy){
@@ -822,10 +825,10 @@
                     this.isUpdateIcon=true;
                     break;
                   }
-                } 
+                }
               }
             }
-            this.resResult=res; 
+            this.resResult=res;
           })
         }
       }
@@ -839,7 +842,6 @@
         }
       }
       this.$message.error('褰撳墠宸ュ簭鏃犵紪鍙凤紝鏃犳硶鏌ョ湅宸ュ簭!')
-     
     },
     getProcessModelList(){
       this.getModelList()
@@ -873,6 +875,7 @@
     },
     cutClick(val) {
       this.activeName = val;
+      this.updateChannelTypeToUrl(val)
       if(this.activeName==2){
         this.Tasks=this.TasksCopy.slice(0,2)
         if(this.Tasks.length<2){
@@ -915,9 +918,6 @@
         }
       });
     },
-
-
-
     getDateObj(date, fmt) {
       if (/(y+)/.test(fmt)) {
         fmt = fmt.replace(
@@ -1160,6 +1160,27 @@
             }
         }
       })
+    },
+    /**
+     * 鍚慤RL涓缃綋鍓嶉�氶亾灞曠ず绫诲瀷
+     * @param {number} type 閫氶亾灞曠ず绫诲瀷
+     */
+    updateChannelTypeToUrl(type){
+      const activeName = this.getChannelTypeFromUrl();
+      if (activeName === type){
+        return
+      }
+      let path = this.$router.history.current.path
+      this.$router.push({path, query: {activeName:  `${type ?? 1}`}})
+    },
+    /**
+     * 浠嶶RL鑾峰彇褰撳墠閫氶亾灞曠ず绫诲瀷
+     * @return {number}
+     */
+    getChannelTypeFromUrl(){
+      let activeName = new URLSearchParams(location.search).get('activeName')
+      activeName = activeName ? +activeName : undefined
+      return activeName
     },
     getProgressInfo() {
       this.resprocInfoTimer=null
@@ -1692,6 +1713,7 @@
           top:10px;
           width:35px;
           vertical-align: middle;
+          cursor:pointer;
           img{
             width:100%;
           }

--
Gitblit v1.8.0