From e35963c6c457a46c11309ddac7458481b586737e Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期四, 26 十月 2023 11:51:31 +0800
Subject: [PATCH] feat: 工序运行时间取值调整

---
 src/components/TaskControlModal.vue |   44 +++++++++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/src/components/TaskControlModal.vue b/src/components/TaskControlModal.vue
index 3e7a3bd..adf7f82 100644
--- a/src/components/TaskControlModal.vue
+++ b/src/components/TaskControlModal.vue
@@ -65,9 +65,9 @@
                   宸ユ椂锛� {{ currentTaskData.Procedure.procedure.workHours || "" }}
                 </div>
                 <div class="title-item">
-                  璁″垝鏃堕棿锛� {{ formatDate(currentTaskData.Order.startTime) || "" }}
+                  璁″垝鏃堕棿锛� {{ formatDate(currentTaskData.Procedure.startTime) || "" }}
                   -
-                  {{ formatDate(currentTaskData.Order.endTime) }}
+                  {{ formatDate(currentTaskData.Procedure.endTime) }}
                 </div>
 
                 <div class="title-item">
@@ -136,8 +136,12 @@
                     </div>
                   </template>
                   <div class="gif-right">
-                    ----- 鍓╀綑鏃堕棿 -----
-                    <span>00:00:{{ 30 - Number(num) < 10 ? 0 : '' }}{{ 30 - Number(num) }}</span>
+                    <div>
+                      ----- 鍓╀綑鏃堕棿 -----
+                    </div>
+                    <div>
+                      <span>00:00:{{ 30 - Number(num) < 10 ? 0 : '' }}{{ 30 - Number(num) }}</span>
+                    </div>
                   </div>
                 </div>
                 {{ message }}
@@ -160,9 +164,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 +216,7 @@
 
 <script>
 import {getTaskInfo, sendProcessParams, startTask,} from "@/api/home"; // 浜х嚎
+import {channelNameConfig} from "@/common/constants";
 export default {
   name: 'TaskControlModal',
   components: {},
@@ -243,11 +248,7 @@
       isLoading: false,
       second: 0,
       secondTimer: null,
-      // 閫氶亾鍚嶇О閰嶇疆 Channel 0 瀵瑰簲灞曠ず 0, Channel 1 瀵瑰簲灞曠ず A,鏆傛椂蹇界暐鍏朵綑鎯呭喌
-      channelNameConfig: {
-        0: '0',
-        1: 'A'
-      }
+      channelNameConfig: channelNameConfig
     };
   },
   mounted() {
@@ -366,6 +367,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 +390,10 @@
      * 鍓嶇炕椤�
      */
     previousTask() {
+      // 鐢熶骇鍑嗗鍊掕鏃朵腑鍜屼笅鍙戝け璐ョ姝㈢炕椤�
+      if (this.showBtn === 2 || this.messageError){
+        return
+      }
       if (this.currentTaskIndex - 1 >= 0) {
         this.currentTaskIndex -= 1
         this.$nextTick(() => {
@@ -401,6 +408,10 @@
      * 鍚庣炕椤�
      */
     nextTask() {
+      // 鐢熶骇鍑嗗鍊掕鏃朵腑鍜屼笅鍙戝け璐ョ姝㈢炕椤�
+      if (this.showBtn === 2 || this.messageError){
+        return
+      }
       if (this.currentTaskIndex + 1 <= this.taskList.length - 1) {
         this.currentTaskIndex += 1
         this.$nextTick(() => {
@@ -416,9 +427,9 @@
       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;
+        // this.show = false;
       }
     },
     getDateObj(date, fmt) {
@@ -917,6 +928,12 @@
   &.next {
     right: -60px;
     padding-left: 4px;
+
+  }
+  &.disabled{
+    background-color: #cccccc;
+    opacity: 0.8;
+    cursor: not-allowed;
   }
 }
 
@@ -937,6 +954,7 @@
     color: #ffffffaa;
     font-size: 16px;
   }
+
 }
 .process-err-tip{
   box-sizing: border-box;

--
Gitblit v1.8.0