qx
qx
2025-05-23 31cb4bc988bdbb3a171d0cc704ff09eeeeccb524
src/views/doctor/checkAll/index.vue
@@ -274,11 +274,10 @@
            <el-form v-if="tableAll && tableAll.tjCategory === '02'" ref="numberValidateForm" label-width="80px"
              class="demo-ruleForm">
              <el-form-item label="检查结论">
                <el-input type="textarea" placeholder="请输入内容" v-model="textarea1" :rows="3"
                  style="width: 96%"></el-input>
                <el-input type="textarea" placeholder="请输入内容" v-model="zhiyeJl" :rows="3" style="width: 96%"></el-input>
              </el-form-item>
              <el-form-item label="体检结果">
                <el-input type="textarea" placeholder="请输入内容" v-model="res" :rows="3" style="width: 96%"></el-input>
                <el-input type="textarea" placeholder="请输入内容" v-model="zhiyeJg" :rows="3" style="width: 96%"></el-input>
              </el-form-item>
            </el-form>
            <div style="margin: 0 0px 10px 15px" v-if="tjproject != '1'">
@@ -807,7 +806,8 @@
  isPdfOrJimu,
  addOrder,
  addOrder1,
  getFcList, UpdFcPro
  getFcList,
  UpdFcPro
} from "@/api/doctor/checkAll";
import { getInfoById } from "@/api/hosp/history";
import { getInfo } from "@/api/login";
@@ -848,14 +848,15 @@
  name: "checkAll",
  data() {
    return {
      res: '未发现目标性疾病',
      zhiyeJl: '', // 初始化检查结论为空
      zhiyeJg: '未发现目标性疾病', // 初始化体检结果为默认值
      selectedAdvice: null,
      activeAdviceIndex: 0,
      advicerulesList: [],
      xmChange: [],
      showjianyi: false,
      adviceLoading: false, // 控制表格加载状态
      adviceEmptyText: '暂无数据', // 自定义空数据提示
      adviceLoading: false,
      adviceEmptyText: '暂无数据',
      total1: 0,
      forms: {
        pacName: ""
@@ -865,9 +866,9 @@
      queryParams1: {
        pageNum: 1,
        pageSize: 10,
        zyzd: '', // 建议名称
        zyzd: '',
      },
      adviceCache: new Map(), // 缓存建议数据
      adviceCache: new Map(),
      addNewDialogVisible: false,
      newItem: {
        parentName: '',
@@ -1009,7 +1010,7 @@
  },
  created() {
    console.log(this.dict.type.dict_tjtype, "职业体检"); // 打印字典数据
    console.log(this.dict.type.dict_tjtype, "职业体检");
    this.getConfigKey();
    this.getdate();
  },
@@ -1031,10 +1032,10 @@
      this.queryParams1.pageNum = 1;
      this.queryParams1.pageSize = 10;
      this.queryParams1.zyzd = '';
      this.selectedAdvice = null; // 重置选中建议
      this.advicerulesList = []; // 清空建议列表
      this.selectedAdvice = null;
      this.advicerulesList = [];
      this.total1 = 0;
      this.adviceCache.clear(); // 清空缓存
      this.adviceCache.clear();
      this.filterAdvices();
      this.showjianyi = true;
    },
@@ -1045,10 +1046,8 @@
        this.queryParams1.pageNum = 1;
      }
      // 生成缓存 key,仅使用 zyzd 和分页参数
      const cacheKey = `${this.queryParams1.zyzd || ''}_${this.queryParams1.pageNum}_${this.queryParams1.pageSize}`;
      // 检查缓存
      if (this.adviceCache.has(cacheKey)) {
        const cachedData = this.adviceCache.get(cacheKey);
        this.advicerulesList = cachedData.rows;
@@ -1057,7 +1056,6 @@
        return;
      }
      // 显示加载状态
      this.adviceLoading = true;
      this.adviceEmptyText = '加载中...';
@@ -1066,13 +1064,11 @@
          this.advicerulesList = response.rows || [];
          this.total1 = response.total || 0;
          // 存入缓存
          this.adviceCache.set(cacheKey, {
            rows: this.advicerulesList,
            total: this.total1,
          });
          // 更新空数据提示
          this.adviceEmptyText = this.advicerulesList.length === 0 ? '暂无匹配的建议' : '暂无数据';
        })
        .catch((error) => {
@@ -1085,7 +1081,7 @@
        .finally(() => {
          this.adviceLoading = false;
        });
    }, 800), // 防抖时间为 800ms
    }, 800),
    handleCurrentChangeAdvice(currentRow) {
      this.selectedAdvice = currentRow;
@@ -1112,7 +1108,6 @@
      }
    },
    // 取消选择并关闭对话框
    cancelAdviceDialog() {
      this.showjianyi = false;
      this.selectedAdvice = null;
@@ -1123,7 +1118,6 @@
      this.adviceCache.clear();
    },
    // 关闭对话框前的确认
    handleCloseAdviceDialog(done) {
      if (this.selectedAdvice) {
        this.$confirm('您已选择一条建议,确定要关闭吗?', '提示', {
@@ -1135,7 +1129,7 @@
            this.cancelAdviceDialog();
            done();
          })
          .catch(() => { });
          .catch(() => {});
      } else {
        this.cancelAdviceDialog();
        done();
@@ -1251,6 +1245,7 @@
        this.newItem.jcxm = value;
      }
    },
    change(val) {
      console.log('选中的值是:', val);
    },
