liuyg
2021-12-10 b8154654b1f83b94f62874a0462b0cd2d5db7cd5
src/views/qiandao/tables.vue
@@ -1,6 +1,7 @@
<template>
  <basic-container class="tablesss">
    <avue-crud
      v-if="visible"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -42,6 +43,7 @@
export default {
  data() {
    return {
      visible: true,
      page: {
        pageSize: 10,
        currentPage: 1,
@@ -118,14 +120,14 @@
      "haveCardid",
      "useZhiWen",
    ]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.notice_add, false),
        viewBtn: this.vaildData(this.permission.notice_view, false),
        delBtn: this.vaildData(this.permission.notice_delete, false),
        editBtn: this.vaildData(this.permission.notice_edit, false),
      };
    },
    // permissionList() {
    //   return {
    //     addBtn: this.vaildData(this.permission.notice_add, false),
    //     viewBtn: this.vaildData(this.permission.notice_view, false),
    //     delBtn: this.vaildData(this.permission.notice_delete, false),
    //     editBtn: this.vaildData(this.permission.notice_edit, false),
    //   };
    // },
  },
  watch: {
    haveCardid() {
@@ -145,6 +147,8 @@
    },
  },
  mounted() {
    // let dom = document.getElementsByClassName("el-table--small");
    // console.log((dom[0].clientHeight = 100), 9);
    // console.log(1545);
    // if (window.name == "baoming") {
    //   let old = JSON.parse(window.localStorage.getItem("baoming"));
@@ -155,6 +159,11 @@
    //   window.name = "baoming";
    //   console.log("不刷新");
    // }
    let t = this;
    window.addEventListener("resize", function () {
      t.resetHeight();
    });
    t.resetHeight();
  },
  methods: {
    // getuserid() {
@@ -166,6 +175,18 @@
    //     return;
    //   }
    // },
    resetHeight() {
      //表格自适应高度
      let windowHeight = document.body.clientHeight;
      let table = document.getElementsByClassName("tablesss");
      let heard = table[0].getElementsByClassName("avue-crud__search");
      this.option.height = windowHeight - (heard[0].clientHeight + 220);
      this.visible = false;
      this.$nextTick(() => {
        this.visible = true;
        this.onLoad(this.page, this.search);
      });
    },
    rowUps(row, msg) {
      row["cell"] = "2";
      let zhiwenData = this.useZhiWen("outZhiwenData");
@@ -179,53 +200,53 @@
          return;
        }
        // console.log(zhiwenData, 456);
        if (
          zhiwenData.imgSRC != "" &&
          zhiwenData.imgSRC != undefined &&
          zhiwenData.imgBMP != "" &&
          zhiwenData.imgBMP != undefined &&
          zhiwenData.featuredata != "" &&
          zhiwenData.featuredata != undefined &&
          zhiwenData.isoks
        ) {
          // console.log("存在指纹");
          row.realName = card.name;
          row.cardid = card.id;
          row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
          row.nation = card.national;
          row.registered = card.certAddress;
          row.fingerprint = zhiwenData.imgBMP;
          row.myPicture = zhiwenData.featuredata;
          this.upDataMain(row);
        } else {
          // this.msg("warning", "无指纹信息,请添加指纹信息后重试!");
          this.$confirm("检测到无指纹信息,是否确定修改?", "确认信息", {
            distinguishCancelAndClose: true,
            confirmButtonText: "保存",
            cancelButtonText: "放弃修改",
          })
            .then(() => {
              row.realName = card.name;
              row.cardid = card.id;
              row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
              row.nation = card.national;
              row.registered = card.certAddress;
              row.fingerprint = zhiwenData.imgBMP;
              row.myPicture = zhiwenData.featuredata;
              this.upDataMain(row);
              // this.$message({
              //   type: "info",
              //   message: "保存修改",
              // });
            })
            .catch((action) => {
              // this.$message({
              //   type: "info",
              //   message:
              //     action === "cancel" ? "放弃保存并离开页面" : "停留在当前页面",
              // });
            });
        }
        // if (
        //   zhiwenData.imgSRC != "" &&
        //   zhiwenData.imgSRC != undefined &&
        //   zhiwenData.imgBMP != "" &&
        //   zhiwenData.imgBMP != undefined &&
        //   zhiwenData.featuredata != "" &&
        //   zhiwenData.featuredata != undefined &&
        //   zhiwenData.isoks
        // ) {
        // console.log("存在指纹");
        row.realName = card.name;
        row.cardid = card.id;
        row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
        row.nation = card.national;
        row.registered = card.certAddress;
        row.fingerprint = zhiwenData.imgBMP;
        row.myPicture = zhiwenData.featuredata;
        this.upDataMain(row);
        // } else {
        //   // this.msg("warning", "无指纹信息,请添加指纹信息后重试!");
        //   this.$confirm("检测到无指纹信息,是否确定修改?", "确认信息", {
        //     distinguishCancelAndClose: true,
        //     confirmButtonText: "保存",
        //     cancelButtonText: "放弃修改",
        //   })
        //     .then(() => {
        //       row.realName = card.name;
        //       row.cardid = card.id;
        //       row.sex = card.sex == "男" ? "1" : card.sex == "女" ? "2" : "3";
        //       row.nation = card.national;
        //       row.registered = card.certAddress;
        //       row.fingerprint = zhiwenData.imgBMP;
        //       row.myPicture = zhiwenData.featuredata;
        //       this.upDataMain(row);
        //       // this.$message({
        //       //   type: "info",
        //       //   message: "保存修改",
        //       // });
        //     })
        //     .catch((action) => {
        //       // this.$message({
        //       //   type: "info",
        //       //   message:
        //       //     action === "cancel" ? "放弃保存并离开页面" : "停留在当前页面",
        //       // });
        //     });
        // }
      } else {
        this.msg("warning", "请读取身份证后重试!");
      }
@@ -268,12 +289,40 @@
        registered: row.registered,
        fingerprint: row.fingerprint,
        myPicture: row.myPicture,
        candidateNo: row.candidateNo,
      };
      upData(b).then((res) => {
        const data = res.data;
        // console.log(data);
        if (data.code == 200) {
          this.msg("success", data.msg);
          // this.msg("success", data.msg);
          this.$confirm("签到成功!", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "success",
          })
            .then(() => {
              this.$message({
                type: "success",
                message: "请继续放入身份证进行识别!",
              });
              this.$store.commit("setIsClears", true);
              // this.$store.commit("setCardidState", false);
              // let zhiwen = {
              //   featuredatas: "",
              //   imgBMP: "",
              //   url: "",
              //   isoks: false,
              //   clear: true,
              // };
              // this.useZhiWen("setZhiwenData", zhiwen);
            })
            .catch(() => {
              // this.$message({
              //   type: "info",
              //   message: "已取消删除",
              // });
            });
        } else {
          this.msg("warning", data.msg);
        }
@@ -385,6 +434,7 @@
      params["auditStatus"] = "1";
      params["cancel"] = "1";
      params["isExam"] = "1";
      params["trainingUnitId"] = this.userInfo.dept_id;
      let values = Object.assign(params, this.query);
      // console.log(values);
      if (values.realName || values.deptName || values.idCardNo) {