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

503 lines
18 KiB

  1. webpackJsonp([55],{
  2. /***/ "YC1C":
  3. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4. "use strict";
  5. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6. // EXTERNAL MODULE: ./src/api/index.js + 5 modules
  7. var api = __webpack_require__("gyMJ");
  8. // EXTERNAL MODULE: ./src/views/zw.vue + 1 modules
  9. var zw = __webpack_require__("RMlb");
  10. // EXTERNAL MODULE: ./node_modules/moment/moment.js
  11. var moment = __webpack_require__("PJh5");
  12. var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
  13. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/offInCard/offInCardOver.vue
  14. //
  15. //
  16. //
  17. //
  18. //
  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. /* harmony default export */ var offInCardOver = ({
  87. inject: ['reload'],
  88. name: "offInCardOver",
  89. data: function data() {
  90. return {
  91. dialogVisible: false,
  92. firstAuthList: [],
  93. secondAuthList: [],
  94. threeAuthList: [],
  95. fourAuthList: [],
  96. romeLockerList: [],
  97. options: [],
  98. roomFirst: "",
  99. roomSecond: "",
  100. roomThree: "",
  101. roomFour: "",
  102. roomFive: "",
  103. submitData: {
  104. cardNo: "",
  105. num: "",
  106. endTime: "",
  107. startTime: ""
  108. },
  109. tableData: [],
  110. romeFiveAuth: [],
  111. FiveAuthList: {
  112. communcationKey: "",
  113. firstAuth: "",
  114. secondAuth: "",
  115. threeAuth: "",
  116. fourAuth: ""
  117. },
  118. privateKey: "",
  119. privateKeyType: ""
  120. };
  121. },
  122. components: { zw: zw["a" /* default */] },
  123. created: function created() {
  124. this.getFirstAuthListMethods();
  125. },
  126. methods: {
  127. // 删除
  128. deleteCardMethods: function deleteCardMethods(index, row) {
  129. var _this2 = this;
  130. var data3 = {
  131. code: "zg/auth/clearCardAuth",
  132. data: {
  133. cardNo: row.cardNum
  134. }
  135. };
  136. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  137. if (res.code == 200) {
  138. _this2.getCardBindAuthList();
  139. }
  140. });
  141. },
  142. // 房源改变
  143. getRoomMethods: function getRoomMethods(e) {
  144. if (e == 1) {
  145. if (this.roomFirst != '') {
  146. this.getSecondAuthList();this.privateKeyType = 1;
  147. } else {
  148. this.roomSecond = "";
  149. this.roomThree = "";
  150. this.roomFour = "";
  151. this.roomFive = "";
  152. this.privateKeyType = "";
  153. }
  154. } else if (e == 2) {
  155. if (this.roomSecond != '') {
  156. this.getThreeAuthList();this.privateKeyType = 2;
  157. } else {
  158. this.roomThree = "";
  159. this.roomFour = "";
  160. this.roomFive = "";
  161. this.privateKeyType = 1;
  162. }
  163. } else if (e == 3) {
  164. if (this.roomThree != '') {
  165. this.getFourAuthList();this.privateKeyType = 3;
  166. } else {
  167. this.roomFour = "";
  168. this.roomFive = "";
  169. this.privateKeyType = 2;
  170. }
  171. } else if (e == 4) {
  172. if (this.roomFour != '') {
  173. this.getRomeLockerList();this.privateKeyType = 4;
  174. } else {
  175. this.roomFive = "";
  176. this.privateKeyType = 3;
  177. }
  178. } else if (e == 5) {
  179. if (this.roomFive != '') {
  180. this.privateKeyType = 5;
  181. } else {
  182. this.privateKeyType = 4;
  183. }
  184. }
  185. console.log(this.privateKeyType);
  186. // switch(e){
  187. // case 1: this.getSecondAuthList();this.privateKeyType=1; break;
  188. // case 2: this.getThreeAuthList();this.privateKeyType=2; break;
  189. // case 3: this.getFourAuthList();this.privateKeyType=3; break;
  190. // case 4: this.getRomeLockerList();this.privateKeyType=4; break;
  191. // case 5: this.privateKeyType=5; break;
  192. // }
  193. },
  194. // 获取一级房源
  195. getFirstAuthListMethods: function getFirstAuthListMethods() {
  196. var _this3 = this;
  197. var data3 = {
  198. code: "zg/auth/firstAuthList",
  199. data: {}
  200. };
  201. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  202. if (res.code == 200) {
  203. _this3.firstAuthList = res.data;
  204. }
  205. });
  206. },
  207. // 获取二级房源
  208. getSecondAuthList: function getSecondAuthList() {
  209. var _this4 = this;
  210. var data3 = {
  211. code: "zg/auth/secondAuthList",
  212. data: {
  213. parentId: this.roomFirst
  214. }
  215. };
  216. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  217. if (res.code == 200) {
  218. _this4.secondAuthList = res.data;
  219. }
  220. });
  221. },
  222. // 获取三级房源
  223. getThreeAuthList: function getThreeAuthList() {
  224. var _this5 = this;
  225. var data3 = {
  226. code: "zg/auth/threeAuthList",
  227. data: {
  228. parentId: this.roomSecond
  229. }
  230. };
  231. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  232. if (res.code == 200) {
  233. _this5.threeAuthList = res.data;
  234. }
  235. });
  236. },
  237. // 获取四级房源
  238. getFourAuthList: function getFourAuthList() {
  239. var _this6 = this;
  240. var data3 = {
  241. code: "zg/auth/fourAuthList",
  242. data: {
  243. parentId: this.roomThree
  244. }
  245. };
  246. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  247. if (res.code == 200) {
  248. _this6.fourAuthList = res.data;
  249. }
  250. });
  251. },
  252. // 获取五级房源
  253. getRomeLockerList: function getRomeLockerList() {
  254. var _this7 = this;
  255. var data3 = {
  256. code: "zg/auth/getRomeLockerList",
  257. data: {
  258. parentId: this.roomFour
  259. }
  260. };
  261. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res) {
  262. if (res.code == 200) {
  263. _this7.romeLockerList = res.data;
  264. }
  265. });
  266. },
  267. showDialogMethods: function showDialogMethods() {
  268. this.dialogVisible = true;
  269. var roomId = "",
  270. type = "";
  271. if (this.roomFive != '') {
  272. roomId = this.roomFive;
  273. type = 5;
  274. } else if (this.roomFour != '') {
  275. roomId = this.roomFour;
  276. type = 4;
  277. } else if (this.roomThree != '') {
  278. roomId = this.roomThree;
  279. type = 3;
  280. } else if (this.roomSecond != '') {
  281. roomId = this.roomSecond;
  282. type = 2;
  283. } else if (this.roomFirst != '') {
  284. roomId = this.roomFirst;
  285. type = 1;
  286. }
  287. this.getromeFiveAuth(roomId, type);
  288. this.addNfc();
  289. },
  290. getromeFiveAuth: function getromeFiveAuth(roomId, type) {
  291. if (type == 1) {
  292. var result = this.firstAuthList.filter(function (item) {
  293. return item.code == roomId;
  294. })[0];
  295. if (result) {
  296. this.getPrivateKey(result.value, type);
  297. }
  298. } else if (type == 2) {
  299. var result = this.secondAuthList.filter(function (item) {
  300. return item.code == roomId;
  301. })[0];
  302. if (result) {
  303. this.getPrivateKey(result.value, type);
  304. }
  305. } else if (type == 3) {
  306. var result = this.threeAuthList.filter(function (item) {
  307. return item.code == roomId;
  308. })[0];
  309. if (result) {
  310. this.getPrivateKey(result.value, type);
  311. }
  312. } else if (type == 4) {
  313. var result = this.fourAuthList.filter(function (item) {
  314. return item.code == roomId;
  315. })[0];
  316. if (result) {
  317. this.getPrivateKey(result.value, type);
  318. }
  319. } else if (type == 5) {
  320. var result = this.romeLockerList.filter(function (item) {
  321. return item.code == roomId;
  322. })[0];
  323. if (result) {
  324. this.getPrivateKey(result.value, type);
  325. }
  326. }
  327. },
  328. getPrivateKey: function getPrivateKey(authName, type) {
  329. var _this8 = this;
  330. var data = {
  331. code: "zg/auth/findAuthCodeInfo",
  332. data: {
  333. authName: authName,
  334. type: type
  335. }
  336. };
  337. Object(api["g" /* httpPost */])(data, this.$api.sendCommand).then(function (res) {
  338. if (res.code == 200) {
  339. _this8.privateKey = res.data;
  340. }
  341. });
  342. },
  343. setVoucherNfc: function setVoucherNfc(data) {
  344. this.submitData.cardNo = data.cardNo;
  345. this.getCardBindAuthList();
  346. },
  347. getCardBindAuthList: function getCardBindAuthList() {
  348. var _this9 = this;
  349. var data3 = {
  350. code: "zg/auth/findCardBindAuth",
  351. data: {
  352. cardNo: this.submitData.cardNo
  353. }
  354. };
  355. Object(api["g" /* httpPost */])(data3, this.$api.sendCommand).then(function (res4) {
  356. _this9.tableData = res4.data;
  357. });
  358. },
  359. addNfc: function addNfc() {
  360. var _this = this;
  361. this.$refs.mychild.cardFun(0x8010, function (data) {
  362. if (data.status == 0) {
  363. console.log(data);
  364. _this.setVoucherNfc(data);
  365. } else {
  366. _this.$message.error("读卡错误,请检查读卡器是否正常!");
  367. }
  368. });
  369. },
  370. writeNfc: function writeNfc() {
  371. var _this10 = this;
  372. var _this = this;
  373. if (this.privateKeyType == '') {
  374. _this.$message.error("请选择房源");
  375. return;
  376. }
  377. if (this.submitData.startTime == '' || this.submitData.endTime == '') {
  378. _this.$message.error("请选择开始结束时间");
  379. return;
  380. }
  381. if (this.submitData.cardNo == '') {
  382. _this.$message.error("请放置卡片在读卡器上");
  383. return;
  384. }
  385. var cardNo = this.submitData.cardNo;
  386. var startTime = moment_default()(this.submitData.startTime).format("X").toString(16);
  387. var endTime = moment_default()(this.submitData.endTime).format("X").toString(16);
  388. var useCountLimit = this.submitData.num.toString(16);
  389. var privateKey = this.privateKey;
  390. if (this.submitData.num == '') {
  391. useCountLimit = '255';
  392. }
  393. useCountLimit = useCountLimit.toString(16);
  394. var keyType = "";
  395. if (this.privateKeyType == 1) {
  396. keyType = 0x01;
  397. } else if (this.privateKeyType == 2) {
  398. keyType = 0x02;
  399. } else if (this.privateKeyType == 3) {
  400. keyType = 0x03;
  401. } else if (this.privateKeyType == 4) {
  402. keyType = 0x04;
  403. } else if (this.privateKeyType == 5) {
  404. keyType = 0xff;
  405. }
  406. this.$refs.mychild.writeCard(0x8011, cardNo, startTime, endTime, useCountLimit, privateKey, keyType, function (data) {
  407. if (data.status == 0) {
  408. console.log(data);
  409. var data3 = {
  410. code: "zg/auth/reportCardAuthInfo",
  411. data: {
  412. authCode: privateKey,
  413. cardNo: cardNo,
  414. endTime: moment_default()(_this10.submitData.endTime).format("X"),
  415. startTime: moment_default()(_this10.submitData.startTime).format("X"),
  416. useCount: useCountLimit
  417. }
  418. };
  419. Object(api["g" /* httpPost */])(data3, _this10.$api.sendCommand).then(function (res4) {
  420. if (res4.code == 200) {
  421. _this.dialogVisible = false;
  422. _this.$message.success("上报成功");
  423. }
  424. });
  425. } else {
  426. console.log(data);
  427. _this.$message.error("写卡错误,请检查读卡器是否正常!");
  428. }
  429. });
  430. }
  431. }
  432. });
  433. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-77e1b581","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/offInCard/offInCardOver.vue
  434. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"p-2"},[_c('zw',{ref:"mychild"}),_vm._v(" "),_c('div',{staticClass:"searvh"},[_c('el-select',{staticClass:"w-2 mb-2",attrs:{"placeholder":"请选择房源","clearable":"","size":"small"},on:{"change":function($event){return _vm.getRoomMethods(1)}},model:{value:(_vm.roomFirst),callback:function ($$v) {_vm.roomFirst=$$v},expression:"roomFirst"}},_vm._l((_vm.firstAuthList),function(item){return _c('el-option',{key:item.code,attrs:{"label":item.value,"value":item.code}})}),1),_vm._v(" "),_c('el-select',{staticClass:"w-2 mb-2",attrs:{"placeholder":"请选择楼宇","clearable":"","size":"small"},on:{"change":function($event){return _vm.getRoomMethods(2)}},model:{value:(_vm.roomSecond),callback:function ($$v) {_vm.roomSecond=$$v},expression:"roomSecond"}},_vm._l((_vm.secondAuthList),function(item){return _c('el-option',{key:item.code,attrs:{"label":item.value,"value":item.code}})}),1),_vm._v(" "),_c('el-select',{staticClass:"w-2 mb-2",attrs:{"placeholder":"请选择单元","clearable":"","size":"small"},on:{"change":function($event){return _vm.getRoomMethods(3)}},model:{value:(_vm.roomThree),callback:function ($$v) {_vm.roomThree=$$v},expression:"roomThree"}},_vm._l((_vm.threeAuthList),function(item){return _c('el-option',{key:item.code,attrs:{"label":item.value,"value":item.code}})}),1),_vm._v(" "),_c('el-select',{staticClass:"w-2 mb-2",attrs:{"placeholder":"请选择楼层","clearable":"","size":"small"},on:{"change":function($event){return _vm.getRoomMethods(4)}},model:{value:(_vm.roomFour),callback:function ($$v) {_vm.roomFour=$$v},expression:"roomFour"}},_vm._l((_vm.fourAuthList),function(item){return _c('el-option',{key:item.code,attrs:{"label":item.value,"value":item.code}})}),1),_vm._v(" "),_c('el-select',{staticClass:"w-2 mb-2",attrs:{"placeholder":"请选择房间","clearable":"","size":"small"},on:{"change":function($event){return _vm.getRoomMethods(5)}},model:{value:(_vm.roomFive),callback:function ($$v) {_vm.roomFive=$$v},expression:"roomFive"}},_vm._l((_vm.romeLockerList),function(item){return _c('el-option',{key:item.code,attrs:{"label":item.value,"value":item.code}})}),1),_vm._v(" "),_c('el-button',{staticClass:"mb-2",staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"type":"primary","clearable":"","size":"small"},nativeOn:{"click":function($event){return _vm.addNfc.apply(null, arguments)}}},[_vm._v("读卡")]),_vm._v(" "),_c('el-button',{staticClass:"mb-2",staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"type":"primary","clearable":"","size":"small"},on:{"click":_vm.showDialogMethods}},[_vm._v("写卡")])],1),_vm._v(" "),_c('div',[_c('el-table',{staticStyle:{"width":"100%"},attrs:{"data":_vm.tableData,"stripe":"","height":"600"}},[_c('el-table-column',{attrs:{"type":"index","width":"80","label":"序号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"cardNum","label":"卡号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"authName","label":"权限名称"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"startTime","label":"开始时间"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"endTime","label":"结束时间"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"useCount","label":"使用次数"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [(scope.row.useCount==255)?_c('span',[_vm._v(_vm._s(scope.row.useCountStr))]):_c('span',[_vm._v(_vm._s(scope.row.useCount))])]}}])}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"createTime","label":"创建时间"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"useCount","label":"操作"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('span',{on:{"click":function($event){return _vm.deleteCardMethods(scope.$index,scope.row)}}},[_vm._v("删除")])]}}])})],1)],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"发放离线卡","visible":_vm.dialogVisible,"width":"50%"},on:{"update:visible":function($event){_vm.dialogVisible=$event}}},[_c('div',{staticClass:"formdata"},[_c('el-date-pic
  435. var staticRenderFns = []
  436. var esExports = { render: render, staticRenderFns: staticRenderFns }
  437. /* harmony default export */ var offInCard_offInCardOver = (esExports);
  438. // CONCATENATED MODULE: ./src/views/offInCard/offInCardOver.vue
  439. function injectStyle (ssrContext) {
  440. __webpack_require__("ktVO")
  441. }
  442. var normalizeComponent = __webpack_require__("VU/8")
  443. /* script */
  444. /* template */
  445. /* template functional */
  446. var __vue_template_functional__ = false
  447. /* styles */
  448. var __vue_styles__ = injectStyle
  449. /* scopeId */
  450. var __vue_scopeId__ = "data-v-77e1b581"
  451. /* moduleIdentifier (server only) */
  452. var __vue_module_identifier__ = null
  453. var Component = normalizeComponent(
  454. offInCardOver,
  455. offInCard_offInCardOver,
  456. __vue_template_functional__,
  457. __vue_styles__,
  458. __vue_scopeId__,
  459. __vue_module_identifier__
  460. )
  461. /* harmony default export */ var views_offInCard_offInCardOver = __webpack_exports__["default"] = (Component.exports);
  462. /***/ }),
  463. /***/ "ktVO":
  464. /***/ (function(module, exports) {
  465. // removed by extract-text-webpack-plugin
  466. /***/ })
  467. });