@@ -1313,63 +1308,50 @@
    },
    handleQuery() {
      this.xmopen = true
      this.xmopen = true;
      let data = {
        tjNum: this.tjNumber,
        type: 0
      }
      };
      getFcList(data).then(res => {
        this.datasList = res.data
      })
        this.datasList = res.data;
      });
    },
    handleaddClick() {
      console.log(this.xmChange)
      console.log(this.xmChange);
      let data = {
        orderId: this.xmChange[0].orderId,
        data: [{
          proId: this.xmChange[0].proId,
          type: 1
        }]
      }
      UpdFcPro(data).then(res => {
        if (res.code == 200) {
          this.xmChange = []
          this.fuchaxiangmu()
        }
      })
      };
      UpdFcPro(data).then(res => {});
    },
    handledeleteClick(row) {
      let data = {
        orderId: row.orderId,
        data: [{
          proId: row.proId,
          type: 0
        }]
      }
      UpdFcPro(data).then(res => {
        if (res.code == 200) {
          this.fuchaxiangmu()
        }
      })
    handledeleteClick() {
      UpdFcPro(data).then(res => {});
    },
    handlexmChange(selection) {
      this.xmChange = []
      this.xmChange = selection
      this.xmChange = [];
      this.xmChange = selection;
      if (selection.length > 1) {
        let del_row = selection.shift();
        this.$refs.elTable.toggleRowSelection(del_row, false); //设置这一行取消选中
        this.$refs.elTable.toggleRowSelection(del_row, false);
      }
    },
    submitFormxm() {
      this.xmopen = false
      this.xmopen = false;
    },
    cancels() {
      this.xmopen = false
      this.xmChange = []
      this.xmopen = false;
      this.xmChange = [];
    },
    getExpends() {
      this.expends = this.yichangList.flatMap(item =>
        item.sone.map(soneItem => soneItem.orderDetailId)
@@ -1391,6 +1373,7 @@
    getRowKeys(row) {
      return row.orderDetailId;
    },
    xiangmuqingkuang() {
      this.loading = true;
      cSWebGetPro(this.tjNumber)
@@ -1452,9 +1435,6 @@
      getFcList(data)
        .then((res) => {
          this.fcList = res.data;
          this.fcList.forEach((item, index) => {
            item.newID = index + 1;
          })
        })
        .catch((error) => {
          console.error('获取复查项目失败:', error);
@@ -1910,11 +1890,17 @@
                      for (let i = 0; i < this.changedate.length; i++) {
                        this.remark = this.changedate[i].remark;
                      }
                      // 回显 zhiyeJl 和 zhiyeJg
                      this.zhiyeJl = response.data.zhiyeJl || '';
                      this.zhiyeJg = response.data.zhiyeJg || '未发现目标性疾病';
                    } else {
                      this.$message({
                        type: "warning",
                        message: "该客户没有体检项目数据",
                      });
                      // 如果没有数据,清空字段
                      this.zhiyeJl = '';
                      this.zhiyeJg = '未发现目标性疾病';
                    }
                  });
                });
@@ -1949,11 +1935,17 @@
                          this.changedate.forEach((item) => {
                            this.textarea1 = item.checkAdvice || "";
                          });
                          // 回显 zhiyeJl 和 zhiyeJg
                          this.zhiyeJl = response.data.zhiyeJl || '';
                          this.zhiyeJg = response.data.zhiyeJg || '未发现目标性疾病';
                        } else {
                          this.$message({
                            type: "warning",
                            message: "该客户没有体检项目数据",
                          });
                          // 如果没有数据,清空字段
                          this.zhiyeJl = '';
                          this.zhiyeJg = '未发现目标性疾病';
                        }
                      });
                    });
