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

---
 src/views/doctor/checkAll/index.vue |  305 +++++++++++++++++++++++++++++++++++---------------
 1 files changed, 210 insertions(+), 95 deletions(-)

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index f0a9a02..5525ecb 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,36 +2583,48 @@
       this.loading = true;
       this.status1 = 0;
       this.yichangList = [];
-      yichang({
-        tjNum: this.tjNumber,
-      })
-        .then((res) => {
-          // this.isLoading = false
-          this.yichangList = res.data;
+      
+      return new Promise((resolve, reject) => {
+        yichang({
+          tjNum: this.tjNumber,
+        })
+          .then((res) => {
+            const data = res.data;
 
-          this.yichangList.forEach((item) => {
-            item.sone.forEach((soneItem) => {
-              if (
-                !Array.isArray(soneItem.advices) ||
-                soneItem.advices.length === 0
-              ) {
-                soneItem.advices = [{ bt: "", nr: "" }];
-              }
+            if (!data || data.length === 0) {
+              this.loading = false;
+              resolve(); // 杩斿洖 Promise锛屼絾涓嶇户缁悗缁�昏緫
+              return;
+            }
+            this.yichangList = data;
+
+            this.yichangList.forEach((item) => {
+              item.sone.forEach((soneItem) => {
+                if (
+                  !Array.isArray(soneItem.advices) ||
+                  soneItem.advices.length === 0
+                ) {
+                  soneItem.advices = [{ bt: "", nr: "" }];
+                }
+              });
             });
+            /* if (!this.yichangList) {
+              this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
+            } */
+            resolve(); // 鎴愬姛瀹屾垚
+          })
+          .catch((error) => {
+            this.loading = false;
+            console.error("鑾峰彇寮傚父缁撴灉澶辫触:", error);
+            this.$message.error("鑾峰彇寮傚父缁撴灉澶辫触");
+            reject(error); // 杩斿洖閿欒
+          })
+          .finally(() => {
+            if (this.loading) {
+              this.loading = false;
+            }
           });
-          if (!this.yichangList) {
-            this.$message.warning("鏆傛棤寮傚父鎶ュ憡");
-          }
-        })
-        .catch((error) => {
-          this.isLoading = false;
-          console.error("鑾峰彇寮傚父缁撴灉澶辫触:", error);
-          this.$message.error("鑾峰彇寮傚父缁撴灉澶辫触");
-        })
-        .finally(() => {
-          this.isLoading = false;
-          this.loading = false;
-        });
+      });
     },
 
     fuchaxiangmu() {
@@ -2939,6 +2951,7 @@
     radiotjprojectChange() {
       if (this.tjproject == "0") {
         getupdateCheckType(this.tjNumber).then((response) => {
+          this.isLoading = false;
           this.changedate = response.data;
           this.changedate.forEach((item) => {
             this.textarea1 = item.checkAdvice;
@@ -3183,62 +3196,13 @@
         this.status = res.data;
         if (this.status) {
           if (this.status.status === "1") {
-            this.yichangjieguo();
-            getInfo().then((response) => {
-              this.userId = response.user.userId;
-              if (this.userId) {
-                let data = {
-                  userId: this.userId,
-                  tjNumber: this.tjNumber,
-                  state: 0,
-                };
-                getModifiedState(data).then((res) => {
-                  this.MsgId = res.msg;
-                  this.isLoading = true;
-                  this.drawer = true;
-                  getupdateCheckType(this.tjNumber).then((response) => {
-                    // this.isLoading = false
-                    this.changedate = response.data;
-                    if (this.changedate) {
-                      this.changedate.forEach((item) => {
-                        this.textarea1 = item.checkAdvice || "";
-                      });
-                      this.initialTotalCheckAdvice = this.textarea1;
-                      this.initialState = JSON.parse(
-                        JSON.stringify(this.changedate)
-                      );
-                      for (let i = 0; i < this.changedate.length; i++) {
-                        this.remark = this.changedate[i].remark;
-                      }
-                      // 鍥炴樉 zhiyeJl 鍜� zhiyeJg
-                      this.zhiyeJl = this.changedate[0].zhiyejl || "";
-                      this.zhiyeJg =
-                        this.changedate[0].zhiyejg || "鏈彂鐜扮洰鏍囨�х柧鐥�";
-                    } else {
-                      this.$message({
-                        type: "warning",
-                        message: "璇ュ鎴锋病鏈変綋妫�椤圭洰鏁版嵁",
-                      });
-                      // 濡傛灉娌℃湁鏁版嵁锛屾竻绌哄瓧娈�
-                      this.zhiyeJl = "";
-                      this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
-                    }
-                  });
-                });
-              }
-            });
-          } else {
-            this.$confirm(
-              "" + this.status.name + "姝e湪淇敼璇ヤ俊鎭�, 鏄惁寮哄埗杩涘幓?",
-              "鎻愮ず",
-              {
-                confirmButtonText: "鏄�",
-                cancelButtonText: "鍚�",
-                type: "warning",
-              }
-            )
-              .then(() => {
-                this.yichangjieguo();
+            // 娌℃湁寮哄埗杩涘叆寮规锛岀洿鎺ュ紑鍚姞杞藉拰寮规
+            this.isLoading = true;
+            this.drawer = true;
+            // 鍏堣皟鐢ㄥ紓甯哥粨鏋滐紝绛夊緟鍏跺畬鎴愬悗鍐嶇户缁悗缁�昏緫
+            this.yichangjieguo().then(() => {
+              // 濡傛灉寮傚父缁撴灉涓虹┖锛屽乏杈规暟鎹姞杞藉畬鎴愬悗灏卞叧闂姞杞芥
+              if (!this.yichangList || this.yichangList.length === 0) {
                 getInfo().then((response) => {
                   this.userId = response.user.userId;
                   if (this.userId) {
@@ -3247,23 +3211,66 @@
                       tjNumber: this.tjNumber,
                       state: 0,
                     };
-                    getforceIn(data).then((res) => {
+                    getModifiedState(data).then((res) => {
                       this.MsgId = res.msg;
-                      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++) {
-                            this.remark = this.changedate[i].remark;
-                          }
-                          this.initialState = JSON.parse(
-                            JSON.stringify(this.changedate)
-                          );
                           this.changedate.forEach((item) => {
                             this.textarea1 = item.checkAdvice || "";
                           });
+                          this.initialTotalCheckAdvice = this.textarea1;
+                          this.initialState = JSON.parse(
+                            JSON.stringify(this.changedate)
+                          );
+                          for (let i = 0; i < this.changedate.length; i++) {
+                            this.remark = this.changedate[i].remark;
+                          }
+                          // 鍥炴樉 zhiyeJl 鍜� zhiyeJg
+                          this.zhiyeJl = this.changedate[0].zhiyejl || "";
+                          this.zhiyeJg =
+                            this.changedate[0].zhiyejg || "鏈彂鐜扮洰鏍囨�х柧鐥�";
+                        } else {
+                          this.$message({
+                            type: "warning",
+                            message: "璇ュ鎴锋病鏈変綋妫�椤圭洰鏁版嵁",
+                          });
+                          // 濡傛灉娌℃湁鏁版嵁锛屾竻绌哄瓧娈�
+                          this.zhiyeJl = "";
+                          this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
+                        }
+
+                      });
+                    });
+                  }
+                });
+              } else {
+                // 寮傚父缁撴灉鏈夋暟鎹紝绛夊緟宸﹀彸涓よ竟閮藉姞杞藉畬鎴�
+                getInfo().then((response) => {
+                  this.userId = response.user.userId;
+                  if (this.userId) {
+                    let data = {
+                      userId: this.userId,
+                      tjNumber: this.tjNumber,
+                      state: 0,
+                    };
+                    getModifiedState(data).then((res) => {
+                      this.MsgId = res.msg;
+                      getupdateCheckType(this.tjNumber).then((response) => {
+                        this.isLoading = false; // 鍏抽棴鍔犺浇妗�
+                        this.changedate = response.data;
+                        if (this.changedate) {
+                          this.changedate.forEach((item) => {
+                            this.textarea1 = item.checkAdvice || "";
+                          });
+                          this.initialTotalCheckAdvice = this.textarea1;
+                          this.initialState = JSON.parse(
+                            JSON.stringify(this.changedate)
+                          );
+                          for (let i = 0; i < this.changedate.length; i++) {
+                            this.remark = this.changedate[i].remark;
+                          }
                           // 鍥炴樉 zhiyeJl 鍜� zhiyeJg
                           this.zhiyeJl = this.changedate[0].zhiyejl || "";
                           this.zhiyeJg =
@@ -3281,8 +3288,116 @@
                     });
                   }
                 });
+              }
+            });
+          } else {
+            this.$confirm(
+              "" + this.status.name + "姝e湪淇敼璇ヤ俊鎭�, 鏄惁寮哄埗杩涘幓?",
+              "鎻愮ず",
+              {
+                confirmButtonText: "鏄�",
+                cancelButtonText: "鍚�",
+                type: "warning",
+              }
+            )
+              .then(() => {
+                // 鍏抽棴琛ㄦ牸鐨刲oading鐘舵��
+                this.loading = false;
+                // 鐢ㄦ埛纭寮哄埗杩涘叆锛屽紑鍚姞杞藉拰寮规
+                this.isLoading = true;
+                this.drawer = true;
+                // 鍏堣皟鐢ㄥ紓甯哥粨鏋滐紝绛夊緟鍏跺畬鎴愬悗鍐嶇户缁悗缁�昏緫
+                this.yichangjieguo().then(() => {
+                  // 濡傛灉寮傚父缁撴灉涓虹┖锛屽乏杈规暟鎹姞杞藉畬鎴愬悗灏卞叧闂姞杞芥
+                  if (!this.yichangList || this.yichangList.length === 0) {
+                    getInfo().then((response) => {
+                      this.userId = response.user.userId;
+                      if (this.userId) {
+                        let data = {
+                          userId: this.userId,
+                          tjNumber: this.tjNumber,
+                          state: 0,
+                        };
+                        getforceIn(data).then((res) => {
+                          this.MsgId = res.msg;
+                          getupdateCheckType(this.tjNumber).then((response) => {
+                            this.isLoading = false; // 鍏抽棴鍔犺浇妗�
+                            this.changedate = response.data;
+                            if (this.changedate) {
+                              for (let i = 0; i < this.changedate.length; i++) {
+                                this.remark = this.changedate[i].remark;
+                              }
+                              this.initialState = JSON.parse(
+                                JSON.stringify(this.changedate)
+                              );
+                              this.changedate.forEach((item) => {
+                                this.textarea1 = item.checkAdvice || "";
+                              });
+                              // 鍥炴樉 zhiyeJl 鍜� zhiyeJg
+                              this.zhiyeJl = this.changedate[0].zhiyejl || "";
+                              this.zhiyeJg =
+                                this.changedate[0].zhiyejg || "鏈彂鐜扮洰鏍囨�х柧鐥�";
+                            } else {
+                              this.$message({
+                                type: "warning",
+                                message: "璇ュ鎴锋病鏈変綋妫�椤圭洰鏁版嵁",
+                              });
+                              // 濡傛灉娌℃湁鏁版嵁锛屾竻绌哄瓧娈�
+                              this.zhiyeJl = "";
+                              this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
+                            }
+
+                          });
+                        });
+                      }
+                    });
+                  } else {
+                    // 寮傚父缁撴灉鏈夋暟鎹紝绛夊緟宸﹀彸涓よ竟閮藉姞杞藉畬鎴�
+                    getInfo().then((response) => {
+                      this.userId = response.user.userId;
+                      if (this.userId) {
+                        let data = {
+                          userId: this.userId,
+                          tjNumber: this.tjNumber,
+                          state: 0,
+                        };
+                        getforceIn(data).then((res) => {
+                          this.MsgId = res.msg;
+                          getupdateCheckType(this.tjNumber).then((response) => {
+                            this.isLoading = false; // 鍏抽棴鍔犺浇妗�
+                            this.changedate = response.data;
+                            if (this.changedate) {
+                              for (let i = 0; i < this.changedate.length; i++) {
+                                this.remark = this.changedate[i].remark;
+                              }
+                              this.initialState = JSON.parse(
+                                JSON.stringify(this.changedate)
+                              );
+                              this.changedate.forEach((item) => {
+                                this.textarea1 = item.checkAdvice || "";
+                              });
+                              // 鍥炴樉 zhiyeJl 鍜� zhiyeJg
+                              this.zhiyeJl = this.changedate[0].zhiyejl || "";
+                              this.zhiyeJg =
+                                this.changedate[0].zhiyejg || "鏈彂鐜扮洰鏍囨�х柧鐥�";
+                            } else {
+                              this.$message({
+                                type: "warning",
+                                message: "璇ュ鎴锋病鏈変綋妫�椤圭洰鏁版嵁",
+                              });
+                              // 濡傛灉娌℃湁鏁版嵁锛屾竻绌哄瓧娈�
+                              this.zhiyeJl = "";
+                              this.zhiyeJg = "鏈彂鐜扮洰鏍囨�х柧鐥�";
+                            }
+                          });
+                        });
+                      }
+                    });
+                  }
+                });
               })
               .catch(() => {
+                this.isLoading = false; // 鍙栨秷鏃朵篃瑕佸叧闂姞杞芥
                 this.$message({
                   type: "info",
                   message: "宸插彇娑堣繘鍏�",
@@ -3366,7 +3481,7 @@
         .then((response) => {
           if (response.code === 200) {
             this.isLoading = false;
-           this.$modal.msgSuccess(response.msg);
+            this.$modal.msgSuccess(response.msg);
             // 娓呯┖瀛楁
             this.zhiyeJl = "";
             this.zhiyeJg = "";

--
Gitblit v1.8.0