webpackJsonp([34],{

/***/ "EsnQ":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
var stringify = __webpack_require__("mvHQ");
var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);

// EXTERNAL MODULE: ./src/api/index.js + 5 modules
var api = __webpack_require__("gyMJ");

// EXTERNAL MODULE: ./src/utils/index.js
var utils = __webpack_require__("0xDb");

// EXTERNAL MODULE: ./src/utils/util.js
var util = __webpack_require__("oFuF");

// EXTERNAL MODULE: ./node_modules/moment/moment.js
var moment = __webpack_require__("PJh5");
var moment_default = /*#__PURE__*/__webpack_require__.n(moment);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/VoucherList.vue

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//






/* harmony default export */ var VoucherList = ({
  inject: ['reload'],
  name: "VoucherList",
  data: function data() {
    return {
      userNameSearch: '',
      deviceNumSearch: '',
      selectVoucherStatus: '',
      voucherStatusList: [{ label: '下发中', value: '0' }, { label: '下发成功', value: '1' }, { label: '发送失败', value: '702' }, { label: '已作废', value: '703' }],
      selectoption: [],
      selectoptionValue: '',
      tableData: [],
      currentPage: 1,
      total: 0,
      form: {
        password: "",
        password1: ""
      },
      row: {},
      index: 0,
      startdate: "",
      documentType1: "",
      certificatestatus: false,
      enddate: "",
      editVisiblelist: false,
      certificatesContent: {
        pzname: ""
      },
      dialogImageUrl: "",
      modifyStatus: true,
      multipleSelection: [],
      modifyvalue2: [],
      dialogVisible: false,
      modifyrow: {},
      cardId: "",
      pageSize: 10,
      selectVcalue: '',
      options: [{
        value: '26',
        label: '锁用户'
      }, {
        value: '0',
        label: '人脸'
      }, {
        value: '1',
        label: '指纹'
      }, {
        value: '2',
        label: '身份证'
      }, {
        value: '3',
        label: 'NFC'
      }, {
        value: '4',
        label: '密码'
      }],
      cardList: [],
      userInfo: {
        type: ''
      },
      AboutDevice: []
    };
  },
  created: function created() {
    // 获取凭证列表/v1/device/certificate/list
    // var tenantId = JSON.parse(localStorage.getItem('tenantId'))
    // if (tenantId == 400) {
    // this.$store.commit('defaultsettenantid')
    // }
    this.userInfo = JSON.parse(localStorage.getItem('info'));
    this.$store.commit('getCardname');
    this.cardList = this.$store.state.cartList;
    this.getcertificate();
    // this.selectoption=JSON.parse(localStorage.getItem('selectoption'))
    // this.selectoptionValue=localStorage.getItem('tenantId')
  },

  methods: {
    selectTenantId: function selectTenantId(e) {
      localStorage.setItem('tenantId', e);
      this.reload();
    },

    // 搜索
    serach: function serach() {
      var _this = this;

      var data = {};
      if (this.deviceNumSearch == "") {
        this.$refs.pagination.internalCurrentPage = 1;
        data = {
          pageNum: 1,
          pageSize: this.pageSize,
          q: stringify_default()({
            type: this.selectVcalue,
            status: this.selectVoucherStatus,
            name: this.userNameSearch,
            types: "0,1,2,3,4,26"
          }),
          orderBy: "create_at desc"
        };
      } else {
        data = {
          pageNum: 1,
          pageSize: this.pageSize,
          q: stringify_default()({
            deviceNum: this.deviceNumSearch,
            type: this.selectVcalue,
            status: this.selectVoucherStatus,
            types: "0,1,2,3,4,26"
          }),
          orderBy: "create_at desc"
        };
      }
      Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
        var dataOne = util["a" /* default */].zlib_unzip(res.data);
        dataOne.map(function (li) {
          li.createAt = _this.time(+new Date(li.createAt));
          li.userTelephone = JSON.parse(li.content).userTelephone;
          li['pzname'] = JSON.parse(li.content).pzname;
          // var cardli = this.cardList.filter((item) => item.id == li.cardId)
          // if (cardli.length == 0) {
          //   li['cardName'] = ''
          // } else {
          //   li['cardName'] = cardli[0].name
          // }
          li['statusText'] = util["a" /* default */].statusCode(li.status);
          li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
          li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
          li.roomName = JSON.parse(li.content).roomName || "";
          if (li.type == 36) {
            li['deviceNum'] = JSON.parse(li.content).deviceNum;
          }
        });
        _this.tableData = dataOne;
        _this.total = res.data.total;
      });
    },

    // input视图刷新
    changesr: function changesr(e) {
      this.$forceUpdate();
    },

    // 修改凭证
    modifyCraiFun: function modifyCraiFun() {
      var _this2 = this;

      var that = this;
      var row = this.modifyrow;
      var ids = this.roomtable;
      var content = JSON.parse(row.content);
      this.documentType1 = row.type;
      var data = {};
      var userTelephone = content.userTelephone;
      var userPassword = content.userPassword;
      var startTime = new Date(this.modifyvalue2[0]).getTime() / 1000;
      var endTime = new Date(this.modifyvalue2[1]).getTime() / 1000;
      Object(utils["i" /* modifyCraiAllFun */])(row, this.modifyvalue2, this.certificatesContent, function (data) {
        if (data.success) {
          var updatedata = {
            id: row.id,
            serial: data.data.serialNumber,
            startTime: startTime,
            endTime: endTime,
            status: 0
          };
          Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res2) {
            if (res2.success) {
              that.getcertificate();
              that.certificatestatus = false;
            }
          });
          that.$message.success("修改成功");
        } else {
          that.$message.error("修改失败");
        }
      });
      return;
      if (row.type == 1) {
        this.getfiId(row, function (data) {
          if (data.length > 0) {
            var fpid = "";
            fpid = data[0].face.toString(16).length != 2 ? "0" + data[0].face.toString(16) : data[0].face.toString(16);
            var str = {
              imei: row.imei,
              deviceNum: row.deviceNum,
              pzname: that.certificatesContent.pzname,
              cardId: row.cardId,
              password: fpid,
              operateMode: 17,
              order: 6217,
              userPassword: userPassword,
              userTelephone: userTelephone,
              passwordStartTime: Object(utils["m" /* timestampToTime */])(that.modifyvalue2[0]),
              passwordEndTime: Object(utils["m" /* timestampToTime */])(that.modifyvalue2[1]),
              is: false
            };
            Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
              if (res1.success) {
                content.passwordStartTime = str.passwordStartTime;
                content.passwordEndTime = str.passwordEndTime;
                content.pzname = str.pzname;
                var updatedata = {
                  id: row.id,
                  content: stringify_default()(content),
                  serial: res1.data.serialNumber,
                  status: 0
                };
                Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res2) {
                  that.certificatestatus = false;
                  that.getcertificate();
                  that.$message.success("修改成功");
                });
              } else {
                that.certificatestatus = false;
                that.getcertificate();
                that.$message.success("修改失败");
              }
            });
          }
        });
        return false;
      } else if (row.type == 2) {
        var arr2 = Object(utils["d" /* dec2hex */])(this.certificatesContent.idcard);
        data = {
          imei: row.imei,
          deviceNum: row.deviceNum,
          userTelephone: userTelephone,
          pzname: this.certificatesContent.pzname,
          cardId: row.cardId,
          userPassword: userPassword,
          password: arr2.toUpperCase(),
          operateMode: 14,
          order: 6214,
          passwordStartTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[0]),
          passwordEndTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[1]),
          is: false
        };
        if (arr2 == "") {
          this.$message.error("请填写完整信息");
          return false;
        }
      } else if (row.type == 3) {
        var array3 = Object(utils["d" /* dec2hex */])(this.certificatesContent.nfc);
        var arr4 = Object(utils["h" /* group */])(array3, 2).reverse();
        var nfc = "";
        arr4.map(function (li) {
          nfc += li;
        });
        data = {
          imei: row.imei,
          deviceNum: row.deviceNum,
          userTelephone: userTelephone,
          pzname: this.certificatesContent.pzname,
          cardId: row.cardId,
          userPassword: userPassword,
          password: arr4.toUpperCase(),
          operateMode: 11,
          order: 6211,
          passwordStartTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[0]),
          passwordEndTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[1]),
          is: false
        };
        if (arr4 == "") {
          this.$message.error("请填写完整信息");
          return false;
        }
      } else if (row.type == 4) {
        data = {
          imei: row.imei,
          deviceNum: row.deviceNum,
          userTelephone: userTelephone,
          pzname: this.certificatesContent.pzname,
          cardId: row.cardId,
          userPassword: userPassword,
          password: this.certificatesContent.password,
          operateMode: 8,
          order: 6208,
          passwordStartTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[0]),
          passwordEndTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[1]),
          is: false
        };
        if (this.certificatesContent.password == "") {
          this.$message.error("请填写完整信息");
          return false;
        }
      }
      Object(api["g" /* httpPost */])(data, this.$api.getDeviceOperateUserInfo).then(function (res) {
        if (res.success) {
          var updatedata = {
            id: row.id,
            content: stringify_default()(data),
            serial: res.data.serialNumber,
            status: 0
          };
          Object(api["g" /* httpPost */])(updatedata, _this2.$api.updateCertificates).then(function (res2) {
            if (res2.success) {
              _this2.getcertificate();
              _this2.certificatestatus = false;
            }
          });
          _this2.$message.success("修改成功");
        }
      });
    },
    modifyCrai: function modifyCrai(index, row) {
      var that = this;
      this.getItems(row.imei, function (data) {
        console.log(data);
        if (data.list.length > 0) {
          if (data.list[0].manufactureId == 201 || data.list[0].manufactureId == 221) {
            that.modifyrow = row;
            var content = JSON.parse(row.content);
            that.documentType1 = row.type;
            that.certificatesContent.username = content.username;
            that.certificatesContent.pzname = content.pzname;
            that.certificatesContent.password = content.password;
            var passwordStartTime = moment_default()(row.startTime * 1000).format('YYYY-MM-DD HH:mm:ss');
            var passwordEndTime = moment_default()(row.endTime * 1000).format('YYYY-MM-DD HH:mm:ss');
            that.modifyStatus = false;
            that.$nextTick(function () {
              that.modifyvalue2[0] = passwordStartTime;
              that.modifyvalue2[1] = passwordEndTime;
              that.modifyStatus = true;
            });
            that.certificatestatus = true;
          } else if (data.list[0].manufactureId == 101) {
            that.modifyrow = row;
            var content = JSON.parse(row.content);
            that.documentType1 = row.type;
            that.certificatesContent.username = content.username;
            that.certificatesContent.pzname = content.pzname;
            that.certificatesContent.password = content.password;
            if (content.passwordStartTime && content.passwordEndTime) {
              var passwordStartTime = that.insertStr(content.passwordStartTime, "-");
              var passwordEndTime = that.insertStr(content.passwordEndTime, "-");
            }
            that.modifyStatus = false;
            that.$nextTick(function () {
              that.modifyvalue2[0] = passwordStartTime;
              that.modifyvalue2[1] = passwordEndTime;
              that.modifyStatus = true;
            });
            that.certificatestatus = true;
          }
        } else {
          that.$message.error('未发现对应设备');
        }
      });
    },
    getItems: function getItems(imei, callback) {
      var _this3 = this;

      var data = {
        q: stringify_default()({
          imei: imei,
          lockType: 1
        }),
        pageNum: 0,
        pageSize: 0
      };
      Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
        if (res.success) {
          callback(res.data);
        } else {
          _this3.$message.error("查询设备失败");
        }
      });
    },
    insertStr: function insertStr(soure, newStr) {
      return soure.slice(0, 4) + newStr + soure.slice(4, 6) + newStr + soure.slice(6, 8) + " " + soure.slice(8, 10) + ":" + soure.slice(10, 12) + ":" + soure.slice(12, 14);
    },

    // 下发凭证
    Issue: function Issue(index, row) {
      var _this4 = this;

      var data = {};
      var userTelephone = JSON.parse(row.content).userTelephone;
      var userPassword = JSON.parse(row.content).userPassword;
      var passwordEndTime = JSON.parse(row.content).passwordEndTime;
      var passwordStartTime = JSON.parse(row.content).passwordStartTime;
      if (row.type == 1) {
        var fpId = new Date();
        var fingerprint = JSON.parse(row.content).fingerprint;
        var str = {
          imei: row.imei,
          deviceNum: row.deviceNum,
          userTelephone: userTelephone,
          userPassword: userPassword,
          password: JSON.parse(row.content).password,
          length: fingerprint.length / 2,
          fpTimeId: fpId.getTime(),
          operateMode: 16,
          order: 6216,
          fingerprint: fingerprint,
          passwordStartTime: passwordStartTime,
          passwordEndTime: passwordEndTime
        };
        Object(api["g" /* httpPost */])(str, this.$api.fingerprintTransfer).then(function (res1) {
          if (res1.success) {
            var str1 = JSON.parse(row.content);
            str1.fpTimeId = str.fpTimeId;
            var updatedata = {
              id: row.id,
              content: stringify_default()(str1),
              serial: res1.data.serialNumber
            };
            Object(api["g" /* httpPost */])(updatedata, _this4.$api.updateCertificates).then(function (res2) {});
            _this4.$message.success("下发成功");
          } else {
            _this4.$message.error("下发失败");
          }
        });
        this.$message.success("操作成功");
        return false;
      } else if (row.type == 2) {
        data = {
          imei: row.imei,
          deviceNum: row.deviceNum,
          userTelephone: userTelephone,
          cardId: row.cardId,
          userPassword: userPassword,
          password: JSON.parse(row.content).password,
          operateMode: 13,
          order: 6213,
          passwordStartTime: passwordStartTime,
          passwordEndTime: passwordEndTime,
          is: false
        };
      } else if (row.type == 3) {
        data = {
          imei: row.imei,
          deviceNum: row.deviceNum,
          userTelephone: userTelephone,
          cardId: row.cardId,
          userPassword: userPassword,
          password: JSON.parse(row.content).password,
          operateMode: 10,
          order: 6210,
          passwordStartTime: passwordStartTime,
          passwordEndTime: passwordEndTime,
          is: false
        };
      } else if (row.type == 4) {
        data = {
          imei: row.imei,
          deviceNum: row.deviceNum,
          userTelephone: userTelephone,
          cardId: row.cardId,
          userPassword: userPassword,
          password: JSON.parse(row.content).password,
          operateMode: 7,
          order: 6207,
          passwordStartTime: passwordStartTime,
          passwordEndTime: passwordEndTime,
          is: false
        };
      }
      Object(api["g" /* httpPost */])(data, this.$api.getDeviceOperateUserInfo).then(function (res) {
        if (res.success) {
          var updatedata = {
            id: row.id,
            serial: res.data.serialNumber
          };
          Object(api["g" /* httpPost */])(updatedata, _this4.$api.updateCertificates).then(function (res) {});
          _this4.$message.success("下发成功");
        } else {
          _this4.$message.error("下发失败");
        }
      });
    },

    // 时间处理
    time: function time() {
      var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : +new Date();

      var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
      return date.toJSON().substr(0, 19).replace("T", " ");
    },

    // 凭证列表获取
    getcertificate: function getcertificate() {
      var _this5 = this;

      var data = {
        pageNum: this.currentPage,
        pageSize: this.pageSize,
        // orderType: "desc",
        orderBy: "create_at desc",
        q: stringify_default()({
          deviceNum: this.deviceNumSearch,
          type: this.selectVcalue,
          status: this.selectVoucherStatus,
          name: this.userNameSearch,
          types: "0,1,2,3,4,26"
        })
      };
      Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
        var dataOne = util["a" /* default */].zlib_unzip(res.data);
        dataOne.map(function (li) {
          li.createAt = _this5.time(+new Date(li.createAt));
          li.userTelephone = JSON.parse(li.content).userTelephone;
          // var cardli = this.cardList.filter((item) => item.id == li.cardId)
          // if (cardli.length == 0) {
          //   li['cardName'] = ''
          // } else {
          //   li['cardName'] = cardli[0].name
          // }
          li['pzname'] = JSON.parse(li.content).pzname;
          li['statusText'] = util["a" /* default */].statusCode(li.status);
          li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
          li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
          li.roomName = JSON.parse(li.content).roomName || "";
          if (li.type == 36) {
            li['deviceNum'] = JSON.parse(li.content).deviceNum;
          }
        });
        _this5.tableData = dataOne;
        _this5.total = res.data.total;
      });
    },
    handleSizeChange: function handleSizeChange(val) {
      this.pageSize = val;
      this.$refs.pagination.internalCurrentPage = 1;
      this.getlistNum(0, val);
    },
    handleCurrentChange: function handleCurrentChange(val) {
      this.getlistNum(val, 10);
    },
    getlistNum: function getlistNum(val, size) {
      var _this6 = this;

      var data = {};
      if (this.deviceNumSearch == "") {
        data = {
          pageNum: val,
          pageSize: size,
          orderBy: "create_at desc",
          q: stringify_default()({
            type: this.selectVcalue,
            status: this.selectVoucherStatus
          })
        };
      } else {
        data = {
          pageNum: val,
          pageSize: size,
          q: stringify_default()({
            deviceNum: this.deviceNumSearch,
            type: this.selectVcalue,
            status: this.selectVoucherStatus,
            name: this.userNameSearch,
            types: "0,1,2,3,4,26"
          }),
          orderBy: "create_at desc"
        };
      }
      Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
        var dataOne = util["a" /* default */].zlib_unzip(res.data);
        dataOne.map(function (li) {
          li.createAt = _this6.time(+new Date(li.createAt));
          li.userTelephone = JSON.parse(li.content).userTelephone;
          // var cardli = this.cardList.filter((item) => item.id == li.cardId)
          // if (cardli.length == 0) {
          //   li['cardName'] = ''
          // } else {
          //   li['cardName'] = cardli[0].name
          // }
          li['pzname'] = JSON.parse(li.content).pzname;
          li['statusText'] = util["a" /* default */].statusCode(li.status);
          li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
          li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
          li.roomName = JSON.parse(li.content).roomName || "";
          if (li.type == 36) {
            li['deviceNum'] = JSON.parse(li.content).deviceNum;
          }
        });
        _this6.tableData = dataOne;
        _this6.total = res.data.total;
      });
    },
    handleSelectionChange: function handleSelectionChange(val) {
      this.multipleSelection = val;
    },

    // 编辑操作
    handleEdit: function handleEdit(index, row) {
      this.row = row;
      this.index = index;
      this.startdate = row.startTime;
      this.enddate = row.endTime;
      this.editVisiblelist = true;
    },

    // 保存编辑
    saveEdit: function saveEdit() {
      var _this7 = this;

      if (this.form.password == this.form.password1 && this.startdate != "" && this.enddate != "") {
        var data = {
          id: this.row.id,
          content: stringify_default()({
            password: this.form.password
          }),
          startTime: Number(this.startdate),
          endTime: Number(this.enddate)
        };
        Object(api["g" /* httpPost */])(data, this.$api.updateCertificates).then(function (res) {
          _this7.$message.success("修改成功");
          _this7.editVisiblelist = false;
        });
      } else {
        this.$message.error("两次密码输入不一致！");
      }
    },
    alldelete: function alldelete() {
      var _this8 = this;

      var that = this;
      // 二次确认删除
      if (this.multipleSelection.length == 0) {
        this.$message.error("请选择删除数据！");
        return false;
      } else {
        this.$confirm("确定要删除吗？", "提示", {
          type: "warning"
        }).then(function () {
          _this8.multipleSelection.map(function (row) {
            Object(utils["a" /* backDevice */])(row, function (data1) {
              console.log(data1);
              if (data1.data.list.length > 0) {
                if (data1.data.list[0].manufactureId == 201 || data1.data.list[0].manufactureId == 221) {
                  Object(utils["e" /* deleteZgVoucher */])(row, function (data) {
                    if (data.success) {
                      that.deleteall(row);
                    } else {
                      that.$confirm('是否删除平台凭证！', data.msg, {
                        type: "warning"
                      }).then(function () {
                        that.deleteall(row);
                      });
                    }
                  });
                } else if (data1.data.list[0].manufactureId == 101) {
                  var str = {};
                  if (row.type == 1) {
                    this.getfiId(row, function (data) {
                      if (data.length > 0) {
                        var fpid = "";
                        if (data[0].face) {
                          fpid = data[0].face.toString(16);
                          if (fpid.length != 2) {
                            fpid = "0" + fpid;
                          }
                        } else {
                          if (data[0].face == 0) {
                            fpid = data[0].face.toString(16);
                            fpid = "0" + fpid;
                          }
                        }
                        str = {
                          imei: row.imei,
                          deviceNum: row.deviceNum,
                          userTelephone: JSON.parse(row.content).userTelephone,
                          operateMode: 18,
                          order: 6218,
                          password: fpid,
                          userPassword: JSON.parse(row.content).userPassword,
                          is: false,
                          passwordStartTime: JSON.parse(row.content).passwordStartTime,
                          passwordEndTime: JSON.parse(row.content).passwordEndTime
                        };
                        Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
                          if (res1.success) {
                            that.deleteall(row);
                          } else {
                            that.$message.error('删除失败');
                          }
                        });
                      } else {
                        that.$message.error("该凭还未下发");
                      }
                    });
                    return false;
                  } else if (row.type == 2) {
                    str = {
                      cardId: row.cardId,
                      imei: row.imei,
                      deviceNum: row.deviceNum,
                      userTelephone: JSON.parse(row.content).userTelephone,
                      userPassword: JSON.parse(row.content).userPassword,
                      operateMode: 13,
                      order: 6213,
                      password: JSON.parse(row.content).password,
                      passwordStartTime: "20210813010101",
                      passwordEndTime: "20680813010101",
                      is: false
                    };
                  } else if (row.type == 3) {
                    str = {
                      cardId: row.cardId,
                      imei: row.imei,
                      deviceNum: row.deviceNum,
                      userTelephone: JSON.parse(row.content).userTelephone,
                      userPassword: JSON.parse(row.content).userPassword,
                      operateMode: 12,
                      order: 6212,
                      is: false,
                      passwordStartTime: "20210813010101",
                      passwordEndTime: "20680813010101"
                    };
                  } else if (row.type == 4) {
                    str = {
                      cardId: row.cardId,
                      imei: row.imei,
                      deviceNum: row.deviceNum,
                      userTelephone: JSON.parse(row.content).userTelephone,
                      operateMode: 9,
                      order: 6209,
                      userPassword: JSON.parse(row.content).userPassword,
                      password: JSON.parse(row.content).password,
                      is: false,
                      passwordStartTime: "20210813010101",
                      passwordEndTime: "20680813010101"
                    };
                  }
                  Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
                    if (res1.success) {
                      that.deleteall(row);
                    } else {
                      that.$message.error('删除失败');
                    }
                  });
                }
              } else {
                that.deleteall(row);
              }
            });
          });
        });
      }
    },
    deleteall: function deleteall(row) {
      var _this9 = this;

      var ids = [];
      // this.multipleSelection.map((row) => {
      ids.push(row.id);
      // if (ids.length == this.multipleSelection.length) {
      var data = {
        ids: ids
      };
      Object(api["g" /* httpPost */])(data, this.$api.deleteCertificates).then(function (res) {
        if (res.success) {
          _this9.getcertificate();
          _this9.$message.success("删除成功！");
        } else {
          _this9.$message.error('平台删除失败');
        }
      });
      // }
      // });
    },

    // 获取指纹id
    getfiId: function getfiId(row, callback) {
      var content = JSON.parse(row.content);
      var data = {
        q: stringify_default()({
          fpTimeId: content.fpTimeId
        }),
        pageNum: 1,
        pageSize: 10
      };
      Object(api["g" /* httpPost */])(data, this.$api.getDeviceResult).then(function (res) {
        var datalist = util["a" /* default */].zlib_unzip(res.data);
        callback(datalist);
      });
    },

    // 删除操作
    handleDelete: function handleDelete(index, row) {
      var that = this;
      // 二次确认删除
      this.$confirm("确定要删除吗？", "提示", {
        type: "warning"
      }).then(function () {
        Object(utils["a" /* backDevice */])(row, function (data1) {
          var _this10 = this;

          if (data1.data.list[0].manufactureId == 201 || data1.data.list[0].manufactureId == 221) {
            Object(utils["e" /* deleteZgVoucher */])(row, function (data) {
              if (data.success) {
                that.deleteall(row);
              } else {
                that.$confirm('是否删除平台凭证！', data.msg, {
                  type: "warning"
                }).then(function () {
                  that.deleteall(row);
                });
              }
            });
          } else if (data1.data.list[0].manufactureId == 101) {
            var str = {};
            if (row.type == 1) {
              this.getfiId(row, function (data) {
                if (data.length > 0) {
                  var fpid = "";
                  if (data[0].face) {
                    fpid = data[0].face.toString(16);
                    if (fpid.length != 2) {
                      fpid = "0" + fpid;
                    }
                  } else {
                    if (data[0].face == 0) {
                      fpid = data[0].face.toString(16);
                      fpid = "0" + fpid;
                    }
                  }
                  str = {
                    imei: row.imei,
                    deviceNum: row.deviceNum,
                    userTelephone: JSON.parse(row.content).userTelephone,
                    operateMode: 18,
                    order: 6218,
                    password: fpid,
                    userPassword: JSON.parse(row.content).userPassword,
                    is: false,
                    passwordStartTime: JSON.parse(row.content).passwordStartTime,
                    passwordEndTime: JSON.parse(row.content).passwordEndTime
                  };
                  Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
                    if (res1.success) {
                      that.deleteall(row);
                    } else {
                      that.$message.error('删除失败');
                    }
                  });
                } else {
                  that.$message.error("该凭还未下发");
                }
              });
              return false;
            } else if (row.type == 2) {
              str = {
                cardId: row.cardId,
                imei: row.imei,
                deviceNum: row.deviceNum,
                userTelephone: JSON.parse(row.content).userTelephone,
                userPassword: JSON.parse(row.content).userPassword,
                operateMode: 13,
                order: 6213,
                password: JSON.parse(row.content).password,
                passwordStartTime: "20210813010101",
                passwordEndTime: "20680813010101",
                is: false
              };
            } else if (row.type == 3) {
              str = {
                cardId: row.cardId,
                imei: row.imei,
                deviceNum: row.deviceNum,
                userTelephone: JSON.parse(row.content).userTelephone,
                operateMode: 12,
                order: 6212,
                userPassword: JSON.parse(row.content).userPassword,
                is: false,
                passwordStartTime: "20210813010101",
                passwordEndTime: "20680813010101"
              };
            } else if (row.type == 4) {
              str = {
                cardId: row.cardId,
                imei: row.imei,
                deviceNum: row.deviceNum,
                userTelephone: JSON.parse(row.content).userTelephone,
                operateMode: 9,
                order: 6209,
                userPassword: JSON.parse(row.content).userPassword,
                password: JSON.parse(row.content).password,
                is: false,
                passwordStartTime: "20210813010101",
                passwordEndTime: "20680813010101"
              };
            }
            Object(api["g" /* httpPost */])(str, this.$api.getDeviceOperateUserInfo).then(function (res1) {
              if (res1.success) {
                var data = {
                  ids: [row.id]
                };
                Object(api["g" /* httpPost */])(data, _this10.$api.deleteCertificates).then(function (res) {
                  if (res.success) {
                    _this10.$message.success("删除成功！");
                    _this10.getcertificate();
                  }
                });
              }
            });
          }
        });
      }).catch(function () {
        // this.$message.error("删除失败");
      });
      // .finally(() => {
      //   var data = {
      //     ids: [row.id],
      //   };
      //   httpPost(data, this.$api.deleteCertificates).then((res) => {
      //     if (res.success) {
      //       this.$message.success("删除成功！");
      //       this.getcertificate();
      //     }
      //   });
      // });
    }
  }
});
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-eaf0af74","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/VoucherList.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-card',{staticClass:"box-card"},[_c('div',{staticClass:"operation"},[_c('selectoption'),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10",attrs:{"placeholder":"设备号","size":"small","clearable":true},model:{value:(_vm.deviceNumSearch),callback:function ($$v) {_vm.deviceNumSearch=$$v},expression:"deviceNumSearch"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10",attrs:{"placeholder":"用户名称","size":"small","clearable":true},model:{value:(_vm.userNameSearch),callback:function ($$v) {_vm.userNameSearch=$$v},expression:"userNameSearch"}}),_vm._v(" "),_c('el-select',{attrs:{"size":"small","placeholder":"请选择凭证类型","clearable":true},model:{value:(_vm.selectVcalue),callback:function ($$v) {_vm.selectVcalue=$$v},expression:"selectVcalue"}},_vm._l((_vm.options),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1),_vm._v(" "),_c('el-select',{attrs:{"size":"small","placeholder":"请选择凭证状态","clearable":""},model:{value:(_vm.selectVoucherStatus),callback:function ($$v) {_vm.selectVoucherStatus=$$v},expression:"selectVoucherStatus"}},_vm._l((_vm.voucherStatusList),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.serach}},[_vm._v("搜索")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.alldelete}},[_vm._v("批量删除")])],1),_vm._v(" "),_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.tableData,"border":"","height":"700","header-cell-class-name":"table-header"},on:{"selection-change":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{"type":"selection","width":"55","align":"center"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"deviceNum","label":"设备号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"roomName","label":"房间名"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"name","label":"人员名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"pzname","label":"凭证名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"类型"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.type == 26)?_c('span',[_vm._v("锁用户")]):_vm._e(),_vm._v(" "),(scope.row.type == 36)?_c('span',[_vm._v("蓝牙扣")]):_vm._e(),_vm._v(" "),(scope.row.type == 0)?_c('span',[_vm._v("人脸")]):_vm._e(),_vm._v(" "),(scope.row.type == 1)?_c('span',[_vm._v("指纹")]):_vm._e(),_vm._v(" "),(scope.row.type == 2)?_c('span',[_vm._v("身份证")]):_vm._e(),_vm._v(" "),(scope.row.type == 3)?_c('span',[_vm._v("NFC")]):_vm._e(),_vm._v(" "),(scope.row.type == 4)?_c('span',[_vm._v("密码")]):_vm._e()]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"number","width":"400","label":"有效期"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('span',[_vm._v(_vm._s(scope.row.startTimeText)+" - "+_vm._s(scope.row.endTimeText))])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"下发状态","prop":"statusText"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"createAt","label":"创建时间"}})],1),_vm._v(" "),_c('div',{staticClass:"pagepg"},[_c('el-pagination',{ref:"pagination",attrs:{"current-page":_vm.currentPage,"page-sizes":[10,30,100,200],"page-size":_vm.pageSize,"layout":"total, sizes, prev, pager, next, jumper","total":_vm.total},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handleCurrentChange}})],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"编辑","visible":_vm.certificatestatus,"width":"30%"},on:{"update:visible":function($event){_vm.certificatestatus=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.certificatestatus = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.modifyCraiFun}},[_vm._v("确 定")])],1)]},proxy:true}])},[_c('el-form',{ref:"formvoucher1",staticClass:"temporary",attrs:{"model":_vm.certificatesContent,"label-width":"80px"}},[_c('el-form-item',{attrs:{"label":"凭证名称"}},[_c('el-input',{attrs:{"clearable":true},model:{value:(_vm.certificatesContent.pzname),callback:function ($$v) {_vm.$set(_vm.certificatesContent, "pzname", $$v)},expression:"certificatesContent.pzname"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"类型"}},[_c('el-select',{staticClass:"documentType",attrs:{"placeholder":"请选择","disabled":""},model:{value:(_vm.documentType1),callback:function ($$v) {_vm.documentType1=$$v},expression:"documentType1"}},[_c('el-option',{attrs:{"label":"人脸","value":0}}),_vm._v(" "),_c('el-option',{attrs:{"label":"指纹","value":1}}),_vm._v(" "),_c('el-option',{attrs:{"label":"身份证","value":2}}),_vm._v(" "),_c('el-option',{attrs:{"label":"NFC","value":3}}),_vm._v(" "),_c('el-option',{attrs:{"label":"密码","value":4}})],1)],1),_vm._v(" "),(_vm.documentType1 == 0)?_c('el-form-item',{attrs:{"label":"上传照片"}},[(_vm.documentType1 == 0)?_c('div',[_c('el-upload',{attrs:{"action":"#","list-type":"picture-card","auto-upload":false,"modal-append-to-body":false},scopedSlots:_vm._u([{key:"file",fn:function(ref){
var file = ref.file;
return _c('div',{},[_c('img',{staticClass:"el-upload-list__item-thumbnail",attrs:{"src":file.url,"alt":""}}),_vm._v(" "),_c('span',{staticClass:"el-upload-list__item-actions"},[_c('span',{staticClass:"el-upload-list__item-preview",on:{"click":function($event){return _vm.handlePictureCardPreview(file)}}},[_c('i',{staticClass:"el-icon-zoom-in"})]),_vm._v(" "),(!_vm.disabled1)?_c('span',{staticClass:"el-upload-list__item-delete",on:{"click":function($event){return _vm.handleDownload(file)}}},[_c('i',{staticClass:"el-icon-download"})]):_vm._e(),_vm._v(" "),(!_vm.disabled1)?_c('span',{staticClass:"el-upload-list__item-delete",on:{"click":function($event){return _vm.handleRemove(file)}}},[_c('i',{staticClass:"el-icon-delete"})]):_vm._e()])])}}],null,false,1205945247)},[_c('i',{staticClass:"el-icon-plus",attrs:{"slot":"default"},slot:"default"})]),_vm._v(" "),_c('el-dialog',{attrs:{"visible":_vm.dialogVisible,"modal-append-to-body":false},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('img',{attrs:{"width":"100%","src":_vm.dialogImageUrl,"alt":""}})])],1):_vm._e()]):_vm._e(),_vm._v(" "),_c('el-form-item',{attrs:{"label":"有效期"}},[(_vm.modifyStatus)?_c('el-date-picker',{attrs:{"type":"datetimerange","align":"right","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:(_vm.modifyvalue2),callback:function ($$v) {_vm.modifyvalue2=$$v},expression:"modifyvalue2"}}):_vm._e()],1)],1)],1)],1)],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var views_VoucherList = (esExports);
// CONCATENATED MODULE: ./src/views/VoucherList.vue
function injectStyle (ssrContext) {
  __webpack_require__("jhQs")
}
var normalizeComponent = __webpack_require__("VU/8")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-eaf0af74"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  VoucherList,
  views_VoucherList,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var src_views_VoucherList = __webpack_exports__["default"] = (Component.exports);


/***/ }),

/***/ "jhQs":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ })

});