chunk-f38d.b084673c.js 15 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-f38d"],{"/9tK":function(t,e,a){"use strict";var i=a("86rT");a.n(i).a},"0P/s":function(t,e,a){"use strict";var i=a("1roJ");a.n(i).a},"1roJ":function(t,e,a){},"86rT":function(t,e,a){},Cl1D:function(t,e,a){},LZUc:function(t,e,a){},MUpt:function(t,e,a){"use strict";var i=a("NAwf");a.n(i).a},NAwf:function(t,e,a){},heIN:function(t,e,a){"use strict";var i=a("LZUc");a.n(i).a},shFe:function(t,e,a){"use strict";a.r(e);var i=a("3vhb"),n=a("FyfS"),s=a.n(n),o=a("P2sY"),c=a.n(o),r=a("14Xm"),l=a.n(r),d=a("D3Ub"),u=a.n(d),_={name:"department_item",props:{root:{type:Object,default:{}},paddingLeft:{type:Number,default:12},checkboxIds:{type:Object,default:{}},department_is_add:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},department_is_click:{type:Boolean,default:!1}},data:function(){return{open:!1}},created:function(){},methods:{choiceDepartment:function(t){t.clientX?this.$emit("choiceDepartment",this.root):this.$emit("choiceDepartment",t)},handClick:function(){this.department_is_click?this.$emit("choiceDepartment",this.root):this.open=!this.open}}},p=(a("0P/s"),a("KHd+")),h=Object(p.a)(_,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"department_item",class:[t.checkboxIds.hasOwnProperty(t.root.id)&&t.department_is_click?"checkbox":""],style:{paddingLeft:t.paddingLeft+"px"},on:{click:t.handClick}},[a("i",{staticClass:"iconfont icon-ht_more_bottom",class:[1==t.open?"open":"",t.root.has_one_sub_department?"":"opacity0"],on:{click:function(e){e.stopPropagation(),t.open=!t.open}}}),t._v(" "),a("i",{staticClass:"iconfont icon-wenjianjia"}),t._v(" "),a("div",{staticClass:"text"},[t._v(t._s(t.root.name))]),t._v(" "),t.department_is_add?[t.checkboxIds.hasOwnProperty(t.root.id)?a("i",{staticClass:"iconfont icon-all_xuanze",on:{click:function(t){t.stopPropagation()}}}):a("i",{staticClass:"iconfont icon-life-game-plus",on:{click:function(e){return e.stopPropagation(),t.choiceDepartment(e)}}})]:t._e()],2),t._v(" "),t.open?[t._l(t.root.has_one_sub_department,function(e,i){return[a("department_item",{key:i,attrs:{paddingLeft:t.paddingLeft+30,root:e,checkboxIds:t.checkboxIds,department_is_add:t.department_is_add,multiple:t.multiple,department_is_click:t.department_is_click},on:{choiceDepartment:t.choiceDepartment}})]})]:t._e()],2)},[],!1,null,"4a17db80",null);h.options.__file="department_item.vue";var f=[],m=null;var v={components:{department_item:h.exports,staff_item:a("PdEq").a},props:{department_is_add:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},department_is_click:{type:Boolean,default:!1},search_name:{type:String,default:""},choice_obj:{type:Object,default:function(){return{data:[],staff:!0,department:!0}}}},data:function(){return{department_list:[],departmentArr:[],checkboxIds:{}}},created:function(){var t=this;return u()(l.a.mark(function e(){return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:0==t.choice_obj_computed.data.length?t.choice_obj_computed.department&&t.getDepartmentList():t.department_list=t.choice_obj_computed.data;case 1:case"end":return e.stop()}},e,t)}))()},watch:{search_name:function(t,e){var a=this;m&&clearTimeout(m),""!=t?m=setTimeout(function(){a.search()},500):this.departmentArr=[]}},computed:{choice_obj_computed:function(){return c()({data:[],staff:!0,department:!0},this.choice_obj)}},methods:{choiceData:function(t){0==this.multiple&&(this.checkboxIds={}),this.$set(this.checkboxIds,t.id,t),this.$emit("choiceData",this.checkboxIds)},delChoiceData:function(t){this.$delete(this.checkboxIds,t),this.$emit("choiceData",this.checkboxIds)},search:function(){f=[],function t(e,a){var i=!0;var n=!1;var o=void 0;try{for(var c,r=s()(a);!(i=(c=r.next()).done);i=!0){var l=c.value;l.name.indexOf(e)>=0&&f.push(l),l.has_one_sub_department&&l.has_one_sub_department.length>0&&t(e,l.has_one_sub_department)}}catch(t){n=!0,o=t}finally{try{!i&&r.return&&r.return()}finally{if(n)throw o}}}(this.search_name,this.department_list),this.departmentArr=f},getDepartmentList:function(){var t=this;return u()(l.a.mark(function e(){var a;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$http.pc_get("admin/getDepatmemtList",{});case 2:1===(a=e.sent).result&&(t.department_list=a.data.list,t.$emit("initDepartmentList",t.department_list[0]));case 4:case"end":return e.stop()}},e,t)}))()}}},b=(a("MUpt"),Object(p.a)(v,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"department"},[""==t.search_name?[t._l(t.department_list,function(e){return[a("department_item",{key:e.id,attrs:{root:e,checkboxIds:t.checkboxIds,department_is_add:t.department_is_add,multiple:t.multiple,department_is_click:t.department_is_click},on:{choiceDepartment:t.choiceData}})]})]:t._e(),t._v(" "),""!=t.search_name?[t._l(t.departmentArr,function(e,i){return[a("department_item",{key:i,attrs:{root:e,checkboxIds:t.checkboxIds,department_is_add:t.department_is_add,multiple:t.multiple,department_is_click:t.department_is_click},on:{choiceDepartment:t.choiceData}})]})]:t._e()],2)},[],!1,null,"e1a44eaa",null));b.options.__file="choice_department.vue";var g=b.exports,k=(a("vDqi"),{data:function(){return{}},props:{dialogVisible:{type:Boolean,default:!1},link:{type:Object,default:function(){return{code_url:"",ticket_url:""}}}},mounted:function(){},methods:{copyLink:function(t){if(""==t)this.$message.error("链接内容为空");else{var e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("Copy"),document.body.removeChild(e),this.$message.success("复制成功")}},close:function(){this.$emit("closeDialog")},downloadCode:function(t){var e=this;return u()(l.a.mark(function a(){var i,n,s,o;return l.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(i="",n="","h5"!==t){a.next=8;break}if(i="二维码",n=e.link.qr_code){a.next=8;break}return e.$message({message:"请检查二维码",type:"error"}),a.abrupt("return");case 8:if("mini"!==t){a.next=14;break}if(i="小程序码",n=e.link.mini_code){a.next=14;break}return e.$message({message:"请检查小程序码",type:"error"}),a.abrupt("return");case 14:s=e.findCharIndex(n,"/",3),n=window.location.protocol+"//"+window.location.host+n.slice(s),(o=new Image).src=n,o.setAttribute("crossOrigin","anonymous"),o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0,t.width,t.height),t.toBlob(function(t){var e=window.URL.createObjectURL(t),a=document.createElement("a");a.href=e,a.download=i,a.remove(),a.click(),URL.revokeObjectURL(n)})};case 20:case"end":return a.stop()}},a,e)}))()},findCharIndex:function(t,e,a){for(var i=t.indexOf(e),n=0;n<a-1;n++)i=t.indexOf(e,i+1);return i},toUrl:function(){window.location.href=this.link.ticket_url}},components:{}}),w=(a("vZTm"),Object(p.a)(k,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-dialog",{attrs:{title:"链接",visible:t.dialogVisible,width:"30%","before-close":t.close},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{staticClass:"content"},[a("div",{staticClass:"download-img"},[a("div",{staticClass:"code"},[t.link.code_url?a("img",{attrs:{src:t.link.code_url,alt:""}}):a("div",{staticClass:"image-error"},[t._v("加载失败")]),t._v(" "),a("div",{staticClass:"down-load",on:{click:function(e){t.downloadCode("h5")}}},[t._v("\n 下载二维码图片\n ")])])]),t._v(" "),a("div",{staticClass:"link"},[a("div",{staticClass:"applet-link"},[a("span",{staticStyle:{"margin-right":"4px"}},[t._v("链接")]),t._v(" "),a("el-input",{staticStyle:{width:"50%",padding:"0 5px"},attrs:{spellcheck:"“false”",disabled:""},model:{value:t.link.ticket_url,callback:function(e){t.$set(t.link,"ticket_url",e)},expression:"link.ticket_url"}}),t._v(" "),a("el-button",{on:{click:function(e){t.copyLink(t.link.ticket_url)}}},[t._v("复制链接")])],1)]),t._v(" "),a("p",{staticClass:"tips"},[a("i",{staticClass:"el-icon-warning"}),t._v("受企业微信隐私政策影响,如同步员工数据后,无法获取员工手机、邮箱、地址等私密数据,需要员工扫描上述二维码或者点击上述链接,进行授权,才可以正常获取私密数据")])]),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.close}},[t._v(" 取 消")])],1)])],1)},[],!1,null,"15d35452",null));w.options.__file="link_dialog.vue";var C=w.exports,x="",y="",D="",L="",$={components:{staff_side:i.a,choice_department:g,LinkDialog:C},data:function(){return{search_status_arr:[{value:"-1",label:"企业微信状态"},{value:"0",label:"未关联"},{value:"1",label:"已激活"},{value:"2",label:"已禁用"},{value:"4",label:"未激活"},{value:"5",label:"退出企业"}],search_status_value:"-1",disabled_status_arr:[{value:"-1",label:"账户状态"},{value:"0",label:"启用"},{value:"1",label:"禁用"}],disabled_status_value:"-1",search_id:"",search_text:"",department_id:0,listData:[],page:1,total_page:0,staff_count:0,showLinkDialog:!1,link:{}}},created:function(){x="",y="",D="",L="",console.log(x),this.getStaffList()},methods:{choiceData:function(t){var e=0;for(var a in t)e=a;e!=this.department_id&&(this.department_id=e,this.page=1,this.getStaffList())},gotoStaffEdit:function(t){var e={};t>0&&(e.staff_id=t),this.$router.push(this.fun.getUrl("staffEdit",{},e))},gotoStaffPermission:function(t){this.$router.push(this.fun.getUrl("staffPermission",{},{id:t}))},initDepartmentList:function(t){},onSearch:function(){x=this.search_id,y=this.search_text,D="-1"==this.search_status_value?"":this.search_status_value,L="-1"==this.disabled_status_value?"":this.disabled_status_value,this.page=1,this.getStaffList()},getStaffList:function(){var t=this,e={department_id:this.department_id,page:this.page};x&&""!=x&&(e.id=x),y&&""!=y&&(e.kwd=y),D&&""!=D&&(e.status=D),L&&""!=L&&(e.disabled=L),$http.pc_get("admin/getStaffList",e,"loading").then(function(e){1===e.result?(t.link.code_url=e.data.code_url,t.link.ticket_url=e.data.ticket_url,t.listData=e.data.data,t.total_page=e.data.last_page,t.staff_count=e.data.total):e.msg&&t.$message.error(e.msg)}).catch(function(t){console.error(t)})},pageChange:function(t){this.page=t,this.getStaffList()},syncWechatStaffList:function(){var t=this;$http.pc_get("admin/refreshStaffList",{},"loading").then(function(e){1===e.result?(t.$message.success(e.msg),t.page=1,t.getStaffList()):e.msg&&t.$message.error(e.msg)}).catch(function(t){console.error(t)})},deleteStaff:function(t,e){var a=this;$http.pc_get("admin/deleteStaff",{id:t,disabled:e},"loading").then(function(t){1===t.result?(a.$message.success(t.msg),a.getStaffList()):t.msg&&a.$message.error(t.msg)}).catch(function(t){console.error(t)})},EmployeeDataAuthorization:function(){this.showLinkDialog=!0}}},S=(a("/9tK"),a("heIN"),Object(p.a)($,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"staff"},[a("staff_side"),t._v(" "),a("div",{staticClass:"staff-right-box"},[a("div",{staticClass:"staff-right-container"},[a("div",{staticClass:"header"},[t._m(0),t._v(" "),a("div",{staticClass:"header-operation"},[a("div",{staticClass:"header-operation-item"},[a("el-input",{attrs:{placeholder:"ID"},model:{value:t.search_id,callback:function(e){t.search_id=e},expression:"search_id"}})],1),t._v(" "),a("div",{staticClass:"header-operation-item"},[a("el-input",{attrs:{placeholder:"姓名/手机号"},model:{value:t.search_text,callback:function(e){t.search_text=e},expression:"search_text"}})],1),t._v(" "),a("div",{staticClass:"header-operation-item"},[a("el-select",{model:{value:t.search_status_value,callback:function(e){t.search_status_value=e},expression:"search_status_value"}},t._l(t.search_status_arr,function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}))],1),t._v(" "),a("div",{staticClass:"header-operation-item"},[a("el-select",{model:{value:t.disabled_status_value,callback:function(e){t.disabled_status_value=e},expression:"disabled_status_value"}},t._l(t.disabled_status_arr,function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}))],1),t._v(" "),a("div",{staticClass:"header-button"},[a("div",{staticClass:"button",on:{click:t.onSearch}},[t._v("搜索")])])])]),t._v(" "),a("div",{staticClass:"main"},[a("div",{staticClass:"main-left"},[a("choice_department",{ref:"choice_department",attrs:{department_is_click:!0},on:{choiceData:t.choiceData,initDepartmentList:t.initDepartmentList}})],1),t._v(" "),a("div",{staticClass:"main-right"},[a("div",{staticClass:"main-right-header"},[t._m(1),t._v(" "),a("div",{staticClass:"header-desc"},[t._v("部门成员数量:"+t._s(t.staff_count))]),t._v(" "),a("div",{staticClass:"header-button"},[a("div",{staticClass:"button",on:{click:t.EmployeeDataAuthorization}},[t._v("\n 员工数据授权\n ")]),t._v(" "),a("div",{staticClass:"button",on:{click:t.syncWechatStaffList}},[t._v("\n 同步企业微信通讯录\n ")]),t._v(" "),a("div",{staticClass:"button",on:{click:function(e){t.gotoStaffEdit(0)}}},[t._v("添加员工")])])]),t._v(" "),a("div",{staticClass:"table-list"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.listData,"row-key":"id",height:"calc(100vh - 35vh)","header-cell-style":{"text-align":"center"},"cell-style":{"text-align":"center"}}},[a("el-table-column",{attrs:{fixed:"",prop:"id",label:"ID",width:"100",fixed:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"name",label:"姓名",width:"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"gender_desc",label:"性别",width:"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"position",label:"职务",width:"120"}}),t._v(" "),a("el-table-column",{attrs:{prop:"address",label:"系统会员",width:"250"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row&&e.row.has_one_member?[a("div",{staticClass:"system-member"},[a("img",{attrs:{src:e.row.has_one_member.avatar,alt:""}}),t._v(" "),a("span",[t._v(t._s(e.row.has_one_member.nickname))])])]:void 0}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"mobile",label:"手机号"}}),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作",width:"200",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row&&e.row.premission?[a("div",{staticClass:"operation"},[1==e.row.premission.setAuth?a("span",{on:{click:function(a){t.gotoStaffPermission(e.row.id)}}},[t._v("权限")]):t._e(),t._v(" "),1==e.row.premission.updateStaff?a("span",{on:{click:function(a){t.gotoStaffEdit(e.row.id)}}},[t._v("编辑")]):t._e(),t._v(" "),1==e.row.premission.deleteStaff?a("span",{on:{click:function(a){t.deleteStaff(e.row.id,e.row.disabled)}}},[t._v(t._s(0==e.row.disabled?"禁用":"解禁"))]):t._e()])]:void 0}}])})],1)],1),t._v(" "),a("div",{staticClass:"table-page"},[a("el-pagination",{attrs:{background:"",layout:"prev, pager, next","page-count":t.total_page},on:{"current-change":t.pageChange}})],1)])])])]),t._v(" "),a("link-dialog",{ref:"dialog",attrs:{dialogVisible:t.showLinkDialog,link:t.link},on:{closeDialog:function(e){t.showLinkDialog=!1}}})],1)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"header-title"},[e("span"),e("b",[this._v("员工管理")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"header-title"},[e("span"),e("b",[this._v("员工管理")])])}],!1,null,"4a78f4a6",null));S.options.__file="staff_list.vue";e.default=S.exports},vZTm:function(t,e,a){"use strict";var i=a("Cl1D");a.n(i).a}}]);