lkk
2024-12-16 c7b33db117fd2893d7d1c93bf5d46e87d33e44d0
src/views/doctor/bgsh/index.vue
@@ -1,35 +1,89 @@
<template>
  <div>
    <el-form :model="queryParams" ref="tableList" :inline="true" label-width="76px" style="margin-top: 10px">
    <el-form
      :model="queryParams"
      ref="tableList"
      :inline="true"
      label-width="76px"
      style="margin-top: 10px"
    >
      <el-form-item label="姓名" prop="name">
        <el-input v-model="queryParams.name" style="width: 120px" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"></el-input>
        <el-input
          v-model="queryParams.name"
          style="width: 120px"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
        ></el-input>
      </el-form-item>
      <el-form-item label="体检号" prop="tjNumber">
        <el-input ref="inputName" v-model="queryParams.tjNumber" style="width: 180px" placeholder="请输入体检号" clearable @keyup.enter.native="handleQuery"></el-input>
        <el-input
          ref="inputName"
          v-model="queryParams.tjNumber"
          style="width: 180px"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="submitForm"
          @blur="hb"
        ></el-input>
      </el-form-item>
      <el-form-item label="体检时间" prop="tjTime">
        <el-date-picker v-model="startTime" 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 label="单位名称" prop="tjCompName" style="margin-left: 20px;">
        <el-select  :remote-method="getRemoteData" v-model="queryParams.tjCompName" value-key="drugManufacturerId" style="width: 180px" remote filterable placeholder="请选择单位名称" clearable @change="searchSelect">
          <el-option v-for="dict in CompanyList" :key="dict.drugManufacturerId" :label="dict.cnName" :value="dict"/>
        <el-date-picker
          v-model="startTime"
          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
        label="单位名称"
        prop="tjCompName"
        style="margin-left: 20px"
      >
        <el-select
          :remote-method="getRemoteData"
          v-model="queryParams.tjCompName"
          value-key="drugManufacturerId"
          style="width: 180px"
          remote
          filterable
          placeholder="请选择单位名称"
          clearable
          @change="searchSelect"
        >
          <el-option
            v-for="dict in CompanyList"
            :key="dict.drugManufacturerId"
            :label="dict.cnName"
            :value="dict"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" size="mini" @click="submitForm">搜索</el-button>
        <el-button  size="mini" @click="resetQuery">重置</el-button>
        <el-button
          type="primary"
          size="mini"
          @click="submitForm"
          style="margin-right: 15px"
          >搜索</el-button
        >
        <el-button size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8" style="margin-left:14px ;">
    <el-row :gutter="10" class="mb8" style="margin-left: 14px">
      <el-col :span="1.5">
        <el-button type="primary"
          size="mini"
          @click="radioChange"
          v-hasPermi="['system:notice:add']"
        >核收</el-button>
        <el-button type="primary" size="mini" @click="radioChange"
          >核收</el-button
        >
      </el-col>
    </el-row>
@@ -39,9 +93,15 @@
        :data="checkList"
        ref="table"
        border
        @selection-change="handleSelectionChange"
        style="margin: 20px; width: 98%"
      >
      <el-table-column type="selection" width="40px" align="center" fixed="left" />
        <el-table-column
          type="selection"
          width="40px"
          align="center"
          fixed="left"
        />
        <!-- <template slot="empty">数据正在加载中</template> -->
        <el-table-column
          label="体检号"
@@ -59,7 +119,7 @@
          width="100px"
          fixed="left"
        />
        <el-table-column
          label="性别"
          align="center"
@@ -88,7 +148,7 @@
          :show-overflow-tooltip="true"
          width="130px"
        />
        <el-table-column
          label="体检时间"
          align="center"
@@ -120,8 +180,6 @@
          prop="tjCompName"
          :show-overflow-tooltip="true"
        />
      </el-table>
      <div class="pag">
@@ -141,22 +199,11 @@
  
