1
lkk
1 天以前 50e2b67bcd84decac4c6be19271fcab2fd61c28c
src/views/doctor/checkAll/index.vue
@@ -733,7 +733,7 @@
                    placeholder="请输入内容"
                    v-model="textarea1"
                    :autosize="{ minRows: minRows, maxRows: maxRows }"
                    style="font-size: 16px;"
                    style="font-size: 16px"
                  ></el-input>
                </el-form-item>
              </el-form>
@@ -744,13 +744,14 @@
                  type="primary"
                  @click.stop="rowClick"
                  icon="el-icon-edit-outline"
                  :disabled="isdisabled || isLoading"
                  >开处方</el-button
                >
                <div v-if="tjproject == '0'">
                  <el-button
                    type="primary"
                    @click="determine"
                    :disabled="isdisabled"
                    :disabled="isdisabled || isLoading"
                    >提交并生成报告</el-button
                  >
                </div>
@@ -779,6 +780,7 @@
                      style="width: 100%"
                      :header-cell-style="{ background: '#67C23A' }"
                      :row-key="getRowKeys"
                      :expand-row-keys="expends"
                    >
                      <!--  :expand-row-keys="expends" -->
                      <el-table-column type="expand">
@@ -2009,7 +2011,6 @@
      flags: false,
      jianqianwenzhendata: [],
      jianqians: false,
      adviceLoading: false,
      sex: true,
      activeName: "1",
      hosproy: true,
@@ -2066,7 +2067,7 @@
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
              picker.$adviceLoading("pick", [start, end]);
            },
          },
          {
@@ -2151,6 +2152,8 @@
      status1: 0,
      viewportHeight: 0,
      expends: [],
      expandRowKeys: [],
      shouldExpand: false,
    };
  },
@@ -2540,14 +2543,26 @@
    },
    getConfigKey() {
      getconfigKey("sfkqtwbg").then((res) => {
      // 使用正确的 getConfigKey 函数(需要参数)
      getConfigKey("sfkqtwbg").then((res) => {
        this.msgtuwen = res.msg;
      }).catch((error) => {
        console.warn("获取配置项 sfkqtwbg 失败:", error);
        this.msgtuwen = ""; // 设置默认值
      });
      getconfigKey("sfkqjqwz").then((res) => {
      getConfigKey("sfkqjqwz").then((res) => {
        this.msgjianqian = res.msg;
      }).catch((error) => {
        console.warn("获取配置项 sfkqjqwz 失败:", error);
        this.msgjianqian = ""; // 设置默认值
      });
      getconfigKey("kcf").then((res) => {
      getConfigKey("kcf").then((res) => {
        this.msgkcf = res.msg;
      }).catch((error) => {
        console.warn("获取配置项 kcf 失败:", error);
        this.msgkcf = ""; // 设置默认值
      });
    },
@@ -2579,13 +2594,35 @@
    },
    yichangjieguo() {
      this.loading = true;
      // 移除表格loading状态,避免在点击详情时显示表格loading框
      // this.loading = true;
      // 不要在这里设置 isLoading = true,因为它在 handleClick 中已经被设置了
      this.status1 = 0;
      yichang({
        tjNum: this.tjNumber,
      })
        .then((res) => {
          this.yichangList = res.data;
      getConfigKey("kzycxmsfzk").then((res) => {
        this.shouldExpand = res.msg;
        // 只有Y/y才展开,其它(包括空、N、null、undefined)都不展开
        if (this.shouldExpand === "Y") {
          this.getExpends();
        } else {
          this.expends = [];
        }
      });
      return new Promise((resolve, reject) => {
        yichang({
          tjNum: this.tjNumber,
        }).then((res) => {
          const data = res.data;
          if (!data || data.length === 0) {
            // 移除警告消息,用户不希望看到"暂无异常报告"的弹框
            // this.$message.warning("暂无异常报告");
            // 移除表格loading状态设置
            // this.loading = false;
            // 不在这里关闭 isLoading,因为它由 handleClick 管理
            resolve(); // 返回 Promise,但不继续后续逻辑
            return;
          }
          this.yichangList = data;
          this.yichangList.forEach((item) => {
            item.sone.forEach((soneItem) => {
              if (
@@ -2596,16 +2633,31 @@
              }
            });
          });
          if (!this.yichangList) {
          /* if (!this.yichangList) {
            this.$message.warning("暂无异常报告");
          } */
          resolve(); // 成功完成
          // 这里也可以根据shouldExpand再调用一次getExpends,确保数据已加载
          if (this.shouldExpand === "Y" || this.shouldExpand === "y") {
            this.getExpends();
          } else {
            this.expends = [];
          }
        })
        });
      })
        .catch((error) => {
          // 不在这里关闭 isLoading,因为它由 handleClick 管理
          // 移除表格loading状态设置
          // this.loading = false;
          console.error("获取异常结果失败:", error);
          this.$message.error("获取异常结果失败");
          reject(error); // 返回错误
        })
        .finally(() => {
          this.loading = false;
          // 移除表格loading状态设置,因为 isLoading 由 handleClick 管理
          // if (this.loading) {
          //   this.loading = false;
          // }
        });
    },
@@ -2935,10 +2987,9 @@
    propoChange() {
      this.cusobj = { sex: this.tableAll.cusSex, isZj: 0 };
      this.$refs.proposal.clearSearchFields();
      getConfigKey("mrzscyjy").then((res) => {
        this.mrjy = res.msg; // 会触发 watch → 设置 tjproposal = "1"
        // console.log(res, 4444);
        // 等数据状态准备好后再打开弹窗
        this.$refs.proposal.title = "建议方案";
        this.$refs.proposal.open = true;
@@ -3133,18 +3184,18 @@
      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('获取体检类型字典失败');
          }
      })
      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;
@@ -3192,6 +3243,10 @@
                      this.zhiyeJl = "";
                      this.zhiyeJg = "未发现目标性疾病";
                    }
                  }).catch((error) => {
                    this.isLoading = false;
                    console.error("获取检查类型失败:", error);
                    this.$message.error("获取检查类型失败");
                  });
                });
              }
