qx
3 天以前 1d1f47e55da5e0f4f20fe5eb20fc426aebb7966a
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;
            // 直接在handleClick中实现并行加载
            this.loadDataInHandleClick();
          } else {
            this.$confirm(
              "" + this.status.name + "正在修改该信息, 是否强制进去?",
              "提示",
              {
                confirmButtonText: "是",
                cancelButtonText: "否",
                type: "warning",
              }
              // 异常结果有数据,继续后续逻辑
              getInfo().then((response) => {
                this.userId = response.user.userId;
            )
              .then(() => {
                // 关闭表格的loading状态
                this.loading = false;
                // 用户确认强制进入,开启加载和弹框
                this.isLoading = true;
                this.drawer = true;
                // 直接在handleClick中实现并行加载(强制进入模式)
                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 + "正在修改该信息, 是否强制进去?",
@@ -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: "已取消进入",