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

451 lines
15 KiB

  1. webpackJsonp([30],{
  2. /***/ "K/kD":
  3. /***/ (function(module, exports) {
  4. // removed by extract-text-webpack-plugin
  5. /***/ }),
  6. /***/ "dlid":
  7. /***/ (function(module, exports) {
  8. // removed by extract-text-webpack-plugin
  9. /***/ }),
  10. /***/ "wgqa":
  11. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12. "use strict";
  13. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14. // EXTERNAL MODULE: ./node_modules/babel-runtime/core-js/json/stringify.js
  15. var stringify = __webpack_require__("mvHQ");
  16. var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
  17. // EXTERNAL MODULE: ./src/api/index.js + 5 modules
  18. var api = __webpack_require__("gyMJ");
  19. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/bindingRoles.vue
  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. /* harmony default export */ var bindingRoles = ({
  106. inject: ['reload'],
  107. name: "basetable",
  108. data: function data() {
  109. return {
  110. selectoption: [],
  111. selectoptionValue: '',
  112. defaultkeys: [],
  113. query: {
  114. address: "",
  115. name: "",
  116. pageIndex: 1,
  117. pageSize: 5,
  118. options: [{
  119. value: "xaxqgy",
  120. label: "雄安新区XXX公寓",
  121. children: []
  122. }]
  123. },
  124. radio: 1,
  125. treedata: [],
  126. defaultProps: {
  127. children: "children",
  128. label: "label"
  129. },
  130. options: [{
  131. value: "选项1",
  132. label: "超级系统管理员"
  133. }, {
  134. value: "选项2",
  135. label: "业务员"
  136. }],
  137. value: "",
  138. tableData: [],
  139. multipleSelection: [],
  140. delList: [],
  141. editVisible: false,
  142. editVisible1: false,
  143. pageTotal: 0,
  144. form: {},
  145. form1: {},
  146. idx: -1,
  147. id: -1,
  148. tableRowClassName: "",
  149. selectedstyle: "",
  150. pageNum: 1,
  151. userInfo: {
  152. type: ''
  153. }
  154. };
  155. },
  156. created: function created() {
  157. this.userInfo = JSON.parse(localStorage.getItem('info'));
  158. this.getUserID();
  159. this.getUserList();
  160. this.selectoption = JSON.parse(localStorage.getItem('selectoption'));
  161. this.selectoptionValue = localStorage.getItem('tenantId');
  162. },
  163. methods: {
  164. selectTenantId: function selectTenantId(e) {
  165. localStorage.setItem('tenantId', e);
  166. this.reload();
  167. },
  168. // 勾选角色
  169. handleCheckChange: function handleCheckChange() {
  170. var authoritieslist = this.$refs.tree.getCheckedNodes();
  171. var authorities = [];
  172. for (var i in authoritieslist) {
  173. // 判断子节点是否存在子节点 如果存在直接请求并且提示 false
  174. if (!authoritieslist[i].hasOwnProperty("children")) {
  175. // 判断是否只选择一个 如果存在直接请求并且提示 false
  176. authoritieslist.map(function (li) {
  177. authorities.push(li.id);
  178. });
  179. this.authorities = authorities;
  180. // if (authoritieslist.length == 1) {
  181. // console.log(authoritieslist);
  182. // } else {
  183. // this.$message.error("只选择一个节点");
  184. // this.$refs.tree.setCheckedKeys([]);
  185. // return
  186. // }
  187. } else {
  188. this.$message.error("只能选择当前分类最后的子分类");
  189. this.$refs.tree.setCheckedKeys([]);
  190. return;
  191. }
  192. }
  193. },
  194. // 用户绑定角色
  195. bindUser: function bindUser() {
  196. var _this = this;
  197. var data = {
  198. userId: this.userId,
  199. roleIds: this.authorities || []
  200. };
  201. Object(api["g" /* httpPost */])(data, this.$api.bindRole).then(function (res) {
  202. if (res.success) {
  203. _this.$message.success('添加成功');
  204. } else {
  205. _this.$message.error('添加失败');
  206. }
  207. });
  208. },
  209. // 获取用户列表
  210. getUserList: function getUserList() {
  211. var _this2 = this;
  212. var info = localStorage.getItem('info');
  213. var q = {};
  214. if (JSON.parse(info).type == 0) {
  215. q = {
  216. username: this.query.name
  217. };
  218. } else {
  219. q = {
  220. username: this.query.name,
  221. enterpriseId: JSON.parse(info).enterpriseId
  222. };
  223. }
  224. var data = {
  225. q: stringify_default()(q),
  226. pageNum: this.pageNum,
  227. pageSize: 5
  228. };
  229. Object(api["d" /* httpGet */])(data, this.$api.getUserList).then(function (res) {
  230. if (res.success) {
  231. var dt = res.data.list;
  232. dt.map(function (li, index) {
  233. li.index = "";
  234. li.index = index;
  235. });
  236. _this2.tableData = dt;
  237. _this2.pageTotal = res.data.total;
  238. } else {
  239. _this2.$message.error('获取失败');
  240. }
  241. });
  242. },
  243. // 获取角色id
  244. getUserID: function getUserID() {
  245. var _this3 = this;
  246. var data = {
  247. pageNum: 1,
  248. pageSize: 100
  249. };
  250. Object(api["d" /* httpGet */])(data, this.$api.getRoleList).then(function (res) {
  251. var obj = [];
  252. res.data.list.map(function (li) {
  253. var str = {
  254. id: li.id,
  255. label: li.name
  256. };
  257. obj.push(str);
  258. });
  259. _this3.treedata = obj;
  260. });
  261. },
  262. handleChange: function handleChange(value) {
  263. console.log(value);
  264. },
  265. // 触发搜索按钮
  266. handleSearch: function handleSearch() {
  267. this.$set(this.query, "pageIndex", 1);
  268. this.$store.commit('increment', 1);
  269. this.getData();
  270. },
  271. getData: function getData() {
  272. var _this4 = this;
  273. var info = localStorage.getItem('info');
  274. var q = {};
  275. if (JSON.parse(info).type == 0) {
  276. q = {
  277. username: this.query.name
  278. };
  279. } else {
  280. q = {
  281. username: this.query.name,
  282. enterpriseId: JSON.parse(info).enterpriseId
  283. };
  284. }
  285. var data = {
  286. q: stringify_default()(q),
  287. pageNum: this.pageNum,
  288. pageSize: 5
  289. };
  290. Object(api["d" /* httpGet */])(data, this.$api.getUserList).then(function (res) {
  291. var dt = res.data.list;
  292. dt.map(function (li, index) {
  293. li.index = "";
  294. li.index = index;
  295. });
  296. _this4.$store.commit('increment', 1);
  297. _this4.tableData = dt;
  298. _this4.pageTotal = res.data.total;
  299. });
  300. },
  301. // 删除操作
  302. handleDelete: function handleDelete(index) {
  303. var _this5 = this;
  304. // 二次确认删除
  305. this.$confirm("确定要删除吗?", "提示", {
  306. type: "warning"
  307. }).then(function () {
  308. _this5.$message.success("删除成功");
  309. _this5.tableData.splice(index, 1);
  310. }).catch(function () {});
  311. },
  312. // 多选操作
  313. handleSelectionChange: function handleSelectionChange(val) {
  314. this.getIndex = val.index;
  315. this.userId = val.id;
  316. this.getroleId(val.id);
  317. },
  318. getroleId: function getroleId(id) {
  319. var _this6 = this;
  320. var data = {
  321. userId: id
  322. };
  323. Object(api["d" /* httpGet */])(data, this.$api.getRolesByUser).then(function (res) {
  324. if (res.success) {
  325. if (res.data.length > 0) {
  326. var defaultkeys = [];
  327. _this6.$refs.tree.setCheckedKeys([]);
  328. res.data.map(function (li) {
  329. defaultkeys.push(li.id);
  330. });
  331. // defaultkeys.push(res.data[0].id)
  332. console.log(defaultkeys);
  333. _this6.defaultkeys = defaultkeys;
  334. } else {
  335. _this6.defaultkeys = [];
  336. _this6.$refs.tree.setCheckedKeys([]);
  337. }
  338. } else {
  339. _this6.$message.error('获取失败');
  340. }
  341. });
  342. },
  343. delAllSelection: function delAllSelection() {
  344. var length = this.multipleSelection.length;
  345. var str = "";
  346. this.delList = this.delList.concat(this.multipleSelection);
  347. for (var i = 0; i < length; i++) {
  348. str += this.multipleSelection[i].name + " ";
  349. }
  350. this.$message.error("\u5220\u9664\u4E86" + str);
  351. this.multipleSelection = [];
  352. },
  353. // 编辑操作
  354. handleEdit: function handleEdit(index, row) {
  355. this.idx = index;
  356. this.form = row;
  357. this.editVisible = true;
  358. },
  359. // 保存编辑
  360. saveEdit: function saveEdit() {
  361. this.editVisible = false;
  362. this.$message.success("\u4FEE\u6539\u7B2C " + (this.idx + 1) + " \u884C\u6210\u529F");
  363. this.$set(this.tableData, this.idx, this.form);
  364. },
  365. // 编辑操作
  366. handleEdit1: function handleEdit1() {
  367. this.editVisible1 = true;
  368. },
  369. // 保存编辑
  370. saveEdit1: function saveEdit1() {
  371. this.editVisible1 = false;
  372. },
  373. // 分页导航
  374. handlePageChange: function handlePageChange(val) {
  375. this.pageNum = val;
  376. this.getUserList(val);
  377. }
  378. }
  379. });
  380. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-58fbb739","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/bindingRoles.vue
  381. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-row',{staticStyle:{"background":"#fff","padding":"20px"},attrs:{"gutter":20}},[_c('el-col',{attrs:{"span":12}},[_c('div',{staticStyle:{"margin-bottom":"20px"}},[_c('selectoption'),_vm._v(" "),_c('el-input',{staticClass:"handle-input mr10",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-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"type":"primary","size":"small","icon":"el-icon-search"},on:{"click":_vm.handleSearch}},[_vm._v("搜索")])],1),_vm._v(" "),_c('div',{staticClass:"container"},[_c('el-table',{ref:"multipleTable",staticClass:"table",attrs:{"data":_vm.tableData,"border":"","highlight-current-row":"","header-cell-class-name":"table-header"},on:{"row-click":_vm.handleSelectionChange}},[_c('el-table-column',{attrs:{"prop":"id","label":"ID","width":"55","align":"center"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"username","label":"登录账号"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"type","label":"分类"}}),_vm._v(" "),_c('el-table-column',{attrs:{"label":"操作","width":"180","align":"center"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('el-button',{attrs:{"type":"text","icon":"el-icon-edit"},on:{"click":function($event){return _vm.handleEdit(scope.$index, scope.row)}}},[_vm._v("编辑")]),_vm._v(" "),_c('el-button',{staticClass:"red",attrs:{"type":"text","icon":"el-icon-delete"},on:{"click":function($event){return _vm.handleDelete(scope.$index, scope.row)}}},[_vm._v("\n 删除")])]}}])})],1),_vm._v(" "),_c('div',{staticClass:"pagination"},[_c('el-pagination',{attrs:{"background":"","layout":"total, prev, pager, next","current-page":_vm.query.pageIndex,"page-size":_vm.query.pageSize,"total":_vm.pageTotal},on:{"current-change":_vm.handlePageChange}})],1)],1)]),_vm._v(" "),_c('el-col',{attrs:{"span":12}},[_c('div',{staticClass:"prever"},[_c('el-button',{staticStyle:{"background":"#FA8E00","border":"none"},attrs:{"type":"primary","size":"small"},on:{"click":_vm.bindUser}},[_vm._v("保存设置")])],1),_vm._v(" "),_c('div',{staticClass:"treediv"},[_c('el-tree',{ref:"tree",attrs:{"data":_vm.treedata,"default-checked-keys":_vm.defaultkeys,"show-checkbox":"","node-key":"id","default-expand-all":"","props":_vm.defaultProps},on:{"check":_vm.handleCheckChange}})],1)])],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"编辑","width":"30%"},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.editVisible = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.saveEdit}},[_vm._v("确 定")])],1)]},proxy:true}]),model:{value:(_vm.editVisible),callback:function ($$v) {_vm.editVisible=$$v},expression:"editVisible"}},[_c('el-form',{ref:"form",attrs:{"model":_vm.form,"label-width":"70px"}},[_c('el-form-item',{attrs:{"label":"用户名"}},[_c('el-input',{attrs:{"clearable":true},model:{value:(_vm.form.name),callback:function ($$v) {_vm.$set(_vm.form, "name", $$v)},expression:"form.name"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"类型"}},[_c('el-input',{attrs:{"clearable":true},model:{value:(_vm.form.address),callback:function ($$v) {_vm.$set(_vm.form, "address", $$v)},expression:"form.address"}})],1)],1)],1),_vm._v(" "),_c('el-dialog',{attrs:{"title":"编辑","width":"30%"},scopedSlots:_vm._u([{key:"footer",fn:function(){return [_c('span',{staticClass:"dialog-footer"},[_c('el-button',{on:{"click":function($event){_vm.editVisible1 = false}}},[_vm._v("取 消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.saveEdit1}},[_vm._v("确 定")])],1)]},proxy:true}]),model:{value:(_vm.editVisible1),callback:function ($$v) {_vm.editVisible1=$$v},expression:"editVisible1"}},[_c('el-form',{ref:"form",attrs:{"model":_vm.form1,"labe
  382. var staticRenderFns = []
  383. var esExports = { render: render, staticRenderFns: staticRenderFns }
  384. /* harmony default export */ var views_bindingRoles = (esExports);
  385. // CONCATENATED MODULE: ./src/views/bindingRoles.vue
  386. function injectStyle (ssrContext) {
  387. __webpack_require__("K/kD")
  388. __webpack_require__("dlid")
  389. }
  390. var normalizeComponent = __webpack_require__("VU/8")
  391. /* script */
  392. /* template */
  393. /* template functional */
  394. var __vue_template_functional__ = false
  395. /* styles */
  396. var __vue_styles__ = injectStyle
  397. /* scopeId */
  398. var __vue_scopeId__ = "data-v-58fbb739"
  399. /* moduleIdentifier (server only) */
  400. var __vue_module_identifier__ = null
  401. var Component = normalizeComponent(
  402. bindingRoles,
  403. views_bindingRoles,
  404. __vue_template_functional__,
  405. __vue_styles__,
  406. __vue_scopeId__,
  407. __vue_module_identifier__
  408. )
  409. /* harmony default export */ var src_views_bindingRoles = __webpack_exports__["default"] = (Component.exports);
  410. /***/ })
  411. });