1
wwl
2025-03-27 c5647495c3cd52131326aa117d8704d017d5bca9
1
3个文件已修改
216 ■■■■■ 已修改文件
src/views/doctor/check/index.vue 110 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/checkAll/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sampling/sampling/index.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/check/index.vue
@@ -274,23 +274,19 @@
        <el-col v-show="baogaoqian">
          <template>
            <el-tabs v-model="radio" type="border-card" @tab-click="handleTabClick" style="margin-left: 10px">
              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index" :lazy="false">
              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index"
                :lazy="false">
                <el-table class="bgc" v-loading="loading" :data="proParentList.sons" border height="460px"
                  style="width: 96%; margin: 10px 10px" :row-class-name="tableRowClassName">
                  <el-table-column prop="project.proName" label="检测项目" width="150">
                  </el-table-column>
                  <el-table-column prop="proResult" label="检测结果" width="150">
                    <!-- <template slot-scope="scope">
                      <el-input type="textarea" autosize size="mini" v-model="scope.row.proResult" autocomplete="off"
                        placeholder="请输入检测结果" @focus="handleFocus(scope.row)" @blur="handleInputConfirm(scope.row)"
                        @input="vale($event, scope.row)" :disabled="scope.row.project.proName === 'BMI'"
                        ></el-input> -->
                        <template slot-scope="{ row, $index }">
                      <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-item${index}-row${$index}`"
                      <el-input type="textarea" autosize size="mini" v-model="row.proResult"
                        :ref="`input-item${index}-row${$index}`"
                      @keydown.enter.native="keyInputConfirm($event,index,$index)" @focus="handleFocus(row)"
                        @blur="handleInputConfirm(row)" @input="vale($event, row)"
                        :disabled="row.project.proName === 'BMI'"
                        ></el-input>
                        :disabled="row.project.proName === 'BMI'"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column prop="exceptionDesc" label="异常" width="55px" align="center">
@@ -420,22 +416,19 @@
        <el-col :span="18" v-show="baogaohou">
          <template>
            <el-tabs v-model="radio" type="border-card" @tab-click="handleTabClick" style="margin-left: 10px">
              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index" :lazy="false">
              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index"
                :lazy="false">
                <el-table class="bgc" v-loading="loading" :data="proParentList.sons" border height="460px"
                  style="width: 96%; margin: 10px 10px" :row-class-name="tableRowClassName">
                  <el-table-column prop="project.proName" label="检测项目" width="100">
                  </el-table-column>
                  <el-table-column prop="proResult" label="检测结果" width="150">
                    <!-- <template slot-scope="scope">
                      <el-input type="textarea" autosize size="mini" v-model="scope.row.proResult" autocomplete="off"
                        placeholder="请输入检测结果" @focus="handleFocus(scope.row)" @blur="handleInputConfirm(scope.row)"
                        @input="vale"></el-input> -->
                        <template slot-scope="{ row, $index }">
                      <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-item${index}-row${$index}`"
                      <el-input type="textarea" autosize size="mini" v-model="row.proResult"
                        :ref="`input-item${index}-row${$index}`"
                      @keydown.enter.native="keyInputConfirm($event,index,$index)" @focus="handleFocus(row)"
                        @blur="handleInputConfirm(row)" @input="vale($event, row)"
                        :disabled="row.project.proName === 'BMI'"
                        ></el-input>
                        :disabled="row.project.proName === 'BMI'"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column label="规则" width="70">
