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

1107 lines
42 KiB

  1. webpackJsonp([34],{
  2. /***/ "EsnQ":
  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: ./src/utils/util.js
  14. var util = __webpack_require__("oFuF");
  15. // EXTERNAL MODULE: ./node_modules/moment/moment.js
  16. var moment = __webpack_require__("PJh5");
  17. var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
  18. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/VoucherList.vue
  19. //
  20. //
  21. //
  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. //
  104. //
  105. //
  106. //
  107. //
  108. //
  109. //
  110. //
  111. //
  112. //
  113. //
  114. //
  115. //
  116. //
  117. //
  118. //
  119. //
  120. //
  121. //
  122. //
  123. //
  124. //
  125. //
  126. //
  127. //
  128. /* harmony default export */ var VoucherList = ({
  129. inject: ['reload'],
  130. name: "VoucherList",
  131. data: function data() {
  132. return {
  133. userNameSearch: '',
  134. deviceNumSearch: '',
  135. selectVoucherStatus: '',
  136. voucherStatusList: [{ label: '下发中', value: '0' }, { label: '下发成功', value: '1' }, { label: '发送失败', value: '702' }, { label: '已作废', value: '703' }],
  137. selectoption: [],
  138. selectoptionValue: '',
  139. tableData: [],
  140. currentPage: 1,
  141. total: 0,
  142. form: {
  143. password: "",
  144. password1: ""
  145. },
  146. row: {},
  147. index: 0,
  148. startdate: "",
  149. documentType1: "",
  150. certificatestatus: false,
  151. enddate: "",
  152. editVisiblelist: false,
  153. certificatesContent: {
  154. pzname: ""
  155. },
  156. dialogImageUrl: "",
  157. modifyStatus: true,
  158. multipleSelection: [],
  159. modifyvalue2: [],
  160. dialogVisible: false,
  161. modifyrow: {},
  162. cardId: "",
  163. pageSize: 10,
  164. selectVcalue: '',
  165. options: [{
  166. value: '26',
  167. label: '锁用户'
  168. }, {
  169. value: '0',
  170. label: '人脸'
  171. }, {
  172. value: '1',
  173. label: '指纹'
  174. }, {
  175. value: '2',
  176. label: '身份证'
  177. }, {
  178. value: '3',
  179. label: 'NFC'
  180. }, {
  181. value: '4',
  182. label: '密码'
  183. }],
  184. cardList: [],
  185. userInfo: {
  186. type: ''
  187. },
  188. AboutDevice: []
  189. };
  190. },
  191. created: function created() {
  192. // 获取凭证列表/v1/device/certificate/list
  193. // var tenantId = JSON.parse(localStorage.getItem('tenantId'))
  194. // if (tenantId == 400) {
  195. // this.$store.commit('defaultsettenantid')
  196. // }
  197. this.userInfo = JSON.parse(localStorage.getItem('info'));
  198. this.$store.commit('getCardname');
  199. this.cardList = this.$store.state.cartList;
  200. this.getcertificate();
  201. // this.selectoption=JSON.parse(localStorage.getItem('selectoption'))
  202. // this.selectoptionValue=localStorage.getItem('tenantId')
  203. },
  204. methods: {
  205. selectTenantId: function selectTenantId(e) {
  206. localStorage.setItem('tenantId', e);
  207. this.reload();
  208. },
  209. // 搜索
  210. serach: function serach() {
  211. var _this = this;
  212. var data = {};
  213. if (this.deviceNumSearch == "") {
  214. this.$refs.pagination.internalCurrentPage = 1;
  215. data = {
  216. pageNum: 1,
  217. pageSize: this.pageSize,
  218. q: stringify_default()({
  219. type: this.selectVcalue,
  220. status: this.selectVoucherStatus,
  221. name: this.userNameSearch,
  222. types: "0,1,2,3,4,26"
  223. }),
  224. orderBy: "create_at desc"
  225. };
  226. } else {
  227. data = {
  228. pageNum: 1,
  229. pageSize: this.pageSize,
  230. q: stringify_default()({
  231. deviceNum: this.deviceNumSearch,
  232. type: this.selectVcalue,
  233. status: this.selectVoucherStatus,
  234. types: "0,1,2,3,4,26"
  235. }),
  236. orderBy: "create_at desc"
  237. };
  238. }
  239. Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
  240. var dataOne = util["a" /* default */].zlib_unzip(res.data);
  241. dataOne.map(function (li) {
  242. li.createAt = _this.time(+new Date(li.createAt));
  243. li.userTelephone = JSON.parse(li.content).userTelephone;
  244. li['pzname'] = JSON.parse(li.content).pzname;
  245. // var cardli = this.cardList.filter((item) => item.id == li.cardId)
  246. // if (cardli.length == 0) {
  247. // li['cardName'] = ''
  248. // } else {
  249. // li['cardName'] = cardli[0].name
  250. // }
  251. li['statusText'] = util["a" /* default */].statusCode(li.status);
  252. li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
  253. li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
  254. li.roomName = JSON.parse(li.content).roomName || "";
  255. if (li.type == 36) {
  256. li['deviceNum'] = JSON.parse(li.content).deviceNum;
  257. }
  258. });
  259. _this.tableData = dataOne;
  260. _this.total = res.data.total;
  261. });
  262. },
  263. // input视图刷新
  264. changesr: function changesr(e) {
  265. this.$forceUpdate();
  266. },
  267. // 修改凭证
  268. modifyCraiFun: function modifyCraiFun() {
  269. var _this2 = this;
  270. var that = this;
  271. var row = this.modifyrow;
  272. var ids = this.roomtable;
  273. var content = JSON.parse(row.content);
  274. this.documentType1 = row.type;
  275. var data = {};
  276. var userTelephone = content.userTelephone;
  277. var userPassword = content.userPassword;
  278. var startTime = new Date(this.modifyvalue2[0]).getTime() / 1000;
  279. var endTime = new Date(this.modifyvalue2[1]).getTime() / 1000;
  280. Object(utils["i" /* modifyCraiAllFun */])(row, this.modifyvalue2, this.certificatesContent, function (data) {
  281. if (data.success) {
  282. var updatedata = {
  283. id: row.id,
  284. serial: data.data.serialNumber,
  285. startTime: startTime,
  286. endTime: endTime,
  287. status: 0
  288. };
  289. Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res2) {
  290. if (res2.success) {
  291. that.getcertificate();
  292. that.certificatestatus = false;
  293. }
  294. });
  295. that.$message.success("修改成功");
  296. } else {
  297. that.$message.error("修改失败");
  298. }
  299. });
  300. return;
  301. if (row.type == 1) {
  302. this.getfiId(row, function (data) {
  303. if (data.length > 0) {
  304. var fpid = "";
  305. fpid = data[0].face.toString(16).length != 2 ? "0" + data[0].face.toString(16) : data[0].face.toString(16);
  306. var str = {
  307. imei: row.imei,
  308. deviceNum: row.deviceNum,
  309. pzname: that.certificatesContent.pzname,
  310. cardId: row.cardId,
  311. password: fpid,
  312. operateMode: 17,
  313. order: 6217,
  314. userPassword: userPassword,
  315. userTelephone: userTelephone,
  316. passwordStartTime: Object(utils["m" /* timestampToTime */])(that.modifyvalue2[0]),
  317. passwordEndTime: Object(utils["m" /* timestampToTime */])(that.modifyvalue2[1]),
  318. is: false
  319. };
  320. Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
  321. if (res1.success) {
  322. content.passwordStartTime = str.passwordStartTime;
  323. content.passwordEndTime = str.passwordEndTime;
  324. content.pzname = str.pzname;
  325. var updatedata = {
  326. id: row.id,
  327. content: stringify_default()(content),
  328. serial: res1.data.serialNumber,
  329. status: 0
  330. };
  331. Object(api["g" /* httpPost */])(updatedata, that.$api.updateCertificates).then(function (res2) {
  332. that.certificatestatus = false;
  333. that.getcertificate();
  334. that.$message.success("修改成功");
  335. });
  336. } else {
  337. that.certificatestatus = false;
  338. that.getcertificate();
  339. that.$message.success("修改失败");
  340. }
  341. });
  342. }
  343. });
  344. return false;
  345. } else if (row.type == 2) {
  346. var arr2 = Object(utils["d" /* dec2hex */])(this.certificatesContent.idcard);
  347. data = {
  348. imei: row.imei,
  349. deviceNum: row.deviceNum,
  350. userTelephone: userTelephone,
  351. pzname: this.certificatesContent.pzname,
  352. cardId: row.cardId,
  353. userPassword: userPassword,
  354. password: arr2.toUpperCase(),
  355. operateMode: 14,
  356. order: 6214,
  357. passwordStartTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[0]),
  358. passwordEndTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[1]),
  359. is: false
  360. };
  361. if (arr2 == "") {
  362. this.$message.error("请填写完整信息");
  363. return false;
  364. }
  365. } else if (row.type == 3) {
  366. var array3 = Object(utils["d" /* dec2hex */])(this.certificatesContent.nfc);
  367. var arr4 = Object(utils["h" /* group */])(array3, 2).reverse();
  368. var nfc = "";
  369. arr4.map(function (li) {
  370. nfc += li;
  371. });
  372. data = {
  373. imei: row.imei,
  374. deviceNum: row.deviceNum,
  375. userTelephone: userTelephone,
  376. pzname: this.certificatesContent.pzname,
  377. cardId: row.cardId,
  378. userPassword: userPassword,
  379. password: arr4.toUpperCase(),
  380. operateMode: 11,
  381. order: 6211,
  382. passwordStartTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[0]),
  383. passwordEndTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[1]),
  384. is: false
  385. };
  386. if (arr4 == "") {
  387. this.$message.error("请填写完整信息");
  388. return false;
  389. }
  390. } else if (row.type == 4) {
  391. data = {
  392. imei: row.imei,
  393. deviceNum: row.deviceNum,
  394. userTelephone: userTelephone,
  395. pzname: this.certificatesContent.pzname,
  396. cardId: row.cardId,
  397. userPassword: userPassword,
  398. password: this.certificatesContent.password,
  399. operateMode: 8,
  400. order: 6208,
  401. passwordStartTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[0]),
  402. passwordEndTime: Object(utils["m" /* timestampToTime */])(this.modifyvalue2[1]),
  403. is: false
  404. };
  405. if (this.certificatesContent.password == "") {
  406. this.$message.error("请填写完整信息");
  407. return false;
  408. }
  409. }
  410. Object(api["g" /* httpPost */])(data, this.$api.getDeviceOperateUserInfo).then(function (res) {
  411. if (res.success) {
  412. var updatedata = {
  413. id: row.id,
  414. content: stringify_default()(data),
  415. serial: res.data.serialNumber,
  416. status: 0
  417. };
  418. Object(api["g" /* httpPost */])(updatedata, _this2.$api.updateCertificates).then(function (res2) {
  419. if (res2.success) {
  420. _this2.getcertificate();
  421. _this2.certificatestatus = false;
  422. }
  423. });
  424. _this2.$message.success("修改成功");
  425. }
  426. });
  427. },
  428. modifyCrai: function modifyCrai(index, row) {
  429. var that = this;
  430. this.getItems(row.imei, function (data) {
  431. console.log(data);
  432. if (data.list.length > 0) {
  433. if (data.list[0].manufactureId == 201 || data.list[0].manufactureId == 221) {
  434. that.modifyrow = row;
  435. var content = JSON.parse(row.content);
  436. that.documentType1 = row.type;
  437. that.certificatesContent.username = content.username;
  438. that.certificatesContent.pzname = content.pzname;
  439. that.certificatesContent.password = content.password;
  440. var passwordStartTime = moment_default()(row.startTime * 1000).format('YYYY-MM-DD HH:mm:ss');
  441. var passwordEndTime = moment_default()(row.endTime * 1000).format('YYYY-MM-DD HH:mm:ss');
  442. that.modifyStatus = false;
  443. that.$nextTick(function () {
  444. that.modifyvalue2[0] = passwordStartTime;
  445. that.modifyvalue2[1] = passwordEndTime;
  446. that.modifyStatus = true;
  447. });
  448. that.certificatestatus = true;
  449. } else if (data.list[0].manufactureId == 101) {
  450. that.modifyrow = row;
  451. var content = JSON.parse(row.content);
  452. that.documentType1 = row.type;
  453. that.certificatesContent.username = content.username;
  454. that.certificatesContent.pzname = content.pzname;
  455. that.certificatesContent.password = content.password;
  456. if (content.passwordStartTime && content.passwordEndTime) {
  457. var passwordStartTime = that.insertStr(content.passwordStartTime, "-");
  458. var passwordEndTime = that.insertStr(content.passwordEndTime, "-");
  459. }
  460. that.modifyStatus = false;
  461. that.$nextTick(function () {
  462. that.modifyvalue2[0] = passwordStartTime;
  463. that.modifyvalue2[1] = passwordEndTime;
  464. that.modifyStatus = true;
  465. });
  466. that.certificatestatus = true;
  467. }
  468. } else {
  469. that.$message.error('未发现对应设备');
  470. }
  471. });
  472. },
  473. getItems: function getItems(imei, callback) {
  474. var _this3 = this;
  475. var data = {
  476. q: stringify_default()({
  477. imei: imei,
  478. lockType: 1
  479. }),
  480. pageNum: 0,
  481. pageSize: 0
  482. };
  483. Object(api["g" /* httpPost */])(data, this.$api.getDeviceItems).then(function (res) {
  484. if (res.success) {
  485. callback(res.data);
  486. } else {
  487. _this3.$message.error("查询设备失败");
  488. }
  489. });
  490. },
  491. insertStr: function insertStr(soure, newStr) {
  492. 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);
  493. },
  494. // 下发凭证
  495. Issue: function Issue(index, row) {
  496. var _this4 = this;
  497. var data = {};
  498. var userTelephone = JSON.parse(row.content).userTelephone;
  499. var userPassword = JSON.parse(row.content).userPassword;
  500. var passwordEndTime = JSON.parse(row.content).passwordEndTime;
  501. var passwordStartTime = JSON.parse(row.content).passwordStartTime;
  502. if (row.type == 1) {
  503. var fpId = new Date();
  504. var fingerprint = JSON.parse(row.content).fingerprint;
  505. var str = {
  506. imei: row.imei,
  507. deviceNum: row.deviceNum,
  508. userTelephone: userTelephone,
  509. userPassword: userPassword,
  510. password: JSON.parse(row.content).password,
  511. length: fingerprint.length / 2,
  512. fpTimeId: fpId.getTime(),
  513. operateMode: 16,
  514. order: 6216,
  515. fingerprint: fingerprint,
  516. passwordStartTime: passwordStartTime,
  517. passwordEndTime: passwordEndTime
  518. };
  519. Object(api["g" /* httpPost */])(str, this.$api.fingerprintTransfer).then(function (res1) {
  520. if (res1.success) {
  521. var str1 = JSON.parse(row.content);
  522. str1.fpTimeId = str.fpTimeId;
  523. var updatedata = {
  524. id: row.id,
  525. content: stringify_default()(str1),
  526. serial: res1.data.serialNumber
  527. };
  528. Object(api["g" /* httpPost */])(updatedata, _this4.$api.updateCertificates).then(function (res2) {});
  529. _this4.$message.success("下发成功");
  530. } else {
  531. _this4.$message.error("下发失败");
  532. }
  533. });
  534. this.$message.success("操作成功");
  535. return false;
  536. } else if (row.type == 2) {
  537. data = {
  538. imei: row.imei,
  539. deviceNum: row.deviceNum,
  540. userTelephone: userTelephone,
  541. cardId: row.cardId,
  542. userPassword: userPassword,
  543. password: JSON.parse(row.content).password,
  544. operateMode: 13,
  545. order: 6213,
  546. passwordStartTime: passwordStartTime,
  547. passwordEndTime: passwordEndTime,
  548. is: false
  549. };
  550. } else if (row.type == 3) {
  551. data = {
  552. imei: row.imei,
  553. deviceNum: row.deviceNum,
  554. userTelephone: userTelephone,
  555. cardId: row.cardId,
  556. userPassword: userPassword,
  557. password: JSON.parse(row.content).password,
  558. operateMode: 10,
  559. order: 6210,
  560. passwordStartTime: passwordStartTime,
  561. passwordEndTime: passwordEndTime,
  562. is: false
  563. };
  564. } else if (row.type == 4) {
  565. data = {
  566. imei: row.imei,
  567. deviceNum: row.deviceNum,
  568. userTelephone: userTelephone,
  569. cardId: row.cardId,
  570. userPassword: userPassword,
  571. password: JSON.parse(row.content).password,
  572. operateMode: 7,
  573. order: 6207,
  574. passwordStartTime: passwordStartTime,
  575. passwordEndTime: passwordEndTime,
  576. is: false
  577. };
  578. }
  579. Object(api["g" /* httpPost */])(data, this.$api.getDeviceOperateUserInfo).then(function (res) {
  580. if (res.success) {
  581. var updatedata = {
  582. id: row.id,
  583. serial: res.data.serialNumber
  584. };
  585. Object(api["g" /* httpPost */])(updatedata, _this4.$api.updateCertificates).then(function (res) {});
  586. _this4.$message.success("下发成功");
  587. } else {
  588. _this4.$message.error("下发失败");
  589. }
  590. });
  591. },
  592. // 时间处理
  593. time: function time() {
  594. var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : +new Date();
  595. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  596. return date.toJSON().substr(0, 19).replace("T", " ");
  597. },
  598. // 凭证列表获取
  599. getcertificate: function getcertificate() {
  600. var _this5 = this;
  601. var data = {
  602. pageNum: this.currentPage,
  603. pageSize: this.pageSize,
  604. // orderType: "desc",
  605. orderBy: "create_at desc",
  606. q: stringify_default()({
  607. deviceNum: this.deviceNumSearch,
  608. type: this.selectVcalue,
  609. status: this.selectVoucherStatus,
  610. name: this.userNameSearch,
  611. types: "0,1,2,3,4,26"
  612. })
  613. };
  614. Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
  615. var dataOne = util["a" /* default */].zlib_unzip(res.data);
  616. dataOne.map(function (li) {
  617. li.createAt = _this5.time(+new Date(li.createAt));
  618. li.userTelephone = JSON.parse(li.content).userTelephone;
  619. // var cardli = this.cardList.filter((item) => item.id == li.cardId)
  620. // if (cardli.length == 0) {
  621. // li['cardName'] = ''
  622. // } else {
  623. // li['cardName'] = cardli[0].name
  624. // }
  625. li['pzname'] = JSON.parse(li.content).pzname;
  626. li['statusText'] = util["a" /* default */].statusCode(li.status);
  627. li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
  628. li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
  629. li.roomName = JSON.parse(li.content).roomName || "";
  630. if (li.type == 36) {
  631. li['deviceNum'] = JSON.parse(li.content).deviceNum;
  632. }
  633. });
  634. _this5.tableData = dataOne;
  635. _this5.total = res.data.total;
  636. });
  637. },
  638. handleSizeChange: function handleSizeChange(val) {
  639. this.pageSize = val;
  640. this.$refs.pagination.internalCurrentPage = 1;
  641. this.getlistNum(0, val);
  642. },
  643. handleCurrentChange: function handleCurrentChange(val) {
  644. this.getlistNum(val, 10);
  645. },
  646. getlistNum: function getlistNum(val, size) {
  647. var _this6 = this;
  648. var data = {};
  649. if (this.deviceNumSearch == "") {
  650. data = {
  651. pageNum: val,
  652. pageSize: size,
  653. orderBy: "create_at desc",
  654. q: stringify_default()({
  655. type: this.selectVcalue,
  656. status: this.selectVoucherStatus
  657. })
  658. };
  659. } else {
  660. data = {
  661. pageNum: val,
  662. pageSize: size,
  663. q: stringify_default()({
  664. deviceNum: this.deviceNumSearch,
  665. type: this.selectVcalue,
  666. status: this.selectVoucherStatus,
  667. name: this.userNameSearch,
  668. types: "0,1,2,3,4,26"
  669. }),
  670. orderBy: "create_at desc"
  671. };
  672. }
  673. Object(api["d" /* httpGet */])(data, this.$api.getCertificates).then(function (res) {
  674. var dataOne = util["a" /* default */].zlib_unzip(res.data);
  675. dataOne.map(function (li) {
  676. li.createAt = _this6.time(+new Date(li.createAt));
  677. li.userTelephone = JSON.parse(li.content).userTelephone;
  678. // var cardli = this.cardList.filter((item) => item.id == li.cardId)
  679. // if (cardli.length == 0) {
  680. // li['cardName'] = ''
  681. // } else {
  682. // li['cardName'] = cardli[0].name
  683. // }
  684. li['pzname'] = JSON.parse(li.content).pzname;
  685. li['statusText'] = util["a" /* default */].statusCode(li.status);
  686. li['startTimeText'] = util["a" /* default */].formatTime(li.startTime);
  687. li['endTimeText'] = util["a" /* default */].formatTime(li.endTime);
  688. li.roomName = JSON.parse(li.content).roomName || "";
  689. if (li.type == 36) {
  690. li['deviceNum'] = JSON.parse(li.content).deviceNum;
  691. }
  692. });
  693. _this6.tableData = dataOne;
  694. _this6.total = res.data.total;
  695. });
  696. },
  697. handleSelectionChange: function handleSelectionChange(val) {
  698. this.multipleSelection = val;
  699. },
  700. // 编辑操作
  701. handleEdit: function handleEdit(index, row) {
  702. this.row = row;
  703. this.index = index;
  704. this.startdate = row.startTime;
  705. this.enddate = row.endTime;
  706. this.editVisiblelist = true;
  707. },
  708. // 保存编辑
  709. saveEdit: function saveEdit() {
  710. var _this7 = this;
  711. if (this.form.password == this.form.password1 && this.startdate != "" && this.enddate != "") {
  712. var data = {
  713. id: this.row.id,
  714. content: stringify_default()({
  715. password: this.form.password
  716. }),
  717. startTime: Number(this.startdate),
  718. endTime: Number(this.enddate)
  719. };
  720. Object(api["g" /* httpPost */])(data, this.$api.updateCertificates).then(function (res) {
  721. _this7.$message.success("修改成功");
  722. _this7.editVisiblelist = false;
  723. });
  724. } else {
  725. this.$message.error("两次密码输入不一致!");
  726. }
  727. },
  728. alldelete: function alldelete() {
  729. var _this8 = this;
  730. var that = this;
  731. // 二次确认删除
  732. if (this.multipleSelection.length == 0) {
  733. this.$message.error("请选择删除数据!");
  734. return false;
  735. } else {
  736. this.$confirm("确定要删除吗?", "提示", {
  737. type: "warning"
  738. }).then(function () {
  739. _this8.multipleSelection.map(function (row) {
  740. Object(utils["a" /* backDevice */])(row, function (data1) {
  741. console.log(data1);
  742. if (data1.data.list.length > 0) {
  743. if (data1.data.list[0].manufactureId == 201 || data1.data.list[0].manufactureId == 221) {
  744. Object(utils["e" /* deleteZgVoucher */])(row, function (data) {
  745. if (data.success) {
  746. that.deleteall(row);
  747. } else {
  748. that.$confirm('是否删除平台凭证!', data.msg, {
  749. type: "warning"
  750. }).then(function () {
  751. that.deleteall(row);
  752. });
  753. }
  754. });
  755. } else if (data1.data.list[0].manufactureId == 101) {
  756. var str = {};
  757. if (row.type == 1) {
  758. this.getfiId(row, function (data) {
  759. if (data.length > 0) {
  760. var fpid = "";
  761. if (data[0].face) {
  762. fpid = data[0].face.toString(16);
  763. if (fpid.length != 2) {
  764. fpid = "0" + fpid;
  765. }
  766. } else {
  767. if (data[0].face == 0) {
  768. fpid = data[0].face.toString(16);
  769. fpid = "0" + fpid;
  770. }
  771. }
  772. str = {
  773. imei: row.imei,
  774. deviceNum: row.deviceNum,
  775. userTelephone: JSON.parse(row.content).userTelephone,
  776. operateMode: 18,
  777. order: 6218,
  778. password: fpid,
  779. userPassword: JSON.parse(row.content).userPassword,
  780. is: false,
  781. passwordStartTime: JSON.parse(row.content).passwordStartTime,
  782. passwordEndTime: JSON.parse(row.content).passwordEndTime
  783. };
  784. Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
  785. if (res1.success) {
  786. that.deleteall(row);
  787. } else {
  788. that.$message.error('删除失败');
  789. }
  790. });
  791. } else {
  792. that.$message.error("该凭还未下发");
  793. }
  794. });
  795. return false;
  796. } else if (row.type == 2) {
  797. str = {
  798. cardId: row.cardId,
  799. imei: row.imei,
  800. deviceNum: row.deviceNum,
  801. userTelephone: JSON.parse(row.content).userTelephone,
  802. userPassword: JSON.parse(row.content).userPassword,
  803. operateMode: 13,
  804. order: 6213,
  805. password: JSON.parse(row.content).password,
  806. passwordStartTime: "20210813010101",
  807. passwordEndTime: "20680813010101",
  808. is: false
  809. };
  810. } else if (row.type == 3) {
  811. str = {
  812. cardId: row.cardId,
  813. imei: row.imei,
  814. deviceNum: row.deviceNum,
  815. userTelephone: JSON.parse(row.content).userTelephone,
  816. userPassword: JSON.parse(row.content).userPassword,
  817. operateMode: 12,
  818. order: 6212,
  819. is: false,
  820. passwordStartTime: "20210813010101",
  821. passwordEndTime: "20680813010101"
  822. };
  823. } else if (row.type == 4) {
  824. str = {
  825. cardId: row.cardId,
  826. imei: row.imei,
  827. deviceNum: row.deviceNum,
  828. userTelephone: JSON.parse(row.content).userTelephone,
  829. operateMode: 9,
  830. order: 6209,
  831. userPassword: JSON.parse(row.content).userPassword,
  832. password: JSON.parse(row.content).password,
  833. is: false,
  834. passwordStartTime: "20210813010101",
  835. passwordEndTime: "20680813010101"
  836. };
  837. }
  838. Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
  839. if (res1.success) {
  840. that.deleteall(row);
  841. } else {
  842. that.$message.error('删除失败');
  843. }
  844. });
  845. }
  846. } else {
  847. that.deleteall(row);
  848. }
  849. });
  850. });
  851. });
  852. }
  853. },
  854. deleteall: function deleteall(row) {
  855. var _this9 = this;
  856. var ids = [];
  857. // this.multipleSelection.map((row) => {
  858. ids.push(row.id);
  859. // if (ids.length == this.multipleSelection.length) {
  860. var data = {
  861. ids: ids
  862. };
  863. Object(api["g" /* httpPost */])(data, this.$api.deleteCertificates).then(function (res) {
  864. if (res.success) {
  865. _this9.getcertificate();
  866. _this9.$message.success("删除成功!");
  867. } else {
  868. _this9.$message.error('平台删除失败');
  869. }
  870. });
  871. // }
  872. // });
  873. },
  874. // 获取指纹id
  875. getfiId: function getfiId(row, callback) {
  876. var content = JSON.parse(row.content);
  877. var data = {
  878. q: stringify_default()({
  879. fpTimeId: content.fpTimeId
  880. }),
  881. pageNum: 1,
  882. pageSize: 10
  883. };
  884. Object(api["g" /* httpPost */])(data, this.$api.getDeviceResult).then(function (res) {
  885. var datalist = util["a" /* default */].zlib_unzip(res.data);
  886. callback(datalist);
  887. });
  888. },
  889. // 删除操作
  890. handleDelete: function handleDelete(index, row) {
  891. var that = this;
  892. // 二次确认删除
  893. this.$confirm("确定要删除吗?", "提示", {
  894. type: "warning"
  895. }).then(function () {
  896. Object(utils["a" /* backDevice */])(row, function (data1) {
  897. var _this10 = this;
  898. if (data1.data.list[0].manufactureId == 201 || data1.data.list[0].manufactureId == 221) {
  899. Object(utils["e" /* deleteZgVoucher */])(row, function (data) {
  900. if (data.success) {
  901. that.deleteall(row);
  902. } else {
  903. that.$confirm('是否删除平台凭证!', data.msg, {
  904. type: "warning"
  905. }).then(function () {
  906. that.deleteall(row);
  907. });
  908. }
  909. });
  910. } else if (data1.data.list[0].manufactureId == 101) {
  911. var str = {};
  912. if (row.type == 1) {
  913. this.getfiId(row, function (data) {
  914. if (data.length > 0) {
  915. var fpid = "";
  916. if (data[0].face) {
  917. fpid = data[0].face.toString(16);
  918. if (fpid.length != 2) {
  919. fpid = "0" + fpid;
  920. }
  921. } else {
  922. if (data[0].face == 0) {
  923. fpid = data[0].face.toString(16);
  924. fpid = "0" + fpid;
  925. }
  926. }
  927. str = {
  928. imei: row.imei,
  929. deviceNum: row.deviceNum,
  930. userTelephone: JSON.parse(row.content).userTelephone,
  931. operateMode: 18,
  932. order: 6218,
  933. password: fpid,
  934. userPassword: JSON.parse(row.content).userPassword,
  935. is: false,
  936. passwordStartTime: JSON.parse(row.content).passwordStartTime,
  937. passwordEndTime: JSON.parse(row.content).passwordEndTime
  938. };
  939. Object(api["g" /* httpPost */])(str, that.$api.getDeviceOperateUserInfo).then(function (res1) {
  940. if (res1.success) {
  941. that.deleteall(row);
  942. } else {
  943. that.$message.error('删除失败');
  944. }
  945. });
  946. } else {
  947. that.$message.error("该凭还未下发");
  948. }
  949. });
  950. return false;
  951. } else if (row.type == 2) {
  952. str = {
  953. cardId: row.cardId,
  954. imei: row.imei,
  955. deviceNum: row.deviceNum,
  956. userTelephone: JSON.parse(row.content).userTelephone,
  957. userPassword: JSON.parse(row.content).userPassword,
  958. operateMode: 13,
  959. order: 6213,
  960. password: JSON.parse(row.content).password,
  961. passwordStartTime: "20210813010101",
  962. passwordEndTime: "20680813010101",
  963. is: false
  964. };
  965. } else if (row.type == 3) {
  966. str = {
  967. cardId: row.cardId,
  968. imei: row.imei,
  969. deviceNum: row.deviceNum,
  970. userTelephone: JSON.parse(row.content).userTelephone,
  971. operateMode: 12,
  972. order: 6212,
  973. userPassword: JSON.parse(row.content).userPassword,
  974. is: false,
  975. passwordStartTime: "20210813010101",
  976. passwordEndTime: "20680813010101"
  977. };
  978. } else if (row.type == 4) {
  979. str = {
  980. cardId: row.cardId,
  981. imei: row.imei,
  982. deviceNum: row.deviceNum,
  983. userTelephone: JSON.parse(row.content).userTelephone,
  984. operateMode: 9,
  985. order: 6209,
  986. userPassword: JSON.parse(row.content).userPassword,
  987. password: JSON.parse(row.content).password,
  988. is: false,
  989. passwordStartTime: "20210813010101",
  990. passwordEndTime: "20680813010101"
  991. };
  992. }
  993. Object(api["g" /* httpPost */])(str, this.$api.getDeviceOperateUserInfo).then(function (res1) {
  994. if (res1.success) {
  995. var data = {
  996. ids: [row.id]
  997. };
  998. Object(api["g" /* httpPost */])(data, _this10.$api.deleteCertificates).then(function (res) {
  999. if (res.success) {
  1000. _this10.$message.success("删除成功!");
  1001. _this10.getcertificate();
  1002. }
  1003. });
  1004. }
  1005. });
  1006. }
  1007. });
  1008. }).catch(function () {
  1009. // this.$message.error("删除失败");
  1010. });
  1011. // .finally(() => {
  1012. // var data = {
  1013. // ids: [row.id],
  1014. // };
  1015. // httpPost(data, this.$api.deleteCertificates).then((res) => {
  1016. // if (res.success) {
  1017. // this.$message.success("删除成功!");
  1018. // this.getcertificate();
  1019. // }
  1020. // });
  1021. // });
  1022. }
  1023. }
  1024. });
  1025. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-eaf0af74","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/views/VoucherList.vue
  1026. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-card',{staticClass:"box-card"},[_c('div',{staticClass:"operation"},[_c('selectoption'),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10",attrs:{"placeholder":"设备号","size":"small","clearable":true},model:{value:(_vm.deviceNumSearch),callback:function ($$v) {_vm.deviceNumSearch=$$v},expression:"deviceNumSearch"}}),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10",attrs:{"placeholder":"用户名称","size":"small","clearable":true},model:{value:(_vm.userNameSearch),callback:function ($$v) {_vm.userNameSearch=$$v},expression:"userNameSearch"}}),_vm._v(" "),_c('el-select',{attrs:{"size":"small","placeholder":"请选择凭证类型","clearable":true},model:{value:(_vm.selectVcalue),callback:function ($$v) {_vm.selectVcalue=$$v},expression:"selectVcalue"}},_vm._l((_vm.options),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1),_vm._v(" "),_c('el-select',{attrs:{"size":"small","placeholder":"请选择凭证状态","clearable":""},model:{value:(_vm.selectVoucherStatus),callback:function ($$v) {_vm.selectVoucherStatus=$$v},expression:"selectVoucherStatus"}},_vm._l((_vm.voucherStatusList),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.serach}},[_vm._v("搜索")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.alldelete}},[_vm._v("批量删除")])],1),_vm._v(" "),_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.tableData,"border":"","height":"700","header-cell-class-name":"table-header"},on:{"selection-change":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{"type":"selection","width":"55","align":"center"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"deviceNum","label":"设备号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"roomName","label":"房间名"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"name","label":"人员名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"pzname","label":"凭证名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"类型"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.type == 26)?_c('span',[_vm._v("锁用户")]):_vm._e(),_vm._v(" "),(scope.row.type == 36)?_c('span',[_vm._v("蓝牙扣")]):_vm._e(),_vm._v(" "),(scope.row.type == 0)?_c('span',[_vm._v("人脸")]):_vm._e(),_vm._v(" "),(scope.row.type == 1)?_c('span',[_vm._v("指纹")]):_vm._e(),_vm._v(" "),(scope.row.type == 2)?_c('span',[_vm._v("身份证")]):_vm._e(),_vm._v(" "),(scope.row.type == 3)?_c('span',[_vm._v("NFC")]):_vm._e(),_vm._v(" "),(scope.row.type == 4)?_c('span',[_vm._v("密码")]):_vm._e()]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"number","width":"400","label":"有效期"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('span',[_vm._v(_vm._s(scope.row.startTimeText)+" - "+_vm._s(scope.row.endTimeText))])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"下发状态","prop":"statusText"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"createAt","label":"创建时间"}})],1),_vm._v(" "),_c('div',{staticClass:"pagepg"},[_c('el-pagination',{ref:"pagination",attrs:{"current-page":_vm.currentPage,"page-sizes":[10,30,100,200],"page-size":_vm.pageSize,"layout":"total, sizes, prev, pager, next, jumper","total":_vm.total},on:{"size-change":_vm.handleSizeChange,"current-change":_vm.handleCurrentChange}})],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"编辑","visible":_vm.certificatestatus,"width":"30%"},on:{"update:visible":function($event){_vm.certificatestatus=$event}},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.certificatestatus = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.modifyCraiFun
  1027. var file = ref.file;
  1028. return _c('div',{},[_c('img',{staticClass:"el-upload-list__item-thumbnail",attrs:{"src":file.url,"alt":""}}),_vm._v(" "),_c('span',{staticClass:"el-upload-list__item-actions"},[_c('span',{staticClass:"el-upload-list__item-preview",on:{"click":function($event){return _vm.handlePictureCardPreview(file)}}},[_c('i',{staticClass:"el-icon-zoom-in"})]),_vm._v(" "),(!_vm.disabled1)?_c('span',{staticClass:"el-upload-list__item-delete",on:{"click":function($event){return _vm.handleDownload(file)}}},[_c('i',{staticClass:"el-icon-download"})]):_vm._e(),_vm._v(" "),(!_vm.disabled1)?_c('span',{staticClass:"el-upload-list__item-delete",on:{"click":function($event){return _vm.handleRemove(file)}}},[_c('i',{staticClass:"el-icon-delete"})]):_vm._e()])])}}],null,false,1205945247)},[_c('i',{staticClass:"el-icon-plus",attrs:{"slot":"default"},slot:"default"})]),_vm._v(" "),_c('el-dialog',{attrs:{"visible":_vm.dialogVisible,"modal-append-to-body":false},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('img',{attrs:{"width":"100%","src":_vm.dialogImageUrl,"alt":""}})])],1):_vm._e()]):_vm._e(),_vm._v(" "),_c('el-form-item',{attrs:{"label":"有效期"}},[(_vm.modifyStatus)?_c('el-date-picker',{attrs:{"type":"datetimerange","align":"right","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:(_vm.modifyvalue2),callback:function ($$v) {_vm.modifyvalue2=$$v},expression:"modifyvalue2"}}):_vm._e()],1)],1)],1)],1)],1)}
  1029. var staticRenderFns = []
  1030. var esExports = { render: render, staticRenderFns: staticRenderFns }
  1031. /* harmony default export */ var views_VoucherList = (esExports);
  1032. // CONCATENATED MODULE: ./src/views/VoucherList.vue
  1033. function injectStyle (ssrContext) {
  1034. __webpack_require__("jhQs")
  1035. }
  1036. var normalizeComponent = __webpack_require__("VU/8")
  1037. /* script */
  1038. /* template */
  1039. /* template functional */
  1040. var __vue_template_functional__ = false
  1041. /* styles */
  1042. var __vue_styles__ = injectStyle
  1043. /* scopeId */
  1044. var __vue_scopeId__ = "data-v-eaf0af74"
  1045. /* moduleIdentifier (server only) */
  1046. var __vue_module_identifier__ = null
  1047. var Component = normalizeComponent(
  1048. VoucherList,
  1049. views_VoucherList,
  1050. __vue_template_functional__,
  1051. __vue_styles__,
  1052. __vue_scopeId__,
  1053. __vue_module_identifier__
  1054. )
  1055. /* harmony default export */ var src_views_VoucherList = __webpack_exports__["default"] = (Component.exports);
  1056. /***/ }),
  1057. /***/ "jhQs":
  1058. /***/ (function(module, exports) {
  1059. // removed by extract-text-webpack-plugin
  1060. /***/ })
  1061. });