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 |  126 ++++++++++++++++++++++++++++++-----------
 1 files changed, 92 insertions(+), 34 deletions(-)

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index bd6d791..7d24ea6 100644
--- a/src/views/doctor/checkAll/index.vue
+++ b/src/views/doctor/checkAll/index.vue
@@ -733,7 +733,7 @@
                     placeholder="璇疯緭鍏ュ唴瀹�"
                     v-model="textarea1"
                     :autosize="{ minRows: minRows, maxRows: maxRows }"
-                    style="font-size: 16px;"
+                    style="font-size: 16px"
                   ></el-input>
                 </el-form-item>
               </el-form>
@@ -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>
@@ -779,6 +780,7 @@
                       style="width: 100%"
                       :header-cell-style="{ background: '#67C23A' }"
                       :row-key="getRowKeys"
+                      :expand-row-keys="expends"
                     >
                       <!--  :expand-row-keys="expends" -->
                       <el-table-column type="expand">
@@ -2009,7 +2011,6 @@
       flags: false,
       jianqianwenzhendata: [],
       jianqians: false,
-      adviceLoading: false,
       sex: true,
       activeName: "1",
       hosproy: true,
@@ -2066,7 +2067,7 @@
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit("pick", [start, end]);
+              picker.$adviceLoading("pick", [start, end]);
             },
           },
           {
@@ -2151,6 +2152,8 @@
       status1: 0,
       viewportHeight: 0,
       expends: [],
+      expandRowKeys: [],
+      shouldExpand: false,
     };
   },
 
@@ -2540,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 = ""; // 璁剧疆榛樿鍊�
       });
     },
 
@@ -2579,13 +2594,35 @@
     },
 
     yichangjieguo() {
-      this.loading = true;
+      // 绉婚櫎琛ㄦ牸loading鐘舵�侊紝閬垮厤鍦ㄧ偣鍑昏鎯呮椂鏄剧ず琛ㄦ牸loading妗�
+      // this.loading = true;
+      // 涓嶈鍦ㄨ繖閲岃缃� isLoading = true锛屽洜涓哄畠鍦� handleClick 涓凡缁忚璁剧疆浜�
       this.status1 = 0;
-      yichang({
-        tjNum: this.tjNumber,
-      })
-        .then((res) => {
-          this.yichangList = res.data;
+      getConfigKey("kzycxmsfzk").then((res) => {
+        this.shouldExpand = res.msg;
+        // 鍙湁Y/y鎵嶅睍寮�锛屽叾瀹冿紙鍖呮嫭绌恒�丯銆乶ull銆乽ndefined锛夐兘涓嶅睍寮�
+        if (this.shouldExpand === "Y") {
+          this.getExpends();
+        } else {
+          this.expends = [];
+        }
+      });
+      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 (
@@ -2596,18 +2633,31 @@
               }
             });
           });
-          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;
+          // }
         });
     },
 
@@ -2937,7 +2987,7 @@
 
     propoChange() {
       this.cusobj = { sex: this.tableAll.cusSex, isZj: 0 };
-       this.$refs.proposal.clearSearchFields()
+      this.$refs.proposal.clearSearchFields();
       getConfigKey("mrzscyjy").then((res) => {
         this.mrjy = res.msg; // 浼氳Е鍙� watch 鈫� 璁剧疆 tjproposal = "1"
         // 绛夋暟鎹姸鎬佸噯澶囧ソ鍚庡啀鎵撳紑寮圭獥
@@ -3134,18 +3184,18 @@
       this.qingkong();
       this.$refs.Pre.open = false;
       this.tableAll = row;
-      let dict = "dict_tjtype"
-      getDicts(dict).then(res => {
-         if (res.code == 200) {
-            res.data.forEach((item) => {
-              if (this.tableAll.tjCategory == item.dictValue) {
-                this.tableAll.tjCategory = item.dictLabel;
-              }
-            });
-          } else {
-            throw new Error('鑾峰彇浣撴绫诲瀷瀛楀吀澶辫触');
-          }
-      })
+      let dict = "dict_tjtype";
+      getDicts(dict).then((res) => {
+        if (res.code == 200) {
+          res.data.forEach((item) => {
+            if (this.tableAll.tjCategory == item.dictValue) {
+              this.tableAll.tjCategory = item.dictLabel;
+            }
+          });
+        } else {
+          throw new Error("鑾峰彇浣撴绫诲瀷瀛楀吀澶辫触");
+        }
+      });
       this.tjproject = "0";
       this.tjNumber = this.tableAll.tjNumber;
 
@@ -3167,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) => {
@@ -3193,6 +3243,10 @@
                       this.zhiyeJl = "";
                       this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
                     }
+                  }).catch((error) => {
+                    this.isLoading = false;
+                    console.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�:", error);
+                    this.$message.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�");
                   });
                 });
               }
@@ -3222,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++) {
@@ -3247,6 +3301,10 @@
                           this.zhiyeJl = "";
                           this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
                         }
+                      }).catch((error) => {
+                        this.isLoading = false;
+                        console.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�:", error);
+                        this.$message.error("鑾峰彇妫�鏌ョ被鍨嬪け璐�");
                       });
                     });
                   }
@@ -3349,7 +3407,7 @@
               id: this.MsgId,
             };
 
-             /* gettoPdf(tjNumber)
+            /* gettoPdf(tjNumber)
               .then((res) => {
                 this.$modal.msgSuccess("宸茬敓鎴愭姤鍛婏紒璇峰墠寰�鎶ュ憡鏍告敹椤甸潰纭锛�");
               })

--
Gitblit v1.8.0