@@ -1005,7 +998,18 @@
    },
    // 输入确认时更新 BMI
    handleInputConfirm(row) {
    handleInputConfirm(row, params) {
      // 如果有 params 且为空,取消异常状态并清空相关字段
      if (params && params.length === 0) {
        row.exceptionDesc = false;
        row.proResult = "";
        row.conclusion = "";
        row.proAdvice = "";
        row.rulesList = [];
        return;
      }
      // 现有 BMI 计算逻辑
      if (row.proResult) {
        if (row.project.proName === '身高' || row.project.proName === '体重') {
          const heightRow = this.proParentList.sons.find(
@@ -1025,7 +1029,73 @@
            bmiRow.proResult = bmi || '';
          }
        }
        this.focusrow = row;
        this.proResult = row;
        const pattern3 = new RegExp("[0-9]+");
        if (pattern3.test(row.proResult)) {
          let data = {
            proId: this.focusrow.proId,
            cusId: this.tableAll.cusId,
            tjNum: this.tableAll.tjNumber,
            keyNum: this.proResult.proResult,
          };
          AutoGetRule(data).then((res) => {
            this.focusrow.conclusion = "";
            if (res.data) {
              this.autorule = res.data;
              this.focusrow.rulesList = res.data;
              if (res.data.length > 0) {
                const conditions = ["正常", "未见异常", "阴性", "未见明显异常"];
                this.focusrow.exceptionDesc = !conditions.some((condition) =>
                  this.autorule[0].bz.includes(condition)
                );
              } else {
                this.focusrow.exceptionDesc = false;
              }
              if (this.autorule.length !== 0 && (this.autorule[0] || this.autorule[0].nr)) {
                this.focusrow.proAdvice = this.autorule[0].nr;
              }
              this.autorule.forEach((item) => {
                this.focusrow.conclusion += this.focusrow.conclusion ? item.bz : item.bz;
              });
            }
          });
        } else {
          let data = {
            proId: this.focusrow.proId,
            cusId: this.tableAll.cusId,
            keyWord: this.proResult.proResult, // 修改为 proResult.proResult
            tjNum: this.tableAll.tjNumber,
            keyNum: this.proResult.proResult,
          };
          AutoGetRule(data).then((res) => {
            this.focusrow.conclusion = "";
            if (res.data) {
              this.autorule = res.data;
              this.focusrow.rulesList = res.data;
              if (res.data.length > 0) {
                const conditions = ["正常", "未见异常", "阴性", "未见明显异常"];
                this.focusrow.exceptionDesc = !conditions.some((condition) =>
                  this.autorule[0].bz.includes(condition)
                );
              } else {
                this.focusrow.exceptionDesc = false;
              }
              if (this.autorule.length !== 0 && (this.autorule[0] || this.autorule[0].nr)) {
                this.focusrow.proAdvice = this.autorule[0].nr;
              }
              this.autorule.forEach((item) => {
                this.focusrow.conclusion += this.focusrow.conclusion ? item.bz : item.bz;
              });
            }
          });
        }
        // 将当前行添加到 rows 中
        this.rows.push(row);
        console.log(this.rows, row);
      }
    },
@@ -1093,7 +1163,6 @@
      });
    },
    // 以下为其他方法,未做修改,仅保留必要部分,其余省略以保持简洁
    handleFocus(row) {
      this.autorule = [];
      if (!row.resultType || row.resultType == 2 ) {
@@ -1286,6 +1355,8 @@
    },
    changDesc(item) {
      console.log(item);
      item.conclusion = item.exceptionDesc ? "异常" : "正常";
    },
@@ -1804,6 +1875,7 @@
      }];
      getaddRemark(data).then((res) => {
        this.$modal.msgSuccess("提交成功");
    this.rows = []; // 提交成功后清空 this.rows
        this.drawer = false;
      });
      this.handleClose();
src/views/doctor/checkAll/index.vue
@@ -720,8 +720,7 @@
        <el-button @click="jianqians = false">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog title="新增异常结果" :visible.sync="addNewDialogVisible" width="900px" :before-close="handleAddNewClose"
      class="custom-dialog">
    <el-dialog title="新增异常结果" :visible.sync="addNewDialogVisible" width="900px" class="custom-dialog">
      <el-form :model="newItem" ref="newItemForm" label-width="100px" class="custom-form">
        <el-form-item label="项目分类" prop="parentName">
          <el-select v-model="newItem.parentName" placeholder="请选择项目分类" clearable filterable
@@ -771,7 +770,7 @@
        <el-form :inline="true">
          <el-form-item label="建议名称">
            <el-input v-model="queryParams1.zyzd" placeholder="请输入建议名称进行筛选" clearable style="width: 200px"
              @input="filterAdvices(true)" onkeydown="if(event.keyCode === 32) return false;" />
              @input="filterAdvices(true)" onkeydown="if(event.keyCode === 32 || event.keyCode === 13) return false;" />
          </el-form-item>
        </el-form>
      </div>
