qx
2025-06-05 53606eac81e6d3a76937c4cb6f45ad61581cb4da
src/views/doctor/inspectCheck/index.vue
@@ -6,6 +6,7 @@
      size="small"
      :inline="true"
      label-width="68px"
      @submit.native.prevent
    >
      <el-form-item label="体检号" prop="reportDoctorCode">
        <el-input
@@ -39,16 +40,162 @@
          size="mini"
          style="margin-right: 15px"
          @click="tongbu"
          :disabled="!selectedFirstTable"
          >同步</el-button
        >
      </el-form-item>
    </el-form>
    <div class="table-title">
    <!-- <div class="table-title">
      <h3>检验记录</h3>
    </div> -->
    <div class="box">
      <div
        style="text-align: center; background-color: #aad8df; margin-top: 10px"
      >
        检验记录
        <!-- {{ item.parent || "" }} -->
      </div>
      <div>
        <el-table
          :data="exaLists"
          border
          style="width: 100%"
          @selection-change="handleSelectionChange"
          :header-cell-style="{ background: '#aad8df' }"
          height="350"
        >
          <el-table-column
            fixed
            type="selection"
            align="center"
            label="选择"
            width="40"
          >
          </el-table-column>
          <el-table-column
            label="姓名"
            align="center"
            prop="name"
            width="80px"
          />
          <el-table-column
            label="性别"
            align="center"
            prop="gender"
            width="80px"
          />
          <el-table-column
            label="年龄"
            align="center"
            prop="patientAge"
            width="80px"
          >
          </el-table-column>
          <el-table-column
            label="送检科室"
            align="center"
            prop="deptName"
            width="100px"
          />
          <el-table-column
            label="检验项目"
            align="center"
            prop="checkParts"
            width="350px"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="项目编号"
            align="center"
            prop="jcxmid"
            width="150px"
          />
          <el-table-column
            label="审核医师"
            align="center"
            prop="shys"
            width="150px"
          />
          <el-table-column
            label="报告时间"
            align="center"
            prop="examinationDate"
            width="150px"
          />
          <!-- :formatter="formatDate" -->
          <el-table-column
            label="门诊号"
            align="center"
            prop="mzh"
            width="140px"
          />
          <el-table-column
            label="申请单号"
            align="center"
            prop="brid"
            width="145px"
          />
          <el-table-column
            label="报告医师"
            align="center"
            prop="reportDoctorName"
            width="120px"
          />
          <el-table-column
            label="检验医师名"
            align="center"
            prop="checkDoctorName"
            width="120px"
          />
          <el-table-column align="center" label="检测项目" width="100px ">
            <template slot-scope="scope">
              <div>{{ scope.row.proName }}</div>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="proResult"
            label="检测结果"
            width="180"
          >
          </el-table-column>
          <el-table-column align="center" prop="company" label="单位">
            <!--    <template slot-scope="scope">
              <div v-if="scope.row.project != null">
                {{ scope.row.standard.company || "" }}
              </div>
              <div v-else>{{ scope.row.proAdvice }}</div>
            </template> -->
          </el-table-column>
          <el-table-column
            align="center"
            prop="conclusion"
            label="异常"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="tjStandardGtValue"
            label=" 参考范围"
          >
            <!--   <template slot-scope="scope">
              <div v-if="scope.row.project != null">
                {{
                  scope.row.standard.tjStandardGtValue ||
                  "/" + "-" + scope.row.standard.tjStandardLtValue ||
                  "/"
                }}
              </div>
            </template> -->
          </el-table-column>
        </el-table>
      </div>
    </div>
    <el-table
    <!--  <el-table
      id="ta"
      ref="tb"
      :data="exaLists"
@@ -131,17 +278,18 @@
        prop="examination"
        :show-overflow-tooltip="true"
      />
    </el-table>
    </el-table> -->
    <div class="table-title">
      <h3>体检记录</h3>
    </div>
    <el-table
      border
      max-height="280"
      height="350"
      ref="tab1"
      :data="checkList"
      v-loading="loading"
      style="width: 100%"
      @selection-change="handleSelectionChangeSecond"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
@@ -184,7 +332,7 @@
        min-width="80"
      />
      <el-table-column
        label="检查时间"
        label="检验时间"
        align="center"
        prop="bcupdateTime"
        min-width="160"
@@ -202,6 +350,7 @@
  
  <script>
