From 1d1f47e55da5e0f4f20fe5eb20fc426aebb7966a Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期一, 04 八月 2025 15:19:22 +0800
Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region

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

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index 4af72f0..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>
@@ -2583,7 +2583,7 @@
       this.loading = true;
       this.status1 = 0;
       this.yichangList = [];
-      
+
       return new Promise((resolve, reject) => {
         yichang({
           tjNum: this.tjNumber,
@@ -2592,7 +2592,6 @@
             const data = res.data;
 
             if (!data || data.length === 0) {
-              this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
               this.loading = false;
               resolve(); // 杩斿洖 Promise锛屼絾涓嶇户缁悗缁�昏緫
               return;
@@ -2609,9 +2608,9 @@
                 }
               });
             });
-            if (!this.yichangList) {
+            /* if (!this.yichangList) {
               this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
-            }
+            } */
             resolve(); // 鎴愬姛瀹屾垚
           })
           .catch((error) => {
@@ -3174,9 +3173,8 @@
       this.formobj = {};
     },
 
-    handleClick(row) {
+    /* handleClick(row) {
       this.qingkong();
-      this.isLoading = true; // 寮�濮嬫暣浣撳姞杞�
       this.$refs.Pre.open = false;
       this.tableAll = row;
       let dict = "dict_tjtype";
@@ -3198,30 +3196,90 @@
         this.status = res.data;
         if (this.status) {
           if (this.status.status === "1") {
-            // 鍏堣皟鐢ㄥ紓甯哥粨鏋滐紝绛夊緟鍏跺畬鎴愬悗鍐嶇户缁悗缁�昏緫
-            this.yichangjieguo().then(() => {
-              // 濡傛灉寮傚父缁撴灉涓虹┖锛岀珛鍗冲叧闂姞杞芥骞舵墦寮�鎶藉眽
-              if (!this.yichangList || this.yichangList.length === 0) {
-                this.isLoading = false;
-                this.drawer = true;
-                return;
+            // 娌℃湁寮哄埗杩涘叆寮规锛岀洿鎺ュ紑鍚姞杞藉拰寮规
+            this.isLoading = true;
+            this.drawer = true;
+            // 鐩存帴鍦╤andleClick涓疄鐜板苟琛屽姞杞�
+            this.loadDataInHandleClick();
+          } else {
+            this.$confirm(
+              "" + this.status.name + "姝e湪淇敼璇ヤ俊鎭�, 鏄惁寮哄埗杩涘幓?",
+              "鎻愮ず",
+              {
+                confirmButtonText: "鏄�",
+                cancelButtonText: "鍚�",
+                type: "warning",
               }
-              
-              // 寮傚父缁撴灉鏈夋暟鎹紝缁х画鍚庣画閫昏緫
-              getInfo().then((response) => {
-                this.userId = response.user.userId;
+            )
+              .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;
+      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;
+
+            // 骞惰鎵ц寮傚父缁撴灉銆佺敤鎴蜂俊鎭幏鍙栧拰浣撴椤圭洰鏁版嵁鑾峰彇
+            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;
-                    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 || "";
@@ -3246,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湪淇敼璇ヤ俊鎭�, 鏄惁寮哄埗杩涘幓?",
@@ -3262,30 +3330,31 @@
               }
             )
               .then(() => {
-                // 鍏堣皟鐢ㄥ紓甯哥粨鏋滐紝绛夊緟鍏跺畬鎴愬悗鍐嶇户缁悗缁�昏緫
-                this.yichangjieguo().then(() => {
-                  // 濡傛灉寮傚父缁撴灉涓虹┖锛岀珛鍗冲叧闂姞杞芥骞舵墦寮�鎶藉眽
-                  if (!this.yichangList || this.yichangList.length === 0) {
-                    this.isLoading = false;
-                    this.drawer = true;
-                    return;
-                  }
-                  
-                  // 寮傚父缁撴灉鏈夋暟鎹紝缁х画鍚庣画閫昏緫
-                  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;
-                        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,14 +3378,23 @@
                             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.isLoading = false; // 鍙栨秷鏃朵篃瑕佸叧闂姞杞芥
                 this.$message({
                   type: "info",
                   message: "宸插彇娑堣繘鍏�",

--
Gitblit v1.8.0