qinxianzhangyao
2024-04-26 1e4a70437b5e2f7bd027ebc4081c22b315da3025
src/views/doctor/checkAll/index.vue
@@ -13,7 +13,7 @@
          style="width: 120px"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
          @keyup.enter.native="submitForm"
        ></el-input>
      </el-form-item>
      <el-form-item label="体检号" prop="tjNumber">
@@ -23,7 +23,8 @@
          style="width: 180px"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          @keyup.enter.native="submitForm"
          @blur="hb"
        ></el-input>
      </el-form-item>
      <el-form-item label="体检时间" prop="tjTime">
@@ -255,7 +256,13 @@
              性别:
            </td>
            <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
              {{ tableAll.cusSex }}
              {{
                tableAll.cusSex == 0
                  ? "男"
                  : tableAll.cusSex == 1
                  ? "女"
                  : "未知"
              }}
            </td>
          </tr>
          <tr style="border: 1px solid #dfe6ec; border-collapse: collapse">
@@ -274,17 +281,48 @@
          </tr>
        </table>
      </div>
      <div style="display: flex">
        <div style="margin: 10px 10px">
          <el-button type="primary" size="mini" @click="historicalreport()"
            >历史报告</el-button
          >
        </div>
        <div style="margin: 10px 10px" v-if="tableAll.tjCategory == '02'">
          <el-button type="primary" size="mini" @click="medicalhistory()"
            >职业病史</el-button
          >
        </div>
      <div>
        <el-row>
          <el-col :span="18">
            <div style="margin: 10px 10px">
              <el-radio-group
                v-model="tjproject"
                @input="radiotjprojectChange"
                style="margin-left: 20px"
              >
                <el-radio-button label="0">体检项目</el-radio-button>
                <el-radio-button label="1">化验项目</el-radio-button>
              </el-radio-group>
            </div>
          </el-col>
          <el-col :span="6">
            <div style="margin-right: 10px; display: flex">
              <div style="margin: 10px 2px">
                <el-button type="primary" size="mini" @click="Graphicreport()"
                  >图文报告</el-button
                >
              </div>
              <div style="margin: 10px 5px">
                <el-button
                  type="primary"
                  size="mini"
                  @click="historicalreport()"
                  >历史报告</el-button
                >
              </div>
              <div style="margin: 10px 5px" v-if="tableAll.tjCategory == '02'">
                <el-button type="primary" size="mini" @click="medicalhistory()"
                  >职业病史</el-button
                >
              </div>
              <div style="margin: 10px 5px">
                <el-button type="primary" size="mini" @click="jianqian()"
                  >检前问诊</el-button
                >
              </div>
            </div>
          </el-col>
        </el-row>
      </div>
      <el-row>
@@ -379,7 +417,7 @@
                  "
                  v-else
                >
                  {{ "" }}
                  {{ item1.proName }}
                </td>
                <td
                  style="
@@ -397,6 +435,7 @@
                    border-collapse: collapse;
                    width: 200px;
                  "
                  v-if="item1.project != null"
                >
                  {{ item1.standard.company }}
                </td>
@@ -406,12 +445,33 @@
                    border-collapse: collapse;
                    width: 200px;
                  "
                  v-else
                >
                  {{ item1.proAdvice }}
                </td>
                <td
                  style="
                    border: 1px solid #dfe6ec;
                    border-collapse: collapse;
                    width: 200px;
                  "
                  v-if="item1.project != null"
                >
                  {{
                    item1.standard.tjStandardGtValue +
                    "-" +
                    item1.standard.tjStandardLtValue
                  }}
                </td>
                <td
                  style="
                    border: 1px solid #dfe6ec;
                    border-collapse: collapse;
                    width: 200px;
                  "
                  v-else
                >
                  {{ item1.stanId }}
                </td>
              </tr>
              <tr
@@ -490,6 +550,15 @@
                </td>
              </tr>
            </table>
            <div style="margin: 0 0px 10px 15px">
              <el-button type="primary" @click="propoChange"
                >快捷建议</el-button
              >
              <el-button type="primary" @click="proposalChange"
                >生成建议</el-button
              >
            </div>
            <el-form
              ref="numberValidateForm"
              label-width="80px"
@@ -506,7 +575,7 @@
                </el-input>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footers">
            <div slot="footer" class="dialog-footers" v-if="tjproject == '0'">
              <el-button
                type="primary"
                @click="determine"
