From 5117eb472133409f395e444abd4bae8915c2ba06 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期一, 04 八月 2025 15:17:37 +0800
Subject: [PATCH] 1

---
 src/views/doctor/checkAll/index.vue |  171 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 125 insertions(+), 46 deletions(-)

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index 9474445..f0c4367 100644
--- a/src/views/doctor/checkAll/index.vue
+++ b/src/views/doctor/checkAll/index.vue
@@ -779,7 +779,7 @@
                   <el-button
                     type="primary"
                     @click="determine"
-                    :disabled="isdisabled"
+                    :disabled="isdisabled || isLoading"
                     >鎻愪氦骞剁敓鎴愭姤鍛�</el-button
                   >
                 </div>
@@ -2581,10 +2581,9 @@
 
     yichangjieguo() {
       this.loading = true;
-      this.isLoading = true; // 纭繚鏁翠綋鍔犺浇妗嗗紑鍚�
       this.status1 = 0;
       this.yichangList = [];
-      
+
       return new Promise((resolve, reject) => {
         yichang({
           tjNum: this.tjNumber,
@@ -2593,9 +2592,7 @@
             const data = res.data;
 
             if (!data || data.length === 0) {
-              this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
               this.loading = false;
-              this.isLoading = false; // 鍏抽棴鏁翠綋鍔犺浇妗�
               resolve(); // 杩斿洖 Promise锛屼絾涓嶇户缁悗缁�昏緫
               return;
             }
@@ -2611,23 +2608,18 @@
                 }
               });
             });
