From 4436c040d89980c8624f88cd4876c808806c414f Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 28 八月 2023 19:52:46 +0800
Subject: [PATCH] 下发参数 弹框修改 2023-8-28

---
 src/components/AddIssue.vue |   97 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 87 insertions(+), 10 deletions(-)

diff --git a/src/components/AddIssue.vue b/src/components/AddIssue.vue
index 734943d..5122e23 100644
--- a/src/components/AddIssue.vue
+++ b/src/components/AddIssue.vue
@@ -28,7 +28,17 @@
               鐢熶骇鏁伴噺锛�<span>{{ taskData.Order.amount || 0 }}</span>
             </div>
           </div>
-          <div class="title-auto-box">
+          <template v-if="messageError">
+            <div class="error-t">
+              <img src="../../public/error.png" />
+            </div>
+            <div class="error-m">
+              {{ messageError }}
+            </div>
+            <div class="font_size_20 color_fff" style="text-align:center;width:100%;margin:10px 0;">璇烽噸璇�</div>
+          </template>
+          <template v-else>
+            <div class="title-auto-box">
             <div class="title-box margin_bottom_20">
               <div class="title-item">
                 璁㈠崟缂栧彿锛歿{ taskData.Order.orderId || "" }}
@@ -97,7 +107,7 @@
                 margin-top: 10px;
               "
             >
-              璇风‘璁ょ敓浜у畨鍏紒
+              {{ message }}
             </div>
             <div class="progress-item">
               <span>{{ parseInt(num/60*100) }}%</span>
@@ -112,6 +122,8 @@
                 ></el-progress>
                 </div>
           </div>
+          </template>
+          
           <!-- <div class="circel-text">
          <div class="circel-text-b">
           鐢熶骇鏁伴噺锛�<span>{{ Order.amount||0 }}</span>{{ Order.unit||'' }}
@@ -120,6 +132,12 @@
         </div>
       </div>
       <div slot="footer" class="dialog-footer tac" style="overflow: hidden">
+        <template v-if="messageError">
+          <div class="btn" style="margin-left:220px;"  @click="confirmClick2">
+            <img src="../../public/confirm3.png" />
+          </div>
+        </template>
+        <template v-else>
         <div class="btn" @click="closeClick">
           <img src="../../public/btn1.png" />
         </div>
@@ -132,13 +150,18 @@
         <div class="btn" v-if="showBtn==3" @click="onSubmit()">
           <img src="../../public/confirm1.png" />
         </div>
+        </template>
+        
       </div>
+      <!-- <ErrorIssue ref="error" :messageError="messageError" @shutdown="shutdown"/> -->
     </div>
   </el-dialog>
+  
 </template>
 
 <script>
 import { startTask, setProductNumber,sendProcessParams } from "@/api/home/index"; // 浜х嚎
+// import ErrorIssue from "@/components/ErrorIssue";
 export default {
   components: {},
   props: {
@@ -167,7 +190,9 @@
       showBtn:1,
       num:0,
       timer:null,
-     
+      message:'璇风‘璁ょ敓浜у畨鍏紒',
+      messageError:'',
+      resParams:{},
     };
   },
   mounted() {
@@ -185,9 +210,14 @@
     }
   },
   methods: {
+    confirmClick2(){
+      this.messageError=''
+    },
     confirmClick1(){
+      
       this.num=0;
       this.showBtn=2;
+      this.message='璇风‘璁ょ敓浜у畨鍏紒',
       this.timer=setInterval(()=>{
        this.num=this.num+1;
       },1000)
@@ -206,7 +236,7 @@
         this.showBtn= 1;
         this.islook=true;
       }else{
-        this.islook=false;
+        this.islook=true;
       }
     },
     getDateObj(date, fmt) {
@@ -247,23 +277,51 @@
         return "";
       }
     },
+  
     onSubmit() {
       if(this.taskData.Procedure.ID){
+        this.message='鍙傛暟涓嬪彂涓�...',
+        this.num=0
+        this.timer=setInterval(()=>{
+         this.num=this.num+1;
+         if(this.num==60||this.resParams){
+          this.num=60
+          this.getCode(this.resParams)
+
+         }
+        },1000)
+        
         sendProcessParams({id:this.taskData.Procedure.ID}).then(res=>{
           if(res.code==200){
             setProductNumber().then((res) => {
-              if (res.code == 200) {
-                this.$message.success("涓嬪彂鎴愬姛锛�");
-                // this.$message.success("涓嬪彂鐢熶骇鏁伴噺鎴愬姛锛�");
-                this.$emit("getSetProductNumber");
-                this.shutdown();
-              }
+              this.resParams=res;
+              
             });
+          }else{
+            this.resParams=res;
           }
         })
      
       }
       
+    },
+    getCode(res){
+      if (res.code == 200) {
+                if(this.num==60){
+                  this.messageError='涓嬪彂鎴愬姛锛�'
+                  clearInterval(this.timer)
+                  this.num=60;
+                  this.showBtn=2;
+                  this.message='璇风‘璁ょ敓浜у畨鍏紒'
+                  // this.$message.success("涓嬪彂鐢熶骇鏁伴噺鎴愬姛锛�");
+                }
+              }else{
+                this.messageError=res.msg?res.msg:'鎶辨瓑锛屽伐搴忎笅鍙戝け璐ワ紒'
+                clearInterval(this.timer)
+                this.num=60;
+                  this.showBtn=2;
+                  this.message='璇风‘璁ょ敓浜у畨鍏紒'
+              }
     },
     shutdown() {
       this.islook = false;
@@ -287,6 +345,9 @@
 .color_4efefa {
   color: #4efefa !important;
 }
+.color_fff{
+  color:#fff;
+}
 .font_size_20 {
   font-size: 20px !important;
 }
@@ -308,6 +369,7 @@
       width: 55%;
     }
   }
+  
   .title-bng {
     height: 42px;
     line-height: 42px;
@@ -323,6 +385,21 @@
     width: 100% !important;
   }
 }
+.error-t{
+    width:120px;
+    margin:50px auto 40px;
+    img{
+      width:100%;
+      display:inline-block;
+    }
+  }
+  .error-m{
+    line-height:35px;
+    font-size:26px;
+    color:#fff;
+    margin-bottom:20px;
+    text-align:center;
+  }
 ::v-deep .el-dialog {
   background: transparent;
 }

--
Gitblit v1.8.0