1
wwl
2025-06-20 57f19e77e693f2bd4b18b1a36661216b987c6388
1
4个文件已修改
1257 ■■■■■ 已修改文件
src/views/doctor/inspectCheck/index.vue 597 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/pacsCheck/index.vue 535 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/zhiye/index.vue 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doctor/inspectCheck/index.vue
@@ -1,160 +1,67 @@
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      label-width="68px"
      @submit.native.prevent
    >
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" @submit.native.prevent>
      <el-form-item label="体检号" prop="reportDoctorCode">
        <el-input
          ref="inputName"
          v-model="queryParams.tjNum"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
        />
        <el-input ref="inputName" v-model="queryParams.tjNum" placeholder="请输入体检号" clearable
          @keyup.enter.native="handleQuery" style="width: 170px" />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          style="margin-right: 15px"
          >查询</el-button
        >
        <el-button
          icon="el-icon-refresh"
          type="primary"
          size="mini"
          @click="resetQuery"
          >重置</el-button
        >
        <el-button
          icon="el-icon-check"
          type="primary"
          size="mini"
          style="margin-right: 15px"
          @click="tongbu"
          :disabled="!selectedFirstTable"
          >同步</el-button
        >
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" style="margin-right: 15px">
          查询
        </el-button>
        <el-button icon="el-icon-refresh" type="primary" size="mini" @click="resetQuery">
          重置
        </el-button>
        <el-button icon="el-icon-check" type="primary" size="mini" style="margin-right: 15px" @click="tongbu">
          同步
        </el-button>
      </el-form-item>
    </el-form>
    <div class="table-title">
      <h3>检验记录</h3>
    <div class="box">
      <div class="table-header">
        检验记录
    </div>
    <el-table
      id="ta"
      ref="tb"
      :data="exaLists"
      v-loading="loading"
      border
      style="width: 100%"
      height="350"
      @selection-change="handleCurrentChange"
      :header-cell-style="{ background: '#aad8df' }"
    >
    <!--  @selection-change="handleSelectionChange"  :row-class-name="tableRowClassName" -->
      <el-table-column
        fixed
        type="selection"
        align="center"
        label="选择"
        width="40"
      >
      <!--    :selectable="isSelectable" -->
      <div>
        <el-table :data="exaLists" border style="width: 100%" @selection-change="handleSelectionChange"
          :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }" height="350" ref="firstTable">
          <el-table-column fixed type="selection" align="center" label="选择" width="50" />
          <el-table-column label="姓名" align="center" prop="name" width="80" />
          <el-table-column label="性别" align="center" prop="gender" width="80" />
          <el-table-column label="年龄" align="center" prop="patientAge" width="80" />
          <el-table-column label="送检科室" align="center" prop="deptName" width="100" />
          <el-table-column label="检验项目" align="center" prop="checkParts" width="350" :show-overflow-tooltip="true" />
          <el-table-column label="项目编号" align="center" prop="jcxmid" width="150" />
          <el-table-column label="审核医师" align="center" prop="shys" width="150" />
          <el-table-column label="报告时间" align="center" prop="examinationDate" width="150" />
          <el-table-column label="门诊号" align="center" prop="mzh" width="140" />
          <el-table-column label="申请单号" align="center" prop="brid" width="145" />
          <el-table-column label="报告医师" align="center" prop="reportDoctorName" width="120" />
          <el-table-column label="检验医师名" align="center" prop="checkDoctorName" width="120" />
          <el-table-column align="center" label="检测项目" width="100">
            <template slot-scope="scope">
              <div>{{ scope.row.proName }}</div>
            </template>
      </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="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="diagnosis"
        width="150"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="报告医师"
        align="center"
        prop="reportDoctorName"
        width="120px"
      />
      <el-table-column
        label="检查医师名"
        align="center"
        prop="checkDoctorName"
        width="120px"
      />
      <el-table-column
        label="结果表现"
        align="center"
        prop="examination"
        :show-overflow-tooltip="true"
      />
          <el-table-column align="center" prop="proResult" label="检测结果" width="180" />
          <el-table-column align="center" prop="company" label="单位" width="80" />
          <el-table-column align="center" prop="conclusion" label="异常" width="180" />
          <el-table-column align="center" prop="tjStandardGtValue" label="参考范围" width="120" />
    </el-table>
    <div class="table-title">
      <h3>体检记录</h3>
    </div>
    <el-table
      border
      max-height="280"
      ref="tab1"
      :data="checkList"
      v-loading="loading"
    </div>
    <div class="table-title">
  <h3>
    体检记录:
    <span class="highlight">姓名:{{ infoList.tjCustomerName || "暂无" }}</span>
    <span class="highlight">性别:{{ infoList.tjCustomerSex == 0 ? "男" : infoList.tjCustomerSex == 1 ? "女" : "暂无" }}</span>
    <span class="highlight">年龄:{{ infoList.tjCustomerAge || "暂无" }}</span>
  </h3>
</div>
    <el-table border 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>
      <el-table-column
        label="状态"
        align="center"
        prop="type"
        :show-overflow-tooltip="true"
        min-width="60"
      >
      :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }">
      <el-table-column type="selection" width="60" />
      <el-table-column label="状态" align="center" prop="type" :show-overflow-tooltip="true" min-width="60">
        <template slot-scope="scope">
          <span v-if="scope.row.type == '0'">未检</span>
          <span v-if="scope.row.type == '1'">已检</span>
