qinxianzhangyao
2024-07-19 e1e0b477de0623e3370fd717e263343e1c8576dc
src/views/doctor/examination/index.vue
@@ -9,10 +9,12 @@
    >
      <el-form-item label="体检号" prop="tjNumber">
        <el-input
          ref="inputName"
          v-model="queryParams.tjNumber"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          @blur="hb"
          style="width: 170px"
        />
      </el-form-item>
@@ -25,12 +27,29 @@
          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="结束日期"
          :default-time="['00:00:00', '23:00:00']"
          format="yyyy-MM-dd HH:mm"
          value-format="yyyy-MM-dd HH:mm"
          @change="dateChangebirthday1"
        >
        </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 icon="el-icon-refresh" size="mini" @click="resetQuery"
@@ -48,7 +67,7 @@
    </el-radio-group>
    <div style="width: 100%; margin-left: 10px; display: flex">
      <div style="width: 40%; margin-right: 20px">
      <div style="width: 40.5%; margin-right: 20px">
        <el-table
          id="ta"
          v-loading="loading"
@@ -56,10 +75,11 @@
          :data="exaList"
          border
          height="520px"
          @selection-change="handleSelectionChange"
          :row-class-name="tableRowClassName"
          highlight-current-row
          @current-change="handleCurrentChange"
        >
          <el-table-column type="selection" width="40" align="center" />
          <!-- <el-table-column type="selection" width="40" align="center" /> -->
          <el-table-column
            label="体检号"
            align="center"
@@ -76,18 +96,30 @@
            label="性别"
            align="center"
            prop="cusSex"
            width="60px"
            width="50px"
          >
            <template slot-scope="scope">
              <!-- {{scope.row.customer.cusSex}} -->
              {{ scope.row.cusSex === 0 ? "男" : "女" }}
              <!-- <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.cusSex " /> -->
              <span v-if="scope.row.cusSex == '0'">男</span>
              <span v-if="scope.row.cusSex == '1'">女</span>
              <span v-if="scope.row.cusSex == '2'">未知</span>
              <span v-if="scope.row.cusSex == '9'">未说明性别</span>
            </template>
            <!-- <template slot-scope="scope"> -->
            <!-- {{scope.row.customer.cusSex}} -->
            <!-- {{ scope.row.cusSex === 0 ? "男" : "女" }} -->
            <!-- <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.cusSex " /> -->
            <!-- </template> -->
          </el-table-column>
          <el-table-column
            label="手机号"
            align="center"
            prop="cusPhone"
            width="100px"
          />
          <el-table-column
            label="登记时间"
            align="center"
            prop="tjTime"
            width="120px"
          />
          <el-table-column
@@ -95,7 +127,7 @@
            label="审核状态"
            align="center"
            prop="confirmStatus"
            width="110px"
            width="80px"
          >
            <template slot-scope="scope">
              <span
@@ -116,12 +148,16 @@
              >
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center">
          <!--   v-hasPermi="['reservation:reservation:edit']" -->
          <el-table-column label="操作" align="center" width="120px">
            <template slot-scope="scope">
              <el-button size="mini" type="text" @click="tongbu(scope.row)"
                >同步</el-button
              >
              <el-button
                :disabled="dis"
                size="mini"
                type="text"
                v-hasPermi="['reservation:reservation:edit']"
                v-show="
                  scope.row.confirmStatus == '299' ||
                  scope.row.confirmStatus == 288
@@ -132,13 +168,12 @@
              <el-button
                size="mini"
                type="text"
                v-hasPermi="['reservation:reservation:edit']"
                v-show="
                  scope.row.confirmStatus == '301' ||
                  scope.row.confirmStatus == 288
                "
                @click="bohui(scope.row)"
                >撤销</el-button
                >驳回</el-button
              >
            </template>
          </el-table-column>
@@ -163,13 +198,15 @@
            label="项目"
            align="center"
            prop="proName"
            width="140"
            width="115"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="状态"
            align="center"
            prop="type"
            :show-overflow-tooltip="true"
            width="60"
          >
            <template slot-scope="scope">
              <span v-if="scope.row.type == '0'">未检</span>
