1 |
- webpackJsonp([68],{GJM8:function(e,t){},Vx02:function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});l("jAcA");var o=l("86U2"),s=(l("4yKu"),l("wolx")),i=(l("UuFX"),l("J1XP")),r=(l("yIEv"),l("OIh9")),a=l("dOd5"),n=l("7+uW");n.a.use(r.a),n.a.use(o.a).use(s.a).use(i.a);var c={name:"role_user_list",components:{EmployeeSelector:a.a},data:function(){return{bar_height:0,title:"角色管理",list:[],filter:{role_id:"",page:1,page_size:20},employee_not_select:[],select_user:{dept:[],employee:[]},select_user1:{dept:[],employee:[]},show_dept_selector1:!1,show_dept_selector:!1,role_name:"",role_list:[],showTip:!1,founder:[],user_info:this.$userInfo(),deptManagerId:0,isload:!0}},watch:{"filter.role_id":function(e){var t=this;e&&(this.role_name=this.role_list.find(function(t){return t.id==e}).name,this.$toast.loading({message:"正在加载"}),this.refresh(function(){t.$toast.clear()}))}},methods:{ScopeGet:function(){var e=this,t=this,l=this.$refs.employee_selector.employee_selected,o=this.$refs.employee_selector1.employee_selected;this.$toast.loading({message:"正在处理"});var s={employee_id:l[0],id:o};this.$axiosUser("post","/api/pro/employee/scope",s).then(function(l){t.$toast.clear(),1==l.data.code?(t.$toast("保存成功"),e.$refs.employee_selector.close(),e.$refs.employee_selector1.close(),e.$refs.my_scroller.triggerPullToRefresh()):t.$toast(l.data.msg)}).catch(function(e){t.$toast.clear()})},delete_employee:function(){var e=this,t=this.$refs.employee_selector.employee_selected;t.length>0&&this.$axiosUser("delete","/api/pro/role/user",{role_id:this.filter.role_id,employee_id:t[0]}).then(function(t){e.$toast.clear(),1==t.data.code?e.show_dept_selector1=!1:e.$toast(t.data.msg)})},add_confirm:function(){var e=this,t=this.$refs.employee_selector.employee_selected;if(0==t.length)return this.$toast("请选择人员"),!1;this.$toast.loading({message:"正在处理"}),this.$axiosUser("put","/api/pro/role/user",{role_id:this.filter.role_id,employee_id:t[0]}).then(function(l){e.$toast.clear(),1==l.data.code?(e.$toast.success("添加成功"),e.founder.push(t[0]),e.show_dept_selector1=!0):e.$toast(l.data.msg)})},add_user:function(){this.show_dept_selector=!0},get_role_list:function(){var e=this,t=this;this.$toast.loading({message:"正在加载"}),this.$axiosUser("get","/api/pro/role/list").then(function(l){1==l.data.code&&(t.role_list=l.data.data.list,t.role_list.forEach(function(t){"dept_manager"==t.code&&(e.deptManagerId=t.id)}),t.filter.role_id=l.data.data.list.find(function(e){return"admin"==e.name}).id,t.get_list(done)),t.$toast.clear()}).catch(function(e){})},get_list:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},l=this;if(!l.filter.role_id)return t(),!1;this.$axiosUser("get","/api/pro/role/user",l.filter).then(function(o){if(1==o.data.code){t();var s=o.data.data.list;e.isload=!(s.length<20),1===l.filter.page?e.list=s:e.list=e.list.concat(s);var i=[];for(var r in e.list)i.push(e.list[r].id);i.push(l.user_info.company_info.creator_id),e.employee_not_select=i,e.founder=[],e.founder.push(l.user_info.company_info.creator_id),e.$refs.my_scroller.finishInfinite(s.length<e.filter.page_size)}else e.$refs.my_scroller.finishInfinite(!0)})},refresh:function(e){var t=this;this.filter.page=1,this.get_list(function(){t.list=[],e()})},infinite:function(e){this.isload?(this.filter.page++,this.get_list(e)):e()},detail:function(e){this.$router.push({name:"edit_user_power",query:{id:e.id,role_id:this.filter.role_id}})}},created:function(){this.get_role_list()},mounted:function(){window.plus&&(this.bar_height=window.plus.navigator.getStatusbarHeight())}},d={render:function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{staticClass:"role_user_list_box"},[l("van-nav-bar",{attrs:{title:"角色管理","left-text":"返回","left-arrow":""},on:{"click-left":e.$route_back,"click-right":function(t){e.showTip=!0}}},[l("template",{slot:"right"},[l("van-icon",{attrs:{name:"question-o"}})],1)],2),e._v(" "),l("van-tabs",{model:{value:e.filter.role_id,callback:function(t){e.$set(e.filter,"role_id",t)},expression:"filter.role_id"}},e._l(e.role_list,function(t,o){return"creator"!=t.code&&"employee"!=t.code?l("van-tab",{key:o,attrs:{title:t.name,name:t.id}}):e._e()}),1),e._v(" "),l("div",{staticClass:"body_com has_header"},[l("scroller",{ref:"my_scroller",attrs:{list:e.list,"on-refresh":e.refresh,"on-infinite":e.infinite}},[l("noData",{directives:[{name:"show",rawName:"v-show",value:0==e.list.length,expression:"list.length == 0"}],attrs:{list:e.list}}),e._v(" "),l("van-cell-group",{directives:[{name:"show",rawName:"v-show",value:e.list.length>0,expression:"list.length > 0"}]},e._l(e.list,function(t,o){return l("van-cell",{key:o,staticClass:"task_list",attrs:{title:t.name},on:{click:function(l){return e.detail(t)}}},[l("template",{slot:"icon"},[l("userImage",{staticClass:"user_image",attrs:{user_name:t.name,id:t.id}})],1)],2)}),1)],1)],1),e._v(" "),l("van-popup",{staticStyle:{width:"100vw",height:"100vh"},attrs:{position:"right"},model:{value:e.showTip,callback:function(t){e.showTip=t},expression:"showTip"}},[l("div",{style:"padding-top:"+e.bar_height+"px;background-color: #26A2FF;"}),e._v(" "),l("van-nav-bar",{attrs:{title:"角色权限","left-text":"返回","left-arrow":""},on:{"click-left":function(t){e.showTip=!1}}}),e._v(" "),l("div",{staticClass:"popup_com has_header"},[l("scroller",[l("van-cell-group",{attrs:{border:!1}},[l("van-cell",{attrs:{border:!1,title:"系统共有5种角色",label:"功道云积分系统共有5种角色,不同角色拥有不同的权限","title-class":"popup_title","label-color":"popup_label"}}),e._v(" "),l("van-cell",{attrs:{border:!1,title:"积分主管理员",label:"积分主管理员为默认角色,拥有所有管理权限和功能权限","title-class":"popup_title","label-color":"popup_label"}}),e._v(" "),l("van-cell",{attrs:{border:!1,title:"公司管理员",label:"公司管理员一般为合伙人、股东等高级管理人员,可管理多个部门人员","title-class":"popup_title","label-color":"popup_label"}}),e._v(" "),l("van-cell",{attrs:{border:!1,title:"积分专员",label:"积分专员一般为人事、行政等管理督办人员,可管理多个部门人员","title-class":"popup_title","label-color":"popup_label"}}),e._v(" "),l("van-cell",{attrs:{border:!1,title:"部门管理员",label:"部门管理员一般为部门/团队经理、主管、组长,可管理对应部门人员","title-class":"popup_title","label-color":"popup_label"}}),e._v(" "),l("van-cell",{attrs:{border:!1,title:"员工",label:"员工为默认角色,每个人都拥有员工角色的功能权限,该角色不可修改","title-class":"popup_title","label-color":"popup_label"}})],1)],1)],1)],1),e._v(" "),e.filter.role_id!=e.deptManagerId?l("div",{staticStyle:{"background-color":"#fff",padding:"0.2rem 0.32rem 0.44rem 0.32rem"}},[e.filter.role_id>0?l("van-button",{attrs:{block:"",type:"info"},on:{click:e.add_user}},[e._v("添加"+e._s(e.role_name))]):e._e()],1):e._e(),e._v(" "),l("EmployeeSelector",{ref:"employee_selector",attrs:{employee_not_select:e.employee_not_select,can_select_employee:!0,can_select_dept:!1,visible:e.show_dept_selector,selected:e.select_user,position:"right",multi:!1},on:{"update:visible":function(t){e.show_dept_selector=t},"update:selected":function(t){e.select_user=t},confirm:e.add_confirm}},[l("van-nav-bar",{attrs:{slot:"nav",title:"选择人员","left-text":"返回","left-arrow":""},on:{"click-left":function(t){e.show_dept_selector=!1}},slot:"nav"}),e._v(" "),l("div",{staticStyle:{padding:"0.32rem","background-color":"#fff",position:"fixed",bottom:"0",left:"0",right:"0","z-index":"2","border-top":"1px solid #f1f1f1"},attrs:{slot:"footer"},slot:"footer"},[l("van-button",{attrs:{block:"",type:"info"},on:{click:e.add_confirm}},[e._v("下一步")])],1)],1),e._v(" "),l("EmployeeSelector",{ref:"employee_selector1",attrs:{can_select_employee:!0,can_select_dept:!1,employee_not_select:e.founder,selected:e.select_user1,visible:e.show_dept_selector1,position:"right",multi:!0},on:{"update:selected":function(t){e.select_user1=t},"update:visible":function(t){e.show_dept_selector1=t},confirm:e.add_confirm}},[l("van-nav-bar",{attrs:{slot:"nav",title:"设置管理范围","left-text":"返回","left-arrow":""},on:{"click-left":e.delete_employee},slot:"nav"}),e._v(" "),l("div",{staticStyle:{padding:"0.32rem","background-color":"#fff",position:"fixed",bottom:"0",left:"0",right:"0","z-index":"2","border-top":"1px solid #f1f1f1"},attrs:{slot:"footer"},slot:"footer"},[l("van-button",{attrs:{block:"",type:"info"},on:{click:e.ScopeGet}},[e._v("完成")])],1)],1)],1)},staticRenderFns:[]};var _=l("VU/8")(c,d,!1,function(e){l("GJM8")},"data-v-aa84898e",null);t.default=_.exports}});
|