完成签约之后直接添加人员,录入下发凭证
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

560 lines
20 KiB

  1. webpackJsonp([41],{
  2. /***/ "JF1I":
  3. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4. "use strict";
  5. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
  7. var stringify = __webpack_require__("mvHQ");
  8. var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
  9. // EXTERNAL MODULE: ./src/api/index.js + 5 modules
  10. var api = __webpack_require__("gyMJ");
  11. // EXTERNAL MODULE: ./src/utils/index.js
  12. var utils = __webpack_require__("0xDb");
  13. // EXTERNAL MODULE: ./node_modules/xlsx/xlsx.js
  14. var xlsx = __webpack_require__("uXZL");
  15. var xlsx_default = /*#__PURE__*/__webpack_require__.n(xlsx);
  16. // EXTERNAL MODULE: ./src/utils/util.js
  17. var util = __webpack_require__("oFuF");
  18. // EXTERNAL MODULE: ./node_modules/moment/moment.js
  19. var moment = __webpack_require__("PJh5");
  20. var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
  21. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/UnlockRecord.vue
  22. //
  23. //
  24. //
  25. //
  26. //
  27. //
  28. //
  29. //
  30. //
  31. //
  32. //
  33. //
  34. //
  35. //
  36. //
  37. //
  38. //
  39. //
  40. //
  41. //
  42. //
  43. //
  44. //
  45. //
  46. //
  47. //
  48. //
  49. //
  50. //
  51. //
  52. //
  53. //
  54. //
  55. //
  56. //
  57. //
  58. //
  59. //
  60. //
  61. //
  62. //
  63. //
  64. //
  65. //
  66. //
  67. //
  68. //
  69. //
  70. //
  71. //
  72. //
  73. //
  74. //
  75. //
  76. //
  77. //
  78. //
  79. //
  80. //
  81. //
  82. //
  83. //
  84. //
  85. //
  86. //
  87. //
  88. //
  89. //
  90. //
  91. //
  92. //
  93. //
  94. //
  95. //
  96. //
  97. //
  98. //
  99. //
  100. //
  101. //
  102. //
  103. /* harmony default export */ var UnlockRecord = ({
  104. inject: ['reload'],
  105. name: "UnlockRecord",
  106. data: function data() {
  107. return {
  108. pageSize: 20,
  109. pageNum: 1,
  110. defaultProps: {
  111. children: "children",
  112. label: "name"
  113. },
  114. config: {
  115. header: ["设备号", "开锁方式", "开锁时间"],
  116. data: [["", "", "", ""]],
  117. rowNum: 7, //表格行数
  118. headerHeight: 35,
  119. headerBGC: "#0f1325", //表头
  120. oddRowBGC: "#0f1325", //奇数行
  121. evenRowBGC: "#171c33", //偶数行
  122. index: false,
  123. columnWidth: [200, 200, 200, 200],
  124. align: ["center"]
  125. },
  126. query: {
  127. openType: "",
  128. operateName: "",
  129. operModul: "",
  130. datePicker: ['', ''],
  131. name: ''
  132. },
  133. query1: {
  134. openType: "",
  135. operateName: "",
  136. operModul: ""
  137. },
  138. activeName: "first",
  139. tableData: [],
  140. tableData1: [],
  141. multipleSelection: [],
  142. delList: [],
  143. editVisible: false,
  144. pageTotal: 0,
  145. pageTotal1: 0,
  146. form: {},
  147. idx: -1,
  148. id: -1,
  149. logList: [],
  150. options: [],
  151. selectRoomId: "",
  152. openRoom: false,
  153. selectkey: [],
  154. userInfo: {
  155. type: ''
  156. },
  157. checkNodeId: []
  158. };
  159. },
  160. beforeCreate: function beforeCreate() {
  161. // var tenantId = JSON.parse(localStorage.getItem('tenantId'))
  162. // if (tenantId == 400) {
  163. // this.$store.commit('defaultsettenantid')
  164. // }
  165. },
  166. created: function created() {
  167. var _this = this;
  168. if (this.$route.params.datePicker) {
  169. this.query.datePicker = this.$route.params.datePicker;
  170. }
  171. if (this.$route.params.type) {
  172. this.query.openType = JSON.parse(this.$route.params.type);
  173. }
  174. this.userInfo = JSON.parse(localStorage.getItem('info'));
  175. var data = {
  176. package: 1,
  177. q: stringify_default()({
  178. lockType: 1
  179. })
  180. };
  181. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  182. _this.$store.commit("deviceFun", res.data.list);
  183. });
  184. this.getalllist();
  185. // this.selectoption=JSON.parse(localStorage.getItem('selectoption'))
  186. // this.selectoptionValue=localStorage.getItem('tenantId')
  187. },
  188. mounted: function mounted() {
  189. // this.getlockAlert();
  190. document.addEventListener('keydown', this.keyDown);
  191. this.getcard();
  192. },
  193. methods: {
  194. keyDown: function keyDown(e) {
  195. //如果是回车则执行登录方法
  196. if (e.keyCode == 13) {
  197. if (this.$route.name == 'UnlockRecord') {
  198. if (!this.drawer) {
  199. this.handleSearch();
  200. }
  201. }
  202. }
  203. },
  204. // 选择房源
  205. checkNode: function checkNode(e) {
  206. console.log(e);
  207. // this.checkNodeId = e[e.length-1]
  208. if (e.length > 0) {
  209. var options = this.options;
  210. var arr = this.getId(options, e[e.length - 1]);
  211. var listarr = [arr[0]];
  212. var obj = this.getNodeId(listarr);
  213. this.checkNodeId = obj;
  214. } else {
  215. this.checkNodeId = [];
  216. }
  217. },
  218. getParentId: function getParentId(list, id) {
  219. for (var i in list) {
  220. if (list[i].id == id) {
  221. return [list[i]];
  222. }
  223. if (list[i].children) {
  224. var node = this.getParentId(list[i].children, id);
  225. if (node !== undefined) {
  226. return node.concat(list[i]);
  227. }
  228. }
  229. }
  230. },
  231. getId: function getId(list, id) {
  232. for (var i in list) {
  233. if (list[i].id == id) {
  234. return [list[i]];
  235. }
  236. if (list[i].children) {
  237. var node = this.getParentId(list[i].children, id);
  238. if (node !== undefined) {
  239. return node;
  240. }
  241. }
  242. }
  243. },
  244. getNodeId: function getNodeId(list) {
  245. var newNodeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  246. for (var i in list) {
  247. newNodeId.push(list[i].id);
  248. if (list[i].children) {
  249. this.getNodeId(list[i].children, newNodeId);
  250. }
  251. }
  252. return newNodeId;
  253. },
  254. resetAll: function resetAll() {
  255. this.query = {
  256. openType: "",
  257. operateName: "",
  258. operModul: "",
  259. datePicker: ['', ''],
  260. name: ""
  261. };
  262. this.checkNodeId = [];
  263. this.handleSearch();
  264. },
  265. exportFun: function exportFun() {
  266. var data = {
  267. orderBy: "open_time desc",
  268. q: this.searchParaProcess({
  269. roomIds: this.checkNodeId,
  270. openType: this.query.openType,
  271. startTime: moment_default()(this.query.datePicker[0]).format("X"),
  272. endTime: moment_default()(this.query.datePicker[1]).format("X"),
  273. name: this.query.name
  274. })
  275. };
  276. if (data.q == '{}') delete data.q;
  277. Object(api["b" /* downloadPost */])(data, this.$api.export).then(function (res) {
  278. var link = document.createElement("a");
  279. var blob = new Blob([res], {
  280. type: "application/vnd.ms-excel"
  281. });
  282. var objectUrl = URL.createObjectURL(blob);
  283. link.href = objectUrl;
  284. link.download = "开锁记录.xlsx";
  285. link.click();
  286. URL.revokeObjectURL(objectUrl);
  287. });
  288. },
  289. handleCheckChange: function handleCheckChange(data, checked, node) {
  290. if (checked) {
  291. this.selectRoomId = data.id;
  292. this.query.operateName = data.name;
  293. this.$refs.tree.setCheckedKeys([data.id]);
  294. } else {
  295. if (this.checkedId == data.id) {
  296. this.$refs.tree.setCheckedKeys([data.id]);
  297. }
  298. }
  299. },
  300. handleClose: function handleClose(done) {
  301. this.openRoom = false;
  302. },
  303. // 打开房间选择列表
  304. openRoomlist: function openRoomlist() {
  305. this.openRoom = true;
  306. },
  307. handleChange: function handleChange(value) {
  308. console.log(value);
  309. this.selectRoomId = value[value.length - 1];
  310. },
  311. //获取房源筛选列表
  312. getalllist: function getalllist() {
  313. var _this2 = this;
  314. var data = {};
  315. Object(api["d" /* httpGet */])(data, this.$api.getTree).then(function (res) {
  316. var list = res.data.sort(function (pre, cur) {
  317. return pre.id - cur.id;
  318. });
  319. var array = Object(utils["n" /* uniqueArray */])(list, "id");
  320. _this2.options = Object(utils["p" /* ztreeToElementTree */])(array, {});
  321. });
  322. },
  323. timestampToTime: function timestampToTime(cjsj) {
  324. if (cjsj.toString().length == 10) {
  325. cjsj = cjsj * 1000;
  326. }
  327. var date = new Date(cjsj); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  328. var Y = date.getFullYear() + "-";
  329. var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
  330. var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  331. var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  332. var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":";
  333. var s = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
  334. return Y + M + D + h + m + s;
  335. },
  336. getOpenType: function getOpenType(openType) {
  337. var str = "";
  338. switch (openType) {
  339. case 1:
  340. str = "指纹开锁";
  341. break;
  342. case 2:
  343. str = "数字键盘开锁";
  344. break;
  345. case 3:
  346. str = "NFC开锁";
  347. break;
  348. case 4:
  349. str = "机械钥匙开锁";
  350. break;
  351. case 5:
  352. str = "蓝牙开锁";
  353. break;
  354. case 6:
  355. str = "NB开锁";
  356. break;
  357. case 7:
  358. str = "身份证";
  359. break;
  360. case 8:
  361. str = "无线钥匙开锁";
  362. break;
  363. case 9:
  364. str = "人脸开锁";
  365. break;
  366. case 10:
  367. str = "离线卡开锁";
  368. break;
  369. default:
  370. str = "其它开锁";
  371. break;
  372. }
  373. return str;
  374. },
  375. getcard: function getcard() {
  376. var _this3 = this;
  377. var data1 = {
  378. pageNum: this.pageNum,
  379. pageSize: this.pageSize,
  380. orderBy: "open_time desc",
  381. q: this.searchParaProcess({
  382. roomIds: this.checkNodeId,
  383. openType: this.query.openType,
  384. startTime: moment_default()(this.query.datePicker[0]).format("X"),
  385. endTime: moment_default()(this.query.datePicker[1]).format("X"),
  386. name: this.query.name
  387. })
  388. };
  389. Object(api["g" /* httpPost */])(data1, this.$api.getOpenRecord).then(function (res) {
  390. var data = [];
  391. res.data.list.map(function (li, index) {
  392. var str = _this3.getOpenType(li.openType);
  393. var compli = _this3.comparison(li.deviceNum);
  394. var name = util["a" /* default */].findIndexArray(_this3.options, li.roomId, []);
  395. var path = '';
  396. if (name) {
  397. path = name.join('/');
  398. li.roomName = path;
  399. }
  400. li.roomId = li.roomId;
  401. li.openTime = _this3.timestampToTime(li.openTime);
  402. var str = [li.deviceNum, str, li.openTime];
  403. data.push(str);
  404. });
  405. _this3.devicestatus = false;
  406. _this3.pageTotal = res.data.total;
  407. _this3.$nextTick(function () {
  408. _this3.config.data = data;
  409. _this3.logList = res.data.list;
  410. _this3.devicestatus = true;
  411. });
  412. });
  413. },
  414. comparison: function comparison(deviceNum) {
  415. var deviceList = this.$store.state.deviceList;
  416. deviceList.some(function (item, index) {
  417. if (item.deviceNum == deviceNum) {
  418. return item;
  419. }
  420. });
  421. },
  422. //门锁报警同步刷新
  423. getlockAlert: function getlockAlert() {
  424. Object(api["d" /* httpGet */])("", this.$api.getOpenRecordList).then(function (res) {});
  425. },
  426. searchParaProcess: function searchParaProcess(obj) {
  427. var myObj = new Object();
  428. for (var key in obj) {
  429. if (obj[key] != "" && obj[key] != 'Invalid date' && obj[key] != []) {
  430. myObj[key] = obj[key];
  431. }
  432. }
  433. return stringify_default()(myObj);
  434. },
  435. // 触发搜索按钮
  436. handleSearch: function handleSearch() {
  437. var _this4 = this;
  438. this.pageNum = 1;
  439. this.openRoom = false;
  440. var data = {
  441. pageNum: 1,
  442. pageSize: this.pageSize,
  443. orderBy: "open_time desc",
  444. q: this.searchParaProcess({
  445. roomIds: this.checkNodeId,
  446. openType: this.query.openType,
  447. startTime: moment_default()(this.query.datePicker[0]).format("X"),
  448. endTime: moment_default()(this.query.datePicker[1]).format("X"),
  449. name: this.query.name
  450. })
  451. };
  452. Object(api["g" /* httpPost */])(data, this.$api.getOpenRecord).then(function (res) {
  453. var data = [];
  454. res.data.list.map(function (li, index) {
  455. var str = _this4.getOpenType(li.openType);
  456. var compli = _this4.comparison(li.deviceNum);
  457. var name = util["a" /* default */].findIndexArray(_this4.options, li.roomId, []);
  458. var path = '';
  459. if (name) {
  460. path = name.join('/');
  461. li.roomName = path;
  462. }
  463. li.roomId = li.roomId;
  464. li.openTime = _this4.timestampToTime(li.openTime);
  465. var str = [li.deviceNum, str, li.openTime];
  466. data.push(str);
  467. });
  468. _this4.devicestatus = false;
  469. _this4.pageTotal = res.data.total;
  470. _this4.$store.commit("increment", 1);
  471. _this4.$nextTick(function () {
  472. _this4.config.data = data;
  473. _this4.logList = res.data.list;
  474. _this4.devicestatus = true;
  475. });
  476. });
  477. },
  478. // 分页导航
  479. handlePageChange: function handlePageChange(val) {
  480. this.pageNum = val;
  481. this.getcard();
  482. },
  483. handleSizeChange: function handleSizeChange(val) {
  484. this.pageSize = val;
  485. this.getcard();
  486. }
  487. }
  488. });
  489. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-acb12472","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/UnlockRecord.vue
  490. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"container"},[_c('div',{staticClass:"handle-box"},[_c('selectoption'),_vm._v(" "),_c('el-cascader',{attrs:{"options":_vm.options,"size":"small","props":{ checkStrictly: true },"clearable":true},on:{"change":_vm.checkNode},model:{value:(_vm.query.operateName),callback:function ($$v) {_vm.$set(_vm.query, "operateName", $$v)},expression:"query.operateName"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10 wRem3",attrs:{"size":"small","placeholder":"姓名","clearable":true},model:{value:(_vm.query.name),callback:function ($$v) {_vm.$set(_vm.query, "name", $$v)},expression:"query.name"}}),_vm._v(" "),_c('el-date-picker',{staticClass:"wRem3",attrs:{"size":"small","type":"datetime","clearable":"","placeholder":"选择开始日期时间","default-time":"00:00:00"},model:{value:(_vm.query.datePicker[0]),callback:function ($$v) {_vm.$set(_vm.query.datePicker, 0, $$v)},expression:"query.datePicker[0]"}}),_vm._v(" "),_c('el-date-picker',{staticClass:"wRem3",attrs:{"size":"small","type":"datetime","clearable":"","placeholder":"选择结束日期时间","default-time":"00:00:00"},model:{value:(_vm.query.datePicker[1]),callback:function ($$v) {_vm.$set(_vm.query.datePicker, 1, $$v)},expression:"query.datePicker[1]"}}),_vm._v(" "),_c('el-select',{staticClass:"handle-select mr10",attrs:{"size":"small","placeholder":"开门方式","clearable":""},model:{value:(_vm.query.openType),callback:function ($$v) {_vm.$set(_vm.query, "openType", $$v)},expression:"query.openType"}},[_c('el-option',{key:"0",attrs:{"label":"全部","value":0}}),_vm._v(" "),_c('el-option',{key:"1",attrs:{"label":"指纹开锁","value":1}}),_vm._v(" "),_c('el-option',{key:"2",attrs:{"label":"数字键盘开锁","value":2}}),_vm._v(" "),_c('el-option',{key:"3",attrs:{"label":"NFC开锁","value":3}}),_vm._v(" "),_c('el-option',{key:"4",attrs:{"label":"机械钥匙开锁","value":4}}),_vm._v(" "),_c('el-option',{key:"6",attrs:{"label":"NB开锁","value":6}}),_vm._v(" "),_c('el-option',{key:"7",attrs:{"label":"身份证","value":7}}),_vm._v(" "),_c('el-option',{key:"8",attrs:{"label":"无线钥匙开锁","value":8}}),_vm._v(" "),_c('el-option',{key:"9",attrs:{"label":"人脸开锁","value":9}}),_vm._v(" "),_c('el-option',{key:"10",attrs:{"label":"离线卡开锁","value":10}}),_vm._v(" "),_c('el-option',{key:"11",attrs:{"label":"离线密码开锁","value":11}}),_vm._v(" "),_c('el-option',{key:"12",attrs:{"label":"门卡试错开锁","value":12}}),_vm._v(" "),_c('el-option',{key:"100",attrs:{"label":"其它开锁","value":100}})],1),_vm._v(" "),_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"size":"small","type":"primary","icon":"el-icon-search"},on:{"click":_vm.handleSearch}},[_vm._v("搜索")]),_vm._v(" "),_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"size":"small","type":"primary","icon":"el-icon-search"},on:{"click":_vm.resetAll}},[_vm._v("重置")]),_vm._v(" "),_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"size":"small","type":"primary","icon":"el-icon-download"},on:{"click":_vm.exportFun}},[_vm._v("导出")]),_vm._v(" "),(_vm.userInfo.type==0)?_c('el-button',{attrs:{"size":"small"},on:{"click":_vm.getlockAlert}},[_vm._v("同步更新")]):_vm._e()],1),_vm._v(" "),_c('el-table',{staticStyle:{"width":"100%"},attrs:{"data":_vm.logList,"stripe":"","height":"500"}},[_c('el-table-column',{attrs:{"prop":"deviceNum","label":"设备号","width":"250"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"name","label":"姓名","width":"180"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"userTelephone","label":"账号","width":"180"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"roomName","label":"房间号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"开锁方式"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.openType == 1)?_c('span',[_vm._v("指纹开锁")]):_vm._e(),_vm._v(" "),(scope.row.openType == 2)?_
  491. var staticRenderFns = []
  492. var esExports = { render: render, staticRenderFns: staticRenderFns }
  493. /* harmony default export */ var views_UnlockRecord = (esExports);
  494. // CONCATENATED MODULE: ./src/views/UnlockRecord.vue
  495. function injectStyle (ssrContext) {
  496. __webpack_require__("cuyk")
  497. }
  498. var normalizeComponent = __webpack_require__("VU/8")
  499. /* script */
  500. /* template */
  501. /* template functional */
  502. var __vue_template_functional__ = false
  503. /* styles */
  504. var __vue_styles__ = injectStyle
  505. /* scopeId */
  506. var __vue_scopeId__ = "data-v-acb12472"
  507. /* moduleIdentifier (server only) */
  508. var __vue_module_identifier__ = null
  509. var Component = normalizeComponent(
  510. UnlockRecord,
  511. views_UnlockRecord,
  512. __vue_template_functional__,
  513. __vue_styles__,
  514. __vue_scopeId__,
  515. __vue_module_identifier__
  516. )
  517. /* harmony default export */ var src_views_UnlockRecord = __webpack_exports__["default"] = (Component.exports);
  518. /***/ }),
  519. /***/ "cuyk":
  520. /***/ (function(module, exports) {
  521. // removed by extract-text-webpack-plugin
  522. /***/ })
  523. });