@@ -178,17 +215,13 @@
              <span v-if="scope.row.type == '3'">延期</span>
            </template>
          </el-table-column>
          <el-table-column
            label="检查医生"
            align="center"
            prop="doctorName"
            width="120"
          />
          <el-table-column
            label="收费方式"
            align="center"
            prop="sffs"
            :show-overflow-tooltip="true"
            width="80"
          />
          <el-table-column
            label="是否收费"
@@ -196,24 +229,30 @@
            prop="isPay"
            :show-overflow-tooltip="true"
          />
          <el-table-column
          <!-- <el-table-column
            label="签到时间"
            align="center"
            prop="qdcreateTime"
            width="160"
          />
          /> -->
          <!-- <el-table-column
            label="检查医生"
            align="center"
            prop="doctorName"
            width="100"
          /> -->
          <el-table-column
            label="保存时间"
            label="检查时间"
            align="center"
            prop="bcupdateTime"
            width="160"
          />
          <el-table-column
          <!-- <el-table-column
            label="保存医生"
            align="center"
            prop="bcdoctorName"
            width="120"
          />
          /> -->
          <el-table-column
            label="最后修改时间"
            align="center"
@@ -223,7 +262,7 @@
        </el-table>
      </div>
    </div>
    <div style="margin-right: 58%">
    <div style="margin-right: 57%">
      <!-- <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> -->