@@ -3246,6 +3301,10 @@
                          this.zhiyeJl = "";
                          this.zhiyeJg = "未发现目标性疾病";
                        }
                      }).catch((error) => {
                        this.isLoading = false;
                        console.error("获取检查类型失败:", error);
                        this.$message.error("获取检查类型失败");
                      });
                    });
                  }
@@ -3348,7 +3407,45 @@
              id: this.MsgId,
            };
            addOrder(dataList)
            /* gettoPdf(tjNumber)
              .then((res) => {
                this.$modal.msgSuccess("已生成报告!请前往报告核收页面确认!");
              })
              .catch(() => {
                this.$modal.msgError(
                  "打印报告失败,请前往报告打印页面补打报告!"
                );
              }); */
            const statePromise = getfiedState(reportData).then(() => {
              this.drawer = false;
            });
            const updatePromises = this.changedate.map((item) => {
              this.proIds = item.parentId;
              let remarks = item.remark;
              let updateOrderRemarkVos = [
                {
                  tjNumber,
                  proId: this.proIds.toString(),
                  remarks,
                },
              ];
              return getModified(updateOrderRemarkVos);
            });
            Promise.all([statePromise, ...updatePromises])
              .then(() => {
                this.loading = false;
                this.queryParams.page = 1;
                this.queryParams.pageSize = 10;
                this.submitForm();
                this.$forceUpdate();
              })
              .catch((error) => {
                this.loading = false;
                console.error("发生错误:", error);
              });
            /* addOrder(dataList)
              .then((res) => {
                if (res.code == 200) {
                  // gettoPdf(tjNumber)
@@ -3395,7 +3492,7 @@
              .catch((error) => {
                this.loading = false;
                console.error("addOrderPromise 失败:", error);
              });
              }); */
          } else {
            this.loading = false;
            this.$modal.msgError("提交失败");