From 50e2b67bcd84decac4c6be19271fcab2fd61c28c Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期五, 01 八月 2025 15:53:57 +0800
Subject: [PATCH] 1

---
 src/views/doctor/checkAll/index.vue |   78 +++++++++++++++++++++++++++++---------
 1 files changed, 59 insertions(+), 19 deletions(-)

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index fe2bf91..7d24ea6 100644
--- a/src/views/doctor/checkAll/index.vue
+++ b/src/views/doctor/checkAll/index.vue
@@ -744,13 +744,14 @@
                   type="primary"
                   @click.stop="rowClick"
                   icon="el-icon-edit-outline"
+                  :disabled="isdisabled || isLoading" 
                   >寮�澶勬柟</el-button
                 >
                 <div v-if="tjproject == '0'">
                   <el-button
                     type="primary"
                     @click="determine"
-                    :disabled="isdisabled"
+                    :disabled="isdisabled || isLoading" 
                     >鎻愪氦骞剁敓鎴愭姤鍛�</el-button
                   >
                 </div>
@@ -2542,14 +2543,26 @@
     },
 
     getConfigKey() {
-      getconfigKey("sfkqtwbg").then((res) => {
+      // 浣跨敤姝g‘鐨� getConfigKey 鍑芥暟锛堥渶瑕佸弬鏁帮級
+      getConfigKey("sfkqtwbg").then((res) => {
         this.msgtuwen = res.msg;
+      }).catch((error) => {
+        console.warn("鑾峰彇閰嶇疆椤� sfkqtwbg 澶辫触:", error);
+        this.msgtuwen = ""; // 璁剧疆榛樿鍊�
       });
-      getconfigKey("sfkqjqwz").then((res) => {
+      
+      getConfigKey("sfkqjqwz").then((res) => {
         this.msgjianqian = res.msg;
+      }).catch((error) => {
+        console.warn("鑾峰彇閰嶇疆椤� sfkqjqwz 澶辫触:", error);
+        this.msgjianqian = ""; // 璁剧疆榛樿鍊�
       });
-      getconfigKey("kcf").then((res) => {
+      
+      getConfigKey("kcf").then((res) => {
         this.msgkcf = res.msg;
+      }).catch((error) => {
+        console.warn("鑾峰彇閰嶇疆椤� kcf 澶辫触:", error);
+        this.msgkcf = ""; // 璁剧疆榛樿鍊�
       });
     },
 
@@ -2581,7 +2594,9 @@
     },
 
     yichangjieguo() {
-      this.loading = true;
+      // 绉婚櫎琛ㄦ牸loading鐘舵�侊紝閬垮厤鍦ㄧ偣鍑昏鎯呮椂鏄剧ず琛ㄦ牸loading妗�
+      // this.loading = true;
+      // 涓嶈鍦ㄨ繖閲岃缃� isLoading = true锛屽洜涓哄畠鍦� handleClick 涓凡缁忚璁剧疆浜�
       this.status1 = 0;
       getConfigKey("kzycxmsfzk").then((res) => {
         this.shouldExpand = res.msg;
@@ -2592,11 +2607,22 @@
           this.expends = [];
         }
       });
-      yichang({
-        tjNum: this.tjNumber,
-      })
-        .then((res) => {
-          this.yichangList = res.data;
+      return new Promise((resolve, reject) => {
+        yichang({
+          tjNum: this.tjNumber,
+        }).then((res) => {
+          const data = res.data;
+
+          if (!data || data.length === 0) {
+            // 绉婚櫎璀﹀憡娑堟伅锛岀敤鎴蜂笉甯屾湜鐪嬪埌"鏆傛棤寮傚父鎶ュ憡"鐨勫脊妗�
+            // this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
+            // 绉婚櫎琛ㄦ牸loading鐘舵�佽缃�
+            // this.loading = false;
+            // 涓嶅湪杩欓噷鍏抽棴 isLoading锛屽洜涓哄畠鐢� handleClick 绠$悊
+            resolve(); // 杩斿洖 Promise锛屼絾涓嶇户缁悗缁�昏緫
+            return;
+          }
+          this.yichangList = data;
           this.yichangList.forEach((item) => {
             item.sone.forEach((soneItem) => {
               if (
@@ -2607,27 +2633,33 @@
               }
             });
           });
-          if (!this.yichangList) {
+          /* if (!this.yichangList) {
             this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
-          }
+          } */
+          resolve(); // 鎴愬姛瀹屾垚
           // 杩欓噷涔熷彲浠ユ牴鎹畇houldExpand鍐嶈皟鐢ㄤ竴娆etExpends锛岀‘淇濇暟鎹凡鍔犺浇
           if (this.shouldExpand === "Y" || this.shouldExpand === "y") {
             this.getExpends();
           } else {
             this.expends = [];
           }
-        })
+        });
+      })
         .catch((error) => {
-          this.isLoading = false;
+          // 涓嶅湪杩欓噷鍏抽棴 isLoading锛屽洜涓哄畠鐢� handleClick 绠$悊
+          // 绉婚櫎琛ㄦ牸loading鐘舵�佽缃�
+          // this.loading = false;
           console.error("鑾峰彇寮傚父缁撴灉澶辫触:", error);
           this.$message.error("鑾峰彇寮傚父缁撴灉澶辫触");
+          reject(error); // 杩斿洖閿欒
         })
         .finally(() => {
-          this.isLoading = false;
-          this.loading = false;
+          // 绉婚櫎琛ㄦ牸loading鐘舵�佽缃紝鍥犱负 isLoading 鐢� handleClick 绠$悊
+          // if (this.loading) {
+          //   this.loading = false;
+          // }
         });
     },
-    
 
     fuchaxiangmu() {
       this.loading = true;
@@ -3185,7 +3217,7 @@
                   this.isLoading = true;
                   this.drawer = true;
                   getupdateCheckType(this.tjNumber).then((response) => {
-                    // this.isLoading = false;
+                    this.isLoading = false;
                     this.changedate = response.data;
                     if (this.changedate) {
                       this.changedate.forEach((item) => {
@@ -3211,6 +3243,10 @@
                       this.zhiyeJl = "";
                       this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
                     }
+                  }).catch((error) => {
+                    this.isLoading = false;
+                    console.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�:", error);
+                    this.$message.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�");
                   });
                 });
               }
@@ -3240,7 +3276,7 @@
                       this.isLoading = true;
                       this.drawer = true;
                       getupdateCheckType(this.tjNumber).then((response) => {
-                        // this.isLoading = false;
+                        this.isLoading = false;
                         this.changedate = response.data;
                         if (this.changedate) {
                           for (let i = 0; i < this.changedate.length; i++) {
@@ -3265,6 +3301,10 @@
                           this.zhiyeJl = "";
                           this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
                         }
+                      }).catch((error) => {
+                        this.isLoading = false;
+                        console.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�:", error);
+                        this.$message.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�");
                       });
                     });
                   }

--
Gitblit v1.8.0