@@ -239,11 +278,21 @@
</template>
<script>
import { getCsList, confirmOrder, cSWebGetPro } from "@/api/doctor/examination";
import {
  getCsList,
  confirmOrder,
  cSWebGetPro,
  dataSynchronization,
} from "@/api/doctor/examination";
import { getNewDateList } from "@/api/hosp/order";
import moment from "moment";
export default {
  dicts: ["dict_tj_status"],
  data() {
    return {
      dis: false,
      createTimeList: "",
      total: 0,
      loading: true,
      // 查询参数
@@ -262,6 +311,7 @@
      exaList: [],
      // 表单参数
      form: {},
      clearTimeSet: null,
      tjNumbers: "",
      multipleSelection: "",
      tjnum: "",
@@ -269,32 +319,122 @@
      selectList: [],
      tg: true,
      bh: true,
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    };
  },
  created() {
    this.getList();
    this.getdate();
    // this.getNowTime();
  },
  mounted() {
    this.$nextTick(() => {
      this.$refs.inputName.focus();
    });
  },
  methods: {
    getdate() {
      getNewDateList().then((res) => {
        this.createTimeList = [
          moment(res.data).format("YYYY-MM-DD 00:00:00"),
          moment(res.data).format("YYYY-MM-DD 23:59:00"),
        ];
        this.getList();
      });
    },
    // / 处理默认选中当前日期
    getNowTime() {
      var curDate = new Date().getTime();
      var dayNum = 7 * 24 * 3600 * 1000;
      var threeDays = curDate - dayNum;
      var sDay = this.getLocalTime(threeDays);
      var end = this.getLocalTime(curDate);
      this.createTimeList = [sDay, end];
    },
    add0(m) {
      return m < 10 ? "0" + m : m;
    },
    getLocalTime(nS) {
      var time = new Date(nS);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      return (
        y +
        "-" +
        this.add0(m) +
        "-" +
        this.add0(d) +
        " " +
        this.add0(h) +
        ":" +
        this.add0(mm)
      );
    },
    dateChangebirthday1(val) {
      this.startTime = val;
    },
    getList() {
      this.queryParams.checkStatus = "0";
      this.loading = true;
      this.queryParams.checkStatus = this.checkStatus;
      if (this.createTimeList) {
        this.queryParams.beginTime = this.createTimeList[0];
        this.queryParams.endTime = this.createTimeList[1];
      } else if (this.createTimeList == null) {
        this.queryParams.beginTime = null;
        this.queryParams.endTime = null;
      }
      getCsList(this.queryParams).then((res) => {
        if (res.data) {
          this.exaList = res.data.customers;
          this.total = res.data.total;
        if (res.code == 200) {
          this.loading = false;
          if (this.exaList.length != 0) {
            this.$nextTick(() => {
              this.$refs.tb.toggleRowSelection(this.exaList[0], true);
            });
          if (res.data) {
            this.exaList = res.data.customers;
            this.total = res.data.total;
            if (this.exaList.length != 0) {
              this.$nextTick(() => {
                this.$refs.tb.toggleRowSelection(this.exaList[0], true);
              });
            } else {
              this.$refs.tb.clearSelection();
            }
            this.total = res.data.total;
          } else {
            this.$refs.tb.clearSelection();
            this.exaList = [];
            this.tableList = [];
          }
          this.total = res.data.total;
          this.loading = false;
        } else {
          this.exaList = [];
          this.tableList = [];
          this.loading = false;
        }
      });
    },
@@ -303,17 +443,27 @@
      this.loading = true;
      this.queryParams.checkStatus = value;
      getCsList(this.queryParams).then((response) => {
        this.exaList = response.data.customers;
        if (this.exaList.length != 0) {
          this.$nextTick(() => {
            this.$refs.tb.toggleRowSelection(this.exaList[0], true);
          });
        } else {
          this.$refs.tb.clearSelection();
        if (response.code == 200) {
          this.exaList = response.data.customers;
          if (this.exaList.length != 0) {
            this.$nextTick(() => {
              this.$refs.tb.toggleRowSelection(this.exaList[0], true);
            });
          } else {
            this.$refs.tb.clearSelection();
            this.xiangmuList = [];
          }
          this.total = response.data.total;
          this.loading = false;
        }
        this.total = response.data.total;
        this.loading = false;
      });
    },
    hb() {
      // console.log(this.queryParams.tjNumber);
      if (this.queryParams.tjNumber != null) {
        this.handleQuery();
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
@@ -322,6 +472,7 @@
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.createTimeList = [];
      this.resetForm("queryForm");
      this.handleQuery();
      this.loading = true;
@@ -342,6 +493,14 @@
        let tjNumber = this.tjnum;
        cSWebGetPro(tjNumber).then((res) => {
          this.xiangmuList = res.data;
          this.xiangmuList.forEach((item) => {
            // console.log(item);
            // if (item.type == 0) {
            //   this.dis = true;
            // } else {
            //   this.dis = false;
            // }
          });
        });
      });
    },
@@ -351,6 +510,21 @@
          return "warning-row";
        }
      }
    },
    handleCurrentChange(val) {
      this.currentRow = val;
      let tjNumber = val.tjNumber;
      cSWebGetPro(tjNumber).then((res) => {
        this.xiangmuList = res.data;
        this.xiangmuList.forEach((item) => {
          // console.log(item);
          // if (item.type == 0) {
          //   this.dis = true;
          // } else {
          //   this.dis = false;
          // }
        });
      });
    },
    // 通过按钮
    tongguo(row) {
@@ -365,12 +539,40 @@
          status: "0",
        };
        confirmOrder(data).then((res) => {
          console.log(res);
          if (res.code == 200) {
            // this.$forceUpdate();
            this.getList();
            this.xiangmuList = [];
            this.$modal.msgSuccess("提交成功!");
          }
        });
      });
    },
    setTime() {
      //设置定时器
      this.clearTimeSet = setInterval(() => {
        this.$modal.closeLoading();
      }, 300000);
    },
    tongbu(row) {
      // this.$refs.tb.toggleRowSelection(row);
      this.$modal.loading("正在同步,请稍候...");
      this.setTime();
      let tjNumber = row.tjNumber;
      dataSynchronization(tjNumber).then((res, error) => {
        if (res.code == 200) {
          // this.$forceUpdate();
          this.handleCurrentChange(row);
          clearInterval(this.clearTimeSet);
          this.clearTimeSet = null;
          this.$modal.closeLoading();
          this.$modal.msgSuccess("同步成功!");
        }
      }).catch(error => {
        this.handleCurrentChange(row);
          clearInterval(this.clearTimeSet);
          this.clearTimeSet = null;
          this.$modal.closeLoading();
      });
    },
    // 驳回按钮
@@ -386,14 +588,12 @@
          status: "1",
        };
        confirmOrder(data).then((res) => {
          console.log(res);
          if (res.code == 200) {
            this.getList();
            this.$modal.msgSuccess("提交成功!");
          }
        });
      });
      console.log(this.tjNumbers);
    },
  },
};
@@ -407,4 +607,7 @@
.el-table .warning-row {
  background: #e5f3ff !important;
}
::v-deep .el-table__body tr.current-row > td {
  background: #edf2fa !important;
}
</style>