@@ -162,76 +69,44 @@
          <span v-if="scope.row.type == '3'">延期</span>
        </template>
      </el-table-column>
      <el-table-column
        label="科室"
        align="center"
        prop="deptName"
        min-width="115"
      />
      <el-table-column
        label="项目"
        align="center"
        prop="proName"
        min-width="160"
      />
      <el-table-column
        label="收费方式"
        align="center"
        prop="sffs"
        min-width="80"
      />
      <el-table-column
        label="是否收费"
        align="center"
        prop="isPay"
        min-width="80"
      />
      <el-table-column
        label="检查时间"
        align="center"
        prop="bcupdateTime"
        min-width="160"
      />
      <el-table-column
        label="最后修改时间"
        align="center"
        prop="zhupdateTime"
        min-width="160"
      />
      <el-table-column label="科室" align="center" prop="deptName" min-width="115" />
      <el-table-column label="项目" align="center" prop="proName" min-width="160" />
      <el-table-column label="收费方式" align="center" prop="sffs" min-width="80" />
      <el-table-column label="是否收费" align="center" prop="isPay" min-width="80" />
      <el-table-column label="检验时间" align="center" prop="bcupdateTime" min-width="160" />
      <el-table-column label="最后修改时间" align="center" prop="zhupdateTime" min-width="160" />
    </el-table>
  </div>
</template>
  <script>
