1 |
- webpackJsonp([45],{DYWK:function(e,t){},"GcG/":function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});l("jAcA");var o=l("86U2"),s=(l("4yKu"),l("wolx")),a=(l("UuFX"),l("J1XP")),i=(l("yIEv"),l("OIh9")),r=l("CC1l"),n=l("7+uW"),c=l("vLgD"),_=l("EdRh");n.a.use(i.a),n.a.use(o.a).use(s.a).use(a.a);var d={name:"role_user_list",components:{EmployeeSelector:r.a,userImage:_.a},data:function(){return{bar_height:0,title:"角色管理",list:[],filter:{role_id:3},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:{}}},watch:{"filter.role_id":function(e){var t=this;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};Object(c.a)({url:"/api/employee/scope",method:"post",data: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(),t.$toast(e.data.msg)})},delete_employee:function(){var e=this,t=this.$refs.employee_selector.employee_selected;t.length>0&&c.a.delete("/api/role/user",{data:{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:"正在处理"}),Object(c.a)({url:"/api/role/user",method:"put",data:{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;this.$toast.loading({message:"正在加载"}),Object(c.a)({url:"/api/role/list",method:"get",data:{}}).then(function(t){1==t.data.code&&(e.role_list=t.data.data.list,e.filter.role_id=t.data.data.list.find(function(e){return"admin"==e.name}).id,e.get_list(done)),e.$toast.clear()}).catch(function(e){})},get_list:function(e){var t=this,l=this;Object(c.a)({url:"/api/role/user",method:"get",params:l.filter}).then(function(o){if(e(),1==o.data.code){t.list=o.data.data.list;var s=[];for(var a in t.founder=[],t.list)s.push(t.list[a].id);s.push(l.user_info.data.company_info.creator_id),t.founder.push(l.user_info.data.company_info.creator_id),t.employee_not_select=s}})},refresh:function(e){var t=this;this.get_list(function(){t.list=[],e()})},infinite:function(e){this.get_list(e)},detail:function(e){this.$router.push({name:"edit_user_power",query:{id:e.id,role_id:this.filter.role_id}})}},mounted:function(){this.get_role_list(),window.plus?(this.bar_height=window.plus.navigator.getStatusbarHeight(),this.user_info=JSON.parse(plus.storage.getItem("user_info"))):this.user_info=JSON.parse(localStorage.getItem("user_info"))},keep_alive_update:{}},p={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}},[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:{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:"角色有五种,分别为超管、部门管理员、积分专员、公司管理员,员工","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(" "),l("div",{staticStyle:{padding:"0.32rem","background-color":"#fff"}},[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._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:"absolute",bottom:"0",left:"0",right:"0","z-index":"2"},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:"absolute",bottom:"0",left:"0",right:"0","z-index":"2"},attrs:{slot:"footer"},slot:"footer"},[e._v("\n "+e._s(e.founder)+"\n "),l("van-button",{attrs:{block:"",type:"info"},on:{click:e.ScopeGet}},[e._v("完成")])],1)],1)],1)},staticRenderFns:[]};var u=l("VU/8")(d,p,!1,function(e){l("DYWK")},"data-v-ba34f01c",null);t.default=u.exports}});
|