@@ -963,21 +1032,52 @@
        ></iframe>
      </div>
    </el-dialog>
    <el-dialog
      title="提示"
      :visible.sync="jianqians"
      width="1000px"
      :before-close="handleClose1"
    >
      <jianqianwenzhen
        :jianqianwenzhendata="jianqianwenzhendata"
        v-if="flags"
      ></jianqianwenzhen>
      <span slot="footer" class="dialog-footer">
        <el-button @click="jianqians = false">取 消</el-button>
      </span>
    </el-dialog>
    <Packages ref="bbb" :baogao="baogao" />
    <proposal ref="proposal" :cusobj="cusobj" @event1="eventchange($event)" />
    <createproposal ref="createproposal" :creatobj="creatobj" />
    <el-dialog
      title="常用建议维护"
      :visible.sync="propdialog"
      width="500px"
      append-to-body
    >
    </el-dialog>
  </div>
</template>
  
<script>
import jianqianwenzhen from "@/components/jianqianwenzhen";
import Packages from "@/components/Packages";
import proposal from "@/components/proposal";
import createproposal from "@/components/createproposal";
import {
  getcheckList,
  getTjdetailList,
  getupdateCheckType,
  getupdateCheckTypeHuaYan,
  getModifiedState,
  getfiedState,
  getState,
  getforceIn,
  gettoPdf,
  getModified,
  isPdfOrJimu,
} from "@/api/doctor/checkAll";
import { getInfoById } from "@/api/hosp/history";
import { getInfo } from "@/api/login";
@@ -986,11 +1086,18 @@
import { getPdf, revoke } from "@/api/hosp/order";
import ViewPdf from "@/components/ViewPdf";
import Historicalreport from "@/components/Historicalreport";
import { getDicts } from "@/api/system/dict/data";
import { getTjYxjcList } from "@/api/system/package";
import { getNewDateList } from "@/api/hosp/order";
import moment from "moment";
export default {
  components: {
    ViewPdf,
    Historicalreport,
    jianqianwenzhen,
    Packages,
    proposal,
    createproposal,
  },
  dicts: [
    "dict_tjtype",
@@ -1000,17 +1107,26 @@
    "lj_positive",
    "tj_work",
    "tj_work_status",
    "tj_smoking_pinlv",
    "tj_work",
  ],
  name: "checkAll",
  data() {
    return {
      baogao: [],
      flags: false,
      jianqianwenzhendata: [],
      jianqians: false,
      sex: true,
      activeName: "1",
      wenzhen: false,
      hosproy: true,
      remarks: "",
      remark: "",
      creatobj:{},
      propdialog: false,
      proIds: "",
      cusobj: {},
      xiaojie: "",
      isdisabled: false,
      dialogVisible: false,
@@ -1057,8 +1173,10 @@
      checkList: [],
      // 绑定单选按钮
      tjStatus: "0",
      tjproject: "0",
      total: 0,
      CompanyList: [],
      Testitems: [],
      CheckBox: {},
      startTime: [],
      textarea1: "",
@@ -1075,6 +1193,7 @@
      Deptobj: "",
      // 点击参数
      changedate: [],
      dataText: [],
      status: {},
      // 查询参数
      queryParams: {
@@ -1117,8 +1236,9 @@
  },
  created() {
    this.getNowTime();
    this.getList();
    // this.getNowTime();
    this.getdate();
  },
  mounted() {
@@ -1127,6 +1247,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();
@@ -1157,6 +1286,12 @@
        ":" +
        this.add0(mm)
      );
    },
    jianqian() {
      this.flags = true;
      this.jianqians = true;
      let tjNumber = this.tableAll.tjNumber;
      this.jianqianwenzhendata.push(tjNumber);
    },
    getList() {
      this.loading = true;
@@ -1196,23 +1331,77 @@
    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;
      isPdfOrJimu(tjNumber).then((response) => {
        if (response.data.flag == "0") {
          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
              this.url = window.webkitURL.createObjectURL(response); //将后端返回的blob文件读取出url
            }
          });
        } else {
          let url = response.data.url;
          const params = { url };
          this.$tab.openPage(
            "健康证检查表",
            "/report/zongjianjiankangzheng",
            params
          );
        }
      });
    },
    Graphicreport() {
      let dictType = "dict_ageunit";
      getDicts(dictType).then((res) => {
        if (res.code == 200) {
          res.data.forEach((item) => {
            if (this.tableAll.age_unit == item.dictValue) {
              this.tableAll.age_unit = item.dictLabel;
            }
          });
          let dictTypes = "sys_user_sex";
          getDicts(dictTypes).then((res) => {
            if (res.code == 200) {
              res.data.forEach((item) => {
                if (this.tableAll.cusSex == item.dictValue) {
                  this.tableAll.cusSex = item.dictLabel;
                }
              });
              let data = {
                patname: this.tableAll.cusName,
                sex: this.tableAll.cusSex,
                patage: this.tableAll.age,
                patagename: this.tableAll.age_unit,
                patbirth: this.tableAll.cusBrithday,
              };
              // let data = {
              //   patname: "脱能娥",
              //   sex: "女",
              //   patage: "60",
              //   patagename: "岁",
              //   patbirth: "1963-01-01"
              // }
              getTjYxjcList(data).then((res) => {
                this.baogao = res.data;
              });
              this.$refs.bbb.open = true;
              this.$refs.bbb.title = "报告字典";
            }
          });
        }
      });
    },
