完成签约之后直接添加人员,录入下发凭证
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.

583 lines
20 KiB

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