import { getlisList, getJyTjList, asyncPacs } from "@/api/doctor/pacsCheck";
import { getOrderList } from "@/api/hosp/order";
import moment from "moment";
export default {
  dicts: ["dict_tj_status"],
  data() {
    return {
        isProcessing: false, // 防止死循环
    isDeselection: false, // 标记是否为取消选中
      infoList: {},
      dis: false,
      code: null,
      createTimeList: "",
      total: 0,
      loading: false,
      isSyncing: false,
      // 查询参数
      isFetchingRightTableData: false,
      queryParams: {
        // page: 1,
        // pageSize: 20,
        name: null,
        start: null,
        end: null,
        tjNum: null,
      },
      // 绑定单选按钮
      checkStatus: "0",
      exaLists: [],
      selectedFirstTable: null, // 第一个表格选中行
      selectedSecondTable: [], // 第二个表格选中行
      // 表单参数
      selectedFirstTable: null,
      selectedSecondTable: [],
      form: {},
      clearTimeSet: null,
      tjNumbers: "",
@@ -280,123 +155,199 @@
      this.$refs.inputName.focus();
    });
  },
  methods: {
    handleDateChange(val) {
      if (val && val.length === 2) {
        this.queryParams.start = val[0]; // 设置开始时间
        this.queryParams.end = val[1]; // 设置结束时间
        this.queryParams.start = val[0];
        this.queryParams.end = val[1];
      } else {
        this.queryParams.start = null;
        this.queryParams.end = null;
      }
      console.log("Query Params:", this.queryParams);
    },
    // isSelectable(row) {
    //   return !!row.mzh;
    // },
    tableRowClassName({ row }) {
      return !row.mzh ? "row-disabled" : "";
      return !row.brid ? "row-disabled" : "";
    },
    handleSelectionChange(val) {
      console.log(val);
      /*  if (val.length > 1) {
        let del_row = val.shift();
        this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
  // 防止重复触发
  if (this.isProcessingSelection) {
    return;
      }
      console.log(val, 999); */
  this.isProcessingSelection = true;
      if (val.length > 0) {
        // const selectedRow = val[0];
        // console.log(val[0], 555);
        this.selectedFirstTable = val;
        console.log("当前选中的行数据:", this.selectedFirstTable);
        // this.fetchRightTableData(selectedRow);
      } else {
  // 如果没有选中行,清空所有选择并跳过接口调用
  if (val.length === 0) {
    this.$refs.firstTable.clearSelection();
        this.selectedFirstTable = null;
        this.checkList = [];
      }
    },
    handleSelectionChange(val) {
      console.log(val);
      if (val.length > 1) {
        let del_row = val.shift();
        this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      console.log(val, 999);
      if (val.length > 0) {
        const selectedRow = val[0];
        console.log(val[0], 555);
        this.selectedFirstTable = selectedRow;
        console.log("当前选中的行数据:", this.selectedFirstTable);
        this.fetchRightTableData(selectedRow);
      } else {
        this.selectedFirstTable = null;
        this.checkList = [];
      }
    },
    // 根据选中的行数据请求右边表格数据
    fetchRightTableData(selectedRow) {
      const code = selectedRow.mzh;
      if (!code) return;
      this.loading = true;
      getJyTjList(code).then((response) => {
        this.checkList = response.data;
        this.loading = false;
    this.isDeselection = true;
    this.$nextTick(() => {
      this.isProcessingSelection = false;
      this.$refs.firstTable.$forceUpdate(); // 强制刷新表格
      });
    return;
  }
  // 检查是否点击了全选按钮(val 长度等于表格总行数)
  if (val.length === this.exaLists.length) {
    this.selectedFirstTable = [...this.exaLists]; // 选中所有行
    this.$refs.firstTable.clearSelection();
    this.exaLists.forEach(row => {
      if (!row.brid) {
        return;
      }
      this.$refs.firstTable.toggleRowSelection(row, true, false);
    });
  } else {
    // 获取最新选中的行
    const latestSelectedRow = val[val.length - 1];
    // 检查是否点击了已选中的行(取消所有选中)
    const isTogglingSelectedRow = this.selectedFirstTable && this.selectedFirstTable.some(row => row.tempId === latestSelectedRow.tempId);
    if (isTogglingSelectedRow) {
      this.$refs.firstTable.clearSelection();
      this.selectedFirstTable = null;
      this.checkList = [];
      this.isDeselection = true;
      this.$nextTick(() => {
        this.isProcessingSelection = false;
        this.$refs.firstTable.$forceUpdate(); // 强制刷新表格
      });
      return;
    }
    // 正常选中逻辑:根据 brid 筛选
    const filterKey = 'brid';
    const filterValue = latestSelectedRow.brid;
    // 清空所有选中状态
    this.$refs.firstTable.clearSelection();
    // 选中与 brid 匹配的行
    const rowsToSelect = this.exaLists.filter(row => row.brid === filterValue);
    rowsToSelect.forEach(row => {
      if (!row.brid) {
        console.warn(`名称为 ${row.name} 的行没有申请单号,跳过选择`);
        return;
      }
      this.$refs.firstTable.toggleRowSelection(row, true, false);
    });
    // 更新 selectedFirstTable 为 brid 匹配的行
    this.selectedFirstTable = rowsToSelect;
  }
  // 调用右侧表格数据
  if (!this.isFetchingRightTableData && this.selectedFirstTable.length > 0) {
    this.isFetchingRightTableData = true;
    this.fetchRightTableData().finally(() => {
      this.isFetchingRightTableData = false;
      this.$nextTick(() => {
        // 仅更新样式,不触发新事件
        this.$refs.firstTable.$forceUpdate();
        this.isProcessingSelection = false;
      });
    });
  } else {
    this.isProcessingSelection = false;
  }
  // 重置 isDeselection 状态
  this.isDeselection = false;
    },
    formatDate(row) {
      if (!row.examinationDate) return "";
      // 使用 moment 解析指定格式的日期字符串
      const date = moment(row.examinationDate, "MM DD YYYY hh:mmA");
      if (!date.isValid()) return "无效日期";
      // 格式化为所需格式
      return date.format("YYYY-MM-DD HH:mm");
    fetchRightTableData() {
      const code = this.queryParams.tjNum;
      if (!code) {
        console.warn('未提供体检号,跳过 fetchRightTableData');
        this.checkList = [];
        this.loading = false;
        return Promise.resolve();
      }
      this.loading = true;
      return getJyTjList(code)
        .then((response) => {
          this.checkList = response.data || [];
          this.loading = false;
        })
        .catch((error) => {
          console.error('获取 checkList 失败:', error);
          this.checkList = [];
          this.loading = false;
          throw error;
        });
    },
    handleSelectionChangeSecond(selectedRows) {
      this.selectedSecondTable = selectedRows;
      console.log("当前选中的行数据:", this.selectedSecondTable);
      if (selectedRows.length > 1) {
        let del_row = selectedRows.shift();
        this.$refs.tab1.toggleRowSelection(del_row, false);
      }
    },
    getList() {
    async handleQuery() {
      if (!this.queryParams.tjNum) {
        this.$message.error("体检号不能为空");
        return;
      }
      this.loading = true;
      try {
        // 并行执行两个查询
        const [orderResponse, lisResponse] = await Promise.all([
          getOrderList(this.queryParams).catch((error) => {
            console.error('获取 orderList 失败:', error);
            return { data: { list: [] } }; // 返回空数据以继续执行
          }),
          getlisList(this.queryParams),
        ]);
        // 处理 getOrderList 结果
        if (orderResponse.data?.list?.length > 0) {
          this.infoList = orderResponse.data.list[0];
        } else {
          this.infoList = {};
          console.warn('getOrderList 返回空列表');
        }
        // 处理 getlisList 结果
        if (lisResponse.code === 200) {
          this.exaLists = lisResponse.data.map((item, index) => ({
            ...item,
            brid: item.brid?.trim(), // 清理空格
            mzh: item.mzh?.trim(),
            tempId: index,
          }));
          // 获取右侧表格数据
          await this.fetchRightTableData();
        } else {
          this.exaLists = [];
          this.$message.error(lisResponse.msg || "查询检验记录失败");
        }
      } catch (error) {
        console.error('查询失败:', error);
        this.$message.error(error?.msg || "查询失败,请稍后重试");
        this.exaLists = [];
        this.checkList = [];
        this.infoList = {};
      } finally {
        this.loading = false;
      }
      // 处理时间范围
      if (this.createTimeList) {
        this.queryParams.start = this.createTimeList[0];
        this.queryParams.end = this.createTimeList[1];
      } else if (this.createTimeList == null) {
      } else {
        this.queryParams.start = null;
        this.queryParams.end = null;
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      // this.queryParams.page = 1;
      this.loading = true;
      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;
          }
        })
        .catch((error) => {
          this.loading = false;
          this.$message.error(res.msg || "查询失败,请稍后重试");
        });
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.createTimeList = [];
      this.resetForm("queryForm");
@@ -406,40 +357,37 @@
        end: null,
        tjNum: null,
      };
      // 清空其他依赖数据
      this.checkList = [];
      this.exaLists = [];
      this.infoList = {};
    },
    handleCurrentChange(row) {
      this.currentRow = row;
      // console.log('当前选中的行:', row);
    },
    setTime() {
      //设置定时器
      this.clearTimeSet = setInterval(() => {
        this.$modal.closeLoading();
      }, 300000);
    },
    tongbu(row) {
    tongbu() {
      this.$modal.loading("正在同步,请稍候...");
      this.setTime();
      const requestData = {
        pacs: this.selectedFirstTable, // 左侧表格选中数据
        tj: this.selectedSecondTable[0], // 右侧表格选中数据
        lis: this.selectedFirstTable ? this.selectedFirstTable.map((item) => ({
          ...item,
          tjNum: this.queryParams.tjNum,
        })) : [],
        jcxmid: this.selectedFirstTable && this.selectedFirstTable.length > 0 ? this.selectedFirstTable[0].jcxmid : null,
        shys: this.selectedFirstTable && this.selectedFirstTable.length > 0 ? this.selectedFirstTable[0].shys : null,
        tj: this.selectedSecondTable[0],
      };
      if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
        this.$message.error("至少选一条数据!");
        return;
      }
      asyncPacs(requestData)
        .then((res) => {
          if (res.code == 200) {
            this.fetchRightTableData(this.selectedFirstTable);
          if (res.code === 200) {
            this.fetchRightTableData();
            clearInterval(this.clearTimeSet);
            this.clearTimeSet = null;
            this.$modal.closeLoading();
@@ -455,38 +403,61 @@
        });
    },
  },
};
</script>
};</script>
  <style lang="scss" scoped>
#ta .el-table__header-wrapper .el-checkbox {
  display: none;
.app-container {
  padding: 20px;
  background: #f5f7fa;
}
.table-header {
  text-align: center;
  background-color: #aad8df;
  padding: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-top: 10px;
  border-radius: 4px 4px 0 0;
}
.table-title {
  text-align: left;
  margin: 20px 0;
  padding: 10px 0;
}
.table-title h3 {
  font-size: 16px;
  color: #333;
  margin: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.table-title .highlight {
  font-weight: bold;
  color: #2c3e50;
}
.el-table {
  border-radius: 4px;
  font-size: 14px;
}
.el-table .warning-row {
  background: #e5f3ff !important;
}
::v-deep .el-table__body tr.current-row > td {
  background: #edf2fa !important;
}
.table-title {
  text-align: center;
  margin-bottom: 15px;
}
.row-disabled {
  color: #ccc; /* 设置禁用行的字体颜色 */
  pointer-events: none; /* 禁止鼠标操作 */
  background-color: #f5f5f5; /* 设置禁用行的背景色 */
}
.pag {
  width: 100%;
  display: flex;
  justify-content: center;
}
.pag1 {
  width: 30%;
  color: #999;
  background-color: #f5f5f5;
}
</style>
src/views/doctor/pacsCheck/index.vue
@@ -1,195 +1,60 @@
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      label-width="68px"
      @submit.native.prevent
    >
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" @submit.native.prevent>
      <el-form-item label="体检号" prop="reportDoctorCode">
        <el-input
          ref="inputName"
          v-model="queryParams.tjNum"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
          @input="onInput"
        />
        <el-input ref="inputName" v-model="queryParams.tjNum" placeholder="请输入体检号" clearable
          @keyup.enter.native="handleQuery" @input="onInput" style="width: 170px" />
      </el-form-item>
      <!--  <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 110px"
        />
      </el-form-item>
      <el-form-item label="登记时间" prop="createTimeList">
        <el-date-picker
          v-model="createTimeList"
          type="datetimerange"
          align="right"
          :picker-options="pickerOptions"
          style="width: 310px"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          format="yyyy.MM.dd"
          value-format="yyyy.MM.dd "
          @change="handleDateChange"
        >
        </el-date-picker>
      </el-form-item> -->
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          style="margin-right: 15px"
          >查询</el-button
        >
        <!-- <el-button size="mini"  @click="tongbu(scope.row)"
          >同步</el-button
        > -->
        <el-button
          icon="el-icon-refresh"
          type="primary"
          size="mini"
          @click="resetQuery"
          >重置</el-button
        >
        <el-button
          icon="el-icon-check"
          type="primary"
          size="mini"
          style="margin-right: 15px"
          @click="tongbu"
          :disabled="!selectedFirstTable"
          >同步</el-button
        >
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" style="margin-right: 15px">
          查询
        </el-button>
        <el-button icon="el-icon-refresh" type="primary" size="mini" @click="resetQuery">
          重置
        </el-button>
        <el-button icon="el-icon-check" type="primary" size="mini" style="margin-right: 15px" @click="tongbu"
          :disabled="!selectedFirstTable">
          同步
        </el-button>
      </el-form-item>
    </el-form>
    <!-- <el-radio-group
      v-model="checkStatus"
      @input="radioChange"
      style="margin: 10px 15px"
    >
    </el-radio-group> -->
    <div class="table-title">
      <h3>检查记录</h3>
    <div class="table-title table-header">
      <div style="text-align: center;">检查记录</div>
    </div>
    <!--  v-loading="loading" :row-class-name="tableRowClassName"  @current-change="handleCurrentChange" -->
    <el-table
      id="ta"
      ref="tb"
      :data="exaLists"
      v-loading="loading"
      border
      height="350"
      @current-change="handleCurrentChange"
      @selection-change="handleSelectionChange"
    <el-table ref="tb" :data="exaLists" v-loading="loading" border style="width: 100%" height="350"
      @current-change="handleCurrentChange" @selection-change="handleSelectionChange"
      :row-class-name="tableRowClassName"
    >
      <el-table-column
        fixed
        type="selection"
        align="center"
        label="选择"
        width="40"
      >
        <!--   :selectable="isSelectable" -->
      </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="150px"
      />
      <!-- :formatter="formatDate" -->
      <el-table-column
        label="报告时间"
        align="center"
        prop="examinationDate"
        width="150px"
      />
      <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="diagnosis"
        width="150"
        :show-overflow-tooltip="true"
      />
      <!--  :show-overflow-tooltip="true" -->
      <el-table-column
        label="报告医师"
        align="center"
        prop="reportDoctorName"
        width="120px"
      />
      <el-table-column
        label="检查医师名"
        align="center"
        prop="checkDoctorName"
        width="120px"
      />
      <el-table-column
        label="结果表现"
        align="center"
        prop="examination"
        :show-overflow-tooltip="true"
      />
      :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }">
      <el-table-column fixed type="selection" align="center" label="选择" width="50" />
      <el-table-column label="姓名" align="center" prop="name" width="80" />
      <el-table-column label="性别" align="center" prop="gender" width="80" />
      <el-table-column label="年龄" align="center" prop="patientAge" width="80" />
      <el-table-column label="送检科室" align="center" prop="deptName" width="100" />
      <el-table-column label="检查项目" align="center" prop="checkParts" width="150" />
      <el-table-column label="报告时间" align="center" prop="examinationDate" width="153" :formatter="formatDate" />
      <el-table-column label="门诊号" align="center" prop="mzh" width="140" />
      <el-table-column label="申请单号" align="center" prop="brid" width="145" />
      <el-table-column label="结果状态" align="center" prop="diagnosis" width="150" :show-overflow-tooltip="true" />
      <el-table-column label="报告医师" align="center" prop="reportDoctorName" width="120" />
      <el-table-column label="检查医师名" align="center" prop="checkDoctorName" width="120" />
      <el-table-column label="结果表现" align="center" prop="examination" :show-overflow-tooltip="true" />
    </el-table>
    <div class="table-title">
      <h3>体检记录</h3>
      <h3>
        体检记录:
        <span class="highlight">姓名:{{ infoList.tjCustomerName || "暂无" }}</span>
        <span class="highlight">性别:{{ infoList.tjCustomerSex == 0 ? "男" : infoList.tjCustomerSex == 1 ? "女" : "暂无"
          }}</span>
        <span class="highlight">年龄:{{ infoList.tjCustomerAge || "暂无" }}</span>
      </h3>
    </div>
    <el-table
      border
      max-height="280"
      ref="tab1"
      :data="checkList"
      v-loading="loading"
    <el-table border max-height="280" ref="tab1" :data="checkList" v-loading="loading" style="width: 100%"
      @selection-change="handleSelectionChangeSecond"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column
        label="状态"
        align="center"
        prop="type"
        :show-overflow-tooltip="true"
        min-width="60"
      >
      :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }">
      <el-table-column type="selection" width="60" />
      <el-table-column label="状态" align="center" prop="type" :show-overflow-tooltip="true" min-width="60">
        <template slot-scope="scope">
          <span v-if="scope.row.type == '0'">未检</span>
          <span v-if="scope.row.type == '1'">已检</span>
@@ -197,92 +62,42 @@
          <span v-if="scope.row.type == '3'">延期</span>
        </template>
      </el-table-column>
      <el-table-column
        label="科室"
        align="center"
        prop="deptName"
        min-width="115"
      />
      <el-table-column
        label="项目"
        align="center"
        prop="proName"
        min-width="160"
      />
      <el-table-column
        label="收费方式"
        align="center"
        prop="sffs"
        min-width="80"
      />
      <el-table-column
        label="是否收费"
        align="center"
        prop="isPay"
        min-width="80"
      />
      <el-table-column
        label="检查时间"
        align="center"
        prop="bcupdateTime"
        min-width="160"
      />
      <el-table-column
        label="最后修改时间"
        align="center"
        prop="zhupdateTime"
        min-width="160"
      />
      <el-table-column label="科室" align="center" prop="deptName" min-width="115" />
      <el-table-column label="项目" align="center" prop="proName" min-width="160" />
      <el-table-column label="收费方式" align="center" prop="sffs" min-width="80" />
      <el-table-column label="是否收费" align="center" prop="isPay" min-width="80" />
      <el-table-column label="检查时间" align="center" prop="bcupdateTime" min-width="160" />
      <el-table-column label="最后修改时间" align="center" prop="zhupdateTime" min-width="160" />
    </el-table>
    <div class="pag">
      <div class="pag1">
        <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page"
                  :page-sizes="pageSize" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="total">
              </el-pagination> -->
        <!-- <pagination
          v-show="total > 0"
          :total="total"
          :pager-count="5"
          :page.sync="queryParams.page"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        /> -->
      </div>
    </div>
  </div>
</template>
  <script>
import { getLeftList, getRightList, asyncPacs } from "@/api/doctor/pacsCheck";
import { getOrderList } from "@/api/hosp/order";
import moment from "moment";
export default {
  dicts: ["dict_tj_status"],
  data() {
    return {
      infoList: {},
      dis: false,
      code: null,
      createTimeList: "",
      total: 0,
      loading: false,
      isSyncing: false,
      // 查询参数
      isFetchingRightTableData: false,
      queryParams: {
        // page: 1,
        // pageSize: 20,
        name: null,
        start: null,
        end: null,
        tjNum: null,
      },
      // 绑定单选按钮
      checkStatus: "0",
      exaLists: [],
      selectedFirstTable: null, // 第一个表格选中行
      selectedSecondTable: [], // 第二个表格选中行
      // 表单参数
      selectedFirstTable: null,
      selectedSecondTable: [],
      form: {},
      clearTimeSet: null,
      tjNumbers: "",
@@ -331,82 +146,85 @@
      this.$refs.inputName.focus();
    });
  },
  methods: {
    onInput(val) {
      this.inputVal = val.replace(/\s+/g, ""); // 清除所有空格
      this.queryParams.tjNum = val.replace(/\s+/g, "");
    },
    handleDateChange(val) {
      if (val && val.length === 2) {
        this.queryParams.start = val[0]; // 设置开始时间
        this.queryParams.end = val[1]; // 设置结束时间
        this.queryParams.start = val[0];
        this.queryParams.end = val[1];
      } else {
        this.queryParams.start = null;
        this.queryParams.end = null;
      }
      console.log("Query Params:", this.queryParams);
    },
    // isSelectable(row) {
    //   return !!row.mzh;
    // },
    tableRowClassName({ row }) {
      return !row.mzh ? "row-disabled" : "";
      return !row.brid ? "row-disabled" : "";
    },
    formatDate(row) {
      if (!row.examinationDate) return "";
      // 使用 moment 解析指定格式的日期字符串
      const date = moment(row.examinationDate, "MM DD YYYY hh:mmA");
      if (!date.isValid()) return "无效日期";
      // 格式化为所需格式
      return date.format("YYYY-MM-DD HH:mm");
      const date = moment(row.examinationDate, "YYYY-MM-DD HH:mm:ss");
      return date.isValid() ? date.format("YYYY-MM-DD HH:mm") : "无效日期";
    },
    handleSelectionChange(val) {
      console.log(val);
      if (val.length > 1) {
        let del_row = val.shift();
        this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      // console.log(val, 999);
      if (val.length > 0) {
        const selectedRow = val[0];
        // console.log(val[0], 555);
        /*  if (!selectedRow.mzh) {
          this.$refs.tb.toggleRowSelection(selectedRow, false);
          this.$message.warning("当前行无有效门诊号,不能选中");
          return;
        } */
        this.selectedFirstTable = selectedRow;
        console.log("当前选中的行数据:", this.selectedFirstTable);
        this.selectedFirstTable = val;
        const code = this.queryParams.tjNum;
        if (!code) {
          this.$message.warning("体检号不能为空!");
          return; // 直接返回,避免继续执行请求
          return;
        }
        this.loading = true;
        getRightList(code).then((response) => {
          this.checkList = response.data;
          this.loading = false;
        });
        // this.fetchRightTableData(selectedRow);
      } else {
        this.selectedFirstTable = null;
        this.checkList = [];
      }
    },
    // 根据选中的行数据请求右边表格数据
    fetchRightTableData(selectedRow) {
      const code = this.queryParams.tjNum;
      // const code = selectedRow.mzh;
      // if (!code) return;
      this.loading = true;
      getRightList(code).then((response) => {
        this.checkList = response.data;
        this.loading = false;
      });
    },
    fetchRightTableData() {
      const code = this.queryParams.tjNum;
      if (!code) {
        console.warn('未提供体检号,跳过 fetchRightTableData');
        this.checkList = [];
        this.loading = false;
        return Promise.resolve();
      }
      this.loading = true;
      return getRightList(code)
        .then((response) => {
          this.checkList = response.data || [];
          this.loading = false;
        })
        .catch((error) => {
          console.error('获取 checkList 失败:', error);
          this.checkList = [];
          this.loading = false;
          throw error;
      });
    },
@@ -414,41 +232,66 @@
      this.selectedSecondTable = selectedRows;
      if (selectedRows.length > 1) {
        let del_row = selectedRows.shift();
        this.$refs.tab1.toggleRowSelection(del_row, false); //设置这一行取消选中
        this.$refs.tab1.toggleRowSelection(del_row, false);
      }
      console.log("当前选中的行数据:", this.selectedSecondTable);
    },
    getList() {
    async handleQuery() {
      if (!this.queryParams.tjNum) {
        this.$message.error("体检号不能为空");
        return;
      }
      this.loading = true;
      try {
        const [orderResponse, leftResponse] = await Promise.all([
          getOrderList(this.queryParams).catch((error) => {
            console.error('获取 orderList 失败:', error);
            return { data: { list: [] } };
          }),
          getLeftList(this.queryParams),
        ]);
        if (orderResponse.data?.list?.length > 0) {
          this.infoList = orderResponse.data.list[0];
        } else {
          this.infoList = {};
          console.warn('getOrderList 返回空列表');
        }
        if (leftResponse.code === 200) {
          this.exaLists = leftResponse.data.map((item, index) => ({
            ...item,
            brid: item.brid?.trim(),
            mzh: item.mzh?.trim(),
            tempId: index,
          }));
          await this.fetchRightTableData();
        } else {
          this.exaLists = [];
          this.$message.error(leftResponse.msg || "查询检查记录失败");
        }
      } catch (error) {
        console.error('查询失败:', error);
        this.$message.error(error?.msg || "查询失败,请稍后重试");
        this.exaLists = [];
        this.checkList = [];
        this.infoList = {};
      } finally {
        this.loading = false;
      }
      if (this.createTimeList) {
        this.queryParams.start = this.createTimeList[0];
        this.queryParams.end = this.createTimeList[1];
      } else if (this.createTimeList == null) {
      } else {
        this.queryParams.start = null;
        this.queryParams.end = null;
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      // this.queryParams.page = 1;
      this.loading = true;
      getLeftList(this.queryParams)
        .then((res) => {
          console.log(res, 1111);
          if (res.code == 200) {
            this.loading = false;
            this.exaLists = res.data;
            // this.code = this.exaLists.mzh;
          }
        })
        .catch((error) => {
          this.loading = false;
          this.$message.error(res.msg || "查询失败,请稍后重试");
        });
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.createTimeList = [];
      this.resetForm("queryForm");
@@ -458,19 +301,16 @@
        end: null,
        tjNum: null,
      };
      // 清空其他依赖数据
      this.checkList = [];
      this.exaLists = [];
      this.infoList = {};
    },
    handleCurrentChange(row) {
      this.currentRow = row;
      // console.log('当前选中的行:', row);
    },
    setTime() {
      //设置定时器
      this.clearTimeSet = setInterval(() => {
        this.$modal.closeLoading();
      }, 300000);
@@ -478,22 +318,19 @@
    tongbu(row) {
      this.$modal.loading("正在同步,请稍候...");
      this.setTime();
      // console.log(val, 66);
      this.selectedFirstTable.tjnum = this.queryParams.tjNum;
      const requestData = {
        pacs: this.selectedFirstTable, // 左侧表格选中数据
        pacs: this.selectedFirstTable.map((item) => ({
          ...item,
          tjNum: this.queryParams.tjNum,
        })),// 左侧表格选中数据
        tj: this.selectedSecondTable[0], // 右侧表格选中数据
      };
      if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
        this.$message.error("至少选一条数据!");
        return;
      }
      asyncPacs(requestData)
        .then((res) => {
          if (res.code == 200) {
            this.fetchRightTableData(this.selectedFirstTable);
          if (res.code === 200) {
            this.fetchRightTableData();
            clearInterval(this.clearTimeSet);
            this.clearTimeSet = null;
            this.$modal.closeLoading();
@@ -506,42 +343,72 @@
          clearInterval(this.clearTimeSet);
          this.clearTimeSet = null;
          this.$modal.closeLoading();
          // this.$modal.error("操作失败,请稍后重试");
          this.$message.error("同步失败,请稍后重试");
        });
    },
  },
};
</script>
  <style lang="scss" scoped>
#ta .el-table__header-wrapper .el-checkbox {
  display: none;
.app-container {
  padding: 20px;
  background: #f5f7fa;
}
.table-header {
  text-align: center;
  background-color: #aad8df;
  padding: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  border-radius: 4px 4px 0 0;
  margin: 10px 0 0 0;
  /* 顶部间距保留,底部间距移除 */
}
.table-title {
  text-align: center;
  padding: 10px 0;
}
.table-title.table-header h3 {
  margin: 0;
  font-weight: bold;
  color: #333;
}
.table-title h3 {
  font-size: 16px;
  color: #333;
  margin: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.table-title .highlight {
  font-weight: bold;
  color: #2c3e50;
}
.el-table {
  border-radius: 4px;
  font-size: 14px;
}
.el-table .warning-row {
  background: #e5f3ff !important;
}
::v-deep .el-table__body tr.current-row > td {
  background: #edf2fa !important;
}
.table-title {
  text-align: center;
  margin-bottom: 15px;
}
.row-disabled {
  color: #ccc; /* 设置禁用行的字体颜色 */
  pointer-events: none; /* 禁止鼠标操作 */
  background-color: #f5f5f5; /* 设置禁用行的背景色 */
}
.pag {
  width: 100%;
  display: flex;
  justify-content: center;
}
.pag1 {
  width: 30%;
  color: #999;
  background-color: #f5f5f5;
}
</style>
src/views/login.vue
@@ -179,6 +179,9 @@
             case '8098':
            this.loginForm.hospId = "bjxjyy";
            break;
            case '8099':
            this.loginForm.hospId = "bjfhyy";
            break;
        }
        Cookies.set("hospId", this.loginForm.hospId);
      } else if (env === 'staging') {
src/views/system/zhiye/index.vue
@@ -758,7 +758,7 @@
  tuantiSelect,
  deptTreeSelect,
  projectGetList,
  getOrderzhiye,
  getOrder,
  getProParentIdDxList,
  getProSonDxList,
  getCusIdcard,
@@ -2380,7 +2380,6 @@
        }
      });
    },
    Package() {
      this.activeNames = "first";
      if (this.form.cusSex == "男") {
@@ -2391,6 +2390,18 @@
      let cusSex = this.form.cusSex;
      this.datekey = Date.now();
      //全部套餐
      let param = {
        sex: cusSex,
        dwId: this.form.firmId || "",
      };
      if (this.form.tjType == 6) {
        if (!this.form.firmId && !this.form.firmName) {
          this.$message({
            type: "warning",
            message: "请先维护单位!",
          });
        } else if (!this.form.firmId && this.form.firmName) {
      this.taocan = true;
      this.loading = true;
      deptTreeSelect(cusSex).then((response) => {
@@ -2413,11 +2424,59 @@
        } catch (error) { }
        this.loading = false;
      });
        } else {
          this.taocan = true;
          this.loading = true;
          tuantiSelect(param).then((res) => {
            this.newpacName = res.data;
            try {
              if (this.tableData1.length >= 1) {
                this.newpacName.forEach((item3) => {
                  this.tableData1.forEach((item4) => {
                    item4.list.forEach((item6) => {
                      if (item6.pacName === item3.pacName) {
                        this.$nextTick(() => {
                          this.$refs.tb.toggleRowSelection(item3, true);
                        });
                        throw Error();
                      }
                    });
                  });
                });
              }
            } catch (error) { }
            this.loading = false;
          });
        }
      } else {
        this.taocan = true;
        this.loading = true;
        deptTreeSelect(cusSex).then((response) => {
          this.newpacName = response.rows;
          try {
            if (this.tableData1.length >= 1) {
              this.newpacName.forEach((item3) => {
                this.tableData1.forEach((item4) => {
                  item4.list.forEach((item6) => {
                    if (item6.pacName === item3.pacName) {
                      this.$nextTick(() => {
                        this.$refs.tb.toggleRowSelection(item3, true);
                      });
                      throw Error();
                    }
                  });
                });
              });
            }
          } catch (error) { }
          this.loading = false;
        });
      }
    },
    // 点击多选框获取选中数据
    handleSelectionChange(selection, row) {
      console.log(selection)
      this.tableData = selection;
      if (selection.length > 1) {
        let del_row = selection.shift();
@@ -2462,37 +2521,6 @@
        });
      }
      if (selection[0]) {
        // this.DataList = [];
        // this.data = JSON.parse(JSON.stringify(this.dXData));
        // selection[0].tjProjectList.forEach((selectionitem) => {
        //   this.Treedata.forEach((item) => {
        //     if (selectionitem.proName == item.proName) {
        //       item.disabled = true;
        //       item.tjProjectList = [];
        //     }
        // if (item.tjProjectList) {
        //   item.tjProjectList.forEach((item1) => {
        //     if (selectionitem.proName == item1.proName) {
        //       item1.disabled = true;
        //       item1.tjProjectList = [];
        //     }
        //     if (item1.tjProjectList) {
        //       item1.tjProjectList.forEach((item2) => {
        //         if (selectionitem.proName == item2.proName) {
        //           item2.disabled = true;
        //           item2.tjProjectList = [];
        //         }
        //       });
        //     }
        //   });
        // }
        // });
        //   this.TreedataList.forEach((item3) => {
        //     if (item3.proParentId == selectionitem.proId) {
        //       item.disabled = true;
        //     }
        //   });
        // });
      } else {
        this.treedataList = JSON.parse(JSON.stringify(this.dXData));
        return;
@@ -2841,6 +2869,7 @@
    // 项目提交
    submit() {
      if (this.form.cusIdcard) {
        var cusId = this.form.cusIdcard;
      } else {
@@ -3041,7 +3070,7 @@
          };
        }
        getOrderzhiye(data).then((res) => {
        getOrder(data).then((res) => {
          this.$modal.msgSuccess("提交成功");
          this.tjNumbers = res.msg;
          this.charge = true;
@@ -3214,7 +3243,14 @@
    },
    listgetOrder(data) {
      getOrderzhiye(data).then((res) => {
      const loading = this.$loading({
        lock: true,
        text: '正在加载中,请稍等!',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
      getOrder(data).then((res) => {
        loading.close();
        this.$modal.msgSuccess("提交成功");
        //调接口显示导检单
        const tjNumber = res.msg;
@@ -3226,7 +3262,6 @@
      this.$tab.refreshPage();
    },
    // 最后提交按钮
    submitPrice() {
      let _this = this;
      this.loadingSubmit = true;
@@ -3278,12 +3313,11 @@
            discount: item.discount,
            parentProId: item.parentProId,
            cusIdCard: item.cusId,
            yhj: item.nowPrice
            yhj: item.nowPrice,
          })); // 创建新的对象,包含 discount 和 id
        gaibianzhekou(newArray).then((res) => {
          this.loadingSubmit = false;
          if (res.code === 200) {
            let data;
            if (pacId || this.tjOrderList.length > 0) {
@@ -3298,10 +3332,6 @@
                firmId: this.form.firmId,
                firmName: this.form.firmName,
                firmDeptName: this.form.firmDeptName,
                zhiyeJhgly: this.form.zhiyeJhgly,
                zhiyeKsjhrq: this.form.zhiyeKsjhrq,
                zhiyeGh: this.form.zhiyeGh,
                zhiyeCj: this.form.zhiyeCj
              };
              this.listgetOrder(data);
@@ -3316,12 +3346,6 @@
                firmId: this.form.firmId,
                firmName: this.form.firmName,
                firmDeptName: this.form.firmDeptName,
                zhiyeJhgly: this.form.zhiyeJhgly,
                zhiyeKsjhrq: this.form.zhiyeKsjhrq,
                zhiyeGh: this.form.zhiyeGh,
                zhiyeCj: this.form.zhiyeCj
              };
              this.listgetOrder(data);
            } else {