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

---
 src/components/ProcessModel.vue |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/components/ProcessModel.vue b/src/components/ProcessModel.vue
index 18c0d1b..89972b7 100644
--- a/src/components/ProcessModel.vue
+++ b/src/components/ProcessModel.vue
@@ -32,8 +32,9 @@
                       <img src="../../public/process-model.png" />
                    </div>
                    <div class="item-r" @click="processDetailsClick(item,index)">
-                      <div class="item-r-t font_weight">{{ item.procedure }}</div>
-                      <div class="item-r-b">褰撳墠宸ヨ壓缂栧彿锛歿{ item.number }}</div>
+                      <div class="item-r-t font_weight">{{ item.number }}</div>
+                      <div class="item-r-b">浜у搧锛歿{ item.product }}</div>
+                      <div class="item-r-b">宸ュ簭锛歿{ item.procedure }}</div>
                     </div>
                     <div class="tip-r" v-if="item.isUpdate">
                       <img src="../../public/process-tip.png" />
@@ -86,7 +87,8 @@
         ref="processDetails"
         :processObj="processObj"
         :listData="listData"
-        @renew="renew"
+        :activeIndex='activeIndex'
+        @updateProcess="updateProcess"
       />
     </div>
     
@@ -125,6 +127,7 @@
       index:null,
       isPage:false,
       isRenew:false,
+      activeIndex:'',
     };
   },
   mounted() {
@@ -132,6 +135,7 @@
   },
   watch: {
     islook(){
+      this.pageObj.page=1
       this.getProcessModelList()
     },
   },
@@ -149,8 +153,9 @@
       if (
         Object.keys(this.listData).length > 0
       ) {
-          this.islook = true;
+          this.pageObj.page=1
           this.getProcessModelList()
+          this.islook = true;
       } else {
         this.islook = false;
       }
@@ -206,18 +211,27 @@
     },
     updateProcess(item,index){
       this.processObj=item;
+      this.activeIndex=index;
+      if (this.isLoading[index]) {
+        return true;
+      }
       this.isLoading[index]=true;
+      this.$refs.processDetails.isLoading=true;
       updateProcessParams({procedureId:this.listData.Procedure.ID}).then(res=>{
         if(res.code==200){
           this.isLoading[index]=false;
+          this.$refs.processDetails.isLoading=false;
           this.$message.success('鏇存柊鎴愬姛锛�')
           this.renew();
         }else{
           this.isLoading[index]=false;
+          this.$refs.processDetails.isLoading=false;
+          this.$refs.processDetails.isUpdate=1;
         }
       })
       setTimeout(()=>{
         this.isLoading[index]=false;
+        this.$refs.processDetails.isLoading=false;
       },50000)
     },
     onSubmitTop() {
@@ -427,7 +441,7 @@
       width:calc(100% - 20px);
       .title-item{
         width:calc(50%  - 30px);
-        height:77px;
+        height:92px;
         padding:23px 10px 10px;
         background:#31478f;
         border-radius: 8px;
@@ -450,7 +464,7 @@
         .item-r{
           width:calc(100% - 60px);
           float:left;
-          line-height:25px;
+          line-height:22px;
           color:#fff;
           font-size:15px;
           cursor:pointer;

--
Gitblit v1.8.0