<script>
import {
  getcheckList,
  getTjdetailList,
  getupdateCheckType,
  getModifiedState,
  getfiedState,
  getState,
  getforceIn,
  gettoPdf,
  getModified,
} from "@/api/doctor/checkAll";
import { getInfo } from "@/api/login";
import { getBghsList, heXiaoByIds } from "@/api/doctor/checkAll";
import { getCompany, queryCompany } from "@/api/team/tuanti";
// import { getDeptAdvice } from "@/api/doctor/check";
import { getPdf, revoke } from "@/api/hosp/order";
import ViewPdf from "@/components/ViewPdf";
import { getNewDateList } from "@/api/hosp/order";
import moment from "moment";
export default {
  components: {
@@ -165,19 +212,7 @@
  name: "checkAll",
  data() {
    return {
      remarks: "",
      remark: "",
      proIds: "",
      xiaojie: "",
      isdisabled: false,
      dialogVisible: false,
      src: "",
      url: "",
      userId: "",
      flag: true,
      bill: null,
      numberList: [],
      dialogVisible: false,
      pickerOptions: {
        shortcuts: [
          {
@@ -220,18 +255,10 @@
      startTime: [],
      textarea1: "",
      loading: true,
      // 当前用户选中的值
      selectLettercurrent: " ",
      // 抽屉打开方式
      drawer: false,
      tableAll: {},
      tjNumber: "",
      // 全部小结
      DeptadviceAll: [],
      MsgId: "",
      Deptobj: "",
      // 点击参数
      changedate: [],
      orderIds: [],
      status: {},
      // 查询参数
      queryParams: {
@@ -242,40 +269,15 @@
        endTime: null,
        compId: null,
        name: null,
        checkStatus:null,
      },
      // 查询参数
      queryParam: {
        pageNum: 1,
        pageSize: 10,
        company: undefined,
        companyId: undefined,
        pacId: undefined,
        pacName: undefined,
        jobNo: undefined,
        name: undefined,
        sex: undefined,
        idCard: undefined,
        age: undefined,
        birthday: undefined,
        position: undefined,
        department: undefined,
        departmentId: undefined,
        phoe: undefined,
        address: undefined,
        marriage: undefined,
        nation: undefined,
        email: undefined,
        tjCategory: undefined,
        payType: undefined,
        checkStatus: null,
      },
    };
  },
  created() {
    this.getNowTime();
    this.getList();
    // this.getNowTime();
    this.getdate();
  },
  mounted() {
@@ -284,6 +286,15 @@
    });
  },
  methods: {
    getdate() {
      getNewDateList().then((res) => {
        this.startTime = [
          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();
@@ -328,17 +339,20 @@
      }
      // 页面数据
      getcheckList(this.queryParams).then((response) => {
        if (response.data) {
          if (response.data.date) {
            this.checkList = response.data.date;
          } else {
            this.checkList = response.data.customers;
          }
      getBghsList(this.queryParams).then((response) => {
        if (response.code == 200) {
          this.loading = false;
          this.total = response.data.total;
        } else {
          this.checkList = [];
          if (response.data) {
            if (response.data.date) {
              this.checkList = response.data.date;
            } else {
              this.checkList = response.data.customers;
            }
            this.total = response.data.total;
          } else {
            this.checkList = [];
          }
        }
      }),
        // 获取单位信息集合
@@ -347,62 +361,20 @@
          this.loading = false;
        });
    },
    viewReport(row) {
      const tjNumber = row.tjNumber;
      const flag = true;
      getPdf(tjNumber, flag).then((response) => {
        if (response.size === 0) {
          const loading = this.$loading({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });
        setTimeout(() => {
          loading.close();
        }, 3000);
          this.$message.msgSuccess("报告正在生成,请两分钟后预览!");
        } else {
          this.dialogVisible = true;
          this.url = window.webkitURL.createObjectURL(response); //将后端返回的blob文件读取出url
        }
      });
    },
    // viewReport(row) {
    //   const tjNumber = row.tjNumber;
    //   const viewNum = "792997692059705344";
    //   const params = { viewNum, tjNumber };
    //   hasReportEnd(tjNumber).then((res) => {
    //     if (res == 1) {
    //       this.$tab.openPage("体检报告", "/report/viewReport", params);
    //     } else {
    //       this.$message.error("该用户体检暂未完成,无法打印体检报告!");
    //     }
    //   });
    // },
    downLoadFileImg(row) {
      const tjNumber = row.tjNumber;
      const flag = true;
      getPdf(tjNumber, flag).then((response) => {
        this.url = window.webkitURL.createObjectURL(response); //将后端返回的blob文件读取出url
      });
    handleSelectionChange(selection) {
      this.orderIds = selection.map((item) => item.orderId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    // 单选按钮
    radioChange(value) {
    radioChange() {
      this.loading = true;
      this.queryParams.checkStatus = value;
      getcheckList(this.queryParams).then((response) => {
        if (response.data) {
          this.checkList = response.data.customers;
          this.total = response.data.total;
        } else {
          this.checkList = [];
      heXiaoByIds(this.orderIds).then((response) => {
        if (response.code == 200) {
          this.$modal.msgSuccess("报告已核收!请前往报告打印页面查看!");
          this.getList();
        }
        this.loading = false;
      });
    },
@@ -425,6 +397,12 @@
    dateChangebirthday1(val) {
      this.startTime = val;
    },
    hb() {
      console.log(this.queryParams.tjNumber);
      if (this.queryParams.tjNumber != "") {
        this.submitForm();
      }
    },
    // 搜索
    submitForm() {
@@ -439,7 +417,7 @@
      }
      // 页面数据
      getcheckList(this.queryParams).then((response) => {
      getBghsList(this.queryParams).then((response) => {
        if (response.data.customers != null) {
          this.checkList = response.data.customers;
          this.checkList.forEach((item) => {
@@ -454,241 +432,13 @@
    },
    // 重置
    resetQuery() {
      this.startTime = [];
      this.resetForm("tableList");
      this.submitForm();
    },
    // 点击详情
    handleClick(row) {
      this.tableAll = row;
      if (this.tableAll.cusSex === 0) {
        this.tableAll.cusSex = "男";
      }
      if (this.tableAll.cusSex === 1) {
        this.tableAll.cusSex = "女";
      }
      this.tjNumber = this.tableAll.tjNumber;
      getState(this.tjNumber).then((res) => {
        this.status = res.data;
        if (this.status.status === "1") {
          getInfo().then((response) => {
            this.userId = response.user.userId;
            if (this.userId) {
              let data = {
                userId: this.userId,
                tjNumber: this.tjNumber,
                state: 0,
              };
              getModifiedState(data).then((res) => {
                this.MsgId = res.msg;
                this.drawer = true;
                getupdateCheckType(this.tjNumber).then((response) => {
                  this.changedate = response.data;
                  this.changedate.forEach((item) => {
                    this.textarea1 = item.checkAdvice;
                  });
                  if (this.changedate) {
                    for (let i = 0; i < this.changedate.length; i++) {
                      this.remark = this.changedate[i].remark;
                    }
                    this.changedate.forEach((item) => {
                      // this.remark = item.remark;
                      item.sons.forEach((item3) => {
                        if (item3.standard.tjStandardGtValue === null) {
                          item3.standard.tjStandardGtValue = "";
                        }
                        if (item3.standard.tjStandardLtValue === null) {
                          item3.standard.tjStandardLtValue = "";
                        }
                      });
                      // item.remark = "";
                    });
                  } else {
                    this.$message({
                      type: "warning ",
                      message: "该客户没有体检项目数据",
                    });
                  }
                });
              });
            }
          });
        } else {
          this.$confirm(
            "" + this.status.name + "正在修改该信息, 是否强制进去?",
            "提示",
            {
              confirmButtonText: "是",
              cancelButtonText: "否",
              type: "warning",
            }
          )
            .then(() => {
              getInfo().then((response) => {
                this.userId = response.user.userId;
                if (this.userId) {
                  let data = {
                    userId: this.userId,
                    tjNumber: this.tjNumber,
                    state: 0,
                  };
                  getforceIn(data).then((res) => {
                    this.MsgId = res.msg;
                    this.drawer = true;
                    getupdateCheckType(this.tjNumber).then((response) => {
                      this.changedate = response.data;
                      if (this.changedate) {
                        for (let i = 0; i < this.changedate.length; i++) {
                          this.remark = this.changedate[i].remark;
                        }
                        this.changedate.forEach((item) => {
                          this.textarea1 = item.checkAdvice;
                          // this.remark = item.remark;
                          item.sons.forEach((item3) => {
                            if (item3.standard.tjStandardGtValue === null) {
                              item3.standard.tjStandardGtValue = "";
                            }
                            if (item3.standard.tjStandardLtValue === null) {
                              item3.standard.tjStandardLtValue = "";
                            }
                          });
                          // item.remark = "";
                        });
                      } else {
                        this.$message({
                          type: "warning ",
                          message: "该客户没有体检项目数据",
                        });
                      }
                    });
                  });
                }
              });
            })
            .catch(() => {
              this.$message({
                type: "info",
                message: "已取消进入",
              });
            });
          this.drawer = false;
        }
      });
      // 获取小结
      // getDeptAdvice().then((response) => {
      //   response.data.forEach((item) => {
      //     this.DeptadviceAll = item;
      //   });
      // });
    },
    // 撤销
    getRevoke(row) {
      const tjNumber = row.tjNumber;
      revoke(tjNumber).then((response) => {
        this.$modal.msgSuccess("撤回成功");
      });
    },
    // 是否关闭弹窗
    handleClose(done) {
      if (this.loading) {
        return;
      }
      this.$confirm("确定要提交吗?")
        .then((_) => {
          this.loading = true;
          this.timer = setTimeout(() => {
            done();
            this.determine();
            // 动画关闭需要一定的时间
            setTimeout(() => {
              this.loading = false;
            }, 400);
          }, 2000);
        })
        .catch((_) => {
          this.drawer = false;
          let data = {
            userId: this.userId,
            tjNumber: this.tjNumber,
            state: 1,
            id: this.MsgId,
          };
          getfiedState(data).then((res) => {});
        });
    },
    // 生成报告
    // generate(row) {
    //   const tjNumber = row.tjNumber;
    //   getGenerate(tjNumber).then((response) => {
    //     this.$modal.msgSuccess("生成成功");
    //   });
    // },
    // xiAoJieChange(event) {
    //   if (event) {
    //     this.changedate.forEach((item) => {
    //       item.remark = "";
    //       item.parentAdvice.forEach((item1) => {
    //         event.forEach((item2) => {
    //           if (item2 == item1.id) {
    //             item.remark = item.remark + item1.advice + "。";
    //           }
    //         });
    //       });
    //     });
    //   }
    // },
    change(vale) {
      // console.log(this.changedate[index].remark);
    },
    determine() {
      let tjNumber = this.tableAll.tjNumber;
      let advice = this.textarea1;
      let data = {
        tjNumber,
        advice,
        checkStatus: 1,
      };
      getTjdetailList(data).then((response) => {
        if (response.code === 200) {
          this.$modal.msgSuccess("提交成功");
          let tjNumber = this.tjNumber;
          let data = {
            userId: this.userId,
            tjNumber: tjNumber,
            state: 1,
            id: this.MsgId,
          };
          gettoPdf(tjNumber).then((res) => {
            this.$modal.msgSuccess("已生成报告!请前往体检记录页面查看!");
          });
          getfiedState(data).then((res) => {
            this.drawer = false;
          });
        }
      });
      for (let i = 0; i < this.changedate.length; i++) {
        this.proIds = this.changedate[i].parentId;
        let remarks = this.changedate[i].remark;
        let updateOrderRemarkVos = [
          {
            tjNumber,
            proId: this.proIds.toString(),
            remarks,
          },
        ];
        getModified(updateOrderRemarkVos).then((response) => {});
      }
      this.submitForm()
      this.$forceUpdate()
      // this.changedate.forEach((item) => {
      //   this.proIds = item.parentId;
      //   // this.remark = item.remark;
      // });
    },
  },
};