-            if (!this.yichangList) {
+            /* if (!this.yichangList) {
               this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
-            }
+            } */
             resolve(); // 鎴愬姛瀹屾垚
           })
           .catch((error) => {
-            this.isLoading = false;
             this.loading = false;
             console.error("鑾峰彇寮傚父缁撴灉澶辫触:", error);
             this.$message.error("鑾峰彇寮傚父缁撴灉澶辫触");
             reject(error); // 杩斿洖閿欒
           })
           .finally(() => {
-            // 鍙湪娌℃湁鎻愬墠杩斿洖鐨勬儏鍐典笅鍏抽棴鍔犺浇妗�
-            if (this.isLoading) {
-              this.isLoading = false;
-            }
             if (this.loading) {
               this.loading = false;
             }
@@ -3181,6 +3173,65 @@
       this.formobj = {};
     },
 
+    /* handleClick(row) {
+      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("鑾峰彇浣撴绫诲瀷瀛楀吀澶辫触");
+        }
+      });
+      this.tjproject = "0";
+      this.tjNumber = this.tableAll.tjNumber;
+
+      getState(this.tjNumber).then((res) => {
+        this.status = res.data;
+        if (this.status) {
+          if (this.status.status === "1") {
+            // 娌℃湁寮哄埗杩涘叆寮规锛岀洿鎺ュ紑鍚姞杞藉拰寮规
+            this.isLoading = true;
+            this.drawer = true;
+            // 鐩存帴鍦╤andleClick涓疄鐜板苟琛屽姞杞�
+            this.loadDataInHandleClick();
+          } else {
+            this.$confirm(
+              "" + this.status.name + "姝e湪淇敼璇ヤ俊鎭�, 鏄惁寮哄埗杩涘幓?",
+              "鎻愮ず",
+              {
+                confirmButtonText: "鏄�",
+                cancelButtonText: "鍚�",
+                type: "warning",
+              }
+            )
+              .then(() => {
+                // 鍏抽棴琛ㄦ牸鐨刲oading鐘舵��
+                this.loading = false;
+                // 鐢ㄦ埛纭寮哄埗杩涘叆锛屽紑鍚姞杞藉拰寮规
+                this.isLoading = true;
+                this.drawer = true;
+                // 鐩存帴鍦╤andleClick涓疄鐜板苟琛屽姞杞斤紙寮哄埗杩涘叆妯″紡锛�
+                this.loadDataInHandleClick(true);
+              })
+              .catch(() => {
+                this.isLoading = false; // 鍙栨秷鏃朵篃瑕佸叧闂姞杞芥
+                this.$message({
+                  type: "info",
+                  message: "宸插彇娑堣繘鍏�",
+                });
+              });
+          }
+        }
+      });
+    }, */
+
     handleClick(row) {
       this.qingkong();
       this.$refs.Pre.open = false;
@@ -3204,27 +3255,31 @@
         this.status = res.data;
         if (this.status) {
           if (this.status.status === "1") {
-            // 鍏堣皟鐢ㄥ紓甯哥粨鏋滐紝绛夊緟鍏跺畬鎴愬悗鍐嶇户缁悗缁�昏緫
-            this.yichangjieguo().then(() => {
-              // 鏃犺寮傚父缁撴灉鏄惁鏈夋暟鎹紝閮界户缁悗缁�昏緫
-              getInfo().then((response) => {
-                this.userId = response.user.userId;
+            // 寮�鍚姞杞藉拰寮规
+            this.isLoading = true;
+            this.drawer = true;
+
+            // 骞惰鎵ц寮傚父缁撴灉銆佺敤鎴蜂俊鎭幏鍙栧拰浣撴椤圭洰鏁版嵁鑾峰彇
+            Promise.all([
+              this.yichangjieguo(),
+              getInfo(),
+              getupdateCheckType(this.tjNumber),
+            ])
+              .then(([yichangResult, userInfo, checkTypeResult]) => {
+                this.userId = userInfo.user.userId;
                 if (this.userId) {
                   let data = {
                     userId: this.userId,
                     tjNumber: this.tjNumber,
                     state: 0,
                   };
-                  getModifiedState(data).then((res) => {
-                    this.MsgId = res.msg;
-                    // 鍙湁褰撳紓甯哥粨鏋滄湁鏁版嵁鏃舵墠寮�鍚姞杞芥
-                    if (this.yichangList && this.yichangList.length > 0) {
-                      this.isLoading = true;
-                    }
-                    this.drawer = true;
-                    getupdateCheckType(this.tjNumber).then((response) => {
-                      this.isLoading = false; // 鍏抽棴鍔犺浇妗�
-                      this.changedate = response.data;
+                  getModifiedState(data)
+                    .then((res) => {
+                      this.MsgId = res.msg;
+                      // 鎵�鏈夋暟鎹兘宸插姞杞藉畬鎴愶紝鍏抽棴loading
+                      this.isLoading = false;
+
+                      this.changedate = checkTypeResult.data;
                       if (this.changedate) {
                         this.changedate.forEach((item) => {
                           this.textarea1 = item.checkAdvice || "";
@@ -3249,11 +3304,21 @@
                         this.zhiyeJl = "";
                         this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
                       }
+                    })
+                    .catch((error) => {
+                      this.isLoading = false;
+                      console.error("淇敼鐘舵�佸け璐�:", error);
+                      this.$message.error("淇敼鐘舵�佸け璐�");
                     });
-                  });
+                } else {
+                  this.isLoading = false;
                 }
+              })
+              .catch((error) => {
+                this.isLoading = false;
+                console.error("骞惰鍔犺浇鏁版嵁澶辫触:", error);
+                this.$message.error("鍔犺浇鏁版嵁澶辫触锛岃閲嶈瘯");
               });
-            });
           } else {
             this.$confirm(
               "" + this.status.name + "姝e湪淇敼璇ヤ俊鎭�, 鏄惁寮哄埗杩涘幓?",
@@ -3265,27 +3330,31 @@
               }
             )
               .then(() => {
-                // 鍏堣皟鐢ㄥ紓甯哥粨鏋滐紝绛夊緟鍏跺畬鎴愬悗鍐嶇户缁悗缁�昏緫
-                this.yichangjieguo().then(() => {
-                  // 鏃犺寮傚父缁撴灉鏄惁鏈夋暟鎹紝閮界户缁悗缁�昏緫
-                  getInfo().then((response) => {
-                    this.userId = response.user.userId;
+                // 寮�鍚姞杞藉拰寮规
+                this.isLoading = true;
+                this.drawer = true;
+
+                // 骞惰鎵ц寮傚父缁撴灉銆佺敤鎴蜂俊鎭幏鍙栧拰浣撴椤圭洰鏁版嵁鑾峰彇
+                Promise.all([
+                  this.yichangjieguo(),
+                  getInfo(),
+                  getupdateCheckType(this.tjNumber),
+                ])
+                  .then(([yichangResult, userInfo, checkTypeResult]) => {
+                    this.userId = userInfo.user.userId;
                     if (this.userId) {
                       let data = {
                         userId: this.userId,
                         tjNumber: this.tjNumber,
                         state: 0,
                       };
-                      getforceIn(data).then((res) => {
-                        this.MsgId = res.msg;
-                        // 鍙湁褰撳紓甯哥粨鏋滄湁鏁版嵁鏃舵墠寮�鍚姞杞芥
-                        if (this.yichangList && this.yichangList.length > 0) {
-                          this.isLoading = true;
-                        }
-                        this.drawer = true;
-                        getupdateCheckType(this.tjNumber).then((response) => {
-                          this.isLoading = false; // 鍏抽棴鍔犺浇妗�
-                          this.changedate = response.data;
+                      getforceIn(data)
+                        .then((res) => {
+                          this.MsgId = res.msg;
+                          // 鎵�鏈夋暟鎹兘宸插姞杞藉畬鎴愶紝鍏抽棴loading
+                          this.isLoading = false;
+
+                          this.changedate = checkTypeResult.data;
                           if (this.changedate) {
                             for (let i = 0; i < this.changedate.length; i++) {
                               this.remark = this.changedate[i].remark;
@@ -3309,11 +3378,21 @@
                             this.zhiyeJl = "";
                             this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
                           }
+                        })
+                        .catch((error) => {
+                          this.isLoading = false;
+                          console.error("寮哄埗杩涘叆澶辫触:", error);
+                          this.$message.error("寮哄埗杩涘叆澶辫触");
                         });
-                      });
+                    } else {
+                      this.isLoading = false;
                     }
+                  })
+                  .catch((error) => {
+                    this.isLoading = false;
+                    console.error("骞惰鍔犺浇鏁版嵁澶辫触:", error);
+                    this.$message.error("鍔犺浇鏁版嵁澶辫触锛岃閲嶈瘯");
                   });
-                });
               })
               .catch(() => {
                 this.$message({

--
Gitblit v1.8.0