From a1a6630f2eabfc78a379b5808b1bf7231a084d0b Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 11 十月 2023 18:02:44 +0800
Subject: [PATCH] 工序弹框的 列表和详情的更新同步

---
 src/components/TaskControlModal.vue |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/src/components/TaskControlModal.vue b/src/components/TaskControlModal.vue
index 3e7a3bd..95c46be 100644
--- a/src/components/TaskControlModal.vue
+++ b/src/components/TaskControlModal.vue
@@ -160,9 +160,9 @@
           </template>
         </div>
         <!--宸︾炕椤垫寜閽�-->
-        <div v-show="showPreviousTaskBtn" class="paginator-btn previous" @click="previousTask">&lt;</div>
+        <div v-show="showPreviousTaskBtn" class="paginator-btn previous" :class="{disabled:showBtn ===2 ||messageError}" @click="previousTask">&lt;</div>
         <!--鍙崇炕椤垫寜閽�-->
-        <div v-show="showNextTaskBtn" class="paginator-btn next" @click="nextTask">&gt;</div>
+        <div v-show="showNextTaskBtn" class="paginator-btn next" :class="{disabled:showBtn ===2 ||messageError}" @click="nextTask">&gt;</div>
       </div>
       <div slot="footer" :class="messageError?'dialog-footer tac btn-error':'dialog-footer tac'"
            style="overflow: hidden">
@@ -212,6 +212,7 @@
 
 <script>
 import {getTaskInfo, sendProcessParams, startTask,} from "@/api/home"; // 浜х嚎
+import {channelNameConfig} from "@/common/constants";
 export default {
   name: 'TaskControlModal',
   components: {},
@@ -243,11 +244,7 @@
       isLoading: false,
       second: 0,
       secondTimer: null,
-      // 閫氶亾鍚嶇О閰嶇疆 Channel 0 瀵瑰簲灞曠ず 0, Channel 1 瀵瑰簲灞曠ず A,鏆傛椂蹇界暐鍏朵綑鎯呭喌
-      channelNameConfig: {
-        0: '0',
-        1: 'A'
-      }
+      channelNameConfig: channelNameConfig
     };
   },
   mounted() {
@@ -366,6 +363,8 @@
     getCurrentTaskProduceParams(id) {
       // const id = this.currentTaskData?.Procedure?.ID
       if (id) {
+        this.currentProcessParams = []
+        this.getProcessParamsErrMsg = ""
         startTask({id}).then((res) => {
           if (res.code === 200) {
             this.currentProcessParams = res.data.Params ?? []
@@ -387,6 +386,10 @@
      * 鍓嶇炕椤�
      */
     previousTask() {
+      // 鐢熶骇鍑嗗鍊掕鏃朵腑鍜屼笅鍙戝け璐ョ姝㈢炕椤�
+      if (this.showBtn === 2 || this.messageError){
+        return
+      }
       if (this.currentTaskIndex - 1 >= 0) {
         this.currentTaskIndex -= 1
         this.$nextTick(() => {
@@ -401,6 +404,10 @@
      * 鍚庣炕椤�
      */
     nextTask() {
+      // 鐢熶骇鍑嗗鍊掕鏃朵腑鍜屼笅鍙戝け璐ョ姝㈢炕椤�
+      if (this.showBtn === 2 || this.messageError){
+        return
+      }
       if (this.currentTaskIndex + 1 <= this.taskList.length - 1) {
         this.currentTaskIndex += 1
         this.$nextTick(() => {
@@ -416,7 +423,7 @@
       if (this.currentTaskData?.Procedure?.ID && this.currentTaskData?.Procedure?.Status === 1) {
         this.num = 0;
         this.showBtn = 1;
-        this.show = true;
+        // this.show = true;
       } else {
         this.show = false;
       }
@@ -917,6 +924,12 @@
   &.next {
     right: -60px;
     padding-left: 4px;
+
+  }
+  &.disabled{
+    background-color: #cccccc;
+    opacity: 0.8;
+    cursor: not-allowed;
   }
 }
 
@@ -937,6 +950,7 @@
     color: #ffffffaa;
     font-size: 16px;
   }
+
 }
 .process-err-tip{
   box-sizing: border-box;

--
Gitblit v1.8.0