From 6d9b6320e57ae787bfcfc56f4f34923166ea1a9b Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 25 八月 2023 12:05:27 +0800
Subject: [PATCH] 面板的需求更改  下方的弹框+倒计时

---
 src/views/visualization.vue |   51 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/src/views/visualization.vue b/src/views/visualization.vue
index 7546681..5e63f08 100644
--- a/src/views/visualization.vue
+++ b/src/views/visualization.vue
@@ -108,7 +108,7 @@
                   color="#09E5ED"
                   :text-inside="true"
                   :stroke-width="30"
-                  :percentage="finishPercent"
+                  :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount):0"
                 ></el-progress>
               </el-descriptions-item>
               <!-- <el-descriptions-item label="鍚堟牸鐜�" style="width: 100%">
@@ -196,7 +196,7 @@
                     </div>
                     <div class="card_top-3">
                       <span class="card-top-r-t"
-                        >瀹屾垚杩涘害锛歿{ finishPercent || 0 }}</span
+                        >瀹屾垚杩涘害锛歿{ taskData.Order?parseInt(finishNumber/taskData.Order.amount):0}}</span
                       >
                       <span class="card-top-r-b">
                         <el-progress
@@ -204,7 +204,7 @@
                           color="#09E5ED"
                           :text-inside="true"
                           :stroke-width="10"
-                          :percentage="finishPercent"
+                          :percentage="taskData.Order?parseInt(finishNumber/taskData.Order.amount):0"
                           :show-text="false"
                         ></el-progress>
                       </span>
@@ -430,7 +430,8 @@
           <img src="../../public/yuan.png" />
           <div class="btn-img">
             <div class="font_size_16" style="line-height: 5; margin-top: 18%">
-              鏆傛棤浠诲姟锛屼紤鎭竴涓嬪惂...
+              <span v-if="showCountDown">璺濈浠诲姟寮�濮嬫椂闂达細{{countDownHour}}鏃� {{countDownMinute}}鍒�</span>
+              <span v-else>鏆傛棤浠诲姟锛屼紤鎭竴涓嬪惂...</span>
             </div>
             <el-button type="primary" @click="reloadPage">鍒锋柊浠诲姟</el-button>
           </div>
@@ -439,10 +440,13 @@
     </template>
     <!-- 鎺у埗鐨勫脊妗� -->
     <AddControl ref="control" :id="taskData.Procedure.ID" />
+    <!-- 鎺у埗鐨勫脊妗� -->
+    <AddIssue ref="control" :taskData="taskData" :Order="taskData.Order" @getSetProductNumber="getTaskInfo" />
   </div>
 </template>
 
 <script>
+
 import {
   getTaskInfo,
   finishTask,
@@ -450,15 +454,18 @@
   saveMiniDict,
   startTask,
   getProgress,
+  countdown,
 } from "@/api/home/index"; // 浜х嚎
 import Card from "@/components/Card.vue";
 import Knowledge from "../components/Knowledge.vue";
 import AddControl from "../components/AddControl.vue";
+import AddIssue from "../components/AddIssue.vue";
 export default {
   components: {
     Card,
     Knowledge,
     AddControl,
+    AddIssue,
   },
   data() {
     return {
@@ -466,7 +473,6 @@
       passrate: 30, //鍚堟牸鐜�
       production: 25, //鐢熶骇涓�
       finishNumber: 0,
-      finishPercent: 0,
       formatTime2:'',
       formatTime3:'',
       // 鍙充晶瀹屾垚
@@ -515,6 +521,10 @@
           },
         },
       },
+      totalNumber:0,
+      showCountDown:false,
+      countDownHour:0,
+      countDownMinute:0,
     };
   },
   mounted() {
@@ -523,28 +533,33 @@
     //   this.passrate = this.getRandomNumber(1, 100);
     //   this.production = this.getRandomNumber(1, 100);
     // }, 3000);
+    this.getDate3()
+    this.getDate2()
     setInterval(()=>{
        this.getDate3()
        this.getDate2()
     },5000)
     this.getTaskInfo();
-    setInterval(() => {
-      this.getProgressInfo();
-    }, 60000);
   },
-
   methods: {
     reloadPage() {
       // window.location.reload();
       this.getTaskInfo();
     },
+    getcountdown(){
+      countdown().then((res) => {
+        if (res.code == 200) {
+          this.showCountDown=res.data.ShowCountDown?res.data.ShowCountDown:false;
+          this.countDownHour=res.data.CountDownHour?res.data.CountDownHour:0
+          this.countDownMinute=res.data.CountDownMinute?res.data.CountDownMinute:0
+        }
+      });
+    },
     getProgressInfo() {
       getProgress().then((res) => {
         if (res.code == 200) {
           this.finishNumber = res.data.finishNumber ? res.data.finishNumber : 0;
-          this.finishPercent = res.data.finishPercent
-            ? res.data.finishPercent
-            : 0;
+          
         }
       });
     },
@@ -658,6 +673,8 @@
               ...this.taskData.Procedure.procedure,
             },
           ]);
+          
+   
           if (this.taskData.Procedure.ID) {
             startTask({ id: this.taskData.Procedure.ID }).then((res) => {
               if (res.code == 200) {
@@ -668,6 +685,10 @@
                 });
               }
             });
+            this.getProgressInfo();
+            setInterval(() => {
+              this.getProgressInfo();
+            }, 6000);
           }
           console.log(this.procedureList, "===1111procedureList");
           // setTimeout(() => {
@@ -676,6 +697,12 @@
           this.setInterCard("outputMaterials", "cardBox3");
           // }, 5000);
         }
+        if(res.code!=200||!this.taskData.Procedure.ID){
+          this.getcountdown();
+            setInterval(() => {
+              this.getcountdown();
+            }, 60000);
+        }
       });
     },
     // 璁剧疆

--
Gitblit v1.8.0