|
|
- webpackJsonp([9,56],{
-
- /***/ "+8yl":
- /***/ (function(module, exports) {
-
- module.exports = "data:image/png;base64,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
-
- /***/ }),
-
- /***/ "/xI2":
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
-
- /***/ "36ME":
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
-
- /***/ "7HYI":
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
-
- /***/ "7qU6":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- var validateIdent = {
- aIdentityCode_City: { // 城市代码列表
- 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林",
- 23: "黑龙江 ", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西",
- 37: "山东", 41: "河南", 42: "湖北 ", 43: "湖南", 44: "广东", 45: "广西", 46: "海南",
- 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏 ", 61: "陕西", 62: "甘肃",
- 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门", 91: "国外 "
- },
- IdentityCode_isCardNo: function IdentityCode_isCardNo(card) {
- //检查号码是否符合规范,包括长度,类型
- var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/; //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
- if (reg.test(card) === false) {
- return false;
- }
- return true;
- },
- IdentityCode_checkProvince: function IdentityCode_checkProvince(card) {
- //取身份证前两位,校验省份
- var province = card.substr(0, 2);
- if (validateIdent.aIdentityCode_City[province] == undefined) {
- return false;
- }
- return true;
- },
- IdentityCode_checkBirthday: function IdentityCode_checkBirthday(card) {
- //检查生日是否正确,15位以'19'年份来进行补齐。
- var len = card.length;
- //身份证15位时,次序为省(3位)市(3位)年(2位)月(2位)日(2位)校验位(3位),皆为数字
- if (len == '15') {
- var re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/;
- var arr_data = card.match(re_fifteen); // 正则取号码内所含出年月日数据
- var year = arr_data[2];
- var month = arr_data[3];
- var day = arr_data[4];
- var birthday = new Date('19' + year + '/' + month + '/' + day);
- return validateIdent.IdentityCode_verifyBirthday('19' + year, month, day, birthday);
- }
- //身份证18位时,次序为省(3位)市(3位)年(4位)月(2位)日(2位)校验位(4位),校验位末尾可能为X
- if (len == '18') {
- var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/;
- var arr_data = card.match(re_eighteen); // 正则取号码内所含出年月日数据
- var year = arr_data[2];
- var month = arr_data[3];
- var day = arr_data[4];
- var birthday = new Date(year + '/' + month + '/' + day);
- return validateIdent.IdentityCode_verifyBirthday(year, month, day, birthday);
- }
- return false;
- },
- IdentityCode_verifyBirthday: function IdentityCode_verifyBirthday(year, month, day, birthday) {
- //校验日期 ,15位以'19'年份来进行补齐。
- var now = new Date();
- var now_year = now.getFullYear();
- //年月日是否合理
- if (birthday.getFullYear() == year && birthday.getMonth() + 1 == month && birthday.getDate() == day) {
- //判断年份的范围(3岁到150岁之间)
- var time = now_year - year;
- if (time >= 3 && time <= 150) {
- return true;
- }
- return false;
- }
- return false;
- },
- IdentityCode_checkParity: function IdentityCode_checkParity(card) {
- //校验位的检测
- card = validateIdent.IdentityCode_changeFivteenToEighteen(card); // 15位转18位
- var len = card.length;
- if (len == '18') {
- var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
- var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
- var cardTemp = 0,
- i,
- valnum;
- for (i = 0; i < 17; i++) {
- cardTemp += card.substr(i, 1) * arrInt[i];
- }
- valnum = arrCh[cardTemp % 11];
- if (valnum == card.substr(17, 1)) {
- return true;
- }
- return false;
- }
- return false;
- },
- IdentityCode_changeFivteenToEighteen: function IdentityCode_changeFivteenToEighteen(card) {
- //15位转18位身份证号
- if (card.length == '15') {
- var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
- var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
- var cardTemp = 0,
- i;
- card = card.substr(0, 6) + '19' + card.substr(6, card.length - 6);
- for (i = 0; i < 17; i++) {
- cardTemp += card.substr(i, 1) * arrInt[i];
- }
- card += arrCh[cardTemp % 11];
- return card;
- }
- return card;
- },
- IdentityCodeValid: function IdentityCodeValid(card) {
- // 身份证号码检验主入口
- var pass = true;
- var sex = '';
- //是否为空
- if (pass && card === '') pass = false;
- //校验长度,类型
- if (pass && validateIdent.IdentityCode_isCardNo(card) === false) pass = false;
- //检查省份
- if (pass && validateIdent.IdentityCode_checkProvince(card) === false) pass = false;
- //校验生日
- if (pass && validateIdent.IdentityCode_checkBirthday(card) === false) pass = false;
- //检验位的检测
- if (pass && validateIdent.IdentityCode_checkParity(card) === false) pass = false;
- if (pass) {
- var iCard = validateIdent.IdentityCode_changeFivteenToEighteen(card);
- if (parseInt(iCard.charAt(16)) % 2 == 0) {
- sex = "0"; // 女生
- } else {
- sex = "1"; // 男生
- }
- return true;
- } else {
- return false;
- }
- }
- };
-
- /* harmony default export */ __webpack_exports__["a"] = (validateIdent.IdentityCodeValid); //导出
-
- /***/ }),
-
- /***/ "BXO0":
- /***/ (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/resetMessage.js
- var resetMessage = __webpack_require__("46Yo");
-
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/getFinger.vue
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
-
-
-
- var Ip;
- var getFinger_select = 0; //第几枚指纹
- var contectStatus; //判断设备是否连接,0表示已连接
- var fingerStatus; //判断手指是否按下,0表示未按下
- var index; //手指序号
- var strBmp; //bmp图像
- var strFTP; //模板 一般存于数据库
- var strFTR1; //特征1
- var strFTR2; //特征1
- var strFTR3; //特征3
- var fingerData = void 0;
-
- var WS_RET_ERR_OK = "0"; //操作成功
- var WS_RET_ERR_PARAM = "-1"; //参数错误
- var WS_RET_ERR_MEMORY = "-2"; //内存分配失败,没有分配到足够的内存
- var WS_RET_ERR_FUN = "-3"; //功能未实现
- var WS_RET_ERR_DEVICE = "-4"; //设备不存在
- var WS_RET_ERR_INIT = "-5"; //设备未初始化
- var WS_RET_ERR_UNKOWN = "-6"; //非法错误号
- var WS_RET_ERR_EXTRACT = "-7"; //提取特征失败或合成模板失败
- var WS_RET_ERR_ELSE = "-9"; //其它错误
-
- var WS_FM_Init = "FM_Init";
- //{"reqcode":"FM_Init"}
- //{"repcode":"FM_Init","result":"xx"}
- var WS_FM_Deinit = "FM_Deinit";
- //{"reqcode":"FM_Deinit"}
- //{"repcode":"FM_Deinit","result":"xx"}
- var WS_FM_GetDevVerison = "FM_GetDevVerison";
- //{"reqcode":"FM_GetDevVerison"}
- //{"reqcode":"FM_GetDevVerison","result":"xx":"version":"string"}
- var WS_FM_GetSdkVerison = "FM_GetSdkVerison";
- //{"reqcode":"FM_GetSdkVerison"}
- //{"reqcode":"FM_GetSdkVerison","result":"xx":"version":"string"}
- var WS_FM_DetectFinger = "FM_DetectFinger";
- //{"reqcode":"FM_DetectFinger"}
- //{"reqcode":"FM_DetectFinger","result":"xx"}
- var WS_FM_Extract = "FM_Extract";
- //{"reqcode":"FM_Extract","index":"(1~6)"}
- //{"reqcode":"FM_Extract","result":"xx","feature":"base64"}
- var WS_FM_Enroll = "FM_Enroll";
-
- var WS_FPM_FeatureMatch = "FM_DetectFinger";
- //{"reqcode":"FM_Enroll"}
- //{"reqcode":"FM_Extract","result":"xx","feature":"base64"}
-
-
- //--------------------------------------------------------------//
- // 清空显示页面
- //--------------------------------------------------------------//
-
-
- function ClearPage_OnClick() {}
- // document.getElementById('mb').value = "";;
- // document.getElementById("output").textContent ="";
-
- //--------------------------------------------------------------//
- // FPM_Init
- //--------------------------------------------------------------//
- function FM_Init_OnClick() {
- ClearPage_OnClick();
- var obj = {
- "reqcode": WS_FM_Init
- };
- var str = stringify_default()(obj);
- plguin_send(str);
- }
- //--------------------------------------------------------------//
- // FM_Deinit
- //--------------------------------------------------------------//
- function FM_Deinit_OnClick() {
- ClearPage_OnClick();
- var obj = {
- "reqcode": WS_FM_Deinit
- };
- var str = stringify_default()(obj);
- plguin_send(str);
- }
- //--------------------------------------------------------------//
- // FM_GetSdkVerison
- //--------------------------------------------------------------//
- function FM_GetSdkVerison_OnClick() {
- ClearPage_OnClick();
- var obj = {
- "reqcode": WS_FM_GetSdkVerison
- };
- var str = stringify_default()(obj);
- plguin_send(str);
- }
- //--------------------------------------------------------------//
- // FM_GetDevVerison
- //--------------------------------------------------------------//
- function FM_GetDevVerison_OnClick() {
- ClearPage_OnClick();
- var obj = {
- "reqcode": WS_FM_GetDevVerison
- };
- var str = stringify_default()(obj);
- plguin_send(str);
- }
-
- //--------------------------------------------------------------//
- // FPM_FeatureExtract
- //--------------------------------------------------------------//
- function FM_Extract_OnClick() {
- // ClearPage_OnClick();
- var obj = {
- "reqcode": WS_FM_Extract,
- "index": getFinger_select + 1 + ""
- };
- var str = stringify_default()(obj);
- plguin_send(str);
- }
- //--------------------------------------------------------------//
- // FM_Enroll
- //--------------------------------------------------------------//
- function FM_Enroll_OnClick() {
- var obj = {
- "reqcode": WS_FM_Enroll
- };
- var str = stringify_default()(obj);
- plguin_send(str);
- }
- //--------------------------------------------------------------//
- // FPM_FeatureMatch
- //--------------------------------------------------------------//
- function FM_DetectFinger_OnClick() {
- var obj = {
- "reqcode": WS_FM_DetectFinger
- };
- var str = stringify_default()(obj);
- plguin_send(str);
- }
-
- function errAlert(iret) {
- if (iret === WS_RET_ERR_OK) {
- resetMessage["a" /* message */].success("操作成功");
- } else if (iret === WS_RET_ERR_PARAM) {
- resetMessage["a" /* message */].success("参数错误");
- } else if (iret === WS_RET_ERR_MEMORY) {
- resetMessage["a" /* message */].success("内存分配失败,没有分配到足够的内存");
- } else if (iret === WS_RET_ERR_FUN) {
- resetMessage["a" /* message */].success("功能未实现");
- } else if (iret === WS_RET_ERR_DEVICE) {
- resetMessage["a" /* message */].success("设备不存在");
- } else if (iret === WS_RET_ERR_EXTRACT) {
- resetMessage["a" /* message */].success("提取特征失败或合成模板失败");
- } else if (iret === WS_RET_ERR_INIT) {
- resetMessage["a" /* message */].success("设备未初始化");
- } else if (iret === WS_RET_ERR_UNKOWN) {
- resetMessage["a" /* message */].success("非法错误号");
- } else if (iret === WS_RET_ERR_ELSE) {
- resetMessage["a" /* message */].success("其它错误");
- }
- }
-
- var mb = null;
- //显示信息
- var log = function log(s) {
- if (document.readyState !== "complete") {
- log.buffer.push(s);
- } else {
- // document.getElementById("output").textContent += (s + "\n");
- // document.getElementById("outputdiv").scrollTop = document.getElementById("outputdiv").scrollHeight;
- }
- };
- log.buffer = [];
- //显示连接状态
- function setConnected(status) {
- // document.getElementById("socketstatus").innerHTML = status;
- }
- var ws = null;
-
- //连接
- function plguin_connect() {
- if (ws != null) {
- console.log("现已连接");
- return;
- }
- var url = Ip;
- if ('WebSocket' in window) {
- ws = new WebSocket(url);
- console.log(ws);
- } else if ('MozWebSocket' in window) {
- ws = new MozWebSocket(url);
- } else {
- log("unsupported WebSocket");
- return;
- }
- ws.onopen = function () {
- log("open");
- setConnected("已连接");
- //设置发信息送类型为:ArrayBuffer
- ws.binaryType = "arraybuffer";
- };
- ws.onmessage = function (e) {
- log("[recv]:" + e.data.toString());
- var s = e.data.toString();
- var obj = JSON.parse(s);
-
- //检测设备
- if (obj.repcode == WS_FM_Init) {
- console.log(obj);
- contectStatus = obj.result;
- }
- //关闭设备
- else if (obj.repcode == WS_FM_Deinit) {
- // console.log(222)
- errAlert(obj.result);
- }
- //插件版本
- else if (obj.repcode == WS_FM_GetDevVerison) {
- //
- var info = "Ver:" + obj.version;
- resetMessage["a" /* message */].success(info);
- }
- //设备版本
- else if (obj.repcode == WS_FM_GetSdkVerison) {
- //
- resetMessage["a" /* message */].success(obj.version);
- }
-
- //提取手指特征
- else if (obj.repcode == WS_FM_Extract) {
- if (obj.result == WS_RET_ERR_OK) {
- if (0 == getFinger_select) {
- console.log(obj);
- // alert("指纹采集成功,请松开手指后在按下")
- resetMessage["a" /* message */].success("指纹采集成功,请松开手指后在按下");
- // this.DetectFinger()
- }
- if (1 == getFinger_select) {
- console.log(obj);
- console.log("第二次数据");
- // alert("指纹采集成功,请松开手指后在按下")
- resetMessage["a" /* message */].success("指纹采集成功,请松开手指后在按下");
- }
- if (2 == getFinger_select) {
- console.log(obj);
- fingerData = obj;
- console.log("第三次数据");
- // alert("指纹采集成功")
- resetMessage["a" /* message */].success("指纹采集成功");
- }
- getFinger_select++;
- } else errAlert(obj.result);
- } else if (obj.repcode == WS_FM_Enroll) {
- strFTP = obj.template;
- errAlert(obj.result);
- if (obj.result == WS_RET_ERR_OK) {
- console.log(obj);
- }
- } else if (obj.repcode == WS_FPM_FeatureMatch) {
- console.log(obj);
- fingerStatus = obj.result;
- console.log(fingerStatus);
- // errAlert(obj.result);
- } else {
- log("Unkown");
- }
- };
- ws.onclose = function (e) {
- log("closed");
- ws = null;
- };
- ws.onerror = function (e) {
- log("error");
- ws = null;
- };
- }
-
- //断开连接
- function plguin_close() {
- if (ws != null) {
- ws.close();
- ws = null;
- setConnected("已断开");
- }
- }
-
- function plguin_send(s) {
- log("[send]:" + s);
- if (ws != null) {
- ws.send(s);
- } else {
- log("[send]: ws null");
- }
- }
-
- function getLocalIp(cb) {
- if (window.navigator.userAgent.indexOf("MSIE") == -1 && window.navigator.userAgent.indexOf("Edge") == -1 && window.navigator.userAgent.indexOf("Trident") == -1) {
- var conn = new RTCPeerConnection({
- iceServers: []
- });
- var noop = function noop() {};
- conn.onicecandidate = function (ice) {
- if (ice.candidate) {
- //使用正则获取ip
- var arr = ice.candidate.candidate.split(' ');
- var ip_addr = null;
- for (var i in arr) {
- if (arr[i].indexOf('.local') != -1) {
- ip_addr = arr[i];
- }
- }
- cb(ip_addr);
- conn.onicecandidate = noop;
- }
- };
- conn.createDataChannel('dataChannel');
- conn.createOffer(conn.setLocalDescription.bind(conn), noop);
- } else {
- try {
- var locator = new ActiveXObject("WbemScripting.SWbemLocator");
- var service = locator.ConnectServer("."); //连接本机服务器
- var properties = service.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled=TRUE");
- //查询使用SQL标准
- var e = new Enumerator(properties);
- for (; !e.atEnd(); e.moveNext()) {
- var p = e.item();
- var desc = "Caption:" + p.Caption + " "; //网卡描述,也可以使用Description
- var ip = "IP:" + p.IPAddress(0) + " "; //IP地址为数组类型,子网俺码及默认网关亦同
- var mac = "MAC:" + p.MACAddress + " "; //网卡物理地址
-
- var ipSplit = ip.split(':');
- ip = ipSplit[1] ? ipSplit[1] : ipSplit[0];
- cb(ip);
- }
- } catch (e) {
- //IE获取失败可提示用户,设置相关信任
- }
- }
- }
-
- /* harmony default export */ var getFinger = ({
- data: function data() {
- return {
- ipAddress: '',
- text: '',
- loading: '',
- list: [],
- isdiable: true, //是否重新采集
- fingerStatus: fingerStatus //判断手指是否按下,0表示未按下
- };
- },
- mounted: function mounted() {},
-
- methods: {
- getFingerData: function getFingerData(value, callback) {
- console.log(fingerData, 'fingerData');
- callback(fingerData);
- },
-
- //连接
- contect: function contect() {
- plguin_connect();
- },
-
- //检测设备
- Init: function Init() {
- FM_Init_OnClick();
- },
-
- //检测手指
- DetectFinger: function DetectFinger() {
- var _this = this;
-
- if (contectStatus == '0') {
- FM_DetectFinger_OnClick();
- setTimeout(function () {
- _this.fingerStatus = fingerStatus;
- }, 1000);
- console.log("finger", this.fingerStatus);
- } else {
- this.Init();
- this.$message("设备未连接,请重新尝试");
- }
- },
-
- //提取特征
- Extract: function Extract() {
- FM_Extract_OnClick();
- },
-
- //合成模板
- Enroll: function Enroll() {
- FM_Enroll_OnClick();
- },
-
- //获取本机IP地址
- getIp: function getIp() {
- getLocalIp(function (ip) {
- console.log(ip);
- });
- var str = window.location.host.split(':');
- console.log(window.location.host, str);
- Ip = "ws://" + '127.0.0.1' + ":9618";
- // httpGet(data,'').then(res => {
- // let str = res.data
- // let targetStr = str.substring(str.indexOf('{'), str.lastIndexOf('}') + 1);
- // Ip = "ws://" + JSON.stringify(targetStr) + ":9618"
- // // Ip = "ws://" + '192.168.1.111' + ":9618"
- // console.log(Ip)
- // })
- },
-
- //重新采集
- onload: function onload() {
- getFinger_select = 0;
- this.isdiable = true;
- },
-
- //loading
- openFullScreen: function openFullScreen() {
- this.loading = this.$loading({
- lock: true,
- text: this.text,
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- });
- }
- },
- created: function created() {
- var _this2 = this;
-
- this.getIp();
- this.text = '设备连接中';
- this.openFullScreen();
- setTimeout(function () {
- _this2.contect();
- setTimeout(function () {
- _this2.Init();
- _this2.loading.close();
- }, 500);
- }, 500);
- },
-
- watch: {
- //监听手指是否按下
- fingerStatus: function fingerStatus(news, olds) {
- var _this3 = this;
-
- console.log("watch", news);
- if (this.fingerStatus == 1 && news == 1) {
- this.Extract();
- this.fingerStatus = 2;
- if (getFinger_select == 2) {
- this.Enroll();
- setTimeout(function () {
- _this3.list.push(strFTP);
- _this3.isdiable = false;
- }, 500);
- console.log(this.list);
- }
- return;
- }
- if (news == 0) {
- this.$message("请按压手指");
- this.fingerStatus = 2;
- }
- }
- }
- });
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-6f9da94a","hasScoped":false,"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/getFinger.vue
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{on:{"click":function($event){return _vm.DetectFinger()}}}),_vm._v(" "),_c('div',{on:{"click":function($event){return _vm.getFingerData()}}}),_vm._v(" "),_c('div',{attrs:{"id":"my-button"},on:{"click":function($event){return _vm.onload()}}})])}
- var staticRenderFns = []
- var esExports = { render: render, staticRenderFns: staticRenderFns }
- /* harmony default export */ var views_getFinger = (esExports);
- // CONCATENATED MODULE: ./src/views/getFinger.vue
- function injectStyle (ssrContext) {
- __webpack_require__("/xI2")
- }
- var normalizeComponent = __webpack_require__("VU/8")
- /* script */
-
-
- /* template */
-
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- getFinger,
- views_getFinger,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
-
- /* harmony default export */ var src_views_getFinger = __webpack_exports__["default"] = (Component.exports);
-
-
- /***/ }),
-
- /***/ "I0e3":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/typeof.js
- var helpers_typeof = __webpack_require__("pFYg");
- var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/object/assign.js
- var object_assign = __webpack_require__("woOf");
- var assign_default = /*#__PURE__*/__webpack_require__.n(object_assign);
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/toConsumableArray.js
- var toConsumableArray = __webpack_require__("Gu7T");
- var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/promise.js
- var promise = __webpack_require__("//Fk");
- var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
-
- // 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: ./node_modules/babel-runtime/regenerator/index.js
- var regenerator = __webpack_require__("Xxa5");
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
-
- // EXTERNAL MODULE: ./node_modules/babel-runtime/helpers/asyncToGenerator.js
- var asyncToGenerator = __webpack_require__("exGp");
- var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
-
- // EXTERNAL MODULE: ./node_modules/vue-schart/src/vue-schart.vue + 2 modules
- var vue_schart = __webpack_require__("S4mo");
-
- // EXTERNAL MODULE: ./src/api/index.js + 5 modules
- var api = __webpack_require__("gyMJ");
-
- // EXTERNAL MODULE: ./src/components/zTree1.vue + 2 modules
- var zTree1 = __webpack_require__("6Ljo");
-
- // EXTERNAL MODULE: ./src/components/usercontent.vue + 2 modules
- var usercontent = __webpack_require__("iPDe");
-
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/personLi.vue
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
- /* harmony default export */ var personLi = ({
- name: "personLi",
- props: ['data'],
- methods: {}
- });
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-2620c9c1","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/components/personLi.vue
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"person-item"},[_c('div',{staticClass:"item-content"},[(_vm.data.sex == 1)?_c('img',{staticClass:"avator",attrs:{"src":__webpack_require__("+8yl"),"alt":""}}):_vm._e(),_vm._v(" "),(_vm.data.sex == 2)?_c('img',{staticClass:"avator",attrs:{"src":__webpack_require__("an/0"),"alt":""}}):_vm._e(),_vm._v(" "),_c('div',[_c('div',{staticClass:"person-content"},[_c('div',[_vm._v("姓名:")]),_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.data.name))])]),_vm._v(" "),_c('div',{staticClass:"person-content"},[_c('div',[_vm._v("身份证号:")]),_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.data.number))])]),_vm._v(" "),_c('div',{staticClass:"person-content"},[_c('div',[_vm._v("手机号:")]),_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.data.phone))])])])]),_vm._v(" "),(_vm.data.rommNameText)?_c('div',{staticClass:"person-bottom"},[_c('span',[_vm._v(_vm._s(_vm.data.rommNameText))])]):_c('div',{staticClass:"person-bottom"},[_vm._v("未入住")]),_vm._v(" "),(_vm.data.cardState == 1)?_c('div',{staticClass:"person-normal normal"},[_vm._v("正常")]):(_vm.data.type==12)?_c('div',{staticClass:"person-normal normal"},[_vm._v("企业")]):_c('div',{staticClass:"person-normal abnormal"},[_vm._v("异常")])])}
- var staticRenderFns = []
- var esExports = { render: render, staticRenderFns: staticRenderFns }
- /* harmony default export */ var components_personLi = (esExports);
- // CONCATENATED MODULE: ./src/components/personLi.vue
- function injectStyle (ssrContext) {
- __webpack_require__("36ME")
- }
- 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-2620c9c1"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- personLi,
- components_personLi,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
-
- /* harmony default export */ var src_components_personLi = (Component.exports);
-
- // EXTERNAL MODULE: ./src/api/allFun.js
- var allFun = __webpack_require__("mprh");
-
- // EXTERNAL MODULE: ./src/utils/equipment.js
- var equipment = __webpack_require__("ObZk");
-
- // EXTERNAL MODULE: ./node_modules/xlsx/xlsx.js
- var xlsx = __webpack_require__("uXZL");
- var xlsx_default = /*#__PURE__*/__webpack_require__.n(xlsx);
-
- // 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/components/contrast/contrast.vue
-
-
-
-
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
-
-
-
-
-
-
-
- var nowDate = new Date();
- var currentTime = nowDate;
- var endcurrentTime = Object(utils["g" /* getcurrentTime1 */])(6);
- /* harmony default export */ var contrast = ({
- name: "contrast",
- data: function data() {
- return {
- dateTime: [currentTime, endcurrentTime],
- batchOperation: false,
- userlist: [],
- userlistOne: [],
- userlistTwo: [],
- multipleSelection: [],
- multipleSelectionOne: [],
- multipleSelectionTwo: [],
- filterFields: [],
- filterFieldsList: [{
- value: 'name',
- label: '名称'
- }, {
- value: 'number',
- label: '学号'
- }, {
- value: 'cardId',
- label: '卡号'
- }, {
- value: 'phone',
- label: '手机号'
- }, {
- value: 'sex',
- label: '性别'
- }, {
- value: 'cardState',
- label: '门卡状态'
- }],
- deviceList: [],
- allCertificates: []
- };
- },
- created: function created() {
- this.getDevice();
- this.getCertificatesSort();
- },
-
- methods: {
- checkboxInit: function checkboxInit(row, index) {
- if (row.color == 'bgred') {
- return 0;
- } else if (row.color == '') {
- return 1;
- }
- },
- tableRowClassName: function tableRowClassName(_ref) {
- var row = _ref.row,
- rowIndex = _ref.rowIndex;
-
- if (row.color == 'bgred') {
- return 'warning-row';
- } else if (row.color == '') {
- return 'success-row';
- }
- return '';
- },
- getDevice: function getDevice() {
- var _this2 = this;
-
- var data = {
- q: stringify_default()({
- lockType: 1
- }),
- pageNum: 0,
- pageSize: 0
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.code == 200) {
- _this2.deviceList = res.data.list;
- }
- });
- },
-
- // 批量删除
- deleteSelect: function deleteSelect() {
- // this.
- },
-
- // 获取凭证名称
- getCertificatesSort: function getCertificatesSort() {
- var _this3 = this;
-
- var dataall = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- inStatus: "0,1",
- types: "13"
- }
- };
- Object(api["d" /* httpGet */])(dataall, this.$api.getCertificates).then(function (resall) {
- if (resall.code == 200) {
- var sendOn = util["a" /* default */].zlib_unzip(resall.data);
- _this3.allCertificates = sendOn;
- }
- });
- },
-
- // 上传对比结果
- batchUploadfun: function batchUploadfun() {
- var _this4 = this;
-
- return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
- var _this;
-
- return regenerator_default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _this = _this4;
-
- if (!(_this4.dateTime[0] == '' || _this4.dateTime[1] == '')) {
- _context.next = 4;
- break;
- }
-
- _this4.$message.error("请选择开始结束时间");
- return _context.abrupt("return", false);
-
- case 4:
- if (_this4.multipleSelectionTwo.length > 0) {
- _this4.multipleSelectionTwo.map(function (li) {
- var fjid = [];
- var str = {
- cardId: li.id,
- siteId: li.roomId,
- startTime: _this4.dateTime[0],
- endTime: _this4.dateTime[1]
- };
- fjid.push(str);
- var infostr = JSON.parse(li.info);
- if (li.manufactureId == 201 || li.manufactureId == 221) {
- var data = {
- lockerId: li.deviceNum,
- imei: li.imei,
- lockerUserId: infostr.userPassword,
- keyId: infostr.userPassword,
- role: 0,
- action: 1,
- order: 6226,
- cardName: li.name,
- roomName: li.siteName,
- pzname: 'NFC' + li.num
- };
- equipment["a" /* default */].addUserToLock(data.lockerId, data.imei, data.lockerUserId, data.role, data.action, data.order, data.cardName, data.roomName, function (callback) {
- if (callback.success) {
- var locakUserdata = {
- deviceNum: li.deviceNum,
- imei: li.imei,
- cardId: li.id,
- content: stringify_default()(data), //operateMode:NFC-10、把人员添加到凭证-1
- type: 26,
- serial: callback.data.serialNumber,
- startTime: parseInt(_this.dateTime[0].getTime() / 1000),
- endTime: parseInt(_this.dateTime[1].getTime() / 1000)
- };
- util["a" /* default */].sendLockUser(locakUserdata, function (callbackLOCK) {});
- if (li.nfc.length == 8) {
- li.nfc = util["a" /* default */].cardFormatConversion(li.nfc);
- li.nfc = li.nfc + '00000000';
- } else if (li.nfc.length == 16) {
- password = li.nfc;
- }
- console.log(li.nfc);
- Object(api["g" /* httpPost */])(fjid, _this4.$api.bindCard).then(function (res) {
- if (res.success) {
- _this4.$message.success("添加成功");
- } else {
- _this4.$message.error("添加失败");
- }
- });
- equipment["a" /* default */].RfCardRegister(data.lockerId, data.imei, data.lockerUserId, 1, 1, li.nfc.toUpperCase(), 50, locakUserdata.startTime, locakUserdata.endTime, 6210, data.cardName, data.roomName, function (callbackTwo) {
- var str = {
- imei: data.imei,
- userTelephone: infostr.userTelephone,
- cardId: li.id,
- userPassword: infostr.userPassword,
- password: li.nfc.toUpperCase(),
- operateMode: 10,
- order: 6210,
- type: 2,
- passwordStartTime: locakUserdata.passwordStartTime,
- passwordEndTime: locakUserdata.passwordEndTime,
- pzname: data.pzname,
- is: false,
- cardName: data.cardName,
- roomName: data.roomName
- };
- var dataCertifi = {
- cardId: li.id,
- imei: data.imei,
- deviceNum: data.deviceNum,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: 13,
- startTime: locakUserdata.startTime,
- endTime: locakUserdata.endTime
- };
- Object(api["g" /* httpPost */])(dataCertifi, _this4.$api.addCertificates).then(function (res) {
- var dataCertifiTwo = dataCertifi;
- dataCertifiTwo.type = 3;
- dataCertifiTwo.serial = callbackTwo.data.serialNumber;
- Object(api["g" /* httpPost */])(dataCertifiTwo, _this4.$api.addCertificates).then(function (res) {
- _this4.$emit('getAboutRoom');
- });
- });
- });
- } else {
- _this4.$message.error(callback.msg);
- if (callback.code == 201016) {
- Object(api["g" /* httpPost */])(fjid, _this4.$api.bindCard).then(function (res) {
- if (res.success) {
- _this4.$message.success("该用户门锁已存在");
- } else {
- _this4.$message.error("添加失败");
- }
- });
- }
- }
- });
- } else if (li.manufactureId == 101) {
- var userstr = {
- imei: li.imei,
- deviceNum: li.deviceNum,
- userTelephone: infostr.userTelephone,
- userPassword: infostr.userPassword,
- password: infostr.userPassword,
- operateMode: 26,
- order: 6226,
- passwordStartTime: moment_default()(_this4.dateTime[0]).format("YYYYMMDDHHmmss"),
- passwordEndTime: moment_default()(_this4.dateTime[1]).format("YYYYMMDDHHmmss"),
- is: false,
- cardName: li.name,
- pzname: 'NFC' + li.num,
- roomName: li.siteName
- };
- equipment["a" /* default */].LDAddUser(userstr.deviceNum, userstr.imei, userstr.userTelephone, userstr.userPassword, userstr.password, userstr.passwordStartTime, userstr.passwordEndTime, userstr.operateMode, userstr.order, userstr.cardName, userstr.roomName, false, function (callback) {
- if (callback.success) {
- var locakUserdata = {
- deviceNum: li.deviceNum,
- imei: li.imei,
- cardId: li.id,
- content: stringify_default()(userstr), //operateMode:NFC-10、把人员添加到凭证-1
- type: 26,
- serial: callback.data.serialNumber,
- startTime: parseInt(_this.dateTime[0].getTime() / 1000),
- endTime: parseInt(_this.dateTime[1].getTime() / 1000)
- };
- util["a" /* default */].sendLockUser(locakUserdata, function (callbackLOCK) {});
- Object(api["g" /* httpPost */])(fjid, _this4.$api.bindCard).then(function (res) {
- if (res.success) {
- equipment["a" /* default */].LDRfCardRegister(userstr.deviceNum, userstr.imei, userstr.userTelephone, userstr.userPassword, li.nfc, userstr.passwordStartTime, userstr.passwordEndTime, 10, 6210, userstr.cardName, userstr.roomName, false, function (callbackTwo) {
- var str = {
- imei: userstr.imei,
- userTelephone: userstr.userTelephone,
- cardId: li.id,
- userPassword: userstr.userPassword,
- password: li.nfc,
- operateMode: 10,
- order: 6210,
- type: 2,
- passwordStartTime: userstr.passwordStartTime,
- passwordEndTime: userstr.passwordEndTime,
- pzname: userstr.pzname,
- is: false,
- cardName: userstr.cardName,
- roomName: userstr.roomName
- };
- var dataCertifi = {
- cardId: li.id,
- imei: userstr.imei,
- deviceNum: userstr.deviceNum,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: 13,
- startTime: locakUserdata.startTime,
- endTime: locakUserdata.endTime
- };
- Object(api["g" /* httpPost */])(dataCertifi, _this4.$api.addCertificates).then(function (res) {
- var dataCertifiTwo = dataCertifi;
- dataCertifiTwo.type = 3;
- dataCertifiTwo.serial = callbackTwo.data.serialNumber;
- Object(api["g" /* httpPost */])(dataCertifiTwo, _this4.$api.addCertificates).then(function (res) {
- _this4.$emit('getAboutRoom');
- });
- });
- });
- _this4.$message.success("添加成功");
- } else {
- _this4.$message.error("添加失败");
- }
- });
- } else {
- _this4.$message.error(callback.msg);
- }
- });
- }
- });
- } else {
- _this4.$message.error("请选择人员");
- }
-
- case 5:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, _this4);
- }))();
- },
-
- //查询人员
- getperson: function getperson(li, callback) {
- var data = {
- orderBy: "create_time desc",
- q: stringify_default()({
- cardId: li.cardId
- })
- };
- var roomAbout = this.$store.state.roomAbout;
- Object(api["g" /* httpPost */])(data, this.$api.getlistNum).then(function (res) {
- callback(res.data.list[0]);
- });
- },
-
- // 清空表格
- clearAll: function clearAll() {
- this.userlist = [];
- },
- clearAllOne: function clearAllOne() {
- this.userlistOne = [];
- },
- clearAllTwo: function clearAllTwo() {
- this.userlistTwo = [];
- },
- mapTwoDimension: function mapTwoDimension(arr) {
- var dataArr = [];
- if (arr.length === 0) {
- console.log(arr, arr.length);
- return dataArr;
- }
- arr.map(function (oneDim) {
- if (dataArr.length == 0) {
- dataArr.push({
- cardId: oneDim.cardId,
- cardState: oneDim.cardState,
- enterpriseId: oneDim.enterpriseId,
- id: oneDim.id,
- info: oneDim.info,
- name: oneDim.name,
- phone: oneDim.phone,
- sex: oneDim.sex,
- siteId: oneDim.siteId,
- siteName: oneDim.siteName,
- type: oneDim.type,
- list: [oneDim]
- });
- } else {
- var res = dataArr.some(function (item) {
- // 判断相同,有就添加到当前项
- if (item.cardId == oneDim.cardId && item.id == oneDim.id) {
- item.list.push(oneDim);
- return true;
- }
- });
- if (!res) {
- // 如果没找相同添加一个新对象
- dataArr.push({
- cardId: oneDim.cardId,
- cardState: oneDim.cardState,
- enterpriseId: oneDim.enterpriseId,
- id: oneDim.id,
- info: oneDim.info,
- name: oneDim.name,
- phone: oneDim.phone,
- sex: oneDim.sex,
- siteId: oneDim.siteId,
- siteName: oneDim.siteName,
- type: oneDim.type,
- list: [oneDim]
- });
- }
- }
- });
- return dataArr;
- },
-
- // 筛选现有人员
- contrastDeDuplication: function contrastDeDuplication(arr) {
- var _this5 = this;
-
- var _this = this;
- var p = new promise_default.a(function (resolve, reject) {
- var list = [];
- arr.map(function (li) {
- _this5.getperson(li, function (data) {
- if (data) {
- li.id = data.id;
- li.info = data.info;
- list.push(li);
- }
- });
- });
- setTimeout(function () {
- resolve(list);
- // reject("筛选错误");
- }, 1000);
- });
- p.then(function (list) {
- // let result = _this.mapTwoDimension(list)
- _this.getRoomIdMethods(list);
- }).catch(function (error) {
- _this.$message.error("请求错误");
- });
- },
-
- // 获取房间id
- getRoomIdMethods: function getRoomIdMethods(result) {
- var _this6 = this;
-
- result.map(function (lt) {
- var id = _this6.deviceList.filter(function (item) {
- return item.roomName == lt.siteName;
- })[0];
- if (id) {
- lt.manufactureId = id.manufactureId;
- lt.deviceNum = id.deviceNum;
- lt.imei = id.imei;
- lt.roomId = id.roomId;
- lt.color = '';
- if (lt.cardId.length == 8) {
- lt.nfc = lt.cardId;
- } else if (lt.cardId.length == 0) {
- lt.nfc = "";
- } else {
- var nfc = '';
- var array3 = Object(utils["d" /* dec2hex */])(lt.cardId);
- var arr4 = Object(utils["h" /* group */])(array3, 2);
- arr4.map(function (li) {
- nfc += li;
- });
- lt.nfc = nfc;
- }
- var num = _this6.allCertificates.filter(function (item) {
- return item.cardId == lt.id;
- });
- lt.num = num.length + 1;
- } else {
- lt.color = 'bgred';
- }
- });
- this.userlistTwo = result;
- },
-
- // 比对表格
- comparisonMethods: function comparisonMethods() {
- var _this7 = this;
-
- return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
- var arr, result;
- return regenerator_default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- _context2.next = 2;
- return _this7.screenMethods(_this7.userlist, _this7.userlistOne, _this7.filterFields);
-
- case 2:
- arr = _context2.sent;
-
- console.log(arr);
- _context2.next = 6;
- return _this7.contrastDeDuplication(arr);
-
- case 6:
- result = _context2.sent;
-
- case 7:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, _this7);
- }))();
- },
- screenMethods: function screenMethods(arr1, arr2, KeyName) {
- var KeyNameData = KeyName;
- var sum = 0,
- products = [];
- if (KeyNameData.length === 0) {
- this.$message.error("请选择筛选条件");
- } else {
- var _loop = function _loop(i) {
- products = arr1.filter(function (item) {
- return arr2.some(function (val) {
- return item[KeyNameData[i]] == val[KeyNameData[i]];
- });
- });
- };
-
- for (var i = 0; i < KeyNameData.length; i++) {
- _loop(i);
- }
- return products;
- }
- },
-
- // 多选操作
- handleSelectionChange: function handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- handleSelectionChangeOne: function handleSelectionChangeOne(val) {
- this.multipleSelectionOne = val;
- },
- handleSelectionChangeTwo: function handleSelectionChangeTwo(val) {
- this.multipleSelectionTwo = val;
- },
-
- // 导入
- exportData: function exportData(event) {
- var _this8 = this;
-
- return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
- var that, f, reader;
- return regenerator_default.a.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- if (event.currentTarget.files.length) {
- _context3.next = 2;
- break;
- }
-
- return _context3.abrupt("return");
-
- case 2:
- that = _this8;
- // 拿取文件对象
-
- f = event.currentTarget.files[0];
- // 用FileReader来读取
-
- reader = new FileReader();
- // 重写FileReader上的readAsBinaryString方法
-
- FileReader.prototype.readAsBinaryString = function (f) {
- var binary = "";
- var wb; // 读取完成的数据
- var outdata; // 你需要的数据
- var reader = new FileReader();
- reader.onload = function (e) {
- // 读取成Uint8Array,再转换为Unicode编码(Unicode占两个字节)
- var bytes = new Uint8Array(reader.result);
- var length = bytes.byteLength;
- for (var i = 0; i < length; i++) {
- binary += String.fromCharCode(bytes[i]);
- }
- // 接下来就是xlsx了,具体可看api
- wb = xlsx_default.a.read(binary, {
- type: "binary"
- });
- outdata = xlsx_default.a.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
- // 自定义方法向父组件传递数据
- var userInfo = localStorage.getItem('info');
- var arr = [];
- outdata.map(function (li, index) {
- var obj = {};
- obj.name = li["名称"];
- obj.siteId = li["房间ID"];
- obj.siteName = li["绑定房间"];
- obj.number = li["编号/证件号/学工号"];
- obj.cardId = li["卡号"];
- obj.phone = li["电话"];
- obj.sex = li["性别"];
- obj.id = li["id"];
- obj.cardState = '1';
- obj.enterpriseId = JSON.parse(userInfo).enterpriseId;
- obj.type = 0;
- var phone = obj.phone.toString();
- obj.siteId = stringify_default()(obj.siteId);
- var str = {
- userPassword: phone.substring(phone.length - 6, phone.length - 1),
- userTelephone: phone
- };
- obj.info = stringify_default()(str);
- if (obj.sex == "男") {
- obj.sex = 1;
- } else if (obj.sex == "女") {
- obj.sex = 2;
- }
- arr.push(obj);
- });
- var map = {},
- dest = [];
- for (var i = 0; i < arr.length; i++) {
- var ai = arr[i];
- if (!map[ai.phone]) {
- dest.push({
- name: ai.name,
- siteId: ai.siteId,
- siteName: ai.siteName,
- number: ai.number,
- cardId: ai.cardId,
- phone: ai.phone,
- sex: ai.sex,
- id: ai.id,
- cardState: ai.cardState,
- enterpriseId: ai.enterpriseId,
- type: ai.type,
- info: ai.info
- });
- map[ai.phone] = ai;
- }
- }
- that.$nextTick(function () {
- that.userlist = arr;
- });
- };
- reader.readAsArrayBuffer(f);
- };
- reader.readAsBinaryString(f);
-
- case 7:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, _this8);
- }))();
- },
- exportDataOne: function exportDataOne(event) {
- if (!event.currentTarget.files.length) {
- return;
- }
- var that = this;
- // 拿取文件对象
- var f = event.currentTarget.files[0];
- // 用FileReader来读取
- var reader = new FileReader();
- // 重写FileReader上的readAsBinaryString方法
- FileReader.prototype.readAsBinaryString = function (f) {
- var binary = "";
- var wb; // 读取完成的数据
- var outdata; // 你需要的数据
- var reader = new FileReader();
- reader.onload = function (e) {
- // 读取成Uint8Array,再转换为Unicode编码(Unicode占两个字节)
- var bytes = new Uint8Array(reader.result);
- var length = bytes.byteLength;
- for (var i = 0; i < length; i++) {
- binary += String.fromCharCode(bytes[i]);
- }
- // 接下来就是xlsx了,具体可看api
- wb = xlsx_default.a.read(binary, {
- type: "binary"
- });
- outdata = xlsx_default.a.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
- // 自定义方法向父组件传递数据
- var userInfo = localStorage.getItem('info');
- var arr = [];
- outdata.map(function (li, index) {
- var obj = {};
- obj.name = li["名称"];
- obj.siteId = li["房间ID"];
- obj.siteName = li["绑定房间"];
- obj.number = li["编号/证件号/学工号"];
- obj.cardId = li["卡号"];
- obj.phone = li["电话"];
- obj.sex = li["性别"];
- obj.id = li["id"];
- obj.cardState = '1';
- obj.enterpriseId = JSON.parse(userInfo).enterpriseId;
- obj.type = 0;
- var phone = obj.phone.toString();
- var str = {
- userPassword: phone.substring(phone.length - 6, phone.length - 1),
- userTelephone: phone
- };
- obj.info = stringify_default()(str);
- if (obj.sex == "男") {
- obj.sex = 1;
- } else if (obj.sex == "女") {
- obj.sex = 2;
- }
- arr.push(obj);
- });
- that.$nextTick(function () {
- that.userlistOne = arr;
- });
- };
- reader.readAsArrayBuffer(f);
- };
- reader.readAsBinaryString(f);
- },
- btnClick: function btnClick() {
- document.querySelector(".input-file").click();
- },
- btnClickOne: function btnClickOne() {
- document.querySelector(".input-fileOne").click();
- },
- exportBtn: function exportBtn() {
- this.exportExcel();
- },
- exportExcel: function exportExcel() {
- var sheet1data = [['名称', '卡号', '状态', '电话', '绑定房间', '性别']];
- var sheet1 = xlsx_default.a.utils.json_to_sheet(sheet1data, {
- skipHeader: true
- });
- // 创建一个新的空的workbook
- var wb = xlsx_default.a.utils.book_new();
- xlsx_default.a.utils.book_append_sheet(wb, sheet1, '人员导入模板');
- // XLSX.utils.book_append_sheet(wb, sheet2, '行政部')
- // XLSX.utils.book_append_sheet(wb, sheet3, '前端部')
- var workbookBlob = this.workbook2blob(wb);
- this.openDownloadDialog(workbookBlob, '人员导入模板.xlsx');
- },
-
- // 将blob对象 创建bloburl,然后用a标签实现弹出下载框
- openDownloadDialog: function openDownloadDialog(blob, fileName) {
- if ((typeof blob === "undefined" ? "undefined" : typeof_default()(blob)) === 'object' && blob instanceof Blob) {
- blob = URL.createObjectURL(blob); // 创建blob地址
- }
- var aLink = document.createElement('a');
- aLink.href = blob;
- // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,有时候 file:///模式下不会生效
- aLink.download = fileName || '';
- var event;
- if (window.MouseEvent) event = new MouseEvent('click');
- // 移动端
- else {
- event = document.createEvent('MouseEvents');
- event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- }
- aLink.dispatchEvent(event);
- },
-
- // 下载模板
- workbook2blob: function workbook2blob(workbook) {
- // 生成excel的配置项
- var wopts = {
- // 要生成的文件类型
- bookType: 'xlsx',
- // // 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
- bookSST: false,
- type: 'binary'
- };
- var wbout = xlsx_default.a.write(workbook, wopts);
- // 将字符串转ArrayBuffer
- function s2ab(s) {
- var buf = new ArrayBuffer(s.length);
- var view = new Uint8Array(buf);
- for (var i = 0; i !== s.length; ++i) {
- view[i] = s.charCodeAt(i) & 0xff;
- }return buf;
- }
- var buf = s2ab(wbout);
- var blob = new Blob([buf], {
- type: 'application/octet-stream'
- });
- return blob;
- }
- }
- });
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-226ecd6d","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/components/contrast/contrast.vue
- var contrast_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"pa-2"},[_c('el-row',[_c('el-col',{attrs:{"span":24}},[_c('div',{staticClass:"d-flex justify-space-between"},[_c('div',[_c('el-button',{staticClass:"importBtn",attrs:{"type":"primary","size":"mini"},on:{"click":_vm.comparisonMethods}},[_vm._v("比对表格")]),_vm._v(" "),_c('el-select',{attrs:{"size":"mini","collapse-tags":"","multiple":"","placeholder":"请选择对比条件"},model:{value:(_vm.filterFields),callback:function ($$v) {_vm.filterFields=$$v},expression:"filterFields"}},_vm._l((_vm.filterFieldsList),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1)],1),_vm._v(" "),_c('div',[_c('el-switch',{attrs:{"active-text":"批量操作"},model:{value:(_vm.batchOperation),callback:function ($$v) {_vm.batchOperation=$$v},expression:"batchOperation"}})],1)])])],1),_vm._v(" "),_c('el-divider'),_vm._v(" "),_c('el-row',{attrs:{"gutter":20}},[_c('el-col',{attrs:{"span":12}},[_c('el-divider',[_vm._v("需要上传人员表")]),_vm._v(" "),_c('el-col',{staticClass:"mb-5",attrs:{"span":24}},[_c('input',{staticClass:"input-file",attrs:{"type":"file","accept":".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"},on:{"change":_vm.exportData}}),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":_vm.btnClick}},[_vm._v("导入EXCEL")]),_vm._v(" "),_c('el-button',{staticClass:"importBtn",attrs:{"size":"mini"},on:{"click":_vm.exportBtn}},[_vm._v("下载模板")]),_vm._v(" "),_c('el-button',{attrs:{"size":"mini"},on:{"click":_vm.deleteSelect}},[_vm._v("批量移除")]),_vm._v(" "),_c('el-button',{attrs:{"size":"mini"},on:{"click":_vm.clearAll}},[_vm._v("清空")])],1),_vm._v(" "),_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.userlist,"border":"","stripe":"","header-cell-class-name":"table-header","height":"400"},on:{"selection-change":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{"type":"selection","width":"55"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"name","label":"名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"number","label":"学号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"cardId","label":"卡号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"phone","label":"手机号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"siteName","label":"绑定房间"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"性别","align":"center"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_vm._v("\n "+_vm._s(scope.row.sex == 1 ? "男" : "女")+"\n ")]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"门卡状态","align":"center"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.cardState == 1)?_c('span',[_vm._v("正常")]):_vm._e(),_vm._v(" "),(scope.row.cardState == 2)?_c('span',[_vm._v("挂失")]):_vm._e(),_vm._v(" "),(scope.row.cardState == 3)?_c('span',[_vm._v("挂失冻结")]):_vm._e(),_vm._v(" "),(scope.row.cardState == 4)?_c('span',[_vm._v("冻结")]):_vm._e(),_vm._v(" "),(scope.row.cardState == 5)?_c('span',[_vm._v("预开户")]):_vm._e(),_vm._v(" "),(scope.row.cardState == 6)?_c('span',[_vm._v("过期")]):_vm._e()]}}])})],1)],1),_vm._v(" "),_c('el-col',{attrs:{"span":12}},[_c('el-divider',[_vm._v("现有人员表")]),_vm._v(" "),_c('el-col',{staticClass:"mb-5",attrs:{"span":24}},[_c('input',{staticClass:"input-file input-fileOne",attrs:{"type":"file","accept":".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"},on:{"change":_vm.exportDataOne}}),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":_vm.btnClickOne}},[_vm._v("导入EXCEL")]),_vm._v(" "),_c('el-button',{attrs:{"size":"mini"},on:{"click":_vm.clearAllOne}},[_vm._v("清空")])],1),_vm._v(" "),_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.userlistOne,"border":"","stripe":"","header-
- var contrast_staticRenderFns = []
- var contrast_esExports = { render: contrast_render, staticRenderFns: contrast_staticRenderFns }
- /* harmony default export */ var contrast_contrast = (contrast_esExports);
- // CONCATENATED MODULE: ./src/components/contrast/contrast.vue
- function contrast_injectStyle (ssrContext) {
- __webpack_require__("XbTi")
- }
- var contrast_normalizeComponent = __webpack_require__("VU/8")
- /* script */
-
-
- /* template */
-
- /* template functional */
- var contrast___vue_template_functional__ = false
- /* styles */
- var contrast___vue_styles__ = contrast_injectStyle
- /* scopeId */
- var contrast___vue_scopeId__ = "data-v-226ecd6d"
- /* moduleIdentifier (server only) */
- var contrast___vue_module_identifier__ = null
- var contrast_Component = contrast_normalizeComponent(
- contrast,
- contrast_contrast,
- contrast___vue_template_functional__,
- contrast___vue_styles__,
- contrast___vue_scopeId__,
- contrast___vue_module_identifier__
- )
-
- /* harmony default export */ var components_contrast_contrast = (contrast_Component.exports);
-
- // EXTERNAL MODULE: ./src/views/zw.vue + 1 modules
- var zw = __webpack_require__("RMlb");
-
- // EXTERNAL MODULE: ./src/views/getFinger.vue + 2 modules
- var getFinger = __webpack_require__("BXO0");
-
- // EXTERNAL MODULE: ./node_modules/js-md5/src/md5.js
- var md5 = __webpack_require__("NC6I");
- var md5_default = /*#__PURE__*/__webpack_require__.n(md5);
-
- // EXTERNAL MODULE: ./node_modules/axios/index.js
- var axios = __webpack_require__("mtWM");
- var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
-
- // EXTERNAL MODULE: ./src/utils/verification.js
- var verification = __webpack_require__("7qU6");
-
- // EXTERNAL MODULE: ./src/components/visualizcomponent/NumberGrow.vue + 2 modules
- var NumberGrow = __webpack_require__("eVaK");
-
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/userManagement.vue
-
-
-
-
-
-
-
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var userManagement_nowDate = new Date();
- var userManagement_currentTime = userManagement_nowDate;
- var userManagement_endcurrentTime = Object(utils["g" /* getcurrentTime1 */])(6);
-
-
-
-
-
-
-
- /* harmony default export */ var userManagement = ({
- inject: ['reload'],
- name: "campus",
- data: function data() {
- var _this2 = this;
-
- return {
- frozenDialog: false, //冻结用户选择时间
- frozenDataSelect: { time: '', timeOne: '' },
- roomScreen: [], //筛选只展示房间,不展示层级
- paginationConfig: 'total, sizes, prev, pager, next, jumper',
- pickerOptionsBegin: {
- disabledDate: function disabledDate(time) {
- // time为形参,实参就是自动获取到的beginTime元素可以选的值
- var maxDateTimeOne = new Date(_this2.maxDateTime).getTime();
- var minDateTimeOne = new Date(_this2.minDateTime).getTime();
- return time.getTime() > maxDateTimeOne || time.getTime() < minDateTimeOne;
- }
- },
- pickerOptionsEnd: {
- disabledDate: function disabledDate(time) {
- var maxDateTimeOne = new Date(_this2.value2[0]).getTime();
- return time.getTime() < maxDateTimeOne; /*今天及之前*/
- }
- },
- regularCard: false,
- drawerVisible: false,
- props: {
- multiple: true,
- emitPath: false
- },
- defaultEnterpriseId: [],
- defaultEnterpriseIdBack: [],
- checkEnterpriseNode: [],
- enterpriseListOption: [],
- WhetherToGreatAnAccount: false,
- dateRange: [],
- batchCredentialList: [],
- multipleSelection4: [],
- // 记录筛选条件
- recordFilterCondition: {
- imei: '',
- deviceNum: '',
- status: '',
- type: '',
- roomId: ''
- },
- sendListRecords: [],
- bindSelectedList: [], //选定绑定房间列表
- bindRoomlist: [], //房源列表
- rulesAdd: {
- username: [{
- required: true,
- message: '请输入姓名',
- trigger: 'blur'
- }],
- documentType: [{
- required: true,
- message: '请选择凭证类型',
- trigger: 'blur'
- }],
- pzname: [{
- required: true,
- message: '请输入凭证名称',
- trigger: 'blur'
- }],
- nfc: [{
- required: true,
- message: '请输入NFC',
- trigger: 'blur'
- }],
- idcard: [{
- required: true,
- message: '请输入卡号',
- trigger: 'blur'
- }],
- password: [{
- required: true,
- message: '请输入密码',
- trigger: 'blur'
- }]
- },
- rules: {
- roomlistVoucher: [],
- SelectedListVoucher: [],
- name: [{
- required: true,
- message: '请输入姓名',
- trigger: 'blur'
- }],
- cardId: [{
- required: true,
- message: '请输入卡号',
- trigger: 'blur'
- }],
- number: [{
- required: true,
- message: '请输入身份证号',
- trigger: 'blur'
- }],
- phone: [{
- required: true,
- message: '请输入电话',
- trigger: 'blur'
- }],
- enterpriseId: [{
- required: true,
- message: '请选择所属部门',
- trigger: 'blur'
- }],
- type: [{
- required: true,
- message: '请选择身份角色',
- trigger: 'blur'
- }]
- },
- tableheight: 0,
- credentialSearch: {
- deviceNum: '',
- imei: '',
- status: '',
- roomId: '',
- type: ''
- },
- selectoption: [],
- selectoptionValue: '',
- enterpriselist: [],
- continuationManagementDate: {
- time: ''
- },
- continuationManagementStatus: false,
- Reissueform: {},
- Reissue: '',
- bindRoomStatus: false,
- bindRoomStatus1: false,
- drawer: false,
- zNodes: [],
- allroomlist: [],
- selectRow: [],
- bindRoomForm: {},
- modify: true,
- roomlistZNodes: [],
- roonNameTop: '',
- lsmm: {},
- roomtablestatus1: true,
- SelectedList: [],
- documentType1: "请选择",
- certificatestatus: false,
- dialogImageUrl: "",
- dialogVisible: false,
- pageSize1: 10,
- disabled1: false,
- setting: {
- edit: {
- enable: true,
- drag: {
- isMove: true
- },
- showRemoveBtn: false,
- showRenameBtn: false
- },
- check: {
- enable: false
- },
- data: {
- simpleData: {
- enable: true,
- pIdKey: "pid"
- }
- },
- view: {
- showIcon: true,
- addHoverDom: this.addHoverDom,
- removeHoverDom: this.removeHoverDom
- }
- },
- value2: ['', ''],
- value3: ['', ''],
- userliststatu: true,
- roomstatus: true,
- roomstatus1: true,
- roomtable: [],
- roomtable1: [],
- roomtable2: [],
- roomtableStatus: true,
- activeName: "0",
- limitUpload: 1000,
- arr: [],
- cardstatus: [{
- value: 1,
- label: "正常"
- }, {
- value: 4,
- label: "冻结"
- }],
- currentPage4: 1,
- currentPage1: 1,
- currentPage2: 1,
- editVisiblelist: false,
- userlist: [],
- userlist1: [],
- userlist1statu: true,
- modifyStatus: true,
- options: {
- type: "pie",
- xRorate: 25,
- legend: {
- position: "left"
- },
- showValue: false,
- bgColor: "rgba(255,255,255,0)",
- labels: ["密码凭证", "身份凭证", "其他"],
- datasets: [{
- data: [28, 10, 2]
- }]
- },
- query: {
- cardId: "",
- number: "",
- name: "",
- type: 0,
- pzname: ""
- },
- tableData: [],
- total1: 0,
- total2: 0,
- multipleSelection: [],
- multipleSelection1: [],
- multipleSelection2: [],
- multipleSelection3: [],
- delList: [],
- editVisible: false,
- pageTotal: 0,
- form: {
- sex: 1,
- cardState: 1,
- name: "",
- number: "",
- cardId: "",
- phone: "",
- enterpriseId: '',
- type: '',
- fingerprintAlias: ''
- },
- idx: -1,
- id: -1,
- activeiconfont: true,
- normal: 0,
- total: 0,
- frozen: 0,
- lose: 0,
- uploadkj: false,
- file: "",
- fileTemp: "",
- files: "",
- treedata: {},
- drawerRow: {},
- deviceList: [],
- userlistquery: [],
- userlistquery1: [],
- temporaryPassword: '',
- documentType: "请选择",
- voucher: {
- username: "",
- pzname: "",
- nfc: "",
- idcard: "",
- password: "123456",
- fingerprintAlias: ""
- },
- bindroomstatus: true,
- fingerprintTransfer: 0,
- fingerprintId: 0,
- checkList: "",
- margkli: "",
- roomlist: [],
- roomlist2: [],
- defaultProps: {
- children: "children",
- label: "name",
- disabled: this.disabledFn
- },
- selectkey: [],
- certificatesContent: {
- pzname: ""
- },
- certificatesRow: {},
- selectkey1: "",
- addroomstatus: true,
- selectkeyadd: [],
- selectRoomdeletelist: [], //多选删除房间数据
- roomlist1: [],
- AboutDevice: [],
- reissue: {
- voucher: ""
- },
- modifyrow: {},
- modifyvalue2: [userManagement_currentTime, userManagement_endcurrentTime],
- allAboutDevice: [],
- localFingerprint: {},
- selectRoom: true,
- personname: '操作',
- pageNum: 1,
- pageSize: 10,
- userInfo: {
- type: ''
- },
- viewRecordSelected: {
- password: ''
- },
- batchRenewalList: [],
- batchRenewalShow: false,
- batchRenewalFrom: {
- startTime: '',
- endTime: ''
- },
- checkInListing: [],
- freeUserManageRow: [],
- freeUserDate: [],
- freeUserDialog: false,
- batchFreeShow: true,
- freeUserTitle: '冻结用户',
- userTypeList: [],
- maxDateTime: '',
- minDateTime: ''
- };
- },
-
- computed: {},
- created: function created() {
- this.userTypeList = this.$MANUFACTURER.userType;
- this.$store.commit('getTree');
- this.tableheight = document.documentElement.clientHeight - 240;
- this.userInfo = JSON.parse(localStorage.getItem('info'));
- this.form.enterpriseId = this.userInfo.enterpriseId;
- this.getAboutRoom();
- this.getEnterprise();
- this.getalllist();
- // this.getcardstatus();
- this.getAboutDevice(); //获取和房间相关的设备
- this.getlockUser();
- this.selectoption = JSON.parse(localStorage.getItem('selectoption'));
- this.selectoptionValue = localStorage.getItem('tenantId');
-
- if (document.documentElement.clientWidth < 1080) {
- this.paginationConfig = 'total, prev, pager, next';
- } else {
- this.paginationConfig = 'total, sizes, prev, pager, next, jumper';
- }
- },
-
- components: {
- Schart: vue_schart["a" /* default */],
- userContent: usercontent["a" /* default */],
- zTree: zTree1["a" /* default */],
- personLi: src_components_personLi,
- zw: zw["a" /* default */], getFinger: getFinger["default"],
- contrast: components_contrast_contrast,
- NumberGrow: NumberGrow["a" /* default */]
- },
- mounted: function mounted() {
- document.addEventListener('keydown', this.keyDown);
- },
- beforeDestroy: function beforeDestroy() {
- this.$store.commit("increment", 1);
- },
-
- methods: {
- // 限时密码
- limitedTimePassword: function limitedTimePassword(index, row) {
- var _this3 = this;
-
- var startTime = moment_default()(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss");
- var endTime = moment_default()(new Date().getTime() + 4 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss");
- var data3 = {
- code: "/zg/offlinepassword/limit",
- data: {
- userName: JSON.parse(this.drawerRow.info).userId,
- lockId: row.deviceNum,
- startTime: startTime,
- endTime: endTime
- }
- };
-
- this.$confirm('此操作将获取限时密码, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- Object(api["g" /* httpPost */])(data3, _this3.$api.sendCommand).then(function (res4) {
- if (res4.success) {
- _this3.$alert("" + res4.data, '限时密码', {
- confirmButtonText: "确定",
- callback: function callback(action) {}
- });
- }
- });
- });
- },
-
- // 对时密码
- timingPassword: function timingPassword(index, row) {
- var _this4 = this;
-
- var startTime = moment_default()(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss");
- var endTime = moment_default()(new Date().getTime() + 24 * 60 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss");
- var data3 = {
- code: "/zg/offlinepassword/correctTime",
- data: {
- userName: JSON.parse(this.drawerRow.info).userId,
- lockId: row.deviceNum
- }
- };
-
- this.$confirm('此操作将获取对时密码, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- Object(api["g" /* httpPost */])(data3, _this4.$api.sendCommand).then(function (res4) {
- if (res4.success) {
- _this4.$alert("" + res4.data, '对时密码', {
- confirmButtonText: "确定",
- callback: function callback(action) {}
- });
- }
- });
- });
- },
-
- // 清空所有密码
- clearAllPassWord: function clearAllPassWord(index, row) {
- var _this5 = this;
-
- var startTime = moment_default()(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss");
- var endTime = moment_default()(new Date().getTime() + 24 * 60 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss");
- var data3 = {
- code: "/zg/offlinepassword/clear",
- data: {
- userName: JSON.parse(this.drawerRow.info).userId,
- lockId: row.deviceNum,
- startTime: startTime
- // endTime:endTime,
- }
- };
-
- this.$confirm('此操作将获取清空密码, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- Object(api["g" /* httpPost */])(data3, _this5.$api.sendCommand).then(function (res4) {
- if (res4.success) {
- _this5.$alert("" + res4.data, '清空密码', {
- confirmButtonText: "确定",
- callback: function callback(action) {}
- });
- }
- });
- });
- },
-
- /*获取临时离线密码*/
- getLimitMethods: function getLimitMethods(index, row) {
- var _this6 = this;
-
- var startTime = moment_default()(new Date().getTime()).format("YYYY-MM-DD HH:mm:ss");
- var endTime = moment_default()(new Date().getTime() + 24 * 60 * 60 * 1000).format("YYYY-MM-DD HH:mm:ss");
- var data3 = {
- code: "/zg/offlinepassword/forever",
- data: {
- userName: JSON.parse(this.drawerRow.info).userId,
- lockId: row.deviceNum,
- startTime: startTime
- // endTime:endTime,
- }
- };
- Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res4) {
- if (res4.success) {
- _this6.$alert("" + res4.data, '离线密码', {
- confirmButtonText: "确定",
- callback: function callback(action) {}
- });
- }
- });
- },
-
- // 对比结果
- backTableMethods: function backTableMethods(data) {
- console.log(data);
- },
- tableRowClassName: function tableRowClassName(_ref) {
- var row = _ref.row,
- rowIndex = _ref.rowIndex;
-
- if (row.color == '0') {
- return "wait-row";
- } else if (row.color == '1') {
- return "success-row";
- } else if (row.color == '702') {
- return "wait-row";
- } else if (row.color == '999') {
- return 'warning-row';
- }
- },
- keyDown: function keyDown(e) {
- //如果是回车则执行登录方法
- if (e.keyCode == 13) {
- if (this.$route.name == 'userManagement') {
- if (!this.drawer) {
- this.handleSearch();
- }
- }
- }
- },
- handleDate: function handleDate(e) {
- var _this7 = this;
-
- this.$nextTick(function () {
- if (e == null) {
- _this7.value2 = [];
- _this7.value3 = [];
- _this7.freeUserDate = [];
- }
- });
- },
- freeUserConfirm: function freeUserConfirm() {
- var _this8 = this;
-
- this.$confirm('是否冻结该锁用户?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- var row = _this8.freeUserManageRow[0];
- // row.frozenStartTime = moment(this.freeUserDate[0]).format("X")
- // row.frozenEndTime = moment(this.freeUserDate[1]).format("X")
- allFun["a" /* default */].freeUserManage(1, row, function (callback) {
- if (callback.code == 200) {
- _this8.$message.success("冻结指令下发成功");
- _this8.freeUserDialog = false;
- } else {
- _this8.$message.error("冻结指令下发失败");
- }
- });
- });
- return;
- if (this.freeUserDate.length != 2) {
- this.$confirm('是否冻结该锁用户?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- var row = _this8.freeUserManageRow[0];
- row.frozenStartTime = 1676603379; //moment(this.freeUserDate[0]).format("X")
- row.frozenEndTime = 1895132615; //moment(this.freeUserDate[1]).format("X")
- allFun["a" /* default */].freeUserManage(1, row, function (callback) {
- if (callback.code == 200) {
- _this8.$message.success("冻结指令下发成功");
- _this8.freeUserDialog = false;
- } else {
- _this8.$message.error("冻结指令下发失败");
- }
- });
- });
- } else {
- this.$message.error("请选择开始结束时间");
- }
- },
-
- // 冻结锁用户
- frozenMethods: function frozenMethods(index, row) {
- var userRow = row;
- var drawerRow = this.drawerRow;
- userRow['userId'] = JSON.parse(drawerRow.info).userId || JSON.parse(drawerRow.info).userPassword;
- userRow['keyId'] = JSON.parse(drawerRow.info).keyId || JSON.parse(drawerRow.info).userPassword;
- userRow['frozenStartTime'] = moment_default()(row.startTime).format("X");
- userRow['frozenEndTime'] = moment_default()(row.endTime).format("X");
- this.freeUserDate = [row.startTime, row.endTime];
- this.freeUserManageRow = [userRow];
- this.freeUserTitle = '冻结锁用户';
- this.frozenDialog = true;
- // this.freeUserConfirm()
- // this.batchFreeShow = true
- // this.freeUserDialog = true
- },
-
- // 冻结用户选择完时间后
- frozenTimeSureMethods: function frozenTimeSureMethods() {
- var _this9 = this;
-
- return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
- return regenerator_default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _this9.freeUserManageRow.map(function (li) {
- li.frozenStartTime = moment_default()(_this9.value2[0]).valueOf() / 1000;
- li.frozenEndTime = moment_default()(_this9.value2[1]).valueOf() / 1000;
- });
- _context.next = 3;
- return _this9.freeUserConfirm();
-
- case 3:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, _this9);
- }))();
- },
-
- // 解冻锁用户
- thawMethods: function thawMethods(index, row) {
- var _this10 = this;
-
- var userRow = row;
- var drawerRow = this.drawerRow;
- userRow['userId'] = JSON.parse(drawerRow.info).userId || JSON.parse(drawerRow.info).userPassword;
- userRow['keyId'] = JSON.parse(drawerRow.info).keyId || JSON.parse(drawerRow.info).userPassword;
- userRow['frozenStartTime'] = 1676603379; //moment(row.startTime).format("X")
- userRow['frozenEndTime'] = 1895132615; //moment(row.endTime).format("X")
- this.$confirm('是否解冻该锁用户?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- allFun["a" /* default */].freeUserManage(0, userRow, function (callback) {
- if (callback.code == 200) {
- _this10.$message.success("解冻指令下发成功");
- } else {
- _this10.$message.error("解冻指令下发失败");
- }
- });
- });
- },
-
- // 批量冻结用户
- batchfrozenMethods: function batchfrozenMethods() {
- this.freeUserTitle = '批量冻结锁用户';
- this.freeUserDate = [];
- this.batchFreeUserConfirm();
- // this.batchFreeShow = false
- // this.freeUserDialog = true
- },
- batchFreeUserConfirm: function batchFreeUserConfirm() {
- var _this11 = this;
-
- var userRow = this.batchRenewalList;
- var drawerRow = this.drawerRow;
- this.$confirm('是否冻结这些锁用户?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- userRow.map(function (li) {
- li['userId'] = JSON.parse(drawerRow.info).userId || JSON.parse(drawerRow.info).userPassword;
- li['keyId'] = JSON.parse(drawerRow.info).keyId || JSON.parse(drawerRow.info).userPassword;
- li['frozenStartTime'] = 1676603379; //moment(this.freeUserDate[0]).format("X")
- li['frozenEndTime'] = 1895132615; //moment(this.freeUserDate[1]).format("X")
- allFun["a" /* default */].freeUserManage(1, li, function (callback) {
- if (callback.code == 200) {
- _this11.$message.success("冻结指令下发成功");
- _this11.batchRenewalList = [];
- _this11.freeUserDialog = false;
- } else {
- _this11.$message.error("冻结指令下发失败");
- }
- });
- });
- });
- },
-
- // 批量解锁用户
- batchthawMethods: function batchthawMethods() {
- var _this12 = this;
-
- var userRow = this.batchRenewalList;
- var drawerRow = this.drawerRow;
- this.$confirm('是否解冻这些锁用户?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- userRow.map(function (li) {
- li['userId'] = JSON.parse(drawerRow.info).userId || JSON.parse(drawerRow.info).userPassword;
- li['keyId'] = JSON.parse(drawerRow.info).keyId || JSON.parse(drawerRow.info).userPassword;
- li['frozenStartTime'] = 1676603379; //moment(li.startTime).format("X")
- li['frozenEndTime'] = 1895132615; //moment(li.endTime).format("X")
- allFun["a" /* default */].freeUserManage(0, li, function (callback) {
- if (callback.code == 200) {
- _this12.$message.success("解冻指令下发成功");
- _this12.batchRenewalList = [];
- _this12.freeUserDialog = false;
- } else {
- _this12.$message.error("解冻指令下发失败");
- }
- });
- });
- });
- },
-
- // 获取锁用户总数
- getlockUser: function getlockUser() {
- var data = {
- pageNum: 0,
- pageSize: 0,
- q: stringify_default()({
- type: 26,
- status: 1,
- types: "26"
- }),
- orderBy: "create_at desc"
- };
- Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
- if (res.code == 200) {
- var _data = util["a" /* default */].zlib_unzip(res.data);
- // this.total = res.data.total
- }
- });
- },
-
- // 批量退租
- batchLeaseback: function batchLeaseback() {
- var _this13 = this;
-
- this.$confirm('是否退租?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- _this13.batchRenewalList.map(function (li, index) {
- _this13.deleteRoomfun(index, li);
- });
- });
- },
-
- // 单个续租
- singleRenewalMethods: function singleRenewalMethods(index, row) {
- this.batchRenewalList = [row];
- this.batchRenewalShow = true;
- },
-
- // 批量续租确认
- batchRenewalMethods: function batchRenewalMethods() {
- var _this14 = this;
-
- this.$confirm('此操作将延长入住时间, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- if (_this14.batchRenewalFrom.endTime == '' || _this14.batchRenewalFrom.startTime == '') {
- _this14.$message.error("请选择时间范围");
- return;
- }
- var drawerRow = _this14.drawerRow;
- _this14.batchRenewalList.map(function (li) {
- if (li.manufactureId == 101) {
- var userTelephone = JSON.parse(drawerRow.info).userTelephone;
- var userPassword = JSON.parse(drawerRow.info).userPassword;
- var endTime = new Date(_this14.batchRenewalFrom.endTime).getTime();
- var startTime = new Date(_this14.batchRenewalFrom.startTime).getTime();
- var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
- var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
- var data = {
- deviceNum: li.deviceNum,
- imei: li.imei,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: userPassword,
- operateMode: 2,
- order: 6202,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- cardName: drawerRow.name,
- roomName: li.roomName
- };
- equipment["a" /* default */].LDAddUser(data.deviceNum, data.imei, data.userTelephone, data.userPassword, data.password, passwordStartTime, passwordEndTime, data.operateMode, data.order, data.cardName, data.roomName, false, function (callback) {
- if (callback.success) {
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: drawerRow.id,
- deviceNum: li.deviceNum,
- types: "0,1,2,3,4",
- inStatus: "0,1"
- }
- };
- var unbind = {
- id: li.id,
- startTime: _this14.batchRenewalFrom.startTime,
- endTime: _this14.batchRenewalFrom.endTime
- };
- Object(api["g" /* httpPost */])(unbind, _this14.$api.setTenant).then(function (res) {});
- Object(api["d" /* httpGet */])(data, _this14.$api.getCertificates).then(function (res) {
- var data = util["a" /* default */].zlib_unzip(res.data);
- data.map(function (lt) {
- util["a" /* default */].modifyPutCarfid(li, lt, startTime, endTime);
- });
- });
- _this14.batchRenewalShow = false;
- } else {
- _this14.$message.error("修改失败");
- }
- });
- } else if (li.manufactureId == 201 || li.manufactureId == 221) {
- var endTime = new Date(_this14.batchRenewalFrom.endTime).getTime();
- var startTime = new Date(_this14.batchRenewalFrom.startTime).getTime();
- var unbind = [{
- cardId: drawerRow.id,
- siteId: li.roomId
- }];
- Object(api["g" /* httpPost */])(unbind, _this14.$api.unbindCard).then(function (res) {
- var data1 = [{
- cardId: drawerRow.id,
- siteId: li.roomId,
- startTime: _this14.batchRenewalFrom.startTime,
- endTime: _this14.batchRenewalFrom.endTime
- }];
- Object(api["g" /* httpPost */])(data1, _this14.$api.bindCard).then(function (res) {
- _this14.operation(0, _this14.drawerRow);
- });
- });
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: drawerRow.id,
- deviceNum: li.deviceNum,
- types: "0,1,2,3,4",
- inStatus: "0,1"
- }
- };
- Object(api["d" /* httpGet */])(data, _this14.$api.getCertificates).then(function (res) {
- var data = util["a" /* default */].zlib_unzip(res.data);
- data.map(function (lt) {
- util["a" /* default */].modifyPutCarfidzg(li, lt, startTime, endTime);
- });
- });
- _this14.batchRenewalShow = false;
- } else {
- _this14.$message.error("暂未发现对应设备");
- }
- });
- });
- },
- batchRenewal: function batchRenewal() {
- this.batchRenewalShow = true;
- },
-
- // 批量选择续租
- renewalOption: function renewalOption(val) {
- this.batchRenewalList = val;
- },
- batchProcessingData: function batchProcessingData() {
- var _this15 = this;
-
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_time desc"
- };
- // httpPost(data, this.$api.getlistNum).then((res1) => {
- this.multipleSelection.map(function (li) {
- _this15.GetCredentialList(li);
- });
- // })
- },
- GetCredentialList: function GetCredentialList(item) {
- allFun["a" /* default */].GetCredentialList(item, 1, function (callback) {
- var dataOne = util["a" /* default */].zlib_unzip(callback.data);
- if (dataOne.length > 0) {
- dataOne.map(function (li) {
- li['fingerprint'] = JSON.parse(li.content).fingerprint;
- });
- var arr = util["a" /* default */].uniqueArray(dataOne, "fingerprint");
- arr.map(function (li, index) {
- allFun["a" /* default */].completePersonnelVouchers(li, index, 1);
- });
- }
- });
- allFun["a" /* default */].GetCredentialList(item, 2, function (callback) {
- var dataOne = util["a" /* default */].zlib_unzip(callback.data);
- if (dataOne.length > 0) {
- dataOne.map(function (li) {
- li['password'] = JSON.parse(li.content).password;
- });
- var arr = util["a" /* default */].uniqueArray(dataOne, "password");
- arr.map(function (li, index) {
- allFun["a" /* default */].completePersonnelVouchers(li, index, 2);
- });
- }
- });
- allFun["a" /* default */].GetCredentialList(item, 3, function (callback) {
- var dataOne = util["a" /* default */].zlib_unzip(callback.data);
- if (dataOne.length > 0) {
- dataOne.map(function (li) {
- li['password'] = JSON.parse(li.content).password;
- });
- var arr = util["a" /* default */].uniqueArray(dataOne, "password");
- arr.map(function (li, index) {
- allFun["a" /* default */].completePersonnelVouchers(li, index, 3);
- });
- }
- });
- allFun["a" /* default */].GetCredentialList(item, 4, function (callback) {
- var dataOne = util["a" /* default */].zlib_unzip(callback.data);
- if (dataOne.length > 0) {
- dataOne.map(function (li) {
- li['password'] = JSON.parse(li.content).password;
- });
- var arr = util["a" /* default */].uniqueArray(dataOne, "password");
- arr.map(function (li, index) {
- allFun["a" /* default */].completePersonnelVouchers(li, index, 4);
- });
- }
- });
- },
-
- // 凭证避免重复
- avoidRepetition: function avoidRepetition(e, type) {
- var _this16 = this;
-
- var person = this.drawerRow;
- if (type == 12) {
- this.roomtable1.map(function (li) {
- var content = JSON.parse(li.content);
- if (li.cardId == person.id && content.password == e && li.type == 12) {
- _this16.$message.error("该身份证已存在");
- _this16.voucher.idcard = '';
- }
- });
- } else if (type == 13) {
- this.roomtable1.map(function (li) {
- var content = JSON.parse(li.content);
- if (li.cardId == person.id && content.password == e && li.type == 13) {
- _this16.$message.error("该NFC已存在");
- _this16.voucher.nfc = '';
- }
- });
- } else if (type == 14) {
- this.roomtable1.map(function (li) {
- var content = JSON.parse(li.content);
- if (li.cardId == person.id && content.password == e && li.type == 14) {
- _this16.$message.error("该密码已存在");
- _this16.voucher.password = '';
- }
- });
- }
- },
-
- // 指纹别名
- fingerprintAliasMethod: function fingerprintAliasMethod(e) {
- var _this17 = this;
-
- var person = this.drawerRow;
- this.roomtable1.map(function (li) {
- var content = JSON.parse(li.content);
- if (li.cardId == person.id && content.fingerprintAlias == e && li.type == 11) {
- _this17.$message.error("该指纹已存在");
- _this17.voucher.fingerprintAlias = '';
- }
- });
- },
-
- // 删除平台记录
- deleteCertificatesMethod: function deleteCertificatesMethod(index, row) {
- var _this18 = this;
-
- this.$confirm("确定要删除平台记录吗?", "提示", {
- type: "warning"
- }).then(function () {
- var data = {
- ids: [row.id]
- };
- Object(api["g" /* httpPost */])(data, _this18.$api.deleteCertificates).then(function (res) {
- if (res.success) {
- _this18.$message.success("删除成功!");
- _this18.getcertificate();
- _this18.obtainVoucherIssuanceRecord();
- }
- });
- });
- },
-
- // 记录筛选条件重置
- recordFilterConditionReset: function recordFilterConditionReset() {
- this.recordFilterCondition = {
- imei: '',
- deviceNum: '',
- status: '',
- type: '',
- roomId: ''
- };
- },
-
- // 查看下发记录
- viewDistributionRecord: function viewDistributionRecord(index, row) {
- this.activeName = 2;
- this.viewRecordSelected = row;
- this.obtainVoucherIssuanceRecord();
- },
- deleteCertificateMethod: function deleteCertificateMethod(index, row) {
- var _this19 = this;
-
- this.$confirm("此操作将删除锁上凭证,请确认!", "提示", {
- type: "warning"
- }).then(function () {
- _this19.deleteLockedCredential(index, row);
- }).catch(function () {});
- },
-
- // 删除锁上凭证
- deleteLockedCredential: function deleteLockedCredential(index, row) {
- var _this20 = this;
-
- var ids = this.roomtable;
- var that = this;
- var str = {};
- var q = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- lockType: 1
- };
- var data = {
- q: stringify_default()(q),
- pageNum: 1,
- pageSize: 10
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.data.list.length > 0) {
- var cardName = row.name + '-' + JSON.parse(row.content).pzname;
- if (res.data.list[0].manufactureId == 201 || res.data.list[0].manufactureId == 221) {
- if (row.type == 1) {
- _this20.getfiId1(row, function (data) {
- if (data.length > 0) {
- equipment["a" /* default */].delFingerPrints(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, data[0].face, 0, row.startTime, row.endTime, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 18;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content),
- serial: callback.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("下发成功");
- that.obtainVoucherIssuanceRecord();
- } else {
- that.$message.error(callback.msg);
- }
- });
- } else {
- that.$message.error("删除失败!");
- }
- });
- } else if (row.type == 2) {
- _this20.getfiId1(row, function (data) {
- if (data.length > 0) {
- equipment["a" /* default */].delCardRegister(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, 1, JSON.parse(row.content).password, 36, row.startTime, row.endTime, 6215, data[0].face, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 15;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content),
- serial: callback.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("下发成功");
- that.obtainVoucherIssuanceRecord();
- } else {
- that.$message.error(callback.msg);
- }
- });
- } else {
- that.$message.error("删除失败!");
- }
- });
- } else if (row.type == 3) {
- _this20.getfiId1(row, function (data) {
- if (data.length > 0) {
- equipment["a" /* default */].delCardRegister(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, 1, JSON.parse(row.content).password, 50, row.startTime, row.endTime, 6212, data[0].face, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 12;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content),
- serial: callback.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("下发成功");
- that.obtainVoucherIssuanceRecord();
- } else {
- that.$message.error(callback.msg);
- }
- });
- } else {
- that.$message.error("删除失败!");
- }
- });
- } else if (row.type == 4) {
- _this20.getfiId1(row, function (data) {
- if (data.length > 0) {
- equipment["a" /* default */].delForeverPassword(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, JSON.parse(row.content).password, 255, row.startTime, row.endTime, 6209, data[0].face, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 9;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content),
- serial: callback.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("下发成功");
- that.obtainVoucherIssuanceRecord();
- } else {
- that.$message.error(callback.msg);
- }
- });
- } else {
- that.$message.error("删除失败");
- }
- });
- }
- } else if (res.data.list[0].manufactureId == 101) {
- if (row.type == 1) {
- _this20.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,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- if (JSON.parse(row.content).pass) {
- str['pass'] = true;
- } else {
- str['pass'] = false;
- }
- Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
- if (res1.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 18;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content),
- serial: res1.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("下发成功");
- that.obtainVoucherIssuanceRecord();
- } else {
- that.$message.error("删除失败!");
- }
- });
- } else {
- that.$message.error("删除失败!");
- }
- });
- return false;
- } else if (row.type == 2) {
- str = {
- imei: row.imei,
- deviceNum: row.deviceNum,
- userTelephone: JSON.parse(row.content).userTelephone,
- operateMode: 15,
- order: 6215,
- password: JSON.parse(row.content).password,
- userPassword: JSON.parse(row.content).userPassword,
- is: false,
- passwordStartTime: JSON.parse(row.content).passwordStartTime,
- passwordEndTime: JSON.parse(row.content).passwordEndTime,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- } else if (row.type == 3) {
- str = {
- imei: row.imei,
- deviceNum: row.deviceNum,
- userTelephone: JSON.parse(row.content).userTelephone,
- operateMode: 12,
- order: 6212,
- password: JSON.parse(row.content).password,
- userPassword: JSON.parse(row.content).userPassword,
- is: false,
- passwordStartTime: JSON.parse(row.content).passwordStartTime,
- passwordEndTime: JSON.parse(row.content).passwordEndTime,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- } else if (row.type == 4) {
- str = {
- 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: JSON.parse(row.content).passwordStartTime,
- passwordEndTime: JSON.parse(row.content).passwordEndTime,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- }
- if (JSON.parse(row.content).pass) {
- str['pass'] = true;
- } else {
- str['pass'] = false;
- }
- Object(api["g" /* httpPost */])(str, _this20.$api.getDeviceOperateUserInfo).then(function (res1) {
- if (res1.success) {
- var content = JSON.parse(row.content);
- content.operateMode = str.operateMode;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content),
- serial: res1.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("下发成功");
- that.obtainVoucherIssuanceRecord();
- } else {
- that.$message.error("删除失败!");
- }
- });
- } else if (res.data.list[0].manufactureId == 1201) {
- if (row.type == 1) {} else if (row.type == 4) {
- var _data2 = {
- code: "lwj/passwordOperate",
- data: {
- lockerId: row.deviceNum,
- lockerUserId: JSON.parse(row.content).userPassword,
- action: 2,
- password: JSON.parse(row.content).password,
- startTime: row.startTime,
- endTime: row.endTime,
- operateMode: 9,
- order: 6209,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- }
- };
- Object(api["g" /* httpPost */])(_data2, _this20.$api.sendCommand).then(function (res) {
- if (res.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 9;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content),
- serial: res.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- } else {
- _this20.$message.error(res.msg);
- }
- });
- }
- }
- } else {
- _this20.$message.error("未找到对应设备");
- }
- });
- },
-
- // 获取凭证下发记录
- obtainVoucherIssuanceRecord: function obtainVoucherIssuanceRecord() {
- var _this21 = this;
-
- var AboutDevice = this.$store.state.roomAbout;
- var password = JSON.parse(this.viewRecordSelected.content).password || '';
- var type = '';
- if (this.viewRecordSelected.type == 11) {
- type = 1;
- } else if (this.viewRecordSelected.type == 12) {
- type = 2;
- } else if (this.viewRecordSelected.type == 13) {
- type = 3;
- } else if (this.viewRecordSelected.type == 14) {
- type = 4;
- }
- if (this.recordFilterCondition.roomId) {
- var t = {
- roomIds: [this.recordFilterCondition.roomId],
- lockType: 1
- };
- var data = {
- q: stringify_default()(t)
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.success) {
- var status = '';
- if (_this21.recordFilterCondition.status == '') {
- status = "0,1,702";
- } else {
- status = _this21.recordFilterCondition.status;
- }
- if (res.data.list.length > 0) {
- if (_this21.viewRecordSelected.type == 13 && (res.data.list[0].manufactureId == 201 || res.data.list[0].manufactureId == 221)) {
- password = util["a" /* default */].cardFormatConversion(password);
- }
- }
- var data6 = {
- pageNum: _this21.currentPage1,
- pageSize: _this21.pageSize1,
- orderBy: "create_at desc",
- q: stringify_default()({
- info: {
- password: password
- },
- cardId: _this21.drawerRow.id,
- deviceNum: res.data.list[0].deviceNum,
- imei: _this21.recordFilterCondition.imei,
- types: type || '0,1,2,3,4',
- inStatus: status
- })
- };
- Object(api["d" /* httpGet */])(data6, _this21.$api.getCertificates).then(function (res) {
- if (res.success) {
- var certiflist = util["a" /* default */].zlib_unzip(res.data);
- console.log(certiflist);
- certiflist.map(function (li) {
- li.createAt = _this21.time(+new Date(li.createAt));
- li['userTelephone'] = JSON.parse(li.content).userTelephone;
- li['operateMode'] = JSON.parse(li.content).operateMode;
- if (JSON.parse(li.content).fingerprintAlias) {
- li.pzname = JSON.parse(li.content).pzname + "-" + JSON.parse(li.content).fingerprintAlias;
- } else {
- li.pzname = JSON.parse(li.content).pzname;
- }
- li['statusText'] = util["a" /* default */].statusCode(li.status);
- var operateMode = JSON.parse(li.content).operateMode;
- if (li.status == 0) {
- if (operateMode == 18 || operateMode == 15 || operateMode == 12 || operateMode == 9) {
- li['statusText'] = '删除中';
- } else if (operateMode == 17 || operateMode == 14 || operateMode == 11 || operateMode == 8) {
- li['statusText'] = '修改中';
- }
- } else if (li.status == 702) {
- if (operateMode == 18 || operateMode == 15 || operateMode == 12 || operateMode == 9) {
- li['statusText'] = '删除失败';
- } else if (operateMode == 17 || operateMode == 14 || operateMode == 11 || operateMode == 8) {
- li['statusText'] = '修改失败';
- }
- }
- li.password = JSON.parse(li.content).password;
- li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
- li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
- li['data'] = JSON.parse(li.content).password;
- if (li.type == 1) {
- li['data'] = li.id;
- }
- var resultArr = AboutDevice.filter(function (_item) {
- return _item.imei == li.imei;
- })[0];
- if (resultArr) {
- li.roomId = resultArr.id;
- li.roomName = resultArr.roomName;
- } else {
- li.roomId = "";
- li.roomName = JSON.parse(li.content).roomName || "";
- }
- });
- _this21.sendListRecords = certiflist;
- _this21.total1 = res.data.total;
- } else {
- _this21.$message.error("获取失败");
- }
- });
- } else {
- _this21.$message.error("获取房间对应门锁信息失败");
- }
- });
- } else {
- var status = '';
- if (this.recordFilterCondition.status == '') {
- status = "0,1,702";
- } else {
- status = this.recordFilterCondition.status;
- }
- var data6 = {};
- if (this.viewRecordSelected.type == 11) {
- password = util["a" /* default */].cardFormatConversion(password);
- data6 = {
- pageNum: this.currentPage1,
- pageSize: this.pageSize1,
- orderBy: "create_at desc",
- q: stringify_default()({
- cardId: this.drawerRow.id,
- info: {
- pzname: JSON.parse(this.viewRecordSelected.content).pzname
- },
- deviceNum: this.recordFilterCondition.deviceNum,
- types: '0,1,2,3,4',
- imei: this.recordFilterCondition.imei,
- inStatus: status,
- type: type
- })
- };
- } else if (this.viewRecordSelected.type == 13) {
- password = util["a" /* default */].cardFormatConversion(password);
- data6 = {
- pageNum: this.currentPage1,
- pageSize: this.pageSize1,
- orderBy: "create_at desc",
- q: stringify_default()({
- cardId: this.drawerRow.id,
- info: {
- pzname: JSON.parse(this.viewRecordSelected.content).pzname
- },
- deviceNum: this.recordFilterCondition.deviceNum,
- types: type || '0,1,2,3,4',
- imei: this.recordFilterCondition.imei,
- inStatus: status
- })
- };
- } else {
- data6 = {
- pageNum: this.currentPage1,
- pageSize: this.pageSize1,
- orderBy: "create_at desc",
- q: stringify_default()({
- cardId: this.drawerRow.id,
- info: {
- password: password
- },
- deviceNum: this.recordFilterCondition.deviceNum,
- types: type || '0,1,2,3,4',
- imei: this.recordFilterCondition.imei,
- inStatus: status
- })
- };
- }
- Object(api["d" /* httpGet */])(data6, this.$api.getCertificates).then(function (res) {
- if (res.success) {
- var certiflist = util["a" /* default */].zlib_unzip(res.data);
- certiflist.map(function (li) {
- li.createAt = _this21.time(+new Date(li.createAt));
- li['userTelephone'] = JSON.parse(li.content).userTelephone;
- li['operateMode'] = JSON.parse(li.content).operateMode;
- var operateMode = JSON.parse(li.content).operateMode;
- li['statusText'] = util["a" /* default */].statusCode(li.status);
- if (li.status == 0) {
- if (operateMode == 18 || operateMode == 15 || operateMode == 12 || operateMode == 9) {
- li['statusText'] = '删除中';
- } else if (operateMode == 17 || operateMode == 14 || operateMode == 11 || operateMode == 8) {
- li['statusText'] = '修改中';
- }
- } else if (li.status == 702) {
- if (operateMode == 18 || operateMode == 15 || operateMode == 12 || operateMode == 9) {
- li['statusText'] = '删除失败';
- } else if (operateMode == 17 || operateMode == 14 || operateMode == 11 || operateMode == 8) {
- li['statusText'] = '修改失败';
- }
- } else if (li.status == 1) {
- if (operateMode == 18 || operateMode == 15 || operateMode == 12 || operateMode == 9) {
- li['statusText'] = '删除成功';
- } else if (operateMode == 17 || operateMode == 14 || operateMode == 11 || operateMode == 8) {
- li['statusText'] = '修改成功';
- }
- }
- if (JSON.parse(li.content).fingerprintAlias) {
- li.pzname = JSON.parse(li.content).pzname + "-" + JSON.parse(li.content).fingerprintAlias;
- } else {
- li.pzname = JSON.parse(li.content).pzname;
- }
- li.password = JSON.parse(li.content).password;
- li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
- li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
- li['data'] = JSON.parse(li.content).password;
- if (li.type == 1) {
- li['data'] = li.id;
- }
- var resultArr = AboutDevice.filter(function (_item) {
- return _item.imei == li.imei;
- })[0];
- if (resultArr) {
- li.roomId = resultArr.id;
- li.roomName = resultArr.roomName;
- } else {
- li.roomId = "";
- li.roomName = JSON.parse(li.content).roomName || "";
- }
- });
- _this21.sendListRecords = certiflist;
- _this21.total1 = res.data.total;
- } else {
- _this21.$message.error("获取失败");
- }
- });
- }
- },
-
- // 导出
- exportfun: function exportfun() {
- var q = {
- type: "0"
- };
- var data = {
- q: stringify_default()(q),
- fileName: "租客信息"
- };
- Object(api["a" /* download */])(data, this.$api.exportCard).then(function (res) {
- var link = document.createElement("a");
- var blob = new Blob([res], {
- type: "application/vnd.ms-excel"
- });
- var objectUrl = URL.createObjectURL(blob);
- link.href = objectUrl;
- link.download = "租客信息.xlsx";
- link.click();
- URL.revokeObjectURL(objectUrl);
- });
- },
-
- // 删除所有对应人员凭证
- dellAllCertificate: function dellAllCertificate(row) {
- var _this22 = this;
-
- var data6 = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: row.id
- }
- };
- Object(api["d" /* httpGet */])(data6, this.$api.getCertificates).then(function (res6) {
- if (res6.success) {
- var ids = [];
- var data = util["a" /* default */].zlib_unzip(res6.data);
- data.map(function (li) {
- ids.push(li.id);
- });
- if (ids.length > 0) {
- var data7 = {
- ids: ids
- };
- Object(api["g" /* httpPost */])(data7, _this22.$api.deleteCertificates).then(function (res7) {
- if (res7.success) {
- _this22.$message.success("成功删除人员对应凭证");
- } else {
- _this22.$message.error("删除人员对应凭证失败");
- }
- });
- }
- } else {
- _this22.$message.error("删除人员对应凭证失败");
- }
- });
- },
-
- // 删除用户
- deleteUser: function deleteUser(row, roomtable) {
- var _this23 = this;
-
- var selectkey = roomtable;
- console.log();
- if (selectkey.length > 0) {
- selectkey.forEach(function (li, index) {
- var resultArr = _this23.AboutDevice.filter(function (_item) {
- return _item.roomId == li;
- })[0];
- if (resultArr) {
- if (resultArr.imei) {
- var roomName = _this23.zNodes.filter(function (item) {
- return li === item.id;
- });
- if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) {
- var data = {
- lockerId: resultArr.deviceNum,
- imei: resultArr.imei,
- lockerUserId: JSON.parse(row.info).userPassword,
- keyId: JSON.parse(row.info).userPassword,
- role: 0,
- action: 2, //1--添加、2--删除、3--修改
- order: 6203,
- cardName: row.name,
- roomName: roomName[0].name
- };
- equipment["a" /* default */].addUserToLock(data.lockerId, data.imei, data.lockerUserId, data.role, data.action, data.order, data.cardName, data.roomName, function (callback) {
- if (callback.success) {
- _this23.$message.success('下发成功');
- _this23.dellAllCertificate(row);
- } else {
- _this23.$message.error(callback.msg);
- }
- });
- } else if (resultArr.manufactureId == 101) {
- var str1 = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- userTelephone: JSON.parse(row.info).userTelephone,
- userPassword: JSON.parse(row.info).userPassword,
- cardName: row.name,
- roomName: roomName[0].name
- };
- equipment["a" /* default */].LDDeleteUser(str1.deviceNum, str1.imei, str1.userTelephone, str1.userPassword, str1.cardName, str1.roomName, function (callback) {
- if (callback.success) {
- _this23.$message.success('下发成功');
- _this23.dellAllCertificate(row);
- } else {
- _this23.$message.error(callback.msg);
- }
- });
- }
- }
- } else {
- _this23.dellAllCertificate(row);
- }
- });
- } else {
- this.dellAllCertificate(row);
- }
- },
-
- // 多个删除
- selectmoredel: function selectmoredel() {
- var _this24 = this;
-
- var list = this.multipleSelection;
- var idlist = [];
- var that = this;
- if (list.length == 0) {
- this.$message.error("请勾选需要删除的数据");
- } else {
- this.$confirm("确定要删除吗?", "提示", {
- type: "warning"
- }).then(function () {
- list.map(function (row) {
- var unbindCarddata = [];
- _this24.screenRoom1(row.id, function (roomtable) {
- var arr = [];
- roomtable.map(function (li) {
- var data = {
- siteId: li.roomId,
- cardId: row.id
- };
- arr.push(li.roomId);
- unbindCarddata.push(data);
- });
- Object(api["g" /* httpPost */])(unbindCarddata, that.$api.unbindCard).then(function (res) {
- var data = {
- ids: [row.id]
- };
- Object(api["g" /* httpPost */])(data, that.$api.deleteCard).then(function (res) {
- if (res.success) {
- that.$message.success("删除成功");
- that.deleteUser(row, arr);
- that.getlist();
- } else {
- that.$message.error("删除失败");
- }
- });
- });
- });
- });
- });
- }
- },
-
- // 触发搜索按钮
- handleSearch: function handleSearch() {
- var _this25 = this;
-
- var q = {
- // type: 0,
- name: this.query.name,
- number: this.query.number,
- phone: this.query.phone
- };
- var data = {
- pageNum: 1,
- pageSize: 10,
- orderBy: "create_time desc",
- q: stringify_default()(q)
- };
- this.currentPage4 = 1;
- var roomAbout = this.$store.state.roomAbout;
- Object(api["g" /* httpPost */])(data, this.$api.getlistNum).then(function (res1) {
- var para = [];
- res1.data.list.map(function (li, index) {
- var userTelephone = JSON.parse(li.info) ? JSON.parse(li.info).userTelephone : '';
- var str = {
- imei: li.imei,
- userTelephone: userTelephone,
- password: "",
- operateMode: 1
- };
- para.push(str);
- _this25.$store.commit("increment", 1);
- li.status = 3;
- li['rommNameText'] = _this25.screenRoomName(li.id);
- });
- // this.getallstatus(para);
- _this25.userlist = res1.data.list;
- _this25.total = res1.data.total;
- });
- },
-
- // 获取人员列表
- getlist: function getlist() {
- var _this26 = this;
-
- var q = {
- // type: 0,
- };
- var data = {
- pageNum: this.currentPage4,
- pageSize: this.pageSize,
- orderBy: "create_time desc",
- q: stringify_default()(q)
- };
- Object(api["g" /* httpPost */])(data, this.$api.getlistNum).then(function (res1) {
- res1.data.list.map(function (li, index) {
- li['rommNameText'] = _this26.screenRoomName(li.id);
- });
- _this26.userlist = res1.data.list;
- _this26.total = res1.data.total;
- });
- },
- screenRoomName: function screenRoomName(id) {
- var _this27 = this;
-
- var roomAbout = this.$store.state.roomAbout;
- var arr = '';
- roomAbout.map(function (lt) {
- if (id == lt.cardId) {
- var name = util["a" /* default */].findIndexArray(_this27.roomlistZNodes, lt.roomId, []);
- if (name) {
- var path = name.join('/');
- arr += path + '、';
- }
- }
- });
- return arr;
- },
-
- // 查询和人员相关的房间
- getAboutRoom: function getAboutRoom() {
- var _this28 = this;
-
- Object(api["d" /* httpGet */])("", this.$api.onlyTenant).then(function (res) {
- _this28.$store.commit("getAboutRoom", res.data.list);
- _this28.getlist();
- });
- },
- getEnterprise: function getEnterprise() {
- var _this29 = this;
-
- Object(api["d" /* httpGet */])("", this.$api.getEnterprise).then(function (res) {
- res.data.list.map(function (li) {
- li['pid'] = li.parentId;
- li['label'] = li.name;
- li['value'] = li.id;
- });
- var array = util["a" /* default */].uniqueArray(res.data.list, "id");
- var roomlistZNodes = Object(utils["q" /* ztreeToElementTree2 */])(array, []);
- _this29.enterpriseListOption = roomlistZNodes;
- _this29.enterpriselist = res.data.list;
- });
- },
-
- // 获取绑定所有房间
- getalllist: function getalllist() {
- var _this30 = this;
-
- var data = {};
- Object(api["d" /* httpGet */])(data, this.$api.getSiteList).then(function (res) {
- _this30.zNodes = JSON.parse(stringify_default()(res.data.list.list));
- var zNodes = JSON.parse(stringify_default()(res.data.list.list));
- var array = util["a" /* default */].uniqueArray(zNodes, "id");
- _this30.roomlistZNodes = Object(utils["q" /* ztreeToElementTree2 */])(array, []);
- });
- },
-
- // 获取卡统计
- getcardstatus: function getcardstatus() {
- var _this31 = this;
-
- var data = {
- cardState: 0
- };
- Object(api["g" /* httpPost */])(data, this.$api.countStatus).then(function (res) {
- res.data.map(function (li) {
- if (li.value == 1) {
- _this31.normal = li.total;
- } else if (li.value == 2) {
- _this31.lose = li.total;
- } else if (li.value == 3) {
- _this31.frozen = li.total;
- }
- });
- });
- },
-
- // 查询和房间相关的设备
- getAboutDevice: function getAboutDevice() {
- var _this32 = this;
-
- Object(api["d" /* httpGet */])("", this.$api.onlySiteDevice).then(function (res) {
- _this32.AboutDevice = res.data.list;
- _this32.$store.commit("getAboutDevice", res.data.list);
- });
- },
- credentialSearchReset: function credentialSearchReset() {
- this.credentialSearch = {
- deviceNum: '',
- imei: '',
- status: '',
- roomId: '',
- type: ''
- };
- },
- selectTenantId: function selectTenantId(e) {
- localStorage.setItem('tenantId', e);
- this.reload();
- },
-
- // 续住保存
- continuationManagementSave: function continuationManagementSave() {
- var _this33 = this;
-
- console.log(this.roomtable, this.drawerRow);
- this.$confirm("是否续住", "提示", {
- type: "warning"
- }).then(function () {
- if (_this33.continuationManagementDate.time == '') {
- _this33.$message.error("请选择时间范围");
- return;
- }
- var endTime = new Date(_this33.continuationManagementDate.time[1]).getTime();
- var startTime = new Date(_this33.continuationManagementDate.time[0]).getTime();
- var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
- var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
- _this33.roomtable.map(function (li) {
- var resultArr = _this33.AboutDevice.filter(function (_item) {
- return _item.roomId == li.roomId;
- })[0];
- var roomName = _this33.zNodes.filter(function (item) {
- return li.roomId === item.id;
- });
- if (resultArr) {
- if (resultArr.manufactureId == 101) {
- var userTelephone = JSON.parse(_this33.drawerRow.info).userTelephone;
- var userPassword = JSON.parse(_this33.drawerRow.info).userPassword;
- resultArr.roomName = roomName[0].name;
- var data = {
- deviceNum: resultArr.deviceNum,
- imei: resultArr.imei,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: userPassword,
- operateMode: 2,
- order: 6202,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- cardName: _this33.drawerRow.name,
- roomName: resultArr.roomName
- };
- equipment["a" /* default */].LDAddUser(data.deviceNum, data.imei, data.userTelephone, data.userPassword, data.password, passwordStartTime, passwordEndTime, data.operateMode, data.order, data.cardName, data.roomName, false, function (callback) {
- if (callback.success) {
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: _this33.drawerRow.id,
- deviceNum: resultArr.deviceNum
- }
- };
- var unbind = [{
- siteId: _this33.drawerRow.id,
- cardId: resultArr.roomId
- }];
- Object(api["g" /* httpPost */])(unbind, _this33.$api.unbindCard).then(function (res) {
- var data1 = [{
- cardId: _this33.drawerRow.id,
- siteId: resultArr.roomId,
- startTime: _this33.continuationManagementDate.time[0],
- endTime: _this33.continuationManagementDate.time[1]
- }];
- Object(api["g" /* httpPost */])(data1, _this33.$api.bindCard).then(function (res) {});
- });
- Object(api["d" /* httpGet */])(data, _this33.$api.getCertificates).then(function (res) {
- var data = util["a" /* default */].zlib_unzip(res.data);
- data.map(function (lt) {
- util["a" /* default */].putCarfid(resultArr, lt, endTime, startTime);
- });
- });
- } else {
- _this33.$message.error("修改失败");
- }
- });
- } else if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) {
- resultArr.roomName = roomName[0].name;
- var unbind = [{
- siteId: _this33.drawerRow.id,
- cardId: resultArr.roomId
- }];
- Object(api["g" /* httpPost */])(unbind, _this33.$api.unbindCard).then(function (res) {
- var data1 = [{
- cardId: _this33.drawerRow.id,
- siteId: resultArr.roomId,
- startTime: _this33.continuationManagementDate.time[0],
- endTime: _this33.continuationManagementDate.time[1]
- }];
- Object(api["g" /* httpPost */])(data1, _this33.$api.bindCard).then(function (res) {});
- });
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: _this33.drawerRow.id,
- deviceNum: resultArr.deviceNum
- }
- };
- Object(api["d" /* httpGet */])(data, _this33.$api.getCertificates).then(function (res) {
- var data = util["a" /* default */].zlib_unzip(res.data);
- data.map(function (lt) {
- util["a" /* default */].putCarfidzg(resultArr, lt, endTime, startTime);
- });
- });
- }
- }
- });
- });
- },
-
- // 续住返回
- continuationManagementBack: function continuationManagementBack() {
- this.activeName = 1;
- this.roomstatus1 = true;
- },
-
- // 续住管理
- continuationManagement: function continuationManagement(index, row) {
- this.activeName = index;
- this.drawerRow = row;
- this.voucher.username = row.name;
- this.personname = row.name;
- this.getAboutDevice1();
- this.screenRoom(row.id); //根据id筛选有关房源
- this.getItems(row.siteId);
- // this.getOperates(row.id);
- this.getcertificate();
-
- this.drawer = true;
- this.activeName = 2;
- },
-
- // 选择房间跳转下发凭证
- issueVoucher: function issueVoucher() {
- this.activeName = 1;
- },
- addBindRoom: function addBindRoom() {
- this.activeName = 0;
- },
-
- // 房源搜索
- searchTable: function searchTable() {
- this.roomtable.map(function (li) {});
- },
-
- // 选择房源,下发凭证
- sendVoucher: function sendVoucher() {
- var _this34 = this;
-
- var SelectedListbind = this.SelectedList;
- var roomAbout = this.$store.state.roomAbout;
- var infostr = JSON.parse(this.drawerRow.info);
- var fjid = [];
- if (this.value2[0] == '' || this.value2[1] == '') {
- this.$message.error("请选择开始结束时间");
- return false;
- }
- if (SelectedListbind.length != 0) {
- SelectedListbind.forEach(function (li) {
- var resultArr = _this34.AboutDevice.filter(function (_item) {
- return _item.roomId == li;
- })[0];
- if (resultArr) {
- if (resultArr.imei) {
- if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) {
- var room = roomAbout.filter(function (item) {
- return item.roomId == resultArr.roomId;
- })[0];
- resultArr.roomName = room.roomName;
- _this34.putCarfidzg(resultArr, _this34.multipleSelection2);
- } else if (resultArr.manufactureId == 101) {
- var room = roomAbout.filter(function (item) {
- return item.roomId == resultArr.roomId;
- })[0];
- resultArr.roomName = room.roomName;
- _this34.putCarfid(resultArr, _this34.multipleSelection2);
- } else if (resultArr.manufactureId == 1201) {
- var room = roomAbout.filter(function (item) {
- return item.roomId == resultArr.roomId;
- })[0];
- resultArr.roomName = room.roomName;
- _this34.putCarfidLwj(resultArr, _this34.multipleSelection2);
- }
- }
- } else {
- _this34.$message.error("该房间未绑定门锁");
- }
- });
- } else {
- this.$message.error("请选择要添加的房间");
- }
- },
- getTypeSort: function getTypeSort(data, type) {
- var num = 1;
- data.map(function (li) {
- if (li.type == type) {
- num++;
- }
- });
- return num;
- },
-
- // 点击查看已绑房间
- backTop: function backTop() {
- this.drawer = false;
- },
-
- // 选择绑定房间弹窗
- bindRoomTop: function bindRoomTop() {
- this.bindRoomStatus = true;
- },
- getSelectedTab: function getSelectedTab(ids) {
- var _this35 = this;
-
- return new promise_default.a(function (resolve, reject) {
- var selected_tab = [];
- var selected = [];
- var zNodes = _this35.zNodes;
- ids.map(function (item) {
- selected_tab = zNodes.filter(function (obj) {
- return obj.id == item;
- });
- selected.push(assign_default.a.apply(Object, [{}].concat(toConsumableArray_default()(selected_tab))));
- });
- resolve(selected);
- });
- },
- bindRoomTop1: function bindRoomTop1(index, row) {
- var _this36 = this;
-
- this.multipleSelection2 = row;
- this.bindRoomStatus1 = true;
- var startTime = '';
- var endTime = '';
- if (stringify_default()(row.startTime).length == 10) {
- startTime = new Date(row.startTime * 1000);
- } else {
- startTime = new Date(row.startTime);
- }
- if (stringify_default()(row.endTime).length == 10) {
- endTime = new Date(row.endTime * 1000);
- } else {
- endTime = new Date(row.endTime);
- }
- this.value2 = [startTime, endTime];
- this.dateRange = [startTime, endTime];
- var ids = [];
- this.roomtable.map(function (li) {
- ids.push(li.roomId);
- });
- this.getSelectedTab(ids).then(function (res) {
- if (res.length > 0) {
- _this36.roomlist = [];
- var array = util["a" /* default */].uniqueArray(res, "id");
- _this36.roomlist = _this36.ztreeToElementTree(array, []);
- } else {
- _this36.roomlist = [];
- }
- });
- },
- getallselectRoom: function getallselectRoom() {
- var ids = [];
- this.roomtable.map(function (li) {
- ids.push(li.roomId);
- });
- var selected_tab = [];
- var selected = [];
- var zNodes = this.zNodes;
- ids.map(function (item) {
- selected_tab = zNodes.filter(function (obj) {
- return obj.id == item;
- });
- selected.push(assign_default.a.apply(Object, [{}].concat(toConsumableArray_default()(selected_tab))));
- });
- if (selected.length > 0) {
- var array = util["a" /* default */].uniqueArray(selected, "id");
- this.roomlistVoucher = [];
- this.roomlistVoucher = this.ztreeToElementTree(array, []);
- } else {
- this.roomlistVoucher = [];
- }
- },
- checkNodeSearch: function checkNodeSearch(e) {
- var selectRow = [];
- console.log(e);
- e.map(function (li) {
- selectRow.push.apply(selectRow, toConsumableArray_default()(li));
- });
- console.log(selectRow);
- // this.bindSelectedList = selectRow
- },
-
- // 选择绑定房间返回的子级id
- checkNode: function checkNode(e) {
- var selectRow = [];
- e.map(function (li) {
- selectRow.push.apply(selectRow, toConsumableArray_default()(li));
- });
- // e.map(li => {
- // selectRow.push(li[li.length - 1])
- // })
- console.log(selectRow);
- this.bindSelectedList = selectRow;
- },
- checkNode1: function checkNode1(e) {
- var selectRow = [];
- console.log(e);
- e.map(function (li) {
- selectRow.push(li[li.length - 1]);
- });
- this.SelectedList = selectRow;
- console.log(this.SelectedList);
- },
-
- // 选择绑定房间返回的子级id
- checkNode2: function checkNode2(e) {
- this.credentialSearch.roomId = e[e.length - 1];
- },
- checkEnterpriseList: function checkEnterpriseList(e) {
- var _this37 = this;
-
- this.$nextTick(function () {
- var list = _this37.$refs['cascader'].getCheckedNodes();
- _this37.checkEnterpriseNode = list;
- });
- },
- checkNodeRecord: function checkNodeRecord(e) {
- this.recordFilterCondition.roomId = e[e.length - 1];
- },
- childNodesDeep: function childNodesDeep(nodes, arr) {
- var _this38 = this;
-
- if (nodes) nodes.forEach(function (ele) {
- arr.push(ele.id);
- if (ele.children) {
- _this38.childNodesDeep(ele.children, arr);
- }
- });
- },
- checkNode3: function checkNode3(e) {
- var selectRow = [];
- e.map(function (li) {
- selectRow.push(li[li.length - 1]);
- });
- // var roomlist=this.roomlist
- // selectRow = this.getChild(roomlist, e[e.length - 1], [])
- this.SelectedListVoucher = selectRow;
- },
-
- // 绑定房间
- bindsave: function bindsave() {
- var _this39 = this;
-
- var SelectedListbind = this.bindSelectedList;
- var infostr = JSON.parse(this.drawerRow.info);
- var fjid = [];
- var _this = this;
- if (this.value2[0] == '' || this.value2[1] == '') {
- this.$message.error("请选择开始结束时间");
- return false;
- }
- if (SelectedListbind.length != 0) {
- SelectedListbind.forEach(function (li) {
- var str = {
- cardId: _this39.drawerRow.id,
- siteId: li,
- startTime: _this39.value2[0],
- endTime: _this39.value2[1]
- };
- var resultArr = _this39.AboutDevice.filter(function (_item) {
- return _item.roomId == li;
- })[0];
- var roomName = _this39.zNodes.filter(function (item) {
- return li === item.id;
- });
- if (resultArr) {
- // console.log(roomName,resultArr, this.drawerRow)
- // return
- if (resultArr.imei) {
- fjid = [str];
- if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) {
- var data = {
- lockerId: resultArr.deviceNum,
- imei: resultArr.imei,
- lockerUserId: infostr.userPassword,
- keyId: infostr.userPassword,
- role: 0,
- action: 1,
- order: 6226,
- cardName: _this39.drawerRow.name,
- roomName: roomName[0].name
- };
- equipment["a" /* default */].addUserToLock(data.lockerId, data.imei, data.lockerUserId, data.role, data.action, data.order, data.cardName, data.roomName, function (callback) {
- if (callback.success) {
- var locakUserdata = {
- deviceNum: resultArr.deviceNum,
- imei: resultArr.imei,
- cardId: _this39.drawerRow.id,
- content: stringify_default()(data), //operateMode:NFC-10、把人员添加到凭证-1
- type: 26,
- serial: callback.data.serialNumber,
- startTime: moment_default()(_this39.value2[0]).valueOf() / 1000,
- endTime: moment_default()(_this39.value2[1]).valueOf() / 1000
- };
- util["a" /* default */].sendLockUser(locakUserdata, function (callbackLOCK) {});
- } else {
- _this39.$message.error(callback.msg);
- if (callback.code == 201016) {
- Object(api["g" /* httpPost */])(fjid, _this39.$api.bindCard).then(function (res) {
- if (res.success) {
- _this39.bindRoomStatus = false;
- _this39.getcheckInList();
- _this39.getAboutRoom();
- setTimeout(function () {
- _this39.updateRoom();
- }, 500);
- _this39.$message.success("用户门锁已存在");
- } else {
- _this39.$message.error("添加失败");
- }
- });
- }
- }
- });
- Object(api["g" /* httpPost */])(fjid, _this39.$api.bindCard).then(function (res) {
- if (res.success) {
- _this39.bindRoomStatus = false;
- _this39.getAboutRoom();
- _this39.getcheckInList();
- setTimeout(function () {
- _this39.updateRoom();
- }, 500);
- } else {
- _this39.$message.error("添加失败");
- }
- });
- } else if (resultArr.manufactureId == 101) {
- var userstr = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- userTelephone: infostr.userTelephone,
- userPassword: infostr.userPassword,
- password: infostr.userPassword,
- operateMode: 26,
- order: 6226,
- passwordStartTime: _this39.moment(_this39.value2[0]).format("YYYYMMDDHHmmss"),
- passwordEndTime: _this39.moment(_this39.value2[1]).format("YYYYMMDDHHmmss"),
- is: false,
- cardName: _this39.drawerRow.name,
- roomName: roomName[0].name
- };
- equipment["a" /* default */].LDAddUser(userstr.deviceNum, userstr.imei, userstr.userTelephone, userstr.userPassword, userstr.password, userstr.passwordStartTime, userstr.passwordEndTime, userstr.operateMode, userstr.order, userstr.cardName, userstr.roomName, false, function (callback) {
- if (callback.success) {
- console.log(_this.value2);
- var locakUserdata = {
- deviceNum: resultArr.deviceNum,
- imei: resultArr.imei,
- cardId: _this39.drawerRow.id,
- content: stringify_default()(userstr), //operateMode:NFC-10、把人员添加到凭证-1
- type: 26,
- serial: callback.data.serialNumber,
- startTime: moment_default()(_this.value2[0]).valueOf() / 1000,
- endTime: moment_default()(_this.value2[1]).valueOf() / 1000
- };
- util["a" /* default */].sendLockUser(locakUserdata, function (callbackLOCK) {});
- Object(api["g" /* httpPost */])(fjid, _this39.$api.bindCard).then(function (res) {
- if (res.success) {
- _this39.bindRoomStatus = false;
- _this39.getAboutRoom();
- _this39.getcheckInList();
- setTimeout(function () {
- _this39.updateRoom();
- }, 500);
- } else {
- _this39.$message.error("添加失败");
- }
- });
- } else {
- _this39.$message.error(callback.msg);
- }
- });
- } else if (resultArr.manufactureId == 1201) {
- Object(api["g" /* httpPost */])(fjid, _this39.$api.bindCard).then(function (res) {
- if (res.success) {
- _this39.bindRoomStatus = false;
- _this39.getAboutRoom();
- _this39.getcheckInList();
- setTimeout(function () {
- _this39.updateRoom();
- }, 500);
- } else {
- _this39.$message.error("添加失败");
- }
- });
- }
- } else {
- fjid.push(str);
- Object(api["g" /* httpPost */])(fjid, _this39.$api.bindCard).then(function (res) {
- if (res.success) {
- _this39.bindRoomStatus = false;
- _this39.getAboutRoom();
- _this39.getcheckInList();
- setTimeout(function () {
- _this39.updateRoom();
- }, 500);
- } else {
- _this39.$message.error("添加失败");
- }
- });
- }
- } else {
- fjid.push(str);
- Object(api["g" /* httpPost */])(fjid, _this39.$api.bindCard).then(function (res) {
- if (res.success) {
- _this39.bindRoomStatus = false;
- _this39.getAboutRoom();
- _this39.getcheckInList();
- setTimeout(function () {
- _this39.updateRoom();
- }, 500);
- } else {
- _this39.$message.error("添加失败");
- }
- });
- _this39.$message.error("该房间未绑定门锁");
- }
- });
- } else {
- this.$message.error("请选择要添加的房间");
- }
- },
-
-
- // 下发凭证
- putCarfidzg: function putCarfidzg(resultArr, row) {
- var _this40 = this;
-
- var data = {};
- var userTelephone = JSON.parse(row.content).userTelephone;
- var userPassword = JSON.parse(row.content).userPassword;
- var startTime = new Date(this.value2[0]).getTime() / 1000;
- var endTime = new Date(this.value2[1]).getTime() / 1000;
- var passwordStartTime = new Date(this.value2[0]).getTime() / 1000;
- var passwordEndTime = new Date(this.value2[1]).getTime() / 1000;
- // var passwordStartTime = JSON.stringify(row.startTime)
- // var passwordEndTime = JSON.stringify(row.endTime)
- // var sort=this.getTypeSort(this.roomtable1,row.type)
- var pzname = JSON.parse(row.content).pzname || '';
- if (passwordStartTime.length == 13) {
- passwordStartTime = startTime / 1000;
- }
- if (passwordEndTime.length == 13) {
- passwordEndTime = endTime / 1000;
- }
-
- if (row.type == 11) {
- // if(pzname==''){
- // pzname='指纹'+sort
- // }
- var fpId = new Date();
- var fingerprint1 = JSON.parse(row.content).fingerprint;
- var str = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- fingerprintAlias: JSON.parse(row.content).fingerprintAlias,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- length: fingerprint1.length / 2,
- fpTimeId: fpId.getTime(),
- operateMode: 16,
- type: 1,
- order: 6216,
- fingerprint: fingerprint1,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- pzname: pzname ? pzname : '',
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- var data3 = {
- lockerId: resultArr.deviceNum,
- imei: resultArr.imei,
- order: 6216,
- lockerUserId: JSON.parse(this.drawerRow.info).userPassword,
- keyId: JSON.parse(this.drawerRow.info).userPassword,
- fingerType: 0,
- file: fingerprint1,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName,
- startTime: passwordStartTime,
- endTime: passwordEndTime
- };
- equipment["a" /* default */].addFingerPrints(data3.lockerId, data3.imei, data3.lockerUserId, data3.fingerType, data3.file, data3.startTime, data3.endTime, data3.cardName, data3.roomName, function (callback) {
- if (callback.success) {
- var data = {
- cardId: _this40.drawerRow.id,
- deviceNum: resultArr.deviceNum,
- imei: resultArr.imei,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: str.type,
- serial: callback.data.serialNumber,
- startTime: startTime,
- endTime: endTime,
- order: 6216
- };
- Object(api["g" /* httpPost */])(data, _this40.$api.addCertificates).then(function (res) {
- _this40.bindRoomStatus1 = false;
- _this40.getcertificate(); //获取凭证
- });
- } else {
- _this40.$message.error(callback.msg);
- }
- });
- } else if (row.type == 12) {
- if (JSON.parse(row.content).password.length != 16) {
- this.$message.error("卡格式错误,请重新录入");
- return;
- }
- // if(pzname==''){
- // pzname='身份证'+sort
- // }
- var str = {
- imei: resultArr.imei,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- operateMode: 13,
- order: 6213,
- type: 2,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- pzname: pzname,
- is: false,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- var data3 = {
- lockerId: resultArr.deviceNum,
- imei: resultArr.imei,
- lockerUserId: userPassword,
- keyId: userPassword,
- action: 1,
- taskStatus: 1,
- order: 6213,
- startTime: passwordStartTime,
- endTime: passwordEndTime,
- cardType: 36,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName,
- cardNo: JSON.parse(row.content).password
- };
- equipment["a" /* default */].RfCardRegister(data3.lockerId, data3.imei, data3.keyId, data3.action, data3.taskStatus, data3.cardNo, data3.cardType, data3.startTime, data3.endTime, data3.order, data3.cardName, data3.roomName, function (callback) {
- if (callback.success) {
- var data = {
- cardId: _this40.drawerRow.id,
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: str.type,
- serial: callback.data.serialNumber,
- startTime: startTime,
- endTime: endTime
- };
- Object(api["g" /* httpPost */])(data, _this40.$api.addCertificates).then(function (res) {
- _this40.bindRoomStatus1 = false;
- _this40.getcertificate(); //获取凭证
- });
- } else {
- _this40.$message.error(callback.msg);
- }
- });
- } else if (row.type == 13) {
- var password = "";
- if (JSON.parse(row.content).password.length == 8) {
- password = util["a" /* default */].cardFormatConversion(JSON.parse(row.content).password);
- password = password + '00000000';
- } else if (JSON.parse(row.content).password.length == 16) {
- password = JSON.parse(row.content).password;
- } else {
- this.$message.error("卡格式错误,请重新录入");
- return;
- }
- // if(pzname==''){
- // pzname='NFC'+sort
- // }
- var str = {
- imei: resultArr.imei,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: password,
- operateMode: 10,
- type: 3,
- order: 6210,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- pzname: pzname,
- is: false,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- var data3 = {
- lockerId: resultArr.deviceNum,
- lockerUserId: userPassword,
- keyId: userPassword,
- imei: resultArr.imei,
- action: 1,
- taskStatus: 1,
- order: 6210,
- startTime: passwordStartTime,
- endTime: passwordEndTime,
- cardType: 50,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName,
- cardNo: password
- };
- equipment["a" /* default */].RfCardRegister(data3.lockerId, data3.imei, data3.keyId, data3.action, data3.taskStatus, data3.cardNo, data3.cardType, data3.startTime, data3.endTime, data3.order, data3.cardName, data3.roomName, function (callback) {
- if (callback.success) {
- var data = {
- cardId: _this40.drawerRow.id,
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: str.type,
- serial: callback.data.serialNumber,
- startTime: startTime,
- endTime: endTime
- };
- Object(api["g" /* httpPost */])(data, _this40.$api.addCertificates).then(function (res) {
- _this40.bindRoomStatus1 = false;
- _this40.getcertificate(); //获取凭证
- });
- } else {
- _this40.$message.error(callback.msg);
- }
- });
- } else if (row.type == 14) {
- // if(pzname==''){
- // pzname='密码'+sort
- // }
- str = {
- imei: resultArr.imei,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- operateMode: 7,
- order: 6207,
- type: 4,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- pzname: pzname,
- is: false,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- var data3 = {
- lockerId: resultArr.deviceNum,
- imei: resultArr.imei,
- order: 6207,
- passwordCount: 255,
- lockerUserId: userPassword,
- keyId: userPassword,
- startTime: passwordStartTime,
- endTime: passwordEndTime,
- action: 1,
- password: JSON.parse(row.content).password,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- equipment["a" /* default */].addForeverPassword(data3.lockerId, data3.imei, data3.keyId, data3.action, data3.password, data3.passwordCount, data3.startTime, data3.endTime, data3.order, data3.cardName, data3.roomName, function (callback) {
- if (callback.success) {
- var data = {
- cardId: _this40.drawerRow.id,
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: str.type,
- serial: callback.data.serialNumber,
- startTime: startTime,
- endTime: endTime
- };
- Object(api["g" /* httpPost */])(data, _this40.$api.addCertificates).then(function (res) {
- _this40.bindRoomStatus1 = false;
- _this40.getcertificate(); //获取凭证
- });
- } else {
- _this40.$message.error(callback.msg);
- }
- });
- }
- },
- putCarfidLwj: function putCarfidLwj(resultArr, row) {
- var _this41 = this;
-
- var userTelephone = JSON.parse(row.content).userTelephone;
- var userPassword = JSON.parse(row.content).userPassword;
- var startTime = new Date(this.value2[0]).getTime() / 1000;
- var endTime = new Date(this.value2[1]).getTime() / 1000;
- var passwordStartTime = new Date(this.value2[0]).getTime() / 1000;
- var passwordEndTime = new Date(this.value2[1]).getTime() / 1000;
- var pzname = JSON.parse(row.content).pzname || '';
- if (passwordStartTime.length == 13) {
- passwordStartTime = startTime / 1000;
- }
- if (passwordEndTime.length == 13) {
- passwordEndTime = endTime / 1000;
- }
- if (row.type == 11) {
- var fpId = new Date();
- var fingerprint1 = JSON.parse(row.content).fingerprint;
- var str = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- fingerprintAlias: JSON.parse(row.content).fingerprintAlias,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- length: fingerprint1.length / 2,
- fpTimeId: fpId.getTime(),
- operateMode: 16,
- type: 1,
- order: 6216,
- fingerprint: fingerprint1,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- pzname: pzname ? pzname : '',
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- var data = {
- code: "lwj/fpOperate",
- data: {
- lockerId: resultArr.deviceNum,
- lockerUserId: JSON.parse(row.content).userPassword,
- action: 1,
- fpData: fingerprint1,
- startTime: startTime,
- endTime: endTime,
- operateMode: 16,
- order: 6216,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- }
- };
- Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- var data = {
- cardId: _this41.drawerRow.id,
- deviceNum: resultArr.deviceNum,
- imei: resultArr.imei,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: str.type,
- serial: res.data.serialNumber,
- startTime: startTime,
- endTime: endTime,
- order: 6216
- };
- Object(api["g" /* httpPost */])(data, _this41.$api.addCertificates).then(function (res) {
- _this41.bindRoomStatus1 = false;
- _this41.getcertificate(); //获取凭证
- });
- } else {
- _this41.$message.error(res.msg);
- }
- });
- }if (row.type == 13) {
-
- var password = "";
- if (JSON.parse(row.content).password.length == 8) {
- password = util["a" /* default */].cardFormatConversion(JSON.parse(row.content).password);
- password = password + '00000000';
- } else if (JSON.parse(row.content).password.length == 16) {
- password = JSON.parse(row.content).password;
- } else {
- this.$message.error("卡格式错误,请重新录入");
- return;
- }
- var _startTime = new Date(this.value2[0]).getTime() / 1000;
- var _endTime = new Date(this.value2[1]).getTime() / 1000;
- var _data3 = {
- code: "lwj/cardOperate",
- data: {
- lockerId: resultArr.deviceNum,
- lockerUserId: JSON.parse(row.content).userPassword,
- action: 1,
- cardNo: JSON.parse(row.content).password,
- startTime: _startTime,
- endTime: _endTime,
- operateMode: 10,
- order: 6210,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- }
- };
- var _str = {
- imei: resultArr.imei,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- operateMode: 10,
- order: 6210,
- type: 3,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- pzname: pzname,
- is: false,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- Object(api["g" /* httpPost */])(_data3, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- var data = {
- cardId: _this41.drawerRow.id,
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- content: stringify_default()(_str), //operateMode:NFC-10、把人员添加到凭证-1
- type: _str.type,
- serial: res.data.serialNumber,
- startTime: _startTime,
- endTime: _endTime
- };
- Object(api["g" /* httpPost */])(data, _this41.$api.addCertificates).then(function (res) {
- _this41.bindRoomStatus1 = false;
- _this41.getcertificate(); //获取凭证
- });
- } else {
- _this41.$message.error(callback.msg);
- }
- });
- } else if (row.type == 14) {
- if (JSON.parse(row.content).password == '') {
- this.$message.error('密码不能为空');
- } else {
- var _startTime2 = new Date(this.value2[0]).getTime() / 1000;
- var _endTime2 = new Date(this.value2[1]).getTime() / 1000;
- var _data4 = {
- code: "lwj/passwordOperate",
- data: {
- lockerId: resultArr.deviceNum,
- lockerUserId: JSON.parse(row.content).userPassword,
- action: 1,
- password: JSON.parse(row.content).password,
- startTime: _startTime2,
- endTime: _endTime2,
- operateMode: 7,
- order: 6207,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- }
- };
- var _str2 = {
- imei: resultArr.imei,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- operateMode: 7,
- order: 6207,
- type: 4,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- pzname: pzname,
- is: false,
- cardName: row.name + '-' + (pzname ? pzname : ''),
- roomName: resultArr.roomName
- };
- Object(api["g" /* httpPost */])(_data4, this.$api.sendCommand).then(function (res) {
- if (res.success) {
- var data = {
- cardId: _this41.drawerRow.id,
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- content: stringify_default()(_str2), //operateMode:NFC-10、把人员添加到凭证-1
- type: _str2.type,
- serial: res.data.serialNumber,
- startTime: _startTime2,
- endTime: _endTime2
- };
- Object(api["g" /* httpPost */])(data, _this41.$api.addCertificates).then(function (res) {
- _this41.bindRoomStatus1 = false;
- _this41.getcertificate(); //获取凭证
- });
- } else {
- _this41.$message.error(callback.msg);
- }
- });
- }
- }
- },
-
- // 下发凭证
- putCarfid: function putCarfid(resultArr, row) {
- var _this42 = this;
-
- var data = {};
- var userTelephone = JSON.parse(row.content).userTelephone;
- var userPassword = JSON.parse(row.content).userPassword;
- var startTime = new Date(this.value2[0]).getTime();
- var endTime = new Date(this.value2[1]).getTime();
- var passwordEndTime = moment_default()(endTime).format("YYYYMMDDHHmmss");
- var passwordStartTime = moment_default()(startTime).format("YYYYMMDDHHmmss");
- // var sort=this.getTypeSort(this.roomtable1,row.type)
- var pzname = JSON.parse(row.content).pzname || '';
- if (row.type == 11) {
- // if(pzname==''){
- // pzname='指纹'+sort
- // }
- var fpId = new Date();
- var fingerprint = JSON.parse(row.content).fingerprint;
- // var array = fingerprint.split(",");
- // var num = this.Bytes2Str(array);
- // return
- var str = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- fingerprintAlias: JSON.parse(row.content).fingerprintAlias,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- length: fingerprint.length / 2,
- fpTimeId: fpId.getTime(),
- operateMode: 16,
- type: 1,
- order: 6216,
- fingerprint: fingerprint,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- cardName: row.name + '-' + pzname,
- roomName: resultArr.roomName,
- pzname: pzname,
- pass: false
- };
- equipment["a" /* default */].LDAddFingerPrints(str.deviceNum, str.imei, str.userTelephone, str.userPassword, str.password, str.passwordStartTime, str.passwordEndTime, str.operateMode, str.order, str.length, str.fpTimeId, str.fingerprint, str.cardName, str.roomName, str.pass, function (callback) {
- if (callback.success) {
- var datafid = {
- deviceNum: resultArr.deviceNum,
- imei: resultArr.imei,
- cardId: _this42.drawerRow.id,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: str.type,
- serial: callback.data.serialNumber,
- startTime: startTime / 1000,
- endTime: endTime / 1000
- };
- Object(api["g" /* httpPost */])(datafid, _this42.$api.addCertificates).then(function (res) {
- if (res.success) {
- _this42.bindRoomStatus1 = false;
- _this42.$message.success("下发成功");
- _this42.getcertificate(); //获取凭证
- } else {
- _this42.$message.error("下发失败");
- }
- });
- } else {
- _this42.$message.error(callback.msg);
- }
- });
- return false;
- } else if (row.type == 12) {
- // if(pzname==''){
- // pzname='身份证'+sort
- // }
- data = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- operateMode: 13,
- order: 6213,
- type: 2,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- is: false,
- cardName: row.name + '-' + pzname,
- roomName: resultArr.roomName,
- pzname: pzname
- };
- } else if (row.type == 13) {
- // if(pzname==''){
- // pzname='NFC'+sort
- // }
- data = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- operateMode: 10,
- order: 6210,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- is: false,
- type: 3,
- cardName: row.name + '-' + pzname,
- roomName: resultArr.roomName,
- pzname: pzname
- };
- } else if (row.type == 14) {
- // if(pzname==''){
- // pzname='密码'+sort
- // }
- data = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- userTelephone: userTelephone,
- cardId: row.cardId,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- operateMode: 7,
- order: 6207,
- type: 4,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- is: false,
- cardName: row.name + '-' + pzname,
- roomName: resultArr.roomName,
- pzname: pzname,
- pass: false
- };
- }
- equipment["a" /* default */].LDRfCardRegister(data.deviceNum, data.imei, data.userTelephone, data.userPassword, data.password, data.passwordStartTime, data.passwordEndTime, data.operateMode, data.order, data.cardName, data.roomName, data.pass, function (callback) {
- if (callback.success) {
- var datafid = {
- deviceNum: resultArr.deviceNum,
- imei: resultArr.imei,
- cardId: _this42.drawerRow.id,
- content: stringify_default()(data), //operateMode:NFC-10、把人员添加到凭证-1
- type: data.type,
- serial: callback.data.serialNumber,
- startTime: startTime / 1000,
- endTime: endTime / 1000
- };
- Object(api["g" /* httpPost */])(datafid, _this42.$api.addCertificates).then(function (res) {
- if (res.success) {
- _this42.bindRoomStatus1 = false;
- _this42.$message.success("下发成功");
- _this42.getcertificate(); //获取凭证
- } else {
- _this42.$message.error("下发失败");
- }
- });
- } else {
- _this42.$message.error(callback.msg);
- }
- });
- },
-
- // 添加房源后更新人员和房间关系
- updateRoom: function updateRoom() {
- var _this43 = this;
-
- var array = this.returnScreenRoom(this.drawerRow.id);
- var SelectedList = [],
- roomtable = [],
- roomScreen = [];
- array.map(function (li) {
- SelectedList.push(li.roomId);
- var name = util["a" /* default */].findIndexArray(_this43.$store.state.zNodes, li.roomId, []);
- var path = '';
- if (name) {
- path = name.join('/');
- }
- li.roomName = path;
- var result = _this43.checkInListing.filter(function (item) {
- return item.siteId == li.roomId;
- })[0];
- var deviceResult = _this43.allAboutDevice.filter(function (it) {
- return it.roomId == li.roomId;
- })[0];
- if (result) {
- li['endTime'] = moment_default()(result.endTime).format("YYYY-MM-DD HH:mm:ss") || '';
- li['startTime'] = moment_default()(result.startTime).format("YYYY-MM-DD HH:mm:ss") || '';
- li['name'] = result.name;
- li.card = li.cardId;
- }
- if (deviceResult) {
- li['deviceNum'] = deviceResult.deviceNum;
- li['imei'] = deviceResult.imei;
- li['manufactureId'] = deviceResult.manufactureId;
- }
- if (li.isRoom == 1) {
- roomScreen.push(li);
- }
- roomtable.push(li);
- });
- this.roomScreen = roomScreen;
- this.SelectedList = SelectedList;
- this.selectkeyadd = SelectedList;
- var list = roomtable.sort(function (pre, cur) {
- return pre.siteId - cur.siteId;
- });
- this.roomtable = list;
- this.roomstatus = !this.roomstatus;
- this.addroomstatus = !this.addroomstatus;
- this.$message.success("操作成功");
- },
-
- // 打开侧边栏
- operation: function operation(index, row) {
- var _this44 = this;
-
- this.activeName = index;
- this.drawerRow = row;
- this.bindroomstatus = true;
- this.voucher.username = row.name;
- this.drawer = true;
- this.personname = row.name;
- this.getAboutDevice1();
- var data = {
- ids: [row.id]
- };
- Object(api["g" /* httpPost */])(data, this.$api.getTenant).then(function (res) {
- if (res.code == 200) {
- _this44.checkInListing = res.data;
- if (res.data.length > 0) {
- _this44.maxDateTime = res.data[0].endTime;
- _this44.minDateTime = res.data[0].startTime;
- _this44.value2 = [_this44.minDateTime, _this44.maxDateTime];
- } else {
- _this44.maxDateTime = '';
- _this44.minDateTime = '';
- _this44.value2 = ['', ''];
- }
- setTimeout(function () {
- _this44.screenRoom(row.id);
- }, 500);
- } else {
- _this44.checkInListing = [];
- }
- });
- this.getItems(row.siteId);
- // this.getOperates(row.id);
- this.getcertificate();
- },
- getcheckInList: function getcheckInList() {
- var _this45 = this;
-
- var data = {
- ids: [this.drawerRow.id]
- };
- Object(api["g" /* httpPost */])(data, this.$api.getTenant).then(function (res) {
- if (res.code == 200) {
- _this45.checkInListing = res.data;
- } else {
- _this45.checkInListing = [];
- }
- });
- },
- getSearchRoomList: function getSearchRoomList() {
- var ids = [];
- this.roomtable.map(function (li) {
- ids.push(li.roomId);
- });
- var selected_tab = [];
- var selected = [];
- var zNodes = this.zNodes;
- ids.map(function (item) {
- selected_tab = zNodes.filter(function (obj) {
- return obj.id == item;
- });
- selected.push(assign_default.a.apply(Object, [{}].concat(toConsumableArray_default()(selected_tab))));
- });
- if (selected.length > 0) {
- var array = util["a" /* default */].uniqueArray(selected, "id");
- this.roomlist2 = [];
- this.roomlist2 = this.ztreeToElementTree(array, []);
- } else {
- this.roomlis2 = [];
- }
- },
-
- // 凭证列表获取
- getcertificate: function getcertificate() {
- var _this46 = this;
-
- if (this.credentialSearch.roomId) {
- var t = {
- roomIds: [this.credentialSearch.roomId],
- lockType: 1
- };
- var data = {
- q: stringify_default()(t)
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.success) {
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: _this46.drawerRow.id,
- deviceNum: res.data.list[0].deviceNum,
- imei: _this46.credentialSearch.imei,
- status: _this46.credentialSearch.status,
- type: _this46.credentialSearch.type,
- types: "10,11,12,13,14"
- }
- };
- _this46.getfilterAcquisition(data);
- } else {
- _this46.$message.error("获取房间对应门锁信息失败");
- }
- });
- } else {
- var data = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: this.drawerRow.id,
- deviceNum: this.credentialSearch.deviceNum,
- imei: this.credentialSearch.imei,
- status: this.credentialSearch.status,
- // type: this.credentialSearch.type,
- types: this.credentialSearch.type || "10,11,12,13,14"
- }
- };
- this.getfilterAcquisition(data);
- }
- },
- getfilterAcquisition: function getfilterAcquisition(data) {
- var _this47 = this;
-
- var dataall = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: this.drawerRow.id,
- deviceNum: this.credentialSearch.deviceNum,
- imei: this.credentialSearch.imei,
- inStatus: "0,1,702",
- types: "0,1,2,3,4"
- }
- };
- Object(api["d" /* httpGet */])(dataall, this.$api.getCertificates).then(function (resall) {
- if (resall.code == 200) {
- var sendOn = util["a" /* default */].zlib_unzip(resall.data);
- console.log(sendOn);
- var sendstatus = true;
- if (resall.data.total == 0) {
- sendstatus = false;
- }
- Object(api["d" /* httpGet */])(data, _this47.$api.getCertificates).then(function (res) {
- var certiflist = util["a" /* default */].zlib_unzip(res.data);
- var AboutDevice = _this47.allAboutDevice;
- console.log(certiflist);
- certiflist.map(function (li) {
- li['color'] = '1';
- var licontent = '';
- var filterResult = '';
- if (li.type == 11) {
- licontent = JSON.parse(li.content).pzname;
- filterResult = sendOn.filter(function (item) {
- return JSON.parse(item.content).pzname == licontent;
- });
- } else if (li.type == 13) {
- // licontent=utils.cardFormatConversion(JSON.parse(li.content).password)
- licontent = JSON.parse(li.content).pzname;
- filterResult = sendOn.filter(function (item) {
- return JSON.parse(item.content).pzname == licontent;
- });
- } else {
- licontent = JSON.parse(li.content).password;
- filterResult = sendOn.filter(function (item) {
- return JSON.parse(item.content).password == licontent;
- });
- }
- if (sendstatus && filterResult && filterResult.length > 0) {
- var statusOne = filterResult.some(function (item) {
- return item.status == 0;
- });
- var statusTwo = filterResult.some(function (item) {
- return item.status == 1;
- });
- var statusThree = filterResult.some(function (item) {
- return item.status == 702;
- });
- if (statusOne) {
- li['color'] = '0';
- } else if (!statusOne && !statusThree && statusTwo) {
- li['color'] = '1';
- } else if (!statusOne && statusThree) {
- li['color'] = '702';
- } else {
- li['color'] = '999';
- }
- }
- li.createAt = _this47.time(+new Date(li.createAt));
- li['userTelephone'] = JSON.parse(li.content).userTelephone;
- li.pzname = JSON.parse(li.content).pzname;
- li.password = JSON.parse(li.content).password;
- li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
- li['fingerprintAlias'] = JSON.parse(li.content).fingerprintAlias || '';
- li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
- li['data'] = JSON.parse(li.content).password;
- if (li.type == 1) {
- li['data'] = li.id;
- }
- if (li.pzname) {
- var statusif = li.pzname.indexOf('蓝牙');
- if (statusif) {
- li['DeletePermissions'] = true;
- } else {
- if (li.type != 11) {
- li['DeletePermissions'] = true;
- } else {
- li['DeletePermissions'] = false;
- }
- }
- } else {
- li['DeletePermissions'] = true;
- }
- });
- _this47.roomtable1 = certiflist;
- _this47.total1 = res.data.total;
- });
- }
- });
- },
-
- // 筛选和这个人员有关的房源
- screenRoom: function screenRoom(id) {
- var _this48 = this;
-
- var roomAbout = this.$store.state.roomAbout;
- var SelectedList = [],
- roomtable = [],
- roomScreen = [];
- roomAbout.map(function (li) {
- var name = util["a" /* default */].findIndexArray(_this48.$store.state.zNodes, li.roomId, []);
- var path = '';
- if (name) {
- path = name.join('/');
- }
- li.roomName = path;
- if (li.cardId == id) {
- if (li.layout != null) {
- SelectedList.push(li.roomId);
- }
- var result = _this48.checkInListing.filter(function (item) {
- return item.siteId == li.roomId;
- })[0];
- var deviceResult = _this48.allAboutDevice.filter(function (it) {
- return it.roomId == li.roomId;
- })[0];
- if (result) {
- li['endTime'] = moment_default()(result.endTime).format("YYYY-MM-DD HH:mm:ss") || '';
- li['startTime'] = moment_default()(result.startTime).format("YYYY-MM-DD HH:mm:ss") || '';
- li['name'] = result.name;
- li['id'] = result.id;
- li.card = li.cardId;
- }
- if (deviceResult) {
- li['deviceNum'] = deviceResult.deviceNum;
- li['imei'] = deviceResult.imei;
- li['manufactureId'] = deviceResult.manufactureId;
- }
- if (li.isRoom == 1) {
- roomScreen.push(li);
- }
- console.log(li);
- roomtable.push(li);
- }
- });
- console.log(roomtable);
- this.roomtablestatus = false;
- if (this.activeName == 0) {
- var data = JSON.parse(stringify_default()(this.zNodes));
- var zNodes = util["a" /* default */].filterObj(data, SelectedList);
- var array = util["a" /* default */].uniqueArray(zNodes, "id");
- var bindRoomlist = this.ztreeToElementTree(array, []);
- this.bindRoomlist = bindRoomlist;
- } else if (this.activeName == 1) {
- var data = JSON.parse(stringify_default()(this.zNodes));
- var array = util["a" /* default */].uniqueArray(data, "id");
- this.bindRoomlist = this.ztreeToElementTree(array, []);
- // this.bindRoomlist = this.roomlist
- }
- var list = roomtable.sort(function (pre, cur) {
- return pre.siteId - cur.siteId;
- });
- this.getSearchRoomList();
- this.$nextTick(function () {
- this.roomtable = list;
- this.SelectedList = SelectedList;
- this.roomtablestatus = true;
- this.roomScreen = roomScreen;
- });
- },
- ztreeToElementTree: function ztreeToElementTree(data, config) {
- var id = 'id'; // 定义ztree数据存储id(自身的id)的key值,可以自定义但一般都是id、pid这种
- var pid = 'pid'; // 定义ztree数据存储pid(父id)的key值
- var children = 'children'; // 定义生成的element tree存储子节点的key,可以在element中规定defaultProps: {children: 'children'}
- var idMap = {}; // 将原始数据转化为以id为key的map
- var elementTree = []; // 输出的element tree数据
- data.forEach(function (item) {
- item['value'] = item.id;
- item['label'] = item.name;
- idMap[item.id] = item;
- });
- data.forEach(function (item) {
- // debugger
- if (idMap[item.pid] != idMap[item.id] && idMap[item.pid]) {
- // 该item项有爸爸,放到对应的父节点下
- !idMap[item.pid].hasOwnProperty(children) && (idMap[item.pid][children] = []);
- idMap[item.pid][children].push(item);
- } else {
- // 根节点
- elementTree.push(item);
- }
- });
- return elementTree;
- },
-
- // 删除操作
- handleDelete: function handleDelete(index, row) {
- var _this49 = this;
-
- this.drawerRow = row;
- var that = this;
- // 二次确认删除
- this.$confirm("确定要删除吗?", "提示", {
- type: "warning"
- }).then(function () {
- var unbindCarddata = [];
- _this49.screenRoom1(row.id, function (roomtable) {
- var arr = [];
- roomtable.map(function (li) {
- var data = {
- siteId: li.roomId,
- cardId: row.id
- };
- arr.push(li.roomId);
- unbindCarddata.push(data);
- });
- if (roomtable.length > 0) {
- that.$confirm("是否先退租已入住房间?", "提示", {
- type: "warning"
- }).then(function () {
- console.log(roomtable);
- roomtable.map(function (li, index) {
- that.deleteRoomfun(index, li);
- });
- });
- } else {
- Object(api["g" /* httpPost */])(unbindCarddata, that.$api.unbindCard).then(function (res) {
- var data = {
- ids: [row.id]
- };
- Object(api["g" /* httpPost */])(data, that.$api.deleteCard).then(function (res) {
- if (res.success) {
- that.$message.success("删除成功");
- that.deleteUser(row, arr);
- that.getlist();
- } else {
- that.$message.error("删除失败");
- }
- });
- });
- }
- });
- });
- },
-
- //添加
- handleSearch1: function handleSearch1() {
- this.modify = true;
- this.editVisiblelist = true;
- },
-
- // 保存编辑
- saveEdit: function saveEdit() {
- var _this50 = this;
-
- // 添加人员的凭证保存
- var documentType = this.documentType;
- var str = {};
- console.log(this.form);
- if (this.form.name == "" || this.form.enterpriseId === "" || this.form.number == "" || this.form.type === "") {
- this.$message.error("请填写完整信息");
- } else if (Object(verification["a" /* default */])(this.form.number)) {
- this.$message.error("请填写正确身份证号");
- } else if (!util["a" /* default */].verificationPhone(this.form.phone)) {
- this.$message.error("请填写正确手机号");
- } else {
- var phone = this.form.phone;
- var infostr = {
- userTelephone: phone,
- userPassword: phone.substring(phone.length - 6, phone.length),
- userId: phone.substring(phone.length - 6, phone.length),
- keyId: phone.substring(phone.length - 6, phone.length)
- };
- var data = {
- cardId: this.form.cardId,
- cardState: 1,
- info: stringify_default()(infostr),
- name: this.form.name,
- number: this.form.number,
- phone: this.form.phone,
- sex: parseInt(this.form.sex),
- enterpriseId: this.form.enterpriseId,
- type: this.form.type
- };
- var drawerRowid = '';
- allFun["a" /* default */].addPeople(data, function (callback) {
- if (callback.success) {
- _this50.editVisiblelist = false;
- var dataprise = [];
- _this50.checkEnterpriseNode.map(function (li) {
- var obj = {
- itemId: callback.data,
- orderId: li.value
- };
- dataprise.push(obj);
- });
- if (dataprise.length > 0) {
- Object(api["g" /* httpPost */])(dataprise, _this50.$api.personBindEnterprise).then(function (res) {});
- }
- var ids = {
- ids: [callback.data]
- };
- Object(api["g" /* httpPost */])(ids, _this50.$api.createkeyCard).then(function (res) {});
- _this50.getAboutRoom();
- _this50.getlist();
- } else {
- _this50.getlist();
- }
- });
- if (this.WhetherToGreatAnAccount) {
- var enterpriseName = this.enterpriselist.filter(function (item) {
- return item.id == _this50.form.enterpriseId;
- })[0];
- if (enterpriseName) {
- var addform = {
- username: this.form.number,
- phone: this.form.phone,
- password: '123456',
- userType: 3,
- identity: 3,
- tenantId: this.$store.state.tenantId,
- enterpriseName: enterpriseName.name,
- enterpriseId: this.form.enterpriseId
- };
- Object(api["g" /* httpPost */])(addform, this.$api.addUser).then(function (res3) {
- if (res3.success) {
- _this50.$message.success("创建账号成功");
- } else {
- _this50.$message.error("创建账号失败");
- }
- });
- } else {
- this.$message.error("请选择所属部门");
- }
- }
- }
- },
- bindsave1: function bindsave1() {
- var _this51 = this;
-
- var documentType = this.documentType;
- var str = {};
- var cardName = this.drawerRow.name,
- pzname = '';
- if (documentType == '请选择') {
- this.$message.error("请选择凭证类型");
- return false;
- }
- if (this.value2[0] == '' || this.value2[1] == '') {
- this.$message.error("请选择开始结束时间");
- return false;
- }
- console.log(this.value2);
- var sort = this.getTypeSort(this.roomtable1, documentType);
- pzname = this.voucher.pzname || '';
- if (documentType == 11 && this.voucher.fingerprintAlias == '') {
- this.$message.error("请选择指纹别名");
- return false;
- }
- if (documentType == 10) {
- this.$message.error("人脸暂未开放");
- return;
- } else if (documentType == 11) {
- var fingerprint = localStorage.getItem("fingerprint");
- var indexofstr = fingerprint.indexOf(',');
- if (indexofstr != -1) {
- var array = fingerprint.split(",");
- var num = this.Bytes2Str(array);
- fingerprint = num;
- }
- if (pzname == '') {
- pzname = '指纹' + sort;
- }
- str = {
- username: this.voucher.username,
- pzname: pzname,
- userTelephone: JSON.parse(this.drawerRow.info).userTelephone,
- userPassword: JSON.parse(this.drawerRow.info).userPassword,
- keyId: JSON.parse(this.drawerRow.info).keyId || '',
- userId: JSON.parse(this.drawerRow.info).userId || '',
- fingerprintAlias: this.voucher.fingerprintAlias,
- password: "",
- passwordStartTime: moment_default()(this.value2[0]).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(this.value2[1]).format('YYYYMMDDHHmmss'),
- operateMode: 16,
- order: 6216,
- fingerprint: fingerprint
- };
- var _data5 = {
- cardId: this.drawerRow.id,
- content: stringify_default()(str),
- type: documentType,
- startTime: parseInt(moment_default()(this.value2[0]).valueOf() / 1000),
- endTime: parseInt(moment_default()(this.value2[1]).valueOf() / 1000)
- };
- Object(api["g" /* httpPost */])(_data5, this.$api.addCertificates).then(function (res) {
- _this51.$message.success('下发成功');
- _this51.roomstatus1 = true;
- _this51.getcertificate(); //获取凭证
- });
- return false;
- } else if (documentType == 12) {
- var arr2 = '';
- if (this.voucher.idcard.length == 16) {
- arr2 = this.voucher.idcard;
- } else if (this.voucher.idcard.length == 0) {
- this.$message.error("请输入身份证");
- return false;
- } else {
- arr2 = Object(utils["d" /* dec2hex */])(this.voucher.idcard);
- }
- if (pzname == '') {
- pzname = '身份证' + sort;
- }
- str = {
- username: this.voucher.username,
- pzname: pzname,
- userTelephone: JSON.parse(this.drawerRow.info).userTelephone,
- userPassword: JSON.parse(this.drawerRow.info).userPassword,
- keyId: JSON.parse(this.drawerRow.info).keyId || '',
- userId: JSON.parse(this.drawerRow.info).userId || '',
- operateMode: 13,
- order: 6213,
- password: arr2.toUpperCase(), //this.voucher.idcard,
- passwordStartTime: moment_default()(this.value2[0]).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(this.value2[1]).format('YYYYMMDDHHmmss'),
- is: false
- };
- } else if (documentType == 13) {
- var nfc = "";
- if (this.voucher.nfc.length == 8) {
- nfc = this.voucher.nfc;
- } else if (this.voucher.nfc.length == 0) {
- this.$message.error("请输入NFC");
- return false;
- } else {
- var array3 = Object(utils["d" /* dec2hex */])(this.voucher.nfc);
- var arr4 = Object(utils["h" /* group */])(array3, 2);
- arr4.map(function (li) {
- nfc += li;
- });
- }
- if (pzname == '') {
- pzname = 'NFC' + sort;
- }
- if (this.regularCard) {
- nfc = nfc + 'AA55';
- }
- str = {
- username: this.voucher.username,
- pzname: pzname,
- operateMode: 10,
- order: 6210,
- userTelephone: JSON.parse(this.drawerRow.info).userTelephone,
- userPassword: JSON.parse(this.drawerRow.info).userPassword,
- keyId: JSON.parse(this.drawerRow.info).keyId || '',
- userId: JSON.parse(this.drawerRow.info).userId || '',
- password: nfc.toUpperCase(), //this.voucher.nfc,
- passwordStartTime: moment_default()(this.value2[0]).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(this.value2[1]).format('YYYYMMDDHHmmss'),
- is: false
- };
- } else if (documentType == 14) {
- if (this.voucher.password.length != 6) {
- this.$message.error("密码长度为6位");
- return false;
- } else if (this.voucher.password.length == 0) {
- this.$message.error("请输入密码");
- return false;
- }
- if (pzname == '') {
- pzname = '密码' + sort;
- }
- str = {
- username: this.voucher.username,
- pzname: pzname,
- // imei: this.deviceList[0].imei,
- password: this.voucher.password,
- userTelephone: JSON.parse(this.drawerRow.info).userTelephone,
- userPassword: JSON.parse(this.drawerRow.info).userPassword,
- keyId: JSON.parse(this.drawerRow.info).keyId || '',
- userId: JSON.parse(this.drawerRow.info).userId || '',
- operateMode: 7,
- order: 6207,
- passwordStartTime: moment_default()(this.value2[0]).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(this.value2[1]).format('YYYYMMDDHHmmss'),
- is: false
- };
- }
- var data = {
- cardId: this.drawerRow.id,
- content: stringify_default()(str),
- type: documentType,
- startTime: moment_default()(this.value2[0]).valueOf() / 1000,
- endTime: moment_default()(this.value2[1]).valueOf() / 1000
- };
- Object(api["g" /* httpPost */])(data, this.$api.addCertificates).then(function (res) {
- _this51.$message.success('添加成功');
- _this51.roomstatus1 = true;
- _this51.getcertificate();
- });
- },
-
- // 重新下发凭证
- Issue: function Issue(index, row) {
- var _this52 = 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;
- var q = {
- deviceNum: row.deviceNum,
- lockType: 1
- // imei: row.imei
- };
- var data = {
- q: stringify_default()(q),
- pageNum: 1,
- pageSize: 10
- };
- this.$confirm("确定要重新下发吗?", "提示", {
- type: "warning"
- }).then(function () {
- Object(api["g" /* httpPost */])(data, _this52.$api.getDeviceItems).then(function (res) {
- if (res.data.list.length > 0) {
- if (res.data.list[0].manufactureId == 201 || res.data.list[0].manufactureId == 221) {
- if (row.type == 1) {
- var fpId = new Date();
- var fingerprint = JSON.parse(row.content).fingerprint;
- var pwd = JSON.parse(row.content).userPassword;
- var startTime = stringify_default()(row.startTime);
- var endTime = stringify_default()(row.endTime);
- if (startTime.length == 13) {
- startTime = Number(row.startTime / 1000);
- }
- if (endTime.length == 13) {
- endTime = Number(row.endTime / 1000);
- }
- equipment["a" /* default */].addFingerPrints(row.deviceNum, row.imei, pwd, 0, fingerprint, startTime, endTime, function (callback) {
- if (callback.success) {
- var str1 = JSON.parse(row.content);
- str1.fpTimeId = callback.serialNumber;
- var updatedata = {
- id: row.id,
- content: stringify_default()(str1),
- serial: callback.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, _this52.$api.updateCertificates).then(function (res2) {});
- _this52.obtainVoucherIssuanceRecord();
- _this52.$message.success(callback.msg);
- } else {
- _this52.$message.error(callback.msg);
- }
- });
- } else if (row.type == 2) {
- var pwd = JSON.parse(row.content).password;
- var userid = JSON.parse(row.content).userPassword;
- if (pwd.length != 16) {
- _this52.$message.error("卡格式错误,请重新录入");
- return;
- }
- var startTime = stringify_default()(row.startTime);
- var endTime = stringify_default()(row.endTime);
- if (startTime.length == 13) {
- startTime = Number(row.startTime / 1000);
- }
- if (endTime.length == 13) {
- endTime = Number(row.endTime / 1000);
- }
- equipment["a" /* default */].RfCardRegister(row.deviceNum, row.imei, userid, 1, 1, pwd, 36, startTime, endTime, 6210, function (callback) {
- if (callback.success) {
- var updatedata = {
- id: row.id,
- serial: callback.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, _this52.$api.updateCertificates).then(function (res) {});
- _this52.$message.success(callback.msg);
- _this52.obtainVoucherIssuanceRecord();
- } else {
- _this52.$message.error(callback.msg);
- _this52.obtainVoucherIssuanceRecord();
- }
- });
- } else if (row.type == 3) {
- var pwd = JSON.parse(row.content).password;
- var userid = JSON.parse(row.content).userPassword;
- if (pwd.length != 8) {
- _this52.$message.error("卡格式错误,请重新录入");
- return;
- }
- pwd = pwd + '00000000';
- var startTime = stringify_default()(row.startTime);
- var endTime = stringify_default()(row.endTime);
- if (startTime.length == 13) {
- startTime = Number(row.startTime / 1000);
- }
- if (endTime.length == 13) {
- endTime = Number(row.endTime / 1000);
- }
- equipment["a" /* default */].RfCardRegister(row.deviceNum, row.imei, userid, 1, 1, pwd, 50, startTime, endTime, 6210, function (callback) {
- if (callback.success) {
- var updatedata = {
- id: row.id,
- serial: callback.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, _this52.$api.updateCertificates).then(function (res) {});
- _this52.$message.success(callback.msg);
- _this52.obtainVoucherIssuanceRecord();
- } else {
- _this52.$message.error(callback.msg);
- _this52.obtainVoucherIssuanceRecord();
- }
- });
- } else if (row.type == 4) {
- var pwd = JSON.parse(row.content).password;
- var userid = JSON.parse(row.content).userPassword;
- var startTime = stringify_default()(row.startTime);
- var endTime = stringify_default()(row.endTime);
- if (startTime.length == 13) {
- startTime = Number(row.startTime / 1000);
- }
- if (endTime.length == 13) {
- endTime = Number(row.endTime / 1000);
- }
- equipment["a" /* default */].addForeverPassword(row.deviceNum, row.imei, userid, 1, pwd, 255, startTime, endTime, 6207, function (callback) {
- if (callback.success) {
- var updatedata = {
- id: row.id,
- serial: callback.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, _this52.$api.updateCertificates).then(function (res) {});
- _this52.$message.success(callback.msg);
- _this52.obtainVoucherIssuanceRecord();
- } else {
- _this52.$message.error(callback.msg);
- _this52.obtainVoucherIssuanceRecord();
- }
- });
- }
- } else if (res.data.list[0].manufactureId == 101) {
- 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,
- fingerprintStartTime: passwordStartTime,
- fingerprintEndTime: passwordEndTime
- };
- Object(api["g" /* httpPost */])(str, _this52.$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, _this52.$api.updateCertificates).then(function (res2) {});
- _this52.$message.success("下发成功");
- _this52.obtainVoucherIssuanceRecord();
- } else {
- _this52.$message.error("下发失败");
- _this52.obtainVoucherIssuanceRecord();
- }
- });
- _this52.$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, _this52.$api.getDeviceOperateUserInfo).then(function (res) {
- if (res.success) {
- var updatedata = {
- id: row.id,
- serial: res.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, _this52.$api.updateCertificates).then(function (res) {});
- _this52.$message.success("下发成功");
- _this52.obtainVoucherIssuanceRecord();
- } else {
- _this52.$message.error("下发失败");
- _this52.obtainVoucherIssuanceRecord();
- }
- });
- }
- } else {
- _this52.$message.error("未发现这个设备");
- }
- });
- });
- },
-
-
- // 解除绑定
- UnbindFun: function UnbindFun(index, row) {
- var _this53 = this;
-
- this.$confirm('是否只解除平台关系', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function () {
- var data = [{
- siteId: row.roomId,
- cardId: _this53.drawerRow.id
- }];
- Object(api["g" /* httpPost */])(data, _this53.$api.unbindCard).then(function (res) {
- if (res.success) {
- _this53.getAboutRoom();
- setTimeout(function () {
- _this53.updateRoom();
- }, 500);
- _this53.screenRoom(_this53.drawerRow.id);
- _this53.$message.success("解绑成功");
- } else {
- _this53.$message.error("解绑失败");
- }
- });
- });
- },
-
- // 下载模板
- workbook2blob: function workbook2blob(workbook) {
- // 生成excel的配置项
- var wopts = {
- // 要生成的文件类型
- bookType: 'xlsx',
- // // 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
- bookSST: false,
- type: 'binary'
- };
- var wbout = xlsx_default.a.write(workbook, wopts);
-
- // 将字符串转ArrayBuffer
- function s2ab(s) {
- var buf = new ArrayBuffer(s.length);
- var view = new Uint8Array(buf);
- for (var i = 0; i !== s.length; ++i) {
- view[i] = s.charCodeAt(i) & 0xff;
- }return buf;
- }
-
- var buf = s2ab(wbout);
- var blob = new Blob([buf], {
- type: 'application/octet-stream'
- });
- return blob;
- },
-
-
- // 将blob对象 创建bloburl,然后用a标签实现弹出下载框
- openDownloadDialog: function openDownloadDialog(blob, fileName) {
- if ((typeof blob === "undefined" ? "undefined" : typeof_default()(blob)) === 'object' && blob instanceof Blob) {
- blob = URL.createObjectURL(blob); // 创建blob地址
- }
- var aLink = document.createElement('a');
- aLink.href = blob;
- // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,有时候 file:///模式下不会生效
- aLink.download = fileName || '';
- var event;
- if (window.MouseEvent) event = new MouseEvent('click');
- // 移动端
- else {
- event = document.createEvent('MouseEvents');
- event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- }
- aLink.dispatchEvent(event);
- },
- exportBtn: function exportBtn() {
- this.exportExcel();
- },
- exportExcel: function exportExcel() {
- var sheet1data = [['人员名称', '房间ID', '房间名称', '学工号', '卡号', '电话(为11位手机号码)', '性别(1为男,2为女)', '开锁方式(3为NFC,4为密码)', '内容(NFC为8位16进制物理卡号、密码为6位数字密码)']];
- var sheet1 = xlsx_default.a.utils.json_to_sheet(sheet1data, {
- skipHeader: true
- });
- // 创建一个新的空的workbook
- var wb = xlsx_default.a.utils.book_new();
- xlsx_default.a.utils.book_append_sheet(wb, sheet1, '人员导入模板');
- // XLSX.utils.book_append_sheet(wb, sheet2, '行政部')
- // XLSX.utils.book_append_sheet(wb, sheet3, '前端部')
- var workbookBlob = this.workbook2blob(wb);
- this.openDownloadDialog(workbookBlob, '人员导入模板.xlsx');
- },
- hexStringToBuffer: function hexStringToBuffer(hex) {
- var buffer = new ArrayBuffer(hex.length / 2);
- var byteStream = new Uint8Array(buffer);
- var i = 0;
- while (hex.length >= 2) {
- var x = parseInt(hex.substring(0, 2), 16);
- hex = hex.substring(2, hex.length);
- byteStream[i++] = x;
- }
- return byteStream;
- },
-
- // 采集指纹
- addfir: function addfir() {
- var _this = this;
- this.$refs.myChild.addFingerprintFun(0x8014, function (data) {
- localStorage.setItem('fingerprint', data);
- _this.localFingerprint = data;
- });
- },
- getFingerData: function getFingerData() {
- var _this54 = this;
-
- return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
- var _this;
-
- return regenerator_default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- _this = _this54;
- _context2.next = 3;
- return _this54.$refs.myGetFinger.DetectFinger();
-
- case 3:
- _context2.next = 5;
- return _this54.$refs.myGetFinger.getFingerData('', function (data) {
- console.log(data);
- localStorage.setItem('fingerprint', data.template);
- _this.localFingerprint = data.template;
- });
-
- case 5:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, _this54);
- }))();
- },
- setVoucherNfc: function setVoucherNfc(data) {
- if (data.cardType == 50) {
- var nfc = "";
- var str = data.cardNo.substr(0, 8);
- var arr4 = Object(utils["h" /* group */])(str, 2).reverse();
- arr4.map(function (li) {
- nfc += li;
- });
- this.voucher.nfc = nfc.toUpperCase();
- console.log(this.voucher.nfc);
- } else if (data.cardType == 36) {
- this.voucher.idcard = data.cardNo.toUpperCase();
- }
- },
- writeNfc: function writeNfc() {
- var _this = this;
- this.$refs.myChild.writeCard(0x8011, function (data) {
- if (data.status == 0) {
- console.log(data);
- } else {
- console.log(data);
- _this.$message.error("写卡错误,请检查读卡器是否正常!");
- }
- });
- },
- addNfc: function addNfc() {
- var _this = this;
- this.$refs.myChild.cardFun(0x8010, function (data) {
- if (data.status == 0) {
- console.log(data);
- _this.setVoucherNfc(data);
- } else {
- _this.$message.error("读卡错误,请检查读卡器是否正常!");
- }
- });
- },
-
- // input视图刷新
- changesr: function changesr(e) {
- this.$forceUpdate();
- },
-
- // 加入信息库
- addInformationBase: function addInformationBase(index, row) {
- var _this55 = this;
-
- var info = JSON.parse(row.content);
- var obj = {},
- content = {},
- arr = [];
- content["type"] = row.type;
- content["order"] = info.order;
- content["cardId"] = info.cardId;
- content["pzname"] = info.pzname;
- if (row.type == 1) {
- content["content"] = info.fingerprint;
- } else {
- content["content"] = info.password;
- }
- content["operateMode"] = info.operateMode;
- content["userPassword"] = info.userPassword;
- content["userTelephone"] = info.userTelephone;
- content["length"] = info.length;
- obj.cardId = this.drawerRow.id;
- obj.content = stringify_default()(content);
- arr.push(obj);
- var data = {
- list: arr
- };
- Object(api["g" /* httpPost */])(data, this.$api.addMark).then(function (res) {
- if (res.success) {
- _this55.$message.success("操作成功");
- }
- });
- },
-
- //多选删除房间数据
- selectRoomdelete: function selectRoomdelete(val) {
- this.selectRoomdeletelist = val;
- },
-
- // 清理房间
- qlfj: function qlfj() {
- var info = JSON.parse(this.drawerRow.info);
- var info1 = {
- roomIds: [],
- userPassword: info.userPassword,
- userTelephone: info.userTelephone
- };
- var data1 = {
- id: this.drawerRow.id,
- info: stringify_default()(info1)
- };
- Object(api["g" /* httpPost */])(data1, this.$api.updateCard).then(function (res) {});
- },
-
- // 退租
- rentWithdrawal: function rentWithdrawal(index, row) {
- this.batchRenewalList = [row];
- this.batchLeaseback();
- },
-
- // 删除房间
- deleteRoomfun: function deleteRoomfun(index, row) {
- var that = this;
- var resultArr = this.AboutDevice.filter(function (_item) {
- return _item.roomId == row.roomId;
- })[0];
- console.log(resultArr, this.drawerRow.id);
- if (resultArr) {
- allFun["a" /* default */].unbindPeopleAndRooms(this.drawerRow.id, resultArr.imei, function (callback) {
- if (callback.success) {
- var dataOne = util["a" /* default */].zlib_unzip(callback.data);
- if (dataOne.length > 0) {
- var data = dataOne[0];
- if (data.status == 0) {
- that.$message.error("该房间正在下发此用户,不能删除!");
- } else if (data.status == 1) {
- that.deleteRelationshipBetweenPersonnelAndRoom(index, row);
- that.getcheckInList();
- that.updateRoom();
- } else if (data.status == 703) {
- that.deleteRelationshipBetweenPersonnelAndRoom(index, row);
- that.getcheckInList();
- } else {
- that.deleteRelationshipBetweenPersonnelAndRoom(index, row);
- that.updateRoom();
- }
- } else {
- that.deleteRelationshipBetweenPersonnelAndRoom(index, row);
- that.getcheckInList();
- that.updateRoom();
- }
- } else {
- that.deleteRelationshipBetweenPersonnelAndRoom(index, row);
- that.getcheckInList();
- that.updateRoom();
- }
- });
- } else {
- that.deleteRelationshipBetweenPersonnelAndRoom(index, row);
- that.getcheckInList();
- that.updateRoom();
- }
- },
- deleteRelationshipBetweenPersonnelAndRoom: function deleteRelationshipBetweenPersonnelAndRoom(index, row) {
- var _this56 = this;
-
- var info = JSON.parse(this.drawerRow.info);
- var data = [{
- siteId: row.roomId,
- cardId: this.drawerRow.id
- }];
- Object(api["g" /* httpPost */])(data, this.$api.unbindCard).then(function (res) {
- if (res.success) {
- var array = _this56.roomtable,
- SelectedList = [],
- roomtable = [];
- _this56.roomtable.map(function (item, Index) {
- if (item.roomId == row.roomId) {
- array.splice(Index, 1);
- }
- });
- array.map(function (li) {
- SelectedList.push(li.roomId);
- });
- _this56.getcheckInList();
- _this56.getAboutRoom();
- setTimeout(function () {
- _this56.updateRoom();
- }, 500);
- // this.roomtablestatus = false
- _this56.selectRoom = false;
- _this56.$nextTick(function () {
- this.SelectedList = SelectedList;
- this.roomtable = roomtable;
- this.selectRoom = true;
- // this.roomtablestatus = true
- });
- var resultArr = _this56.AboutDevice.filter(function (_item) {
- return _item.roomId == row.roomId;
- })[0];
- if (resultArr) {
- if (resultArr.imei) {
- if (resultArr.manufactureId == 201 || resultArr.manufactureId == 221) {
- var data = {
- lockerId: resultArr.deviceNum,
- imei: resultArr.imei,
- lockerUserId: info.userPassword,
- keyId: info.userPassword,
- role: 0,
- action: 2, //1--添加、2--删除、3--修改
- order: 6203,
- cardName: _this56.drawerRow.name,
- roomName: resultArr.roomName
- };
- Object(api["g" /* httpPost */])(data, _this56.$api.ZGduserOperation).then(function (res) {
- if (res.success) {
- _this56.$message.success('删除用户成功');
- } else {
- _this56.$message.error(res.msg);
- }
- });
- } else if (resultArr.manufactureId == 101) {
- var str = {
- imei: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- userTelephone: info.userTelephone,
- userPassword: info.userPassword,
- operateMode: 3,
- order: 6203,
- password: "20210816",
- cardName: _this56.drawerRow.name,
- roomName: resultArr.roomName,
- is: false
- };
- Object(api["g" /* httpPost */])(str, _this56.$api.getDeviceOperateUserInfo).then(function (res1) {
- if (res1.success) {
- _this56.$message.success("删除用户成功");
- } else {
- _this56.$message.error(res1.msg);
- }
- });
- }
- }
- }
- _this56.screenRoom(_this56.drawerRow.id);
- _this56.$message.success("解绑房间成功");
- }
- });
- },
- getRandomNumber: function getRandomNumber(n) {
- var arr = new Array(n); //用于存放随机数
- var randomNumber = ""; //存放随机数
- for (i = 0; i < arr.length; i++) {
- arr[i] = parseInt(Math.random() * 10);
- }var flag = 0;
- for (i = 0; i < arr.length - 1; i++) {
- for (j = i + 1; j < arr.length; j++) {
- if (arr[i] == arr[j]) {
- flag = 1;
- break;
- }
- }
- if (flag) break;
- }
- for (var i = 0; i < arr.length; i++) {
- randomNumber += arr[i];
- }
- return randomNumber;
- },
-
- // 修改凭证
- modifyCraiFun: function modifyCraiFun() {
- var that = this;
- var row = this.modifyrow;
- var content = JSON.parse(row.content);
- var passwordStartTime = moment_default()(this.value2[0].getTime()).format('YYYYMMDDHHmmss');
- var passwordEndTime = moment_default()(this.value2[1].getTime()).format('YYYYMMDDHHmmss');
- content.pzname = that.certificatesContent.pzname;
- content.passwordStartTime = passwordStartTime;
- content.passwordEndTime = passwordEndTime;
- var updatedata = {
- id: row.id,
- content: stringify_default()(content),
- startTime: this.value2[0].getTime() / 1000,
- endTime: this.value2[1].getTime() / 1000
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res2) {
- that.getcertificate();
- that.certificatestatus = false;
- });
- },
- modifyCrai: function modifyCrai(index, row) {
- this.modifyrow = row;
- var content = JSON.parse(row.content);
- this.documentType1 = row.type;
- this.certificatesContent.username = content.username;
- this.certificatesContent.pzname = content.pzname;
- this.certificatesContent.password = content.password;
- var passwordStartTime = '',
- passwordEndTime = '';
- if (row.startTime && row.endTime) {
- var str1 = stringify_default()(row.startTime);
- var str2 = stringify_default()(row.endTime);
- if (str1.length == 13 && str2.length == 13) {
- passwordStartTime = moment_default()(row.startTime).format('YYYY-MM-DD HH:mm:ss');
- passwordEndTime = moment_default()(row.endTime).format('YYYY-MM-DD HH:mm:ss');
- } else if (str1.length == 10 && str2.length == 10) {
- passwordStartTime = moment_default()(row.startTime * 1000).format('YYYY-MM-DD HH:mm:ss');
- passwordEndTime = moment_default()(row.endTime * 1000).format('YYYY-MM-DD HH:mm:ss');
- }
- } else if (!row.deviceNum.indexOf('yxwl')) {
- passwordStartTime = this.insertStr(content.endTime, "-");
- passwordEndTime = this.insertStr(content.passwordEndTime, "-");
- }
- this.modifyStatus = false;
- this.$nextTick(function () {
- this.modifyvalue2[0] = passwordStartTime;
- this.modifyvalue2[1] = passwordEndTime;
- this.modifyStatus = true;
- });
- this.certificatestatus = true;
- },
- 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);
- },
-
- //所选房源
- handleCheckChange: function handleCheckChange() {
- this.selectkey = this.$refs.tree.getCheckedKeys();
- },
-
- // 房源添加
- handleCheckChangeadd: function handleCheckChangeadd() {
- this.selectkeyadd = this.$refs.tree2.getCheckedKeys();
- },
-
- //所选房源
- handleCheckChange1: function handleCheckChange1() {
- this.selectkey1 = this.$refs.tree1.getCheckedKeys();
- },
- markFun: function markFun(e) {
- var info = this.tableData[e];
- this.documentType = info.type;
- if (info.type == 1) {
- localStorage.setItem("fingerprint", info.content);
- } else if (info.type == 2) {
- this.voucher.idcard = info.content;
- } else if (info.type == 3) {
- this.voucher.nfc = info.content;
- } else if (info.type == 4) {
- this.voucher.password = info.content;
- }
- },
-
- // 获取信息库
- getOperates: function getOperates(id) {
- // var data = {
- // q: JSON.stringify({
- // cardId: id,
- // }),
- // };
- // httpGet(data, this.$api.getMark).then((res) => {
- // var array = [];
- // res.data.map((li) => {
- // var str = JSON.parse(li.content);
- // str.id = li.id;
- // str.cardId = li.cardId;
- // array.push(str);
- // });
- // this.tableData = array;
- // });
- },
-
- // 人脸图片上传功能
- handleRemove: function handleRemove(file) {
- console.log(file);
- },
- handlePictureCardPreview: function handlePictureCardPreview(file) {
- this.dialogImageUrl = file.url;
- this.dialogVisible1 = true;
- },
- handleDownload: function handleDownload(file) {
- console.log(file);
- },
- selectCheck: function selectCheck(e) {
- if (e == "左手大拇指") {
- this.fingerprintId = 0;
- } else if (e == "左手食指") {
- this.fingerprintId = 1;
- } else if (e == "右手大拇指") {
- this.fingerprintId = 2;
- } else if (e == "右手食指") {
- this.fingerprintId = 3;
- }
- },
-
- // 分页
- handleSizeChange1: function handleSizeChange1(val) {
- this.pageSize1 = val;
- this.obtainVoucherIssuanceRecord();
- },
- handleCurrentChange1: function handleCurrentChange1(val) {
- this.currentPage1 = val;
- this.obtainVoucherIssuanceRecord();
- },
- getlistNum1: function getlistNum1(val, size) {
- var _this57 = this;
-
- var dataall = {
- pageNum: 0,
- pageSize: 0,
- orderBy: "create_at desc",
- q: {
- cardId: this.drawerRow.id,
- deviceNum: this.credentialSearch.deviceNum,
- imei: this.credentialSearch.imei,
- inStatus: "0,1,702",
- types: "0,1,2,3,4"
- }
- };
- Object(api["d" /* httpGet */])(dataall, this.$api.getCertificates).then(function (resall) {
- if (resall.code == 200) {
- var sendOn = util["a" /* default */].zlib_unzip(resall.data);
- var sendstatus = true;
- if (resall.data.total == 0) {
- sendstatus = false;
- }
- var data = {
- pageNum: _this57.currentPage1,
- pageSize: _this57.pageSize1,
- orderBy: "create_at desc",
- q: {
- cardId: _this57.drawerRow.id,
- type: '1,2,3,4'
- }
- };
- Object(api["d" /* httpGet */])(data, _this57.$api.getCertificates).then(function (res) {
- var certiflist = util["a" /* default */].zlib_unzip(res.data);
- var AboutDevice = _this57.allAboutDevice;
- certiflist.map(function (li) {
- li['color'] = '1';
- var licontent = JSON.parse(li.content).password;
- var filterResult = sendOn.filter(function (item) {
- return JSON.parse(item.content).password == licontent;
- });
- if (sendstatus && filterResult && filterResult.length > 0) {
- var statusOne = filterResult.some(function (item) {
- return item.status == 0;
- });
- var statusTwo = filterResult.some(function (item) {
- return item.status == 1;
- });
- var statusThree = filterResult.some(function (item) {
- return item.status == 702;
- });
- if (statusOne) {
- li['color'] = '0';
- } else if (!statusOne && !statusThree && statusTwo) {
- li['color'] = '1';
- } else if (!statusOne && statusThree) {
- li['color'] = '702';
- } else {
- li['color'] = '999';
- }
- }
- li.createAt = _this57.time(+new Date(li.createAt));
- li.userTelephone = JSON.parse(li.content).userTelephone;
- li.pzname = JSON.parse(li.content).pzname;
- li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
- li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
- li['data'] = JSON.parse(li.content).password;
- if (li.type == 1) {
- li['data'] = li.id;
- }
- if (li.pzname) {
- var statusif = li.pzname.indexOf('蓝牙') || -1;
- if (statusif) {
- li['DeletePermissions'] = true;
- } else {
- if (li.type != 11) {
- li['DeletePermissions'] = true;
- } else {
- li['DeletePermissions'] = false;
- }
- }
- } else {
- li['DeletePermissions'] = false;
- }
- });
- var array = util["a" /* default */].uniqueArray(certiflist, "data");
- _this57.roomtable1 = certiflist;
- _this57.total1 = res.data.total;
- });
- }
- });
- },
-
- // 获取指纹id
- getfiId: function getfiId(row, callback) {
- var content = JSON.parse(row.content);
- var data = {
- q: stringify_default()({
- serial: row.serial
- }),
- 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);
- });
- },
-
- // 获取指纹id
- getfiId1: function getfiId1(row, callback) {
- var data = {
- q: stringify_default()({
- serial: row.serial
- }),
- 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);
- });
- },
-
- // 批量删除凭证
- deleAll: function deleAll() {
- var _this58 = this;
-
- // console.log(this.multipleSelection4)
- // return
- var multipleSelection4 = this.multipleSelection4;
- this.$confirm("确定要删除吗?", "提示", {
- type: "warning"
- }).then(function () {
- multipleSelection4.map(function (li, index) {
- _this58.deletefun2(index, li);
- });
- });
- },
-
- // 删除凭证操作
- deletefun2: function deletefun2(index, row) {
- var _this59 = this;
-
- // 二次确认删除
- var ids = this.roomtable;
- var that = this;
- var str = {};
-
- var q = {
- deviceNum: row.deviceNum,
- imei: row.imei,
- lockType: 1
- };
- var data = {
- q: stringify_default()(q),
- pageNum: 1,
- pageSize: 10
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.data.list.length > 0) {
- var cardName = row.name + '-' + JSON.parse(row.content).pzname;
- if (res.data.list[0].manufactureId == 201 || res.data.list[0].manufactureId == 221) {
- if (row.type == 1) {
- _this59.getfiId1(row, function (data) {
- if (data.length > 0) {
- equipment["a" /* default */].delFingerPrints(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, data[0].face, 0, row.startTime, row.endTime, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 18;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content)
- // serial: callback.data.serialNumber,
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("删除成功!");
- } else {
- that.$message.error(callback.msg);
- }
- });
- } else {
- that.$message.success("未找到对应锁上凭证记录");
- }
- });
- } else if (row.type == 2) {
- _this59.getfiId1(row, function (data) {
- if (data.length > 0) {
- if (JSON.parse(row.content).password.length != 16) {
- this.$confirm("卡格式错误,请重新录入", "提示", {
- type: "warning"
- }).then(function () {});
- } else {
- equipment["a" /* default */].delCardRegister(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, 1, JSON.parse(row.content).password, 36, row.startTime, row.endTime, 6212, data[0].face, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 15;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content)
- // serial: callback.data.serialNumber,
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("删除成功!");
- } else {
- that.$message.error(callback.msg);
- }
- });
- }
- } else {
- that.$message.success("未找到对应锁上凭证记录");
- }
- });
- } else if (row.type == 3) {
- _this59.getfiId1(row, function (data) {
- console.log(data);
- if (data.length > 0) {
- if (JSON.parse(row.content).password.length != 8) {
- this.$confirm("卡格式错误,是否删除重新录入", "提示", {
- type: "warning"
- }).then(function () {
- var data = {
- ids: [row.id]
- };
- Object(api["g" /* httpPost */])(data, that.$api.deleteCertificates).then(function (res) {
- if (res.success) {
- that.$message.success("删除成功!");
- that.getcertificate();
- }
- });
- });
- } else {
- equipment["a" /* default */].delCardRegister(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, 1, JSON.parse(row.content).password, 50, row.startTime, row.endTime, 6212, data[0].face, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 12;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content)
- // serial: callback.data.serialNumber,
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("删除成功!");
- } else {
- that.$message.error(callback.msg);
- }
- });
- }
- } else {
- that.$message.success("未找到对应锁上凭证记录");
- }
- });
- } else if (row.type == 4) {
- _this59.getfiId1(row, function (data) {
- if (data.length > 0) {
- equipment["a" /* default */].delForeverPassword(row.deviceNum, row.imei, JSON.parse(row.content).userPassword, 2, JSON.parse(row.content).password, 255, row.startTime, row.endTime, 6209, data[0].face, cardName, res.data.list[0].roomName, function (callback) {
- if (callback.success) {
- var content = JSON.parse(row.content);
- content.operateMode = 9;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content)
- // serial: callback.data.serialNumber,
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("删除成功!");
- } else {
- that.$message.error(callback.msg);
- }
- });
- } else {
- that.$message.success("未找到对应锁上凭证记录");
- }
- });
- }
- } else if (res.data.list[0].manufactureId == 101) {
- if (row.type == 1) {
- _this59.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,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- if (JSON.parse(row.content).pass) {
- str['pass'] = true;
- } else {
- str['pass'] = false;
- }
- Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
- if (res1.success) {
- var content = JSON.parse(row.content);
- content.operateMode = str.operateMode;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content)
- // serial: res1.data.serialNumber,
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("删除成功!");
- }
- });
- } else {
- that.$message.success("未找到对应锁上凭证记录");
- }
- });
- return false;
- } else if (row.type == 2) {
- str = {
- imei: row.imei,
- deviceNum: row.deviceNum,
- userTelephone: JSON.parse(row.content).userTelephone,
- operateMode: 15,
- order: 6215,
- password: JSON.parse(row.content).password,
- userPassword: JSON.parse(row.content).userPassword,
- is: false,
- passwordStartTime: JSON.parse(row.content).passwordStartTime,
- passwordEndTime: JSON.parse(row.content).passwordEndTime,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- } else if (row.type == 3) {
- str = {
- imei: row.imei,
- deviceNum: row.deviceNum,
- userTelephone: JSON.parse(row.content).userTelephone,
- operateMode: 12,
- order: 6212,
- password: JSON.parse(row.content).password,
- userPassword: JSON.parse(row.content).userPassword,
- is: false,
- passwordStartTime: JSON.parse(row.content).passwordStartTime,
- passwordEndTime: JSON.parse(row.content).passwordEndTime,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- } else if (row.type == 4) {
- str = {
- 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: JSON.parse(row.content).passwordStartTime,
- passwordEndTime: JSON.parse(row.content).passwordEndTime,
- cardName: cardName,
- roomName: res.data.list[0].roomName
- };
- }
- if (JSON.parse(row.content).pass) {
- str['pass'] = true;
- } else {
- str['pass'] = false;
- }
- Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
- if (res1.success) {
- var content = JSON.parse(row.content);
- content.operateMode = str.operateMode;
- var updatedata = {
- id: row.id,
- status: 0,
- content: stringify_default()(content)
- // serial: res1.data.serialNumber,
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res) {});
- that.$message.success("删除成功!");
- }
- });
- }
- } else {
- // var data = {
- // ids: [row.id],
- // };
- // httpPost(data, that.$api.deleteCertificates).then((
- // res) => {
- // if (res.success) {
- // that.$message.success("删除成功!");
- // that.getcertificate();
- // }
- // });
- that.$message.error("未找到锁上对应凭证ID");
- }
- });
- },
- deletefun1: function deletefun1(index, row) {
- var _this60 = this;
-
- var that = this;
- this.$confirm("此操作将删除凭证记录,请确认!", "提示", {
- type: "warning"
- }).then(function () {
- var pzid = [];
- pzid.push(row.id);
- if (row.type == 11) {
- var pzname = JSON.parse(row.content).pzname;
- var data6 = {
- pageNum: 1,
- pageSize: 10,
- orderBy: "create_at desc",
- q: stringify_default()({
- info: {
- pzname: pzname
- },
- cardId: _this60.drawerRow.id,
- inStatus: "0,1,702",
- type: 1
- })
- };
- Object(api["d" /* httpGet */])(data6, _this60.$api.getCertificates).then(function (res) {
- var dataOne = util["a" /* default */].zlib_unzip(res.data);
- if (dataOne.length > 0) {
- _this60.$message.error("请先删除锁上凭证");
- } else {
- var data = {
- ids: pzid
- };
- Object(api["g" /* httpPost */])(data, that.$api.deleteCertificates).then(function (res) {
- if (res.success) {
- that.$message.success("删除成功!");
- that.getcertificate();
- }
- });
- }
- });
- } else {
- var password = JSON.parse(row.content).password;
- var data6 = {
- pageNum: 1,
- pageSize: 10,
- orderBy: "create_at desc",
- q: stringify_default()({
- info: {
- password: password
- },
- cardId: _this60.drawerRow.id,
- inStatus: "0,1,702",
- types: "0,1,2,3,4"
- })
- };
- Object(api["d" /* httpGet */])(data6, _this60.$api.getCertificates).then(function (res) {
- var dataOne = util["a" /* default */].zlib_unzip(res.data);
- if (dataOne.length > 0) {
- _this60.$message.error("请先删除锁上凭证");
- } else {
- var data = {
- ids: pzid
- };
- Object(api["g" /* httpPost */])(data, that.$api.deleteCertificates).then(function (res) {
- if (res.success) {
- that.$message.success("删除成功!");
- that.getcertificate();
- }
- });
- }
- });
- }
- });
- },
- getArrDifference: function getArrDifference(arr1, arr2) {
- return arr1.concat(arr2).filter(function (v, i, arr) {
- return arr.indexOf(v) === arr.lastIndexOf(v);
- });
- },
- bindsave2: function bindsave2() {
- var SelectedList = [];
- this.roomtable.map(function (li) {
- SelectedList.push(li.roomId);
- });
- this.SelectedList = SelectedList;
- this.addroomstatus = !this.addroomstatus;
- },
- putCarfid1: function putCarfid1(resultArr, row) {
- 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: resultArr.imei,
- deviceNum: resultArr.deviceNum,
- userTelephone: userTelephone,
- userPassword: userPassword,
- password: JSON.parse(row.content).password,
- length: fingerprint.length / 2,
- fpTimeId: fpId.getTime(),
- operateMode: 16,
- order: 6216,
- fingerprint: fingerprint,
- fingerprintStartTime: passwordStartTime,
- fingerprintEndTime: passwordEndTime
- };
- Object(api["g" /* httpPost */])(str, this.$api.fingerprintTransfer).then(function (res1) {
- var updatedata = {
- id: row.id,
- serial: res1.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res2) {});
- });
- return false;
- } else if (row.type == 2) {
- data = {
- imei: resultArr.imei,
- deviceNum: resultArr.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: resultArr.imei,
- deviceNum: resultArr.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: resultArr.imei,
- deviceNum: resultArr.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 (res1) {
- if (res1.success) {
- var updatedata = {
- id: row.id,
- serial: res1.data.serialNumber
- };
- Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res2) {});
- }
- });
- },
-
- // 转换标准时间
- getbztime: function getbztime(time) {
- var d = new Date(time);
- var mon = d.getMonth() + 1 < 10 ? "0" + (d.getMonth() + 1) : d.getMonth() + 1;
- var day = d.getDate() < 10 ? "0" + d.getDate() : d.getDate();
- var hour = d.getDate() < 10 ? "0" + d.getDate() : d.getDate();
- var min = d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes();
- var secon = d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds();
- var datetime = d.getFullYear() + "" + mon + "" + day + "" + hour + "" + min + "" + secon;
- return datetime;
- },
- 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", " ");
- },
- Bytes2Str: function Bytes2Str(arrBytes) {
- var str = "";
- for (var i = 0; i < arrBytes.length; i++) {
- var tmp;
- var num = parseInt(arrBytes[i]);
- if (num < 0) {
- //此处填坑,当byte因为符合位导致数值为负时候,需要对数据进行处理
- tmp = (255 + num + 1).toString(16);
- } else {
- tmp = num.toString(16);
- }
- if (tmp.length == 1) {
- tmp = "0" + tmp;
- }
- if (i > 0) {
- str += "" + tmp;
- } else {
- str += tmp;
- }
- }
- return str;
- },
-
- // 选择绑定房间
- onClick: function onClick(evt, treeId, treeNode) {
- // 点击事件
- this.treedata = treeNode;
- this.getItems(treeNode.id);
- this.getlist();
- },
- getItems: function getItems(id) {
- var _this61 = this;
-
- if (id) {
- var t = {
- roomIds: [id],
- lockType: 1
- };
- var data = {
- q: stringify_default()(t)
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- if (res.data.list.length == 0) {
- // this.$message.error("该房间还未绑定门锁");
- // this.bindroomstatus = false;
- } else {
- _this61.deviceList = res.data.list;
- }
- });
- } else {
- this.bindroomstatus = false;
- // this.$message({
- // message: "该人员还未绑定房间",
- // type: "error",
- // customClass: "zZindex",
- // });
- }
- },
-
- // tabs标签页切换
- handleClick: function handleClick(tab, event) {},
-
- // 侧边栏添加绑定房间
- bindroom: function bindroom() {
- this.roomstatus = !this.roomstatus;
- this.addroomstatus = true;
- },
- addroom: function addroom() {
- var array = this.roomtable,
- SelectedList = [];
- array.map(function (li) {
- SelectedList.push(li.roomId);
- });
- console.log(SelectedList);
- this.SelectedList = SelectedList;
- this.roomstatus = !this.roomstatus;
- this.addroomstatus = false;
- },
- bindroom1: function bindroom1() {
- this.roomstatus1 = !this.roomstatus1;
- var nfc = '';
- var arr2 = Object(utils["d" /* dec2hex */])(this.drawerRow.cardId);
- var arr4 = Object(utils["h" /* group */])(arr2, 2).reverse();
- arr4.map(function (li) {
- nfc += li;
- });
- if (nfc.length != 8) {
- this.voucher.nfc = "";
- } else {
- this.voucher.nfc = nfc.toUpperCase();
- }
- },
-
- // 关闭侧边栏
- handleClose: function handleClose() {
- this.drawer = false;
- this.drawerVisible = false;
- this.personname = '';
- },
- screenRoom1: function screenRoom1(id, callback) {
- var _this62 = this;
-
- // httpGet("", this.$api.onlyTenant).then((res) => {
- // var roomAbout = res.data.list;
- // var roomtable = [];
- // roomAbout.map((li) => {
- // if (li.cardId == id) {
- // roomtable.push(li);
- // }
- // });
- // callback(roomtable)
- // });
- var roomAbout = this.$store.state.roomAbout;
- var roomtable = [];
- roomAbout.map(function (li) {
- var name = util["a" /* default */].findIndexArray(_this62.$store.state.zNodes, li.roomId, []);
- var path = '';
- if (name) {
- path = name.join('/');
- }
- li.roomName = path;
- if (li.cardId == id) {
- roomtable.push(li);
- }
- });
- console.log(roomtable);
- callback(roomtable);
- },
- returnScreenRoom: function returnScreenRoom(id) {
- var _this63 = this;
-
- var roomAbout = this.$store.state.roomAbout;
- var SelectedList = [],
- roomtable = [];
- roomAbout.map(function (li) {
- var name = util["a" /* default */].findIndexArray(_this63.$store.state.zNodes, li.roomId, []);
- var path = '';
- if (name) {
- path = name.join('/');
- }
- li.roomName = path;
- if (li.cardId == id) {
- if (li.layout) {
- SelectedList.push(li.roomId);
- }
- var result = _this63.checkInListing.filter(function (item) {
- return item.siteId == li.roomId;
- })[0];
- var deviceResult = _this63.allAboutDevice.filter(function (it) {
- return it.roomId == li.roomId;
- })[0];
- if (result) {
- li['endTime'] = moment_default()(result.endTime).format("YYYY-MM-DD HH:mm:ss") || '';
- li['startTime'] = moment_default()(result.startTime).format("YYYY-MM-DD HH:mm:ss") || '';
- li['name'] = result.name;
- li.card = li.cardId;
- }
- if (deviceResult) {
- li['deviceNum'] = deviceResult.deviceNum;
- li['imei'] = deviceResult.imei;
- li['manufactureId'] = deviceResult.manufactureId;
- }
- roomtable.push(li);
- }
- });
- return roomtable;
- // this.roomtable=roomtable
- },
- getAboutDevice1: function getAboutDevice1() {
- var _this64 = this;
-
- var data = {
- pageNum: 0,
- pageSize: 0,
- q: stringify_default()({
- lockType: 1
- })
- };
- Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
- _this64.allAboutDevice = res.data.list;
- });
- },
- oninput: function oninput(e) {
- var str = Number(e).toString(2);
- var str1 = Number(str);
- var str3 = Number(str1).toString(16);
- },
- downloadItem: function downloadItem(url) {
- axios_default.a.get(url, {
- responseType: "blob"
- }).then(function (_ref2) {
- var data = _ref2.data;
-
- var blob = new Blob([data], {
- type: "application/vnd.ms-excel"
- });
- var link = document.createElement("a");
- link.href = window.URL.createObjectURL(blob);
- link.download = url.split("/").pop();
- // for IE
- if (navigator.msSaveBlob) {
- navigator.msSaveBlob(blob, "SPU_templateV1.1.xlsx");
- }
- link.click().catch(function (error) {
- console.error(error);
- });
- });
- },
- getallstatus: function getallstatus(para) {
- var _this65 = this;
-
- var data3 = {
- code: "operateUserInfo/status",
- data: {
- para: para
- }
- };
- var userlistquery = this.userlistquery;
- Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res4) {
- _this65.userlistquery1 = res4.data;
- });
- },
- activeiconfun: function activeiconfun(t) {
- this.activeiconfont = t;
- },
- handleSizeChange: function handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.getlistNum(0, val);
- },
- handleCurrentChange: function handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.getlistNum(val, 10);
- this.$store.commit("increment", val);
- },
-
- // 分页
- handleSizeChange2: function handleSizeChange2(val) {
- this.pageSize2 = val;
- this.getlistNum2(0, val);
- },
- handleCurrentChange2: function handleCurrentChange2(val) {
- this.currentPage2 = val;
- // console.log(`当前页: ${val}`);
- this.getlistNum2(val, 10);
- },
- getlistNum2: function getlistNum2(val, size) {
- var _this66 = this;
-
- var data = {
- pageNum: this.currentPage2,
- pageSize: this.pageSize2,
- orderBy: "create_at desc",
- q: {
- cardId: this.drawerRow.id
- }
- };
- Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
- var certiflist = util["a" /* default */].zlib_unzip(res.data);
- var AboutDevice = _this66.allAboutDevice;
- certiflist.map(function (li) {
- li.createAt = _this66.time(+new Date(li.createAt));
- li.userTelephone = JSON.parse(li.content).userTelephone;
- 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);
- var resultArr = AboutDevice.filter(function (_item) {
- return _item.imei == li.imei;
- })[0];
- if (resultArr) {
- li.roomId = resultArr.id;
- li.roomName = resultArr.roomName;
- } else {
- li.roomId = "";
- li.roomName = "";
- }
- });
- _this66.roomtable2 = certiflist;
- _this66.total2 = res.data.total;
- });
- },
- getlistNum: function getlistNum(val, size) {
- var _this67 = this;
-
- var q = {
- // type: 0,
- name: this.query.name
- };
- var data = {
- pageNum: val,
- pageSize: size,
- orderBy: "create_time desc",
- q: stringify_default()(q)
- };
- var roomAbout = this.$store.state.roomAbout;
- Object(api["g" /* httpPost */])(data, this.$api.getlistNum).then(function (res1) {
- if (res1.success) {
- var para = [];
- res1.data.list.map(function (li, index) {
- var userTelephone = JSON.parse(li.info) ? JSON.parse(li.info).userTelephone : '';
- var str = {
- imei: li.imei,
- userTelephone: userTelephone,
- password: "",
- operateMode: 1
- };
- para.push(str);
- li.status = 3;
- li['rommNameText'] = _this67.screenRoomName(li.id);
- });
- // this.getallstatus(para);
- _this67.userlist = res1.data.list;
- _this67.total = res1.data.total;
- _this67.currentPage4 = val;
- _this67.pageSize = size;
- } else {
- _this67.$message.error(res1.message);
- }
- });
- },
- handleChange: function handleChange(value) {
- console.log(value);
- },
-
- //批量上传
- batchUpload: function batchUpload() {
- this.uploadkj = true;
- },
- batchUploadpl: function batchUploadpl() {
- var data = [];
- this.userlist.map(function (li) {
- data.push(li.id);
- });
- console.log(data);
- var ids = {
- ids: data
- };
- Object(api["g" /* httpPost */])(ids, this.$api.createkeyCard).then(function (res) {});
- },
- checkSameData: function checkSameData(arr, str) {
- var _arr = [],
- _t = [],
-
- // 临时的变量
- _tmp;
-
- // 按照特定的参数将数组排序将具有相同值得排在一起
- arr = arr.sort(function (a, b) {
- var s = a[str],
- t = b[str];
-
- return s < t ? -1 : 1;
- });
-
- if (arr.length) {
- _tmp = arr[0][str];
- }
- // console.log( arr );
- // 将相同类别的对象添加到统一个数组
- for (var i in arr) {
- if (arr[i][str] === _tmp) {
- _t.push(arr[i]);
- } else {
- _tmp = arr[i][str];
- _arr.push(_t);
- _t = [arr[i]];
- }
- }
- // 将最后的内容推出新数组
- _arr.push(_t);
- return _arr;
- },
-
- //批量上传确认
- batchUploadfun: function batchUploadfun() {
- var _this68 = this;
-
- var that = this;
- var array = this.checkSameData(this.userlist1, "phone");
- var arrlist = [];
- this.batchCredentialList = [];
- array.map(function (li) {
- arrlist.push(li[0]);
- });
- if (this.value3) {
- var data = {
- list: arrlist
- };
- Object(api["g" /* httpPost */])(data, this.$api.infoImport).then(function (res) {
- if (res.success) {
- arrlist.map(function (li, index) {
- _this68.getperson(li, function (data) {
- li.id = data.id;
- array[index].map(function (lt) {
- lt['personId'] = data.id;
- });
- var screeningList = allFun["a" /* default */].deWeight(array[index], 'type', 'modeContent');
- var passwordSum = 0,
- nfcSum = 0;
- screeningList.map(function (li) {
- var operateMode = '',
- order = '',
- pzname = '',
- type = '';
- if (li.mode == 4) {
- operateMode = 7;
- order = 6207;
- type = 14;
- var num = allFun["a" /* default */].getCertificatesNum(data.id, 14, 1, '') || 0;
- pzname = '密码' + (num + passwordSum);
- passwordSum++;
- } else if (li.mode == 3) {
- operateMode = 10;
- order = 6210;
- type = 13;
- var num = allFun["a" /* default */].getCertificatesNum(data.id, 13, 1, '') || 0;
- pzname = 'NFC' + (num + nfcSum);
- nfcSum++;
- }
- var str = {
- userTelephone: JSON.parse(li.info).userTelephone,
- userPassword: JSON.parse(li.info).userPassword,
- password: li.modeContent,
- operateMode: operateMode,
- order: order,
- passwordStartTime: moment_default()(that.value3[0].getTime()).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(that.value3[1].getTime()).format('YYYYMMDDHHmmss'),
- cardName: data.name,
- pzname: pzname,
- pass: false
- };
- var datafidOne = {
- cardId: data.id,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: type,
- startTime: that.value3[0].getTime() / 1000,
- endTime: that.value3[1].getTime() / 1000
- };
- that.batchCredentialList.push(datafidOne);
- Object(api["g" /* httpPost */])(datafidOne, that.$api.addCertificates).then(function (res) {
- if (res.success) {
-
- that.$message.success("添加成功");
- } else {
- that.$message.error("添加失败");
- }
- });
- });
- setTimeout(function () {
- that.bindsaveFun(array[index]);
- }, 500);
- });
- });
- _this68.getlist();
- _this68.uploadkj = false;
- } else {
- _this68.$message.error('导入失败');
- }
- });
- } else {
- this.$message.error("请选择开始结束时间");
- }
- },
-
- //查询人员
- getperson: function getperson(li, callback) {
- var data = {
- orderBy: "create_time desc",
- q: stringify_default()({
- cardId: li.cardId
- })
- };
- var roomAbout = this.$store.state.roomAbout;
- Object(api["g" /* httpPost */])(data, this.$api.getlistNum).then(function (res) {
- callback(res.data.list[0]);
- });
- },
-
- // 绑定房间
- bindsaveFun: function bindsaveFun(list) {
- var _this69 = this;
-
- var array = this.checkSameData(list, "siteId");
- array.map(function (drawerRow, index) {
- _this69.sendUserlock(drawerRow[0]);
- setTimeout(_this69.sendUservoucher(drawerRow), 1000);
- });
- },
- getCertificatesName: function getCertificatesName(id, type, content, callback) {
- this.batchCredentialList.map(function (li) {
- var info = JSON.parse(li.content);
- if (li.cardId == id && li.type == type && info.password == content) {
- var pzname = info.pzname;
- callback(pzname);
- }
- });
- },
- sendUservoucher: function sendUservoucher(voucherlist) {
- var _this70 = this;
-
- voucherlist.map(function (drawerRow) {
- setTimeout(function () {
- var credentialName = '';
- if (drawerRow.mode == 2) {
- _this70.getCertificatesName(drawerRow.personId, 12, drawerRow.modeContent, function (callback) {
- credentialName = callback;
- console.log(credentialName);
- _this70.sendVoucherMethods(drawerRow, credentialName);
- });
- } else if (drawerRow.mode == 3) {
- _this70.getCertificatesName(drawerRow.personId, 13, drawerRow.modeContent, function (callback) {
- credentialName = callback;
- console.log(credentialName);
- _this70.sendVoucherMethods(drawerRow, credentialName);
- });
- } else if (drawerRow.mode == 4) {
- _this70.getCertificatesName(drawerRow.personId, 14, drawerRow.modeContent, function (callback) {
- credentialName = callback;
- _this70.sendVoucherMethods(drawerRow, credentialName);
- });
- }
- }, 1000);
- });
- },
- sendVoucherMethods: function sendVoucherMethods(drawerRow, credentialName) {
- var _this71 = this;
-
- var info = JSON.parse(drawerRow.info);
- var data = [{
- cardId: drawerRow.personId,
- siteId: drawerRow.siteId,
- startTime: this.value3[0],
- endTime: this.value3[1]
- }];
- var setid = {
- pageNum: 1,
- pageSize: 10,
- q: stringify_default()({
- roomIds: [drawerRow.siteId],
- lockType: 1
- })
- };
- Object(api["g" /* httpPost */])(setid, this.$api.getDeviceItems).then(function (res) {
- var timeMantissa = moment_default()().format('xx');
- var mantissa = timeMantissa.substr(timeMantissa.length - 4, timeMantissa.length - 1);
- if (res.data.list.length > 0) {
- var IMEI = res.data.list[0].imei;
- var DeviceNumRow = res.data.list[0];
- if (DeviceNumRow.manufactureId == 201 || DeviceNumRow.manufactureId == 221) {
- var startTime = _this71.value3[0].getTime() / 1000;
- var endTime = _this71.value3[1].getTime() / 1000;
- if (drawerRow.mode == 4) {
- var pwd = drawerRow.modeContent;
- var userid = info.userPassword;
- var str = {
- username: drawerRow.name,
- pzname: credentialName,
- imei: IMEI,
- userTelephone: info.userTelephone,
- userPassword: info.userPassword,
- operateMode: 7,
- order: 6207,
- password: stringify_default()(pwd),
- passwordStartTime: startTime,
- passwordEndTime: endTime,
- is: false
- };
- if (stringify_default()(pwd).length != 6) {
- _this71.$message.error("密码格式错误");
- return;
- }
- var cardName = drawerRow.name + '-' + credentialName;
- equipment["a" /* default */].addForeverPassword(DeviceNumRow.deviceNum, IMEI, userid, 1, pwd, 255, startTime, endTime, 6207, cardName, DeviceNumRow.roomName, function (callback1) {
- if (callback1.success) {
- var data = {
- deviceNum: DeviceNumRow.deviceNum,
- imei: IMEI,
- cardId: drawerRow.personId,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: drawerRow.mode,
- serial: callback1.data.serialNumber,
- startTime: _this71.value3[0].getTime() / 1000,
- endTime: _this71.value3[1].getTime() / 1000
- };
- Object(api["g" /* httpPost */])(data, _this71.$api.addCertificates).then(function (res) {});
- _this71.$message.success("下发成功");
- } else {
- _this71.$message.error(callback1.msg);
- }
- });
- } else if (drawerRow.mode == 3) {
- var userid = info.userPassword;
- var cardNo = util["a" /* default */].cardFormatConversion(drawerRow.modeContent.toUpperCase());
- if (cardNo.length == 8) {
- cardNo = cardNo + '00000000';
- } else if (cardNo.length != 16) {
- cardNo = cardNo.padEnd(16, '0');
- }
- var str = {
- username: drawerRow.name,
- pzname: credentialName,
- imei: IMEI,
- userTelephone: info.userTelephone,
- userPassword: info.userPassword,
- operateMode: 10,
- order: 6210,
- password: cardNo,
- passwordStartTime: startTime,
- passwordEndTime: endTime,
- is: false
- };
- if (cardNo.length != 8) {
- _this71.$message.error("NFC格式错误");
- return;
- }
- var cardName = drawerRow.name + '-' + credentialName;
- equipment["a" /* default */].RfCardRegister(DeviceNumRow.deviceNum, IMEI, userid, 1, 1, cardNo, 50, startTime, endTime, 6210, cardName, DeviceNumRow.roomName, function (callback1) {
- if (callback1.success) {
- var data = {
- deviceNum: DeviceNumRow.deviceNum,
- imei: IMEI,
- cardId: drawerRow.personId,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: drawerRow.mode,
- serial: callback1.data.serialNumber,
- startTime: _this71.value3[0].getTime() / 1000,
- endTime: _this71.value3[1].getTime() / 1000
- };
- Object(api["g" /* httpPost */])(data, _this71.$api.addCertificates).then(function (res) {});
- _this71.$message.success("下发成功");
- } else {
- _this71.$message.error(callback1.msg);
- }
- });
- } else if (drawerRow.mode == 2) {
- var userid = info.userPassword;
- var cardNo = Object(utils["k" /* reverse */])(drawerRow.modeContent).toUpperCase();
- var str = {
- username: drawerRow.name,
- pzname: credentialName,
- imei: DeviceNumRow.imei,
- userTelephone: info.userTelephone,
- userPassword: info.userPassword,
- operateMode: 13,
- order: 6213,
- password: cardNo,
- passwordStartTime: startTime,
- passwordEndTime: endTime,
- is: false
- };
- if (cardNo.length != 16) {
- _this71.$message.error("身份证格式错误");
- return;
- }
- var cardName = drawerRow.name + '-' + credentialName;
- equipment["a" /* default */].RfCardRegister(DeviceNumRow.deviceNum, IMEI, userid, 1, 1, cardNo, 36, startTime, endTime, 6213, cardName, DeviceNumRow.roomName, function (callback1) {
- if (callback1.success) {
- var data = {
- deviceNum: DeviceNumRow.deviceNum,
- imei: IMEI,
- cardId: drawerRow.personId,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: drawerRow.mode,
- serial: callback1.data.serialNumber,
- startTime: _this71.value3[0].getTime() / 1000,
- endTime: _this71.value3[1].getTime() / 1000
- };
- Object(api["g" /* httpPost */])(data, _this71.$api.addCertificates).then(function (res) {});
- _this71.$message.success("下发成功");
- } else {
- _this71.$message.error(callback1.msg);
- }
- });
- } else {
- _this71.$message.error("批量不支持指纹");
- }
- } else if (DeviceNumRow.manufactureId == 101) {
- var passwordStartTime = moment_default()(_this71.value3[0].getTime()).format('YYYYMMDDHHmmss');
- var passwordEndTime = moment_default()(_this71.value3[1].getTime()).format('YYYYMMDDHHmmss');
- var str = {};
- if (drawerRow.mode == 2) {
- var arr2 = drawerRow.modeContent;
- str = {
- username: drawerRow.name,
- imei: IMEI,
- pzname: credentialName,
- userTelephone: info.userTelephone,
- userPassword: info.userPassword,
- operateMode: 13,
- order: 6213,
- password: arr2.toUpperCase(),
- passwordStartTime: moment_default()(_this71.value3[0].getTime()).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(_this71.value3[1].getTime()).format('YYYYMMDDHHmmss'),
- is: false
- };
- if (arr2.length != 16) {
- _this71.$message.error("身份证格式错误");
- return false;
- }
- } else if (drawerRow.mode == 3) {
- var array3 = drawerRow.modeContent;
- str = {
- username: drawerRow.name,
- imei: IMEI,
- pzname: credentialName,
- operateMode: 10,
- order: 6210,
- userTelephone: info.userTelephone,
- userPassword: info.userPassword,
- password: array3.toUpperCase(),
- passwordStartTime: moment_default()(_this71.value3[0].getTime()).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(_this71.value3[1].getTime()).format('YYYYMMDDHHmmss'),
- is: false
- };
- if (array3.length != 8) {
- _this71.$message.error("NFC格式错误");
- return false;
- }
- } else if (drawerRow.mode == 4) {
- var password = stringify_default()(drawerRow.modeContent);
- str = {
- username: drawerRow.name,
- imei: IMEI,
- password: password,
- pzname: credentialName,
- userTelephone: info.userTelephone,
- userPassword: info.userPassword,
- operateMode: 7,
- order: 6207,
- passwordStartTime: moment_default()(_this71.value3[0].getTime()).format('YYYYMMDDHHmmss'),
- passwordEndTime: moment_default()(_this71.value3[1].getTime()).format('YYYYMMDDHHmmss'),
- is: false
- };
- if (password.length != 6) {
- _this71.$message.error("密码格式错误");
- return false;
- }
- }
- str['cardName'] = drawerRow.name + '-' + str.pzname, str['roomName'] = DeviceNumRow.roomName, Object(api["g" /* httpPost */])(str, _this71.$api.getDeviceOperateUserInfo).then(function (res1) {
- if (res1.success) {
- var data = {
- deviceNum: DeviceNumRow.deviceNum,
- imei: IMEI,
- cardId: drawerRow.personId,
- content: stringify_default()(str), //operateMode:NFC-10、把人员添加到凭证-1
- type: drawerRow.mode,
- serial: res1.data.serialNumber,
- startTime: _this71.value3[0].getTime() / 1000,
- endTime: _this71.value3[1].getTime() / 1000
- };
- Object(api["g" /* httpPost */])(data, _this71.$api.addCertificates).then(function (res) {});
- } else {
- _this71.$message.error(res1.msg);
- }
- });
- }
- } else {
- _this71.$message.error(drawerRow.siteName + "该房间未找到对应门锁");
- }
- });
- },
- sendUserlock: function sendUserlock(drawerRow) {
- var _this72 = this;
-
- var info = JSON.parse(drawerRow.info);
- var data = [{
- cardId: drawerRow.personId,
- siteId: drawerRow.siteId,
- startTime: this.value3[0],
- endTime: this.value3[1]
- }];
- var setid = {
- pageNum: 1,
- pageSize: 10,
- q: stringify_default()({
- roomIds: [drawerRow.siteId],
- lockType: 1
- })
- };
- Object(api["g" /* httpPost */])(setid, this.$api.getDeviceItems).then(function (res) {
- if (res.data.list.length > 0) {
- var timeMantissa = moment_default()().format('xx');
- var mantissa = timeMantissa.substr(timeMantissa.length - 4, timeMantissa.length - 1);
- var IMEI = res.data.list[0].imei;
- var DeviceNumRow = res.data.list[0];
- if (DeviceNumRow.manufactureId == 201 || DeviceNumRow.manufactureId == 221) {
- equipment["a" /* default */].addUserToLock(DeviceNumRow.deviceNum, IMEI, info.userPassword, 0, 1, 6226, drawerRow.name, DeviceNumRow.roomName, function (callback) {
- if (callback.success) {
- var userstr = {
- lockerId: DeviceNumRow.deviceNum,
- imei: IMEI,
- lockerUserId: info.userPassword,
- keyId: info.userPassword,
- role: 0,
- action: 1,
- order: 6226,
- cardName: drawerRow.name,
- roomName: DeviceNumRow.roomName
- };
- var locakUserdata = {
- deviceNum: DeviceNumRow.deviceNum,
- imei: IMEI,
- cardId: drawerRow.personId,
- content: stringify_default()(userstr), //operateMode:NFC-10、把人员添加到凭证-1
- type: 26,
- serial: callback.data.serialNumber,
- startTime: _this72.value3[0].getTime() / 1000,
- endTime: _this72.value3[1].getTime() / 1000
- };
- util["a" /* default */].sendLockUser(locakUserdata, function (callbackLOCK) {});
- Object(api["g" /* httpPost */])(data, _this72.$api.bindCard).then(function (res1) {
- if (res1.success) {
- _this72.$message.success("绑定成功");
- _this72.getAboutRoom();
- } else {
- _this72.$message.error(res2.message);
- }
- });
- } else {
- _this72.$message.error(callback.msg);
- }
- });
- } else if (DeviceNumRow.manufactureId == 101) {
- var passwordStartTime = moment_default()(_this72.value3[0].getTime()).format('YYYYMMDDHHmmss');
- var passwordEndTime = moment_default()(_this72.value3[1].getTime()).format('YYYYMMDDHHmmss');
- var str1 = {
- imei: IMEI,
- deviceNum: DeviceNumRow.deviceNum,
- userTelephone: info.userTelephone,
- // cardId:this.personInfo.cardId,
- userPassword: info.userPassword,
- password: info.userPassword,
- operateMode: 26,
- order: 6226,
- passwordStartTime: passwordStartTime,
- passwordEndTime: passwordEndTime,
- is: false,
- cardName: drawerRow.name,
- roomName: DeviceNumRow.roomName
- };
- Object(api["g" /* httpPost */])(str1, _this72.$api.getDeviceOperateUserInfo).then(function (res2) {
- if (res2.success) {
- var userstr = {
- lockerId: DeviceNumRow.deviceNum,
- imei: IMEI,
- lockerUserId: info.userPassword,
- keyId: info.userPassword,
- role: 0,
- action: 1,
- order: 6226,
- cardName: drawerRow.name,
- roomName: DeviceNumRow.roomName
- };
- var locakUserdata = {
- deviceNum: DeviceNumRow.deviceNum,
- imei: IMEI,
- cardId: drawerRow.personId,
- content: stringify_default()(userstr), //operateMode:NFC-10、把人员添加到凭证-1
- type: 26,
- serial: res2.data.serialNumber,
- startTime: _this72.value3[0].getTime() / 1000,
- endTime: _this72.value3[1].getTime() / 1000
- };
- util["a" /* default */].sendLockUser(locakUserdata, function (callbackLOCK) {});
- Object(api["g" /* httpPost */])(data, _this72.$api.bindCard).then(function (res1) {
- if (res1.success) {
- _this72.$message.success("绑定成功");
- _this72.getAboutRoom();
- } else {
- _this72.$message.error(res2.message);
- }
- });
- } else {
- _this72.$message.error(res2.message);
- }
- });
- }
- } else {
- _this72.$message.error(drawerRow.siteName + "该房间未找到对应门锁");
- }
- });
- },
-
- // 多选操作
- handleSelectionChange: function handleSelectionChange(val) {
- this.multipleSelection = val;
- },
-
- // 新增房源,选择凭证
- handleSelectionChange2: function handleSelectionChange2(val) {
- this.multipleSelection2 = val;
- },
- handleSelectionChange3: function handleSelectionChange3(val) {
- this.multipleSelection3 = val;
- },
- handleSelectionChange4: function handleSelectionChange4(val) {
- this.multipleSelection4 = val;
- },
- handleSelectionChange1: function handleSelectionChange1(val) {
- this.multipleSelection1 = val;
- },
- delAllSelection: function delAllSelection() {
- var length = this.multipleSelection.length;
- var str = "";
- this.delList = this.delList.concat(this.multipleSelection);
- for (var _i = 0; _i < length; _i++) {
- str += this.multipleSelection[_i].name + " ";
- }
- this.$message.error("\u5220\u9664\u4E86" + str);
- this.multipleSelection = [];
- },
-
- // 编辑操作
- handleEdit: function handleEdit(index, row) {
- var _this73 = this;
-
- this.modify = false;
- this.idx = index;
- this.form = row;
- this.editVisiblelist = true;
- var data = [{
- itemId: row.id
- }];
- Object(api["g" /* httpPost */])(data, this.$api.getPersonBindEnterprise).then(function (res) {
- if (res.code == 200) {
- var list = [];
- res.data.map(function (li) {
- list.push(li.enterpriseId);
- });
- _this73.defaultEnterpriseId = list;
- _this73.defaultEnterpriseIdBack = res.data;
- }
- });
- },
-
- // 子组件触发修改
- handleEdit1: function handleEdit1(row) {
- this.modify = false;
- this.form = row;
- this.editVisiblelist = true;
- },
-
- // 重置from
- resetFrom: function resetFrom() {
- this.form = {
- sex: 1,
- number: "",
- name: "",
- phone: "",
- cardId: "",
- cardState: 1
- };
- },
- modifyEdit: function modifyEdit() {
- var _this74 = this;
-
- var data = {
- id: this.form.id,
- cardId: this.form.cardId,
- cardState: this.form.cardState,
- name: this.form.name,
- number: this.form.number,
- phone: this.form.phone,
- sex: parseInt(this.form.sex),
- enterpriseId: this.form.enterpriseId,
- type: this.form.type
- };
- if (this.form.key) {
- var rowInfo = JSON.parse(this.form.info);
- var rqTime = moment_default()().format("X");
- rowInfo.loginKey = Object(api["j" /* setCode */])("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXKHkNKieiGOTjXZJ0lFBjhRCa\nZTaAebTIfB9nnnVmNVIp//yCfyFXSlxbAj58CQwCVhwy109ROYf3BcsQNMZz7Djo\n8a5V0JThNye4ihxLiYLawLRjb2y2/IhzV0/JZiFtaM83xUt0tbqTKxD00Up7dy8c\n9OXc0h//0uQSraf6JwIDAQAB", this.form.key);
- data.info = stringify_default()(rowInfo);
- }
- Object(api["g" /* httpPost */])(data, this.$api.updateCard).then(function (res) {
- if (_this74.defaultEnterpriseIdBack.length > 0) {
- var arr = [];
- _this74.defaultEnterpriseIdBack.map(function (li) {
- var obj = {
- itemId: li.cardId,
- orderId: li.enterpriseId
- };
- arr.push(obj);
- });
- Object(api["g" /* httpPost */])(arr, _this74.$api.personUnBindEnterprise).then(function (res) {
- if (res.code == 200) {
- var dataprise = [];
- _this74.checkEnterpriseNode.map(function (li) {
- var obj = {
- itemId: _this74.form.id,
- orderId: li.value
- };
- dataprise.push(obj);
- });
- Object(api["g" /* httpPost */])(dataprise, _this74.$api.personBindEnterprise).then(function (res) {});
- }
- });
- } else {
- if (_this74.checkEnterpriseNode.length > 0) {
- var dataprise = [];
- _this74.checkEnterpriseNode.map(function (li) {
- var obj = {
- itemId: _this74.form.id,
- orderId: li.value
- };
- dataprise.push(obj);
- });
- Object(api["g" /* httpPost */])(dataprise, _this74.$api.personBindEnterprise).then(function (res) {});
- }
- }
- _this74.editVisiblelist = false;
- _this74.getlist();
- _this74.$store.commit("increment", 1);
- });
- },
-
- // 分页导航
- handlePageChange: function handlePageChange(val) {
- this.$set(this.query, "pageIndex", val);
- this.getData();
- },
- btnClick: function btnClick() {
- document.querySelector(".input-file").click();
- },
- exportData: function exportData(event) {
- if (!event.currentTarget.files.length) {
- return;
- }
- var that = this;
- // 拿取文件对象
- var f = event.currentTarget.files[0];
- // 用FileReader来读取
- var reader = new FileReader();
- // 重写FileReader上的readAsBinaryString方法
- FileReader.prototype.readAsBinaryString = function (f) {
- var binary = "";
- var wb; // 读取完成的数据
- var outdata; // 你需要的数据
- var reader = new FileReader();
- reader.onload = function (e) {
- // 读取成Uint8Array,再转换为Unicode编码(Unicode占两个字节)
- var bytes = new Uint8Array(reader.result);
- var length = bytes.byteLength;
- for (var i = 0; i < length; i++) {
- binary += String.fromCharCode(bytes[i]);
- }
- // 接下来就是xlsx了,具体可看api
- wb = xlsx_default.a.read(binary, {
- type: "binary"
- });
- outdata = xlsx_default.a.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
- // 自定义方法向父组件传递数据
- console.log(outdata);
- var userInfo = localStorage.getItem('info');
- var arr = [];
- outdata.map(function (li, index) {
- var obj = {};
- obj.name = li["人员名称"];
- obj.siteId = li["房间ID"];
- obj.siteName = li["房间名称"];
- obj.number = li["学工号"];
- obj.cardId = li["卡号"];
- obj.phone = li["电话(为11位手机号码)"];
- obj.sex = li["性别(1为男,2为女)"];
- obj.mode = li["开锁方式(3为NFC,4为密码)"];
- obj.modeContent = li["内容(NFC为8位16进制物理卡号、密码为6位数字密码)"];
- obj.id = li["id"];
- obj.cardState = '1';
- obj.enterpriseId = JSON.parse(userInfo).enterpriseId;
- obj.type = 0;
- var phone = stringify_default()(obj.phone);
- obj.phone = phone;
- obj.siteId = stringify_default()(obj.siteId);
- var str = {
- userPassword: phone.substr(phone.length - 6, phone.length - 1),
- userTelephone: phone
- };
- obj.info = stringify_default()(str);
- if (obj.sex == "男") {
- obj.sex = 1;
- } else if (obj.sex == "女") {
- obj.sex = 2;
- }
- if (obj.mode == "密码") {
- obj.mode = 4;
- } else if (obj.mode == "NFC") {
- obj.mode = 3;
- } else if (obj.mode == "身份证") {
- obj.mode = 2;
- }
- if (obj.cardState == "正常") {
- obj.cardState = 1;
- } else if (obj.cardState == "挂失") {
- obj.cardState = 2;
- } else if (obj.cardState == "挂失冻结") {
- obj.cardState = 3;
- } else if (obj.cardState == "冻结") {
- obj.cardState = 4;
- } else if (obj.cardState == "预开户") {
- obj.cardState = 5;
- } else if (obj.cardState == "过期") {
- obj.cardState = 6;
- }
- arr.push(obj);
- });
- console.log(arr);
- that.userlist1statu = false;
- that.$nextTick(function () {
- that.userlist1 = arr;
- that.userlist1statu = true;
- });
- };
- reader.readAsArrayBuffer(f);
- };
- reader.readAsBinaryString(f);
- }
- }
- });
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-028b07c1","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/userManagement.vue
- var userManagement_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('zw',{ref:"myChild"}),_vm._v(" "),_c('getFinger',{ref:"myGetFinger"}),_vm._v(" "),(!_vm.drawer)?_c('div',[_c('el-row',{staticClass:"mb-2",attrs:{"gutter":20}},[_c('el-col',{attrs:{"span":24}},[_c('el-card',{attrs:{"shadow":"never"}},[_c('div',{staticClass:"d-flex flex-wrap align-center justify-space-around font-style"},[_c('div',{staticClass:"flexLi my-3 d-flex flex-nowrap align-center d-inlie-block text-center hand-type"},[_c('div',{staticClass:"mr-2"},[_c('i',{staticClass:"iconfont httpicon-zhanghao font-size-40 color-03A9F4"})]),_vm._v(" "),_c('div',[_c('div',{staticClass:"color-00000073 font-size-16 font-weight-700 color-03A9F4"},[_vm._v("总住户")]),_vm._v(" "),_c('div',{staticClass:"font-size-24 mt-2"},[_c('NumberGrow',{staticClass:"color-03A9F4",attrs:{"value":_vm.total}}),_c('span',{staticClass:"font-size-16 color-00000073 ml-1"},[_vm._v("人")])],1)])]),_vm._v(" "),_c('div',{staticClass:"flexLi my-3 d-flex flex-nowrap align-center d-inlie-block text-center hand-type"},[_c('div',{staticClass:"mr-2"},[_c('i',{staticClass:"iconfont httpicon-tubiaozhizuomoban-101 font-size-40 color-03A9F4"})]),_vm._v(" "),_c('div',[_c('div',{staticClass:"color-00000073 font-size-16 font-weight-700 color-03A9F4"},[_vm._v("已入住")]),_vm._v(" "),_c('div',{staticClass:"font-size-24 mt-2"},[_c('NumberGrow',{staticClass:"color-03A9F4",attrs:{"value":0}}),_c('span',{staticClass:"font-size-16 color-00000073 ml-1"},[_vm._v("人")])],1)])]),_vm._v(" "),_c('div',{staticClass:"flexLi my-3 d-flex flex-nowrap align-center d-inlie-block text-center hand-type"},[_c('div',{staticClass:"mr-2"},[_c('i',{staticClass:"iconfont httpicon-chazhaofangyuan font-size-40 color-03A9F4"})]),_vm._v(" "),_c('div',[_c('div',{staticClass:"color-00000073 font-size-16 font-weight-700 color-03A9F4"},[_vm._v("未入住")]),_vm._v(" "),_c('div',{staticClass:"font-size-24 mt-2"},[_c('NumberGrow',{staticClass:"color-03A9F4",attrs:{"value":0}}),_c('span',{staticClass:"font-size-16 color-00000073 ml-1"},[_vm._v("人")])],1)])]),_vm._v(" "),_c('div',{staticClass:"flexLi my-3 d-flex flex-nowrap align-center d-inlie-block text-center hand-type"},[_c('div',{staticClass:"mr-2"},[_c('i',{staticClass:"iconfont httpicon-shebei font-size-40 color-03A9F4"})]),_vm._v(" "),_c('div',[_c('div',{staticClass:"color-00000073 font-size-16 font-weight-700 color-03A9F4"},[_vm._v("已签约人数")]),_vm._v(" "),_c('div',{staticClass:"font-size-24 mt-2"},[_c('NumberGrow',{staticClass:"color-03A9F4",attrs:{"value":0}}),_c('span',{staticClass:"font-size-16 color-00000073 ml-1"},[_vm._v("人")])],1)])]),_vm._v(" "),_c('div',{staticClass:"flexLi my-3 d-flex flex-nowrap align-center d-inlie-block text-center hand-type"},[_c('div',{staticClass:"mr-2"},[_c('i',{staticClass:"iconfont httpicon-chaxun font-size-40 color-03A9F4"})]),_vm._v(" "),_c('div',[_c('div',{staticClass:"color-00000073 font-size-16 font-weight-700 color-03A9F4"},[_vm._v("待签约人数")]),_vm._v(" "),_c('div',{staticClass:"font-size-24 mt-2"},[_c('NumberGrow',{staticClass:"color-03A9F4",attrs:{"value":0}}),_c('span',{staticClass:"font-size-16 color-00000073 ml-1"},[_vm._v("人")])],1)])]),_vm._v(" "),_c('div',{staticClass:"flexLi my-3 d-flex flex-nowrap align-center d-inlie-block text-center hand-type"},[_c('div',{staticClass:"mr-2"},[_c('i',{staticClass:"iconfont httpicon-renyuanguanli font-size-40 color-F56C6C"})]),_vm._v(" "),_c('div',[_c('div',{staticClass:"color-00000073 font-size-16 font-weight-700 color-F56C6C"},[_vm._v("已欠费人数")]),_vm._v(" "),_c('div',{staticClass:"font-size-24 mt-2"},[_c('NumberGrow',{staticClass:"color-F56C6C",attrs:{"value":0}}),_c('span',{staticClass:"font-size-16 color-00000073 ml-1"},[_vm._v("人")])],1)])]),_vm._v(" "),_c('div',{staticClass:"flexLi my-3 d-flex flex-nowrap align-center d-inlie-block text-center hand-type"},[_c('div',{staticClass:"mr-2"},[_c('i',{staticClass:"iconfont httpicon-gongdanguanli font-size-40 color-ff9900"})]),_vm._v(" "),_c('div',[
- 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(" "),(_vm.documentType == 11)?_c('el-form-item',{attrs:{"label":"指纹"}},[_c('el-radio-group',{attrs:{"size":"small"},model:{value:(_vm.voucher.fingerprintAlias),callback:function ($$v) {_vm.$set(_vm.voucher, "fingerprintAlias", $$v)},expression:"voucher.fingerprintAlias"}},[_c('el-radio-button',{attrs:{"label":"左手大拇指"}}),_vm._v(" "),_c('el-radio-button',{attrs:{"label":"左手食指"}}),_vm._v(" "),_c('el-radio-button',{attrs:{"label":"右手大拇指"}}),_vm._v(" "),_c('el-radio-button',{attrs:{"label":"右手食指"}})],1),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.addfir}},[_vm._v("GX1000-zh采集指纹")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.getFingerData}},[_vm._v("LWJ采集指纹")]),_vm._v(" "),_c('iframe',{staticStyle:{"width":"100%","height":"350px"},attrs:{"src":"static/equipment/mafp_serial/index.html","frameborder":"0","id":"iframeBox"}})],1):_vm._e(),_vm._v(" "),(_vm.documentType == 12)?_c('el-form-item',{attrs:{"label":"身份证","prop":"idcard"}},[_c('el-input',{staticClass:"widthRem5",attrs:{"placeholder":"请输入内容","size":"middle","clearable":true},on:{"change":function($event){return _vm.avoidRepetition($event,12)}},model:{value:(_vm.voucher.idcard),callback:function ($$v) {_vm.$set(_vm.voucher, "idcard", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:"voucher.idcard"}},[_c('el-button',{attrs:{"slot":"append"},nativeOn:{"click":function($event){return _vm.addNfc.apply(null, arguments)}},slot:"append"},[_vm._v("GX1000-zh采集卡")])],1)],1):_vm._e(),_vm._v(" "),(_vm.documentType == 13)?_c('el-form-item',{attrs:{"label":"NFC卡号","prop":"nfc"}},[_c('el-input',{staticClass:"widthRem5",attrs:{"placeholder":"请输入内容","size":"middle","clearable":true},on:{"change":function($event){return _vm.avoidRepetition($event,13)}},model:{value:(_vm.voucher.nfc),callback:function ($$v) {_vm.$set(_vm.voucher, "nfc", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:"voucher.nfc"}},[_c('el-button',{attrs:{"slot":"append"},nativeOn:{"click":function($event){return _vm.addNfc.apply(null, arguments)}},slot:"append"},[_vm._v("GX1000-zh采集卡")])],1),_vm._v(" "),_c('el-switch',{attrs:{"active-text":"是否是常开卡","active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:(_vm.regularCard),callback:function ($$v) {_vm.regularCard=$$v},expression:"regularCard"}})],1):_vm._e(),_vm._v(" "),(_vm.documentType == 14)?_c('el-form-item',{attrs:{"label":"密码","prop":"password"}},[_c('el-input',{staticClass:"widthRem5",attrs:{"type":"number","size":"middle","maxlength":"6","clearable":true,"show-password":""},on:{"change":function($event){return _vm.avoidRepetition($event,14)}},model:{value:(_vm.voucher.password),callback:function ($$v) {_vm.$set(_vm.voucher, "password", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:"voucher.password"}})],1):_vm._e(),_vm._v(" "),_c('el-form-item',{a
- var userManagement_staticRenderFns = []
- var userManagement_esExports = { render: userManagement_render, staticRenderFns: userManagement_staticRenderFns }
- /* harmony default export */ var views_userManagement = (userManagement_esExports);
- // CONCATENATED MODULE: ./src/views/userManagement.vue
- function userManagement_injectStyle (ssrContext) {
- __webpack_require__("7HYI")
- }
- var userManagement_normalizeComponent = __webpack_require__("VU/8")
- /* script */
-
-
- /* template */
-
- /* template functional */
- var userManagement___vue_template_functional__ = false
- /* styles */
- var userManagement___vue_styles__ = userManagement_injectStyle
- /* scopeId */
- var userManagement___vue_scopeId__ = "data-v-028b07c1"
- /* moduleIdentifier (server only) */
- var userManagement___vue_module_identifier__ = null
- var userManagement_Component = userManagement_normalizeComponent(
- userManagement,
- views_userManagement,
- userManagement___vue_template_functional__,
- userManagement___vue_styles__,
- userManagement___vue_scopeId__,
- userManagement___vue_module_identifier__
- )
-
- /* harmony default export */ var src_views_userManagement = __webpack_exports__["default"] = (userManagement_Component.exports);
-
-
- /***/ }),
-
- /***/ "J1Rt":
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
-
- /***/ "XbTi":
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
-
- /***/ "an/0":
- /***/ (function(module, exports) {
-
- module.exports = "data:image/png;base64,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
-
- /***/ }),
-
- /***/ "iPDe":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
-
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/usercontent.vue
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
-
- /* harmony default export */ var usercontent = ({
- props: ['userInfo'],
- methods: {
- modify: function modify() {
- this.$emit('func', this.userInfo);
- }
- }
- });
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-77e208de","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/components/usercontent.vue
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"usercontent"},[_c('div',{staticClass:"contentuser"},[_vm._m(0),_vm._v(" "),_c('div',{staticClass:"name"},[_vm._v(_vm._s(_vm.userInfo.name))]),_vm._v(" "),_c('div',{staticClass:"address"},[_vm._v(_vm._s(_vm.userInfo.address))]),_vm._v(" "),_c('div',{staticClass:"studentNumber"},[_vm._v("学号:"+_vm._s(_vm.userInfo.number))]),_vm._v(" "),_c('div',{staticClass:"cardNumber"},[_vm._v("卡号:"+_vm._s(_vm.userInfo.cardId))])]),_vm._v(" "),_c('div',{staticClass:"icon"},[_vm._m(1),_vm._v(" "),_c('div',[_c('i',{staticClass:"iconfont httpicon-bianji",on:{"click":_vm.modify}})]),_vm._v(" "),_vm._m(2),_vm._v(" "),_vm._m(3)])])}
- var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"img"},[_c('img',{attrs:{"src":__webpack_require__("Tp5f"),"alt":""}})])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('i',{staticClass:"iconfont httpicon-chaxun"})])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('i',{staticClass:"iconfont httpicon-shouye"})])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('i',{staticClass:"iconfont httpicon-pingzhengguanli"})])}]
- var esExports = { render: render, staticRenderFns: staticRenderFns }
- /* harmony default export */ var components_usercontent = (esExports);
- // CONCATENATED MODULE: ./src/components/usercontent.vue
- function injectStyle (ssrContext) {
- __webpack_require__("J1Rt")
- }
- 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-77e208de"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- usercontent,
- components_usercontent,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
-
- /* harmony default export */ var src_components_usercontent = __webpack_exports__["a"] = (Component.exports);
-
-
- /***/ }),
-
- /***/ "pmPM":
- /***/ (function(module, exports) {
-
- module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABeCAYAAADCISFWAAAMkklEQVR4Xu2dTW/juBmAX1ISJX8kztdsmjTFpNstUCSnAv0B8yey556ypxbYopf2MppDe2yB7mnnJ2z+wh76Hwoveth2doGpg2w+ndiWSIpk8dKyJ8nMZjyW5FiJBPhkSZTehy9Fvl8kcMdhQqAAoXvU6HlMOS41hBIekLuumff/jB8bwwOjzaleabkS/t1P4MuXCSFg5v3Zrz/fj0IwYUgB2u5R46nn9xPPYTWHAIIs/2GEbwyAToxJVlqXEi5bEp6Hqkzw3gnOGCDfvfit3wrWfa9LGWkSCpIR4olSa9u4y/UBDJMGhGe0MUns+/xJp8PJy5eyLN3yLRAIDT7bd0+WloKgrmvUYw4I72EAewcVQ4hWAOKy2422Wi1OwlCXAd7b4OwQCewCIPA84RPhOWV4kSzPqH0h4wsVr/3iIob9cnzv3gHumQvwjF0CBA4AI8Y8iO/aXWA1IYkMIt6Nj/g2bIsyaN0NcAaAwP6+e/TLRVaXXuD0CAPv4Q6TI5gILgEQSwAxtNuSHByoLBo8i2vvBEdF4hFTfxQaV2pw2FNMaNdtfq3f9B3os8cCDofK5bjGS6lxFbgK3CyG+dzaGE1OKo3LTaSzuVEFbjZyzr2VClzuIp3NDStws5Fz7q1U4HIX6WxuWIGbjZxzb6UCd5dI0Y2S95GT16ICdxsMk8ZIZkAIoxlTwLkxvj8GSDj/IHfR6Fp7ne8TdOwS6FOC9tQMECtwt8AZMtAaGomCi0SCSHjXV1s/T6y/67uzVbL9ARr4HQBsr5xa6K9fudRzHMrWHBcdvZQQN4sx/AY4gPJ5B/I2eaFAhDHxyuoZh7N/KYB/aghziO0IgcDOHoFvdj3rNwQIsrifxuDqgxjOvpAkhLl3pr7LkZqbkVkRIhYABgAQF+HjQoP4mTmt+2yhlsXhe0PjdtoSPj14A+72lzmVGIEcOuAHjDi3Ty0UHHqWI9GNnuwcR+TT/H1cZn/fO19errNFJ8gKDt06vNGTUf9Eba8sGByOt1otctTrkfX1odiOjgB089JswCaC1dDpGNjcVEV0yvcxLRScYVIlV1rESSLWm99L2AEF3+ze7MM77ckmKLev2+g4cLjpXUI3cKCVyVNvpFSKMamCyDpQSVwj1E580l8aJIUTLYwOwx+em8RXyn63f9VP4HBTQRiaWWlioeBASjubNIwrJSKljdIrZFWfDAaTwbrV7dbqdQv9pDYgjiHU7VKX+L5DPZEpoAkDhhAGMG5ASEIEI8DSqLbbs1U7U5bGQMNeY6CrVcBUEtfUE4AEOh01izjNYsGhlHH9ZsPhmAFP5LeWw3BBIQg0ALIsBcZ94/o6c5Klxej89N0M9LTyXSl4ILunp/KT1VVZ5BBaPLj3DdYP5X/URACtJVO4/FmCJQEbHVlU1FgFLu+OMwLYSwNtoS3g+YHMO0q6Apc3uPR++N3UcJXwmsPXojoHgCTPobMCVxA4a8yw8CCRxogVQmIIQ5nXrLMCVyA4e2spjWJcDhokWu83OYShygNeBa5ocKnmJX7MWzzAIRNtoUnWZitwWSU4yfXphCWhWrR4EEEYolsk09KoAjeJ4HM6R5N+EkFz8KTdjrKGuVfgcoIyyW3QBCguVbxc+2+UdYlQgZtE4jmdg/7JxHd4y+cxbL0WWQzvxYO7ZhrK6f3f3AbNXXhMYqLKvfEpbpjOMPnA4Wv1VxzCg6mXB8WCu2YGQmOshpYGuJjijd++hPgBoVw61POHuellgMekQZNYAhdiCZZigFBM67QtFByO6UpGchFaAi0HsNFRcLhpYKMzlXfgBj7u0+OzVS/g3Ke+72XxgOfSkya8CQ6XChqiDxBvZHAwFwoOHalN4UfQ6fC8XR02V/3FnncefVxjNV0rTTqYHS6ZXGj0Iug3o2nNYIWCexO6EMbTDgl3deS8QhcmVJZ8TsPhkpik6ckBPP0+nnaCUig4mxTvqHht6SJGD/G0vetdEhtqXOidB1GNxSXSuDKAs+F53JWS9SRW8fn2VaI/WV3NZDFAiN+enpLAdWnwE8/1I+U7wveyhOflo0oT3qUMQyV6v62bn7nKuvlFnBnaSDxYmoosACVYpqpEs0qUx9xPTm70wSJC0Mu0hsNnLctyYMLB4/GcVpoF+ONBMtGblsvkNdErPY6Txkbmj88H8NnLJItrp9DlwOPAMflbYqh7E0Pyd9qZI7srcJPLPduZTBolmbS5FM/DKGvUVwUuG47Jrk6XRbgMsOUV//b3uAI3meju96zxMgDEBUC8XYUu3C+PiVvHHIqmSSTVYhlz8H7/BZbazWSMqIbKiaWf4cQKXAbh3eelpQQ3SuD3xDCRP8uBaVDWzOUPC3uPCnzft/d7lJHUAI3viM9G+kDHhu/SgUvz4zR0k8QsJooca90b5rhNc6w3m8NrGz1y1ms4TsAdhwceFcLJ5B0Y2VGn6QBoRG9glg5XClSiTUvjc7masnGWbNnAYaanZIwvLXa53Zhh86UaJ+9Pg2/0RcZrXzxzYPHXXpf7gcsDP0vowjix0RqCMbkx1eg7epcdPTg32vcVZqeKE5WsN5u2/P0x/MBqrFWjnHn2FmUDh47UvicH6xk8vXdp5tADbuo+k5mS90epxKI2kGsU8zQATo4pdQihpFaz3YX4MRnuEGK0jiKjtNZyU+ktN9Hgcw1fn2s4ONCwt0ePnj4NGitevbTgMHRh0OtF683pYytmAW5UTDuCjtiA8wRgVwO0KcAuPYQOBdgE2uuRG4n7mHq80zZvctrD4aNu7Dsn/8E9G+o1aow71jhjEsEYx6wdEoYYPJXpKHQ5MCpD0T8SYquPQ+WmguehgReQMcrLConCYjefoZJJhXEgkvckJzzhw6oKsL3YJYeXfYLghkcHNhYbBi5bxhbMwWI53S7Z+tk1Bsqh3VOXuZQy4qV7NuBQWSZwo7FdXZpELutkLaorWOxO83W70TtRmC5sUg/AdRn3aC9bZSF8Tuuhx2HQ95VGbXrPgUOnHULRE8+Gpa1wzx4sV2U98yJxxpFn1ywn9nufMYrZtnv7+XKtgn5rmmwrG+R0oLBs2AJOu/NI4B8tW7DSgOfduXQZFw2QGIiMxyikup++XQPscmU0S70WwmGtJ0wIuxFThly5YsHlBOmh3MbOXrF0yKVJRBDIPkCyjYHCAPpDI+AqcLPuFem6z0hhNDSTxJwmK2RVwE5bfkiMZQVu1uCut5eu7xLhSyxHtd7/XgLsTpTkX4G7T3DY9jgxhitpmpjkP5H2VeDuG9yo/evWFdwq5j1DZwVuXsCl2qelUDJwhvv83AGvAjdP4PBZrn337LZoP1KxtgI3b+DGmseU3WHLVq19u6DbO8A9cw/hGWvYHRsfxzZk88jOhqujGY5qcfq/QfzJFzfDHd4G99WeA6+32NBdovzSJAzOpfQzPpQ1lQkVD2i09ptXg+vrvBvg0pwz3Mw23SO10riMos98OVpb0qpEEU5WsF40BhoRgxqGx9fLFHyfHq5yJ4iWPbdW8yiAm8VBmfmpqxsMM3xwyOxqsfzTN1XayQ9h2HSMoehut5ZtFgw3YihT3tkDB4zJIoa7qun7qHUR7B1ocvXXPz0ZQ0IBTBN38cAFNw+vh0OmBIiXoD2wZrH+X/68UcGaBzTveQYmTSIjvgitARbsJlfhHz8iHhuGk43cSvfxHiNX1vW28/Cz3ce7FNFmmjQSww8xlswn52G4hN5crNIDsADooERPbhFtT3rP4aZHWMaYZN7waNI25/68dGmA5jB1ZjR5FYaB2+0Sb9OhtN/MGAsy/es/afRsZznuNwlOllxCXAo9l3os054C0z/R/F05qtSE+xwQEwIdPmIIMOmuG0W+0ze75HW36zXWGfM0ZdQQt/oGDwVuy48wV2picC03X4fBOJh//I6dD+pBBe4mm1Flde17WNd5vg603rz+w+fBwkd+YMO4y1LDZAZiHFVVx6Cr+QMXhjh0B1eM16hIvMpWeq1HpPGZZmHuwZWnnOEMFG5s/iqBxlXgbnS
-
- /***/ })
-
- });
|