@@ -1044,6 +1043,7 @@
    });
  },
  methods: {
    handleAdviceBlur(row, index) {
      // 构造 advices 数据
      let advicesToSubmit = [];
@@ -1205,12 +1205,6 @@
      if (value) {
        this.newItem.jcxm = value; // 将选择的项目分类赋值给检测项目
      }
    },
    handleAddNewClose(done) {
      // this.$confirm('确定关闭新增窗口吗?未保存的数据将丢失。')
      //   .then(() => done())
      //   .catch(() => { });
    },
    // 添加新的建议组
src/views/sampling/sampling/index.vue
@@ -104,9 +104,9 @@
        </el-table>
      </div>
      <div style="width: 50%">
        <!-- v-if="this.rightTabShow"  v-if="tableList.length > 0"-->
        <el-table v-loading="loading" :data="tableList" @selection-change="handleChange" :span-method="objectSpanMethod"
          ref="elTable" :row-class-name="tableRowClassName" border height="520px">
        <!-- v-if="this.rightTabShow" -->
        <el-table v-if="tableList.length > 0" v-loading="loading" :data="tableList" @selection-change="handleChange"
          :span-method="objectSpanMethod" ref="tab1" :row-class-name="tableRowClassName" border height="520px">
          <el-table-column type="selection" width="40" align="center" />
          <!--  :selectable="selectEnable" -->
          <!-- <el-table-column label="是否签收" align="center" prop="isSignFor" /> -->
@@ -540,68 +540,31 @@
      if (this.createTimeList) {
        this.queryParams.beginTime = this.createTimeList[0];
        this.queryParams.endTime = this.createTimeList[1];
      } else if (this.createTimeList == null) {
      } else {
        this.queryParams.beginTime = null;
        this.queryParams.endTime = null;
      }
      getList(this.queryParams).then((response) => {
        this.loading1 = false;
        if (response.data) {
          if (!response.data.list || response.data.list.length === 0) {
            this.samplingList = [];
            this.tableList = [];
            this.loading1 = false;
            this.loading = false;
            return;
          } else {
        if (response.data && response.data.list && response.data.list.length > 0) {
            this.samplingList = response.data.list;
            // 判断是否需要刷新右边表格
            this.$nextTick(() => {
              this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
              // 检查是否全选
              if (this.samplingList.length === this.selectedRows.length) {
                this.disableSelections = true;
              } else {
                this.disableSelections = false;
              }
            });
          }
          this.total = response.data.total;
          this.loading1 = false;
        } else {
          this.samplingList = [];
          this.tableList = [];
          this.loading1 = false;
        }
      });
      /* getList(this.queryParams).then((response) => {
        if (response.data) {
          if (response.data.list == null) {
            this.samplingList = [];
            this.tableList = [];
            this.loading = false;
          } else {
            this.samplingList = response.data.list;
            console.log(this.samplingList,888);
            this.loading = false;
            if (this.samplingList.length != 0) {
              this.$nextTick(() => {
                this.$refs.tb.toggleRowSelection(this.samplingList[0], true);
            this.$refs.tb.toggleRowSelection(this.samplingList[0], true); // 默认选中第一行
            this.fetchData(this.samplingList[0].tjNumber); // 刷新右侧表格
              });
            } else {
              this.$refs.tb.clearSelection();
            }
          }
          this.total = response.data.total;
          this.loading = false;
        } else {
          this.samplingList = [];
          this.tableList = [];
          this.loading = false;
          this.selectList = []; // 清空 selectList
          this.ids = []; // 清空 ids
          if (this.$refs.tab1) {
            this.$refs.tab1.clearSelection(); // 清空右侧表格选中状态
        }
      }); */
        }
        this.loading1 = false;
      });
    },
    // 取消按钮
    cancel() {
@@ -695,10 +658,18 @@
              this.tableList = response.data;
              this.$nextTick(() => {
      this.$refs.elTable.doLayout(); // 通过 ref 调用表格方法
                if (this.$refs.tab1) {
                  this.$refs.tab1.clearSelection(); // 清空之前的选中状态
                }
    });
              resolve(this.tableList);
            } else {
              this.tableList = [];
              this.selectList = [];
              this.ids = [];
              if (this.$refs.tab1) {
                this.$refs.tab1.clearSelection();
              }
              resolve([]);
            }
          })
@@ -965,23 +936,26 @@
    // 确认采样
    Confirmreceipt() {
      const loadingInstance = this.$loading({
        lock: true, // 锁定屏幕
        text: "加载中...", // 加载文本
        spinner: "el-icon-loading", // 自定义加载图标
        background: "rgba(255, 255, 255, 0.7)", // 背景颜色
        lock: true,
        text: "加载中...",
        spinner: "el-icon-loading",
        background: "rgba(255, 255, 255, 0.7)",
      });
      confirmSampling(this.ids)
        .then((res) => {
          console.log(this.selectList, 2222);
          if (res.code === 200) {
            this.buda();
            this.getList();
            this.buda(); // 打印条码
            this.$refs.tab1.clearSelection(); // 清除右侧表格的选中状态
            this.selectList = []; // 清空 selectList
            this.ids = []; // 清空 ids
            this.getList(); // 刷新左侧表格
            console.log("采样后 - selectList:", this.selectList, "qiehuan:", this.qiehuan);
          } else {
            this.$message.error(res.msg);
          }
        })
        .catch((error) => {
          console.error("采样失败:", error);
        })
        .finally(() => {
          loadingInstance.close();