@@ -1989,7 +1981,7 @@
              done();
            });
          })
          .catch(() => { });
          .catch(() => {});
      } else {
        let data = {
          userId: this.userId,
@@ -2017,10 +2009,9 @@
        tjNumber,
        advice,
        checkStatus: 1,
        zhiyeJl: this.zhiyeJl, // 添加检查结论
        zhiyeJg: this.zhiyeJg  // 添加体检结果
      };
      console.log(this.yichangList, 6644);
      let dataList = this.yichangList
        .map((item) => {
          return item.sone.map((soneItem) => ({
@@ -2034,14 +2025,17 @@
            dw: soneItem.proAdvice,
          }));
        })
        .flat(); // 使用 flat() 方法将嵌套数组展平
        .flat();
      this.loading = true;
      getTjdetailList(data)
        .then((response) => {
          if (response.code === 200) {
            this.$modal.msgSuccess("提交成功");
            // 清空字段
            this.zhiyeJl = '';
            this.zhiyeJg = '';
            // 准备生成报告的请求数据
            let reportData = {
              userId: this.userId,
              tjNumber: tjNumber,
@@ -2049,12 +2043,8 @@
              id: this.MsgId,
            };
            // 调用 addOrderPromise
            console.log(dataList, 5555);
            addOrder(dataList)
              .then((res) => {
                console.log(res, 999);
                if (res.code == 200) {
                  gettoPdf(tjNumber)
                    .then((res) => {
@@ -2080,41 +2070,36 @@
                        remarks,
                      },
                    ];
                    return getModified(updateOrderRemarkVos); // 返回 Promise
                    return getModified(updateOrderRemarkVos);
                  });
                  // 等待所有请求完成
                  Promise.all([statePromise, ...updatePromises])
                    .then(() => {
                      // 所有请求完成,关闭 loading
                      this.loading = false;
                      // 更新分页信息
                      this.queryParams.page = 1;
                      this.queryParams.pageSize = 10;
                      this.submitForm();
                      this.$forceUpdate();
                    })
                    .catch((error) => {
                      // 处理错误情况
                      this.loading = false;
                      console.error("发生错误:", error);
                    });
                }
              })
              .catch((error) => {
                // 如果 addOrderPromise 失败,处理错误
                this.loading = false;
                console.error("addOrderPromise 失败:", error);
              });
          } else {
            // 提交失败,关闭 loading
            this.loading = false;
            this.$modal.msgError("提交失败");
          }
        })
        .catch((error) => {
          // 提交请求失败,关闭 loading
          this.loading = false;
          console.error("提交请求失败:", error);
          this.$modal.msgError("提交请求失败");
        });
    },