@@ -1294,6 +1483,94 @@
        this.loading = false;
      });
    },
    propoChange() {
      this.cusobj = { sex: this.tableAll.cusSex, isZj: 0 };
      this.$refs.proposal.open = true;
      this.$refs.proposal.title = "建议方案";
      // this.$refs.proposal.getList();
    },
    eventchange(data) {
      this.dataText = data
      data.forEach((item) => {
        this.textarea1 += item.advice;
      });
    },
    proposalChange() {
      if (this.textarea1) {
        this.creatobj = {proParentList:this.textarea1, isZj: 0}
        this.$refs.createproposal.open = true;
        this.$refs.createproposal.title = "常用建议维护";
      }else{
        this.$message({
              type: "warning ",
              message: "请先填写总检建议",
            });
      }
    },
    radiotjprojectChange() {
      if (this.tjproject == "0") {
        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 if (this.tjproject == "1") {
        getupdateCheckTypeHuaYan(this.tjNumber).then((res) => {
          if (res.data) {
            // this.Testitems = res.data
            this.changedate = res.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: "该客户没有化验项目数据",
            });
          }
        });
      }
    },
    // 体检公司拼音搜索
    getRemoteData(query) {
@@ -1313,6 +1590,12 @@
    // 时间
    dateChangebirthday1(val) {
      this.startTime = val;
    },
    hb() {
      if (this.queryParams.tjNumber != "") {
        this.submitForm();
      }
    },
    // 搜索
@@ -1347,6 +1630,7 @@
    },
    // 重置
    resetQuery() {
      this.startTime = [];
      this.resetForm("tableList");
      this.submitForm();
    },
@@ -1354,12 +1638,16 @@
    // 点击详情
    handleClick(row) {
      this.tableAll = row;
      if (this.tableAll.cusSex === 0) {
        this.tableAll.cusSex = "男";
      }
      if (this.tableAll.cusSex === 1) {
        this.tableAll.cusSex = "女";
      }
      this.tjproject = "0";
      // if (this.tableAll.cusSex === 0) {
      //   this.tableAll.cusSex = "男";
      // }
      // if (this.tableAll.cusSex === 1) {
      //   this.tableAll.cusSex = "女";
      // }
      // if (this.tableAll.cusSex === 2) {
      //   this.tableAll.cusSex = "未知";
      // }
      this.tjNumber = this.tableAll.tjNumber;
      getState(this.tjNumber).then((res) => {
        this.status = res.data;
@@ -1377,10 +1665,10 @@
                this.drawer = true;
                getupdateCheckType(this.tjNumber).then((response) => {
                  this.changedate = response.data;
                  this.changedate.forEach((item) => {
                    this.textarea1 = item.checkAdvice;
                  });
                  if (this.changedate) {
                    this.changedate.forEach((item) => {
                      this.textarea1 = item.checkAdvice;
                    });
                    for (let i = 0; i < this.changedate.length; i++) {
                      this.remark = this.changedate[i].remark;
                    }
@@ -1478,10 +1766,19 @@
    },
    // 撤销
    getRevoke(row) {
      this.loading = true;
      const tjNumber = row.tjNumber;
      revoke(tjNumber).then((response) => {
        this.$modal.msgSuccess("撤回成功");
        if (response.code == 200) {
          this.loading = false;
          this.getList();
        }
      });
    },
    cancel() {
      this.propdialog = false;
    },
    // 是否关闭弹窗
@@ -1512,7 +1809,9 @@
          getfiedState(data).then((res) => {});
        });
    },
    handleClose1() {
      this.jianqians = false;
    },
    // 生成报告
    // generate(row) {
    //   const tjNumber = row.tjNumber;