From e38a87dc7116cb36d5747ddad62f07ba6741117e Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期五, 01 八月 2025 12:05:11 +0800
Subject: [PATCH] 1

---
 src/views/doctor/checkAll/index.vue |  312 +++++++++++++++++++++++++++++++++++----------------
 1 files changed, 214 insertions(+), 98 deletions(-)

diff --git a/src/views/doctor/checkAll/index.vue b/src/views/doctor/checkAll/index.vue
index 6041adc..fceb9d5 100644
--- a/src/views/doctor/checkAll/index.vue
+++ b/src/views/doctor/checkAll/index.vue
@@ -808,7 +808,6 @@
                       style="width: 100%"
                       :header-cell-style="{ background: '#67C23A' }"
                       :row-key="getRowKeys"
-                      v-loading="loading"
                     >
                       <!-- :expand-row-keys="expends" -->
                       <el-table-column type="expand">
@@ -2581,39 +2580,51 @@
     },
 
     yichangjieguo() {
-      this.isLoading = true;
+      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() {
@@ -2940,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;
@@ -3184,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) {
@@ -3248,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 =
@@ -3282,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: "宸插彇娑堣繘鍏�",
@@ -3339,6 +3453,7 @@
       let tjNumber = this.tableAll.tjNumber;
       let tjh = this.tableAll.tjNumber;
       let advice = this.textarea1;
+      this.isLoading = true;
       let data = {
         tjNumber,
         advice,
@@ -3365,7 +3480,8 @@
       getTjdetailList(data)
         .then((response) => {
           if (response.code === 200) {
-            this.$modal.msgSuccess("鎻愪氦鎴愬姛");
+            this.isLoading = false;
+            this.$modal.msgSuccess(response.msg);
             // 娓呯┖瀛楁
             this.zhiyeJl = "";
             this.zhiyeJg = "";
@@ -3376,7 +3492,7 @@
               state: 1,
               id: this.MsgId,
             };
-            gettoPdf(tjNumber)
+            /* gettoPdf(tjNumber)
               .then((res) => {
                 this.$modal.msgSuccess("宸茬敓鎴愭姤鍛婏紒璇峰墠寰�鎶ュ憡鏍告敹椤甸潰纭锛�");
               })
@@ -3384,7 +3500,7 @@
                 this.$modal.msgError(
                   "鎵撳嵃鎶ュ憡澶辫触锛岃鍓嶅線鎶ュ憡鎵撳嵃椤甸潰琛ユ墦鎶ュ憡锛�"
                 );
-              });
+              }); */
             const statePromise = getfiedState(reportData).then(() => {
               this.drawer = false;
             });

--
Gitblit v1.8.0