import { getlisList, getJyTjList, asyncPacs } from "@/api/doctor/pacsCheck";
import moment from "moment";
export default {
  dicts: ["dict_tj_status"],
@@ -277,50 +426,58 @@
    });
  },
  methods: {
    handleDateChange(val){
    handleDateChange(val) {
      if (val && val.length === 2) {
        this.queryParams.start = val[0]; // 设置开始时间
        this.queryParams.end = val[1];   // 设置结束时间
        this.queryParams.end = val[1]; // 设置结束时间
      } else {
        this.queryParams.start = null;
        this.queryParams.end = null;
      }
      console.log('Query Params:', this.queryParams);
      console.log("Query Params:", this.queryParams);
    },
    /* formatDate(row) {
      if (!row.examinationDate) return "";
    },
    isSelectable(row) {
      return !!row.mzh;
    },
      // 使用 moment 解析指定格式的日期字符串
      const date = moment(row.examinationDate, "MM DD YYYY hh:mmA");
      if (!date.isValid()) return "无效日期";
      // 格式化为所需格式
      return date.format("YYYY-MM-DD HH:mm");
    }, */
    // isSelectable(row) {
    //   return !!row.mzh;
    // },
    tableRowClassName({ row }) {
      return !row.mzh ? "row-disabled" : "";
    },
    handleSelectionChange(val) {
      console.log(val);
      if (val.length > 1) {
      // console.log(val);
      /*  if (val.length > 1) {
        let del_row = val.shift();
        this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      console.log(val, 999);
      console.log(val, 999); */
      if (val.length > 0) {
        const selectedRow = val[0];
        console.log(val[0], 555);
        // const selectedRow = val[0];
        // console.log(val[0], 555);
        this.selectedFirstTable = selectedRow;
        this.selectedFirstTable = val;
        console.log("当前选中的行数据:", this.selectedFirstTable);
        this.fetchRightTableData(selectedRow);
        this.fetchRightTableData(val);
      } else {
        this.selectedFirstTable = null;
        this.checkList = [];
      }
    },
    // 根据选中的行数据请求右边表格数据
    fetchRightTableData(selectedRow) {
      const code = selectedRow.mzh;
      if (!code) return;
      this.loading = true;
    fetchRightTableData() {
      const code = queryParams.tjNum;
      // if (!code) return;
      getJyTjList(code).then((response) => {
        this.checkList = response.data;
        this.loading = false;
@@ -329,6 +486,10 @@
    handleSelectionChangeSecond(selectedRows) {
      this.selectedSecondTable = selectedRows;
      if (selectedRows.length > 1) {
        let del_row = selectedRows.shift();
        this.$refs.tab1.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      console.log("当前选中的行数据:", this.selectedSecondTable);
    },
    getList() {
@@ -345,13 +506,21 @@
    handleQuery() {
      // this.queryParams.page = 1;
      this.loading = true;
      if (!this.queryParams.tjNum) {
        this.loading = false;
        this.$message.error("体检号不能为空");
        return; // 终止请求
      }
      getlisList(this.queryParams)
        .then((res) => {
          console.log(res, 1111);
          if (res.code == 200) {
            this.loading = false;
            this.exaLists = res.data;
            this.code = this.exaLists.mzh;
            // const code = this.exaLists[0].mzh;
            const code = this.queryParams.tjNum;
            getJyTjList(code).then((response) => {
              this.checkList = response.data;
            });
          }
        })
        .catch((error) => {
@@ -392,14 +561,19 @@
      this.$modal.loading("正在同步,请稍候...");
      this.setTime();
      const requestData = {
        pacs: this.selectedFirstTable, // 左侧表格选中数据
        lis: this.selectedFirstTable.map((item) => ({
          ...item,
          tjNum: this.queryParams.tjNum,
        })),
        jcxmid: this.selectedFirstTable.jcxmid,
        shys: this.selectedFirstTable.shys,
        tj: this.selectedSecondTable[0], // 右侧表格选中数据
      };
      if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
      /*   if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
        this.$message.error("至少选一条数据!");
        return;
      }
      } */
      asyncPacs(requestData)
        .then((res) => {
@@ -417,7 +591,7 @@
          clearInterval(this.clearTimeSet);
          this.clearTimeSet = null;
          this.$modal.closeLoading();
        })
        });
    },
  },
};
@@ -437,7 +611,7 @@
.table-title {
  text-align: center;
  margin-bottom: 15px;
  margin-bottom: 10px;
}
.row-disabled {
  color: #ccc; /* 设置禁用行的字体颜色 */