qinxianzhangyao
2024-07-04 683b2620e0fbfba24787046e2630cbfed0337484
src/views/system/tijian/index.vue
@@ -1381,7 +1381,8 @@
  getByTjNum,
} from "@/api/hosp/customer";
import { getPrintSetUp } from "@/api/system/examcharge";
import axios from "axios";
import { getIp } from '@/utils/auth'
import {
  deptTreeSelect,
  projectGetList,
@@ -1398,6 +1399,7 @@
  getIsRequired,
  getconfigKey,
  getHistryTjOrderProByCusIdCard,
  readCertCardInfos,
} from "@/api/system/tijian";
import Packages from "@/components/Packages";
import { MessageBox } from "element-ui";
@@ -1591,6 +1593,8 @@
        pacRemark: null,
      },
      valueUrl: "ws://127.0.0.1:18890",
      valueUrls: "ws://127.0.0.1:6789/websocket",
      // valueUrls: "ws://"+getIp() +":6789/websocket",
      WebSocket: null,
      // 身份证需要
      // socket: null,
@@ -1655,11 +1659,12 @@
  },
  created() {
    this.getCurrentDateTime();
    this.startTimer();
    this.getList1();
    // this.getData();
  },
  methods: {
    getCurrentDateTime() {
      const currentDate = new Date();
@@ -2350,6 +2355,91 @@
              this.$refs.aaa.open = true;
              this.$refs.aaa.getAllList();
              this.$refs.aaa.title = "证件字典";
            } else if (res.msg == "S") {
              var websocket = null;
              var url = this.valueUrls;
              // var url = 'ws://'+ getIp() +':6789/websocket'
              console.log(url)
              if ("WebSocket" in window) {
                websocket = new WebSocket(url);
              } else if ("MozWebSocket" in window) {
                websocket = new MozWebSocket(url);
              } else {
                // console.log("SockJS");
              }
              if (websocket == null) {
                alert("11111");
              }
              websocket.onopen = function () {
                try {
                websocket.send("发送");
              } catch (err) {
                var tryTime = 0;
                // 重试10次,每次之间间隔3秒
                if (tryTime < 1) {
                  var t1 = setTimeout(function () {
                    tryTime++;
                websocket.send("发送");
                  }, 1 * 1000);
                } else {
                  console.error("重连失败.");
                }
              }
              };
              websocket.onclose = function () {
                alert("读卡器连接关闭");
              };
              websocket.onmessage = function (event) {
                var resultObj =JSON.parse(event.data);
               _this.form.cusName = resultObj.data.name;
                    _this.form.cusSex =
                    resultObj.data.sex;
                    _this.form.cusNational =resultObj.data.mz;
                    _this.form.cusBrithday = resultObj.data.csrq;
                    if (_this.form.cusBrithday) {
                      _this.form.cusBrithday = _this.form.cusBrithday.replace(
                        /^(\d{4})(\d{2})(\d{2})$/,
                        "$1-$2-$3"
                      );
                    }
                    _this.form.cusAddr = resultObj.data.addres;
                    _this.form.cusIdcard = resultObj.data.card;
              };
              //连接发生错误的回调方法
              websocket.onerror = function () {
                alert("请检查读卡器连接是否正常");
              };
              // let url = window.location.protocol + "//" + window.location.host;
              // console.log(url);
              // axios
              //   .get("http://localhost:81/dev-api/readCertCardInfos")
              //   .then((res) => {
              //     console.log(res);
              //   })
              //   .catch((err) => {
              //     console.log(err);
              //   });
              // readCertCardInfos().then((res) => {
              //   _this.form.cusName = res.data.name;
              //       _this.form.cusSex =
              //       res.data.sex;
              //       _this.form.cusNational = res.data.mz;
              //       _this.form.cusBrithday = res.data.csrq;
              //       if (_this.form.cusBrithday) {
              //         _this.form.cusBrithday = _this.form.cusBrithday.replace(
              //           /^(\d{4})(\d{2})(\d{2})$/,
              //           "$1-$2-$3"
              //         );
              //       }
              //       _this.form.cusAddr = res.data.addres;
              //       _this.form.cusIdcard = res.data.card;
              // });
            }
          }
        });
@@ -2559,7 +2649,7 @@
        this.tableData.forEach((item) => {
          this.tableData1.forEach((item1) => {
            item.tjProjectList.forEach((item2) => {
              console.log(item1)
              console.log(item1);
              if (item2.proId == item1.proPrantId && item1.pacName == "单项") {
                this.$confirm(
                  "该套餐包含了已选单项,是否确认选择该套餐?",
@@ -2572,14 +2662,14 @@
                )
                  .then(() => {
                    this.$message({
                        type: "success",
                        message: "请注意查看价格",
                      });
                      type: "success",
                      message: "请注意查看价格",
                    });
                  })
                  .catch((action) => {
                    if (action === "cancel") {
                      let del_row = selection.shift();
                      this.$refs.tb.toggleRowSelection(del_row, false);
                      this.$refs.tb.toggleRowSelection(del_row, false);
                      this.$message({
                        type: "warning",
                        message: "已取消",
@@ -2632,11 +2722,11 @@
    handleClick(tab, event) {
      if (this.activeNames == "second") {
        this.DataList = [];
        this.checkedkey= [];
        this.checkedkey = [];
        this.getDataList();
      } else if (this.activeNames == "third") {
        this.DataLists = [];
        this.checkedkeys= [];
        this.checkedkeys = [];
        getZhList().then((response) => {
          if (response.data) {
            this.packageList = response.data;
@@ -3415,11 +3505,17 @@
  width: 100%;
  display: flex;
}
.tab3 {
  max-height: 400px;
  border: 1px solid #dcdfe6;
}
.filter-tree {
  /* max-height: 360px;
  overflow-y: auto;
  border: 1px solid #d9d9d9;
  border: 1px solid #d9d9d9; */
  overflow: auto;
  flex: 1;
  height: 350px;
}
.tab2 {