1 |
- webpackJsonp([18],{"/5PA":function(e,t){},"136b":function(e,t){},"1z26":function(e,t){},"3tbb":function(e,t){},"8hLK":function(e,t){},HH7m:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("Dd8w"),a=i.n(s),n=i("//Fk"),r=i.n(n),o=i("Xxa5"),l=i.n(o),c=i("exGp"),u=i.n(c),d=i("ifoU"),f=i.n(d),h=i("McOJ"),_=i("erru"),p=i("LYKV"),v=i("u2KI"),m=i.n(v),g=[{label:"ADQ",value:"1"},{label:"MP",value:"2"}],C={name:"memberInfoBind",components:{selfChannel:_.a},props:{dialogVisible:{type:Boolean,default:function(){return!1}},userInfo:{type:Object,default:function(){return{account_id:"",app_id:"",operator_id:"",user_id:""}}}},data:function(){return{loading:!1,typeOptions:m()(g),form:{account_id:"",app_id:"",operator_id:"",user_id:""}}},watch:{dialogVisible:function(e){e&&this.handleGetFormData()}},methods:{onChangeAccountId:function(e){this.form.account_id=e},onChangeAppId:function(e){this.form.app_id=e},onChangeOperatorId:function(e){this.form.operator_id=e},handleConfirm:function(){var e=this;return u()(l.a.mark(function t(){var i,s,n,r;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:return i=a()({},e.form),e.loading=!0,t.next=7,e.$axios.post(""+e.URL.BASEURL+e.URL.manage_bindUserAdqAccountId,a()({},i));case 7:s=t.sent,n=s.data,(r=void 0===n?{}:n)&&0==r.errno?(e.$message.success("操作成功"),e.handleClearFormData(),e.$emit("confirm")):4002!=r.errno&&e.$message.warning(r.err||"操作失败"),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(0),console.log("error => ",t.t0);case 16:return t.prev=16,e.loading=!1,t.finish(16);case 19:case"end":return t.stop()}},t,e,[[0,13,16,19]])}))()},handleCancel:function(){this.handleClearFormData(),this.$emit("cancel")},handleFormValidate:function(){return new r.a(function(e,t){e("表单校验通过")})},handleGetFormData:function(){var e=this.userInfo,t=e.account_id,i=void 0===t?"":t,s=e.app_id,a=void 0===s?"":s,n=e.operator_id,r=void 0===n?"":n,o=e.user_id,l=void 0===o?"":o;this.form.account_id=i||"",this.form.app_id=a||"",this.form.operator_id=r||"",this.form.user_id=l},handleClearFormData:function(){this.form.account_id="",this.form.app_id="",this.form.operator_id="",this.form.user_id=""}}},b={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{staticClass:"bind-dialog",attrs:{visible:e.dialogVisible,"before-close":e.handleCancel,title:"信息绑定",width:"450px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable required"},[e._v("所属类型")]),e._v(" "),i("span",[e._v("ADQ")])]),e._v(" "),i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[e._v("投放账号")]),e._v(" "),e.dialogVisible?i("selfChannel",{attrs:{title:"",width:"280px",type:"adqAccount",afferent_value:e.form.account_id,placeholder:"请选择投放账号"},on:{channelDefine:e.onChangeAccountId}}):e._e()],1),e._v(" "),i("div",{staticClass:"form-tips"},[e._v("可传空,此时会将原来设置的投放账号置空")]),e._v(" "),i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[e._v("绑定公众号")]),e._v(" "),e.dialogVisible?i("selfChannel",{attrs:{title:"",width:"280px",type:"officialAccount",afferent_value:e.form.app_id,placeholder:"请选择公众号"},on:{channelDefine:e.onChangeAppId}}):e._e()],1),e._v(" "),i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[e._v("绑定运营")]),e._v(" "),e.dialogVisible?i("selfChannel",{attrs:{title:"",width:"280px",type:"circleCreate",afferent_params:{type:1,operator_id:e.form.operator_id||""},afferent_value:e.form.operator_id,placeholder:"请选择运营"},on:{channelDefine:e.onChangeOperatorId}}):e._e()],1)]),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:e.handleCancel}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.handleConfirm}},[e._v("确 定")])],1)])},staticRenderFns:[]};var w=i("VU/8")(C,b,!1,function(e){i("/5PA")},"data-v-b467a4d4",null).exports,y=i("fGUm"),x=i("mvHQ"),k=i.n(x),A=i("M4fF"),S=i.n(A),D={components:{selfInput:h.a},props:{clearable:{type:Boolean,default:!0},reset:{type:Boolean,default:!1},width:{type:String},labelWidth:{type:String},afferent_users:{type:Array},disabled:{type:Boolean,default:!1},waitForAssignNum:{type:Number,default:function(){return 0}}},watch:{reset:function(){this.selectUser=[],this.final_result=[],this.changeSelect()}},data:function(){return{input_keyword:"",visible:!1,resetFlag:!1,loading:!1,userList:[],old_user_list:[],userTotal:0,selectUser:[],final_result:[]}},created:function(){0==this.userList.length?this.init():(this.selectUser=JSON.parse(k()(this.final_result)),this.changeSelect(),this.afferent_init())},methods:{handleCreatedFn:function(){0==this.userList.length?this.init():(this.selectUser=JSON.parse(k()(this.final_result)),this.changeSelect(),this.afferent_init())},afferent_init:function(){var e=this,t=[];if(this.afferent_users&&this.afferent_users.length>0){this.userList.forEach(function(i){i.user_list.forEach(function(i){-1!=e.afferent_users.indexOf(i.user_id)&&t.push(i)})}),this.selectUser=t;var i=JSON.parse(k()(t)),s={};i=i.reduce(function(e,t){return!s[t.user_id]&&(s[t.user_id]=e.push(t)),e},[]),this.final_result=i,this.changeSelect()}else this.selectUser=[],this.final_result=[],this.changeSelect()},handleReset:function(){this.selectUser=[],this.final_result=[],this.changeSelect(),this.input_keyword="",this.resetFlag=!this.resetFlag,this.init()},defineEvent:function(){var e=this;return u()(l.a.mark(function t(){var i,s;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.final_result=JSON.parse(k()(e.selectUser)),i=e.selectUser.map(function(e){return e.user_id}),e.selectUser.map(function(e){return e.name}),0!=i.length){t.next=6;break}return e.$message({message:"请选择成员",type:"warning"}),t.abrupt("return");case 6:return t.prev=6,t.next=9,e.handleSubmit(i);case 9:s=t.sent,e.visible=!1,e.$emit("res",s),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(6),console.log("error => ",t.t0);case 17:case"end":return t.stop()}},t,e,[[6,14]])}))()},handleSubmit:function(e){var t,i=this;return new r.a((t=u()(l.a.mark(function t(s,a){var n,r,o,c,u;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=""+i.URL.BASEURL+i.URL.member_batchActiveAccount,r={userid_list:e,corpid:i.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=i.$localSelfStore.getLocal("defaultCorp")?JSON.parse(i.$localSelfStore.getLocal("defaultCorp")).corpid:""},i.loading=!0,t.next=6,i.$axios.post(n,r);case 6:o=t.sent,c=o.data,(u=void 0===c?{}:c)&&0==u.errno?s(u.rst):4002!=u.errno&&(i.$message.warning(u.err||"操作失败"),a(u.err)),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(0),console.log("error => ",t.t0),a(t.t0);case 16:return t.prev=16,i.loading=!1,t.finish(16);case 19:case"end":return t.stop()}},t,i,[[0,12,16,19]])})),function(e,i){return t.apply(this,arguments)}))},userSearch:function(){var e=this.input_keyword.split(" ");0==(e=e.filter(function(e){return""!=e})).length&&(e=[""]);var t=[];this.old_user_list.forEach(function(i){var s=i.user_list.filter(function(t){var i=!1;return e.forEach(function(e){i||(i=t.name&&-1!=t.name.indexOf(e))}),i});if(s&&s.length>0){var a=JSON.parse(k()(i));a.user_list=s,t.push(a)}}),this.userList=t;var i=0;this.userList.forEach(function(e){e.is_open=!1,e.is_select=!1,e.user_list.forEach(function(e){e.is_select=!1}),i+=e.user_list.length}),this.changeSelect(),this.userTotal=i},init:function(e){var t=this;this.loading=!0;var i=this.URL.userList;this.$axios.get(this.URL.BASEURL+i,{params:{status:1}}).then(function(i){i=i.data;t.loading=!1,i&&0==i.errno?(t.userList=i.rst.list,t.old_user_list=JSON.parse(k()(i.rst.list)),t.userList.forEach(function(e){e.is_open=!1,e.is_select=!1,e.user_list.forEach(function(e){e.is_select=!1})}),"userSearch"!=e&&(t.selectUser=JSON.parse(k()(t.final_result)),t.afferent_init()),t.changeSelect(),t.userTotal=i.rst.count):4002!=i.errno&&t.$message({message:i.err,type:"warning"})}).catch(function(e){t.loading=!1})},openEvent:function(e){var t=this.userList[e];t.is_open=!t.is_open,this.$set(this.userList,e,t)},selectUserEvent:function(e,t,i){var s=S.a.cloneDeep(this.selectUser),a=S.a.cloneDeep(this.userList[t]);if("all"==e)if(a.is_select){var n=a.user_list.map(function(e){return e.user_id});s=s.filter(function(e){return-1==n.indexOf(e.user_id)})}else s=s.concat(a.user_list);else{var r=a.user_list[i];if(1==r.is_active)return this.$message.warning("当前成员已分配过许可"),!1;r.is_select?s=s.filter(function(e){return e.user_id!=r.user_id}):s.push(r)}var o={};if((s=(s=s.reduce(function(e,t){return!o[t.user_id]&&(o[t.user_id]=e.push(t)),e},[])).filter(function(e){return 1!=e.is_active}))&&s.length>this.waitForAssignNum){var l=0==this.waitForAssignNum?"暂无待分配许可":"最多可选"+this.waitForAssignNum+"名成员";return this.$message.warning(l),!1}this.selectUser=s,this.$set(this.userList,t,a),this.changeSelect()},changeSelect:function(){var e=this,t=JSON.parse(k()(this.userList)),i=this.selectUser.map(function(e){return e.user_id});t.forEach(function(t){t.user_list=t.user_list.filter(function(e){return-1!=i.indexOf(e.user_id)}),e.userList.forEach(function(e){e.department_id==t.department_id&&(t.user_list.length==e.user_list.length?e.is_select=!0:e.is_select=!1)})}),this.userList.forEach(function(e){e.user_list.forEach(function(e){-1==i.indexOf(e.user_id)?e.is_select=!1:e.is_select=!0})})},closeUser:function(e){-1==e?this.selectUser=[]:this.selectUser.splice(e,1),this.changeSelect()}}},F={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"common-screen-item"},[i("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(t){e.$emit("updateAssignNum"),e.handleReset(),e.visible=!0}}},[e._v("批量分配许可")]),e._v(" "),i("el-dialog",{staticClass:"batchAssign-dialog",attrs:{visible:e.visible,"before-close":function(){e.visible=!1},"close-on-click-modal":!1,title:"批量分配许可",width:"700px"},on:{"update:visible":function(t){e.visible=t}}},[i("div",{staticClass:"flex",staticStyle:{padding:"10px"}},[i("div",{staticClass:"propoverItem"},[i("self-input",{staticStyle:{"margin-top":"0"},attrs:{reset:e.resetFlag,hasLabel:!1,label_name:"成员名称",inputFlag:!0,width:"270px"},on:{inputChange:function(t){e.input_keyword=t,e.userSearch()}}}),e._v(" "),i("div",{staticStyle:{"font-size":"12px",color:"#f9a527"}},[e._v("添加 空格 可进行多成员搜索")]),e._v(" "),i("div",{staticClass:"allMember"},[e._v("全部成员("+e._s(e.userTotal)+"):")]),e._v(" "),i("div",{staticClass:"memberBoxBig self-scrollbar-3"},[e._l(e.userList,function(t,s){return[i("div",{key:s+"userList"+t.department_id,staticClass:"memberBox"},[i("i",{class:["el-icon-caret-bottom",t.is_open?"reversalAnimation":""],on:{click:function(t){return e.openEvent(s)}}}),e._v(" "),i("div",{staticClass:"meberList"},[i("div",{staticClass:"department",on:{click:function(t){return e.selectUserEvent("all",s)}}},[i("div",{staticClass:"flex",staticStyle:{"align-items":"flex-start"}},[i("i",{staticClass:"el-icon-s-cooperation",staticStyle:{"margin-top":"3px"}}),e._v(" "),i("span",[e._v(e._s(t.department_name?t.department_name:"部门"+(s+1)))])]),e._v(" "),i("div",{class:["checkbox",t.is_select?"checkbox_active":""]},[i("i",{staticClass:"el-icon-check"})])]),e._v(" "),e._l(t.user_list,function(a,n){return i("div",{key:a.user_id,class:["memberItem",1==a.is_active?"disabled":""],style:t.is_open?"display:none":"",on:{click:function(t){return e.selectUserEvent("user",s,n)}}},[i("div",{staticClass:"flex",staticStyle:{flex:"1"}},[i("img",{staticClass:"memberImg",attrs:{src:a.avatar,alt:""}}),e._v(" "),i("div",{staticClass:"memberInfo"},[i("div",{staticClass:"name"},[e._v(e._s(a.name))]),e._v(" "),i("div",{staticClass:"other"},[e._v("部门:"+e._s(a.department_list&&a.department_list.join(",")))])])]),e._v(" "),i("div",{class:["checkbox",a.is_select?"checkbox_active":""]},[i("i",{staticClass:"el-icon-check"})])])})],2)])]})],2)],1),e._v(" "),i("div",{staticClass:"line"}),e._v(" "),i("div",{staticClass:"propoverItem",staticStyle:{"padding-left":"20px"}},[i("div",{staticClass:"title"},[e._v("已选择的成员")]),e._v(" "),i("div",{staticClass:"choice_result_top"},[i("div",{staticClass:"clear",on:{click:function(t){return e.closeUser(-1)}}},[e._v("全部清空")]),e._v(" "),i("div",{staticClass:"result_num"},[e._v("已选择"),i("span",[e._v(e._s(e.selectUser&&e.selectUser.length))]),e._v("人")])]),e._v(" "),i("div",{staticClass:"member_result self-scrollbar-3"},e._l(e.selectUser,function(t,s){return i("div",{key:s,staticClass:"memberItem"},[i("div",{staticClass:"flex",staticStyle:{flex:"1"}},[i("img",{staticClass:"memberImg",attrs:{src:t.avatar,alt:""}}),e._v(" "),i("div",{staticClass:"memberInfo"},[i("div",{staticClass:"name"},[e._v(e._s(t.name))]),e._v(" "),i("div",{staticClass:"other"},[e._v("部门:"+e._s(t.department_list&&t.department_list.join(",")))])])]),e._v(" "),i("i",{staticClass:"el-icon-close",staticStyle:{"margin-left":"10px"},on:{click:function(t){return e.closeUser(s)}}})])}),0),e._v(" "),i("div",{staticClass:"buttons"},[i("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(t){e.visible=!1}}},[e._v("取消")]),e._v(" "),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.defineEvent}},[e._v("确定")])],1)])])])],1)},staticRenderFns:[]};var I=i("VU/8")(D,F,!1,function(e){i("136b")},"data-v-13376a85",null).exports,L={name:"assignDialog",props:{dialogVisible:{type:Boolean,default:function(){return!1}},userInfo:{type:Object,default:function(){return{user_id:"",name:""}}},waitForAssignNum:{type:Number,default:function(){return 0}}},data:function(){return{loading:!1,form:{corpid:"",userid:""}}},watch:{dialogVisible:function(e){e&&this.handleGetFormData()}},methods:{handleGetFormData:function(){var e=this.userInfo.user_id,t=void 0===e?"":e;this.form.userid=t},handleClearFormData:function(){this.form.userid=""},handleConfirm:function(){var e=this;return u()(l.a.mark(function t(){var i,s,n,r,o;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:return i=""+e.URL.BASEURL+e.URL.member_activeAccount,s=a()({},e.form,{corpid:e.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=e.$localSelfStore.getLocal("defaultCorp")?JSON.parse(e.$localSelfStore.getLocal("defaultCorp")).corpid:""}),e.loading=!0,t.next=8,e.$axios.get(i,{params:s});case 8:n=t.sent,r=n.data,(o=void 0===r?{}:r)&&0==o.errno?(e.$message.success("操作成功"),e.handleClearFormData(),e.$emit("confirm")):4002!=o.errno&&(e.$message.warning(o.err||"操作失败"),e.handleCancel()),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),console.log("error => ",t.t0);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}},t,e,[[0,14,17,20]])}))()},handleCancel:function(){this.handleClearFormData(),this.$emit("cancel")},handleFormValidate:function(){return new r.a(function(e,t){e("表单校验通过")})}}},U={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{staticClass:"assign-dialog",attrs:{visible:e.dialogVisible,"before-close":e.handleCancel,title:"分配许可",width:"450px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[e._v("\n 现有待分配许可"+e._s(e.waitForAssignNum)+"个,是否确定分配给成员【"+e._s(e.userInfo.name)+"】\n ")]),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:e.handleCancel}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.handleConfirm}},[e._v("确 定")])],1)])},staticRenderFns:[]};var V=i("VU/8")(L,U,!1,function(e){i("3tbb")},"data-v-10fc9b85",null).exports,N={name:"assignDialog",components:{serviceSingle:i("3uEH").a},props:{dialogVisible:{type:Boolean,default:function(){return!1}},userInfo:{type:Object,default:function(){return{user_id:"",name:""}}},waitForAssignNum:{type:Number,default:function(){return 0}}},data:function(){return{resetFlag:!1,loading:!1,transferUserPl:"请选择要承接许可的成员",form:{takeover_userid:"",handover_userid:""}}},watch:{dialogVisible:function(e){e&&this.handleGetFormData()}},methods:{handleGetFormData:function(){var e=this.userInfo.user_id,t=void 0===e?"":e;this.form.handover_userid=t},handleClearFormData:function(){this.resetFlag=!this.resetFlag,this.$refs.serviceSingle.clear(),this.form.handover_userid=""},onChangeTransferUser:function(e){this.form.takeover_userid=e?e.user_id:""},handleConfirm:function(){var e=this;return u()(l.a.mark(function t(){var i,s,n,r,o;return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:return i=""+e.URL.BASEURL+e.URL.member_transfer,s=a()({},e.form,{corpid:e.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=e.$localSelfStore.getLocal("defaultCorp")?JSON.parse(e.$localSelfStore.getLocal("defaultCorp")).corpid:""}),e.loading=!0,t.next=8,e.$axios.get(i,{params:s});case 8:n=t.sent,r=n.data,(o=void 0===r?{}:r)&&0==o.errno?(e.$message.success("操作成功"),e.handleClearFormData(),e.$emit("confirm")):4002!=o.errno&&(e.$message.warning(o.err||"操作失败"),e.handleCancel()),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),console.log("error => ",t.t0);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}},t,e,[[0,14,17,20]])}))()},handleCancel:function(){this.handleClearFormData(),this.$emit("cancel")},handleFormValidate:function(){var e=this;return new r.a(function(t,i){e.form.takeover_userid?t("表单校验通过"):(e.$message.warning(e.transferUserPl),i("表单校验未通过"))})}}},$={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{staticClass:"transfer-dialog",attrs:{visible:e.dialogVisible,"before-close":e.handleCancel,title:"转移许可",width:"450px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[e._v("\n 将成员【"+e._s(e.userInfo.name)+"】转移至\n "),i("div",{staticClass:"form-item"},[i("serviceSingle",{ref:"serviceSingle",staticStyle:{"margin-left":"-65px"},attrs:{title:"成员",placeholder:e.transferUserPl,reset:e.resetFlag,source:"memberTransfer"},on:{customerDefine:e.onChangeTransferUser}})],1)]),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:e.handleCancel}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.handleConfirm}},[e._v("确 定")])],1)])},staticRenderFns:[]};var R=i("VU/8")(N,$,!1,function(e){i("i25K")},"data-v-5e8e581f",null).exports,E=i("Gu7T"),B=i.n(E),O={name:"assignResult",props:{dialogVisible:{type:Boolean,default:function(){return!1}},resInfo:{type:Object,default:function(){return{success:0,failed:0,fail_list:[]}}}},data:function(){return{loading:!1,success:0,failed:0,fail_list:[]}},watch:{dialogVisible:function(e){e&&this.handleGetFormData()}},methods:{handleGetFormData:function(){var e=this.resInfo,t=e.success,i=void 0===t?0:t,s=e.failed,a=void 0===s?0:s,n=e.fail_list,r=void 0===n?[]:n;this.success=i,this.failed=a,this.fail_list=[].concat(B()(r))},handleClearFormData:function(){this.success=0,this.failed=0,this.fail_list=[]},handleConfirm:function(){var e=this;return u()(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:e.$emit("confirm"),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.log("error => ",t.t0);case 9:return t.prev=9,e.loading=!1,t.finish(9);case 12:case"end":return t.stop()}},t,e,[[0,6,9,12]])}))()},handleCancel:function(){this.handleClearFormData(),this.$emit("cancel")},handleFormValidate:function(){return new r.a(function(e,t){e("表单校验通过")})}}},G={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dialog",{staticClass:"result-dialog",attrs:{visible:e.dialogVisible,"before-close":e.handleCancel,title:"批量分配许可结果",width:"600px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[s("div",{staticClass:"tips"},[e._v("成功分配"),s("span",{staticClass:"highlight"},[e._v(e._s(e.success))]),e._v("个许可,失败分配"),s("span",{staticClass:"highlight"},[e._v(e._s(e.failed))]),e._v("个许可")]),e._v(" "),e.fail_list&&e.fail_list.length?[s("div",{staticClass:"label"},[e._v("失败原因:")]),e._v(" "),s("div",{staticClass:"res-wrap"},[s("div",{staticClass:"header"},[s("div",{staticClass:"column pl-8"},[e._v("成员")]),e._v(" "),s("div",{staticClass:"column-res"},[e._v("失败原因")])]),e._v(" "),e._l(e.fail_list,function(t,a){return s("div",{key:a,staticClass:"res-item"},[s("div",{staticClass:"column"},[s("img",{staticClass:"user-avatar",attrs:{src:i("pIyw")}}),e._v(" "),s("span",{staticClass:"user-name"},[e._v(e._s(t.user_name))])]),e._v(" "),s("div",{staticClass:"column-res"},[e._v(e._s(t.errcode||"-"))])])})],2)]:e._e()],2),e._v(" "),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{size:"mini"},on:{click:e.handleCancel}},[e._v("取 消")]),e._v(" "),s("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.handleConfirm}},[e._v("确 定")])],1)])},staticRenderFns:[]};var z=i("VU/8")(O,G,!1,function(e){i("1z26")},"data-v-6406f237",null).exports,T=i("la//"),W=new f.a([[String(T.D.MP),"MP"],[String(T.D.ADQ),"ADQ"]]),M={name:"memberManage",components:{selfinput:h.a,selfChannel:_.a,userDetail:p.a,memberInfoBind:w,selfCustomerservice:y.a,batchAssign:I,assignDialog:V,transferDialog:R,assignResult:z},data:function(){return{userDetailFlag:!1,drawerSize:"60%",loading:!1,page:1,pages:0,total:0,page_size:20,tableData:[],checkVals:[],depart_List:[],keyword:"",height:"",user_detail_id:"",infoBindDialogVisible:!1,currentBindInfo:{},user_ids:[],customerData:{customer_count:0,user_add_yesterday:0,user_loss_yesterday:0},is_active:"",waitForAssignNum:0,assignDialogVisible:!1,currentAssignInfo:{},transferDialogVisible:!1,currentTransferInfo:{},assignResultVisible:!1,currentAssignResult:{},account_id:"",app_id:"",operator_id:"",expire_days:"",resetFlag:!1}},computed:{isShowCustomerData:function(){return this.user_ids&&this.user_ids.length}},created:function(){this.height=document.documentElement.clientHeight-200>400?document.documentElement.clientHeight-200:400,this.init_depart(),this.init(1),this.handleGetWaitForAssignNum()},methods:{detailEvent:function(e){this.userDetailFlag=!0,this.user_detail_id=e.user_id},closeDrawer:function(){this.userDetailFlag=!1},changeDrawerSize:function(){this.drawerSize="80%"==this.drawerSize?"60%":"80%"},inputChange:function(e){this.keyword=e,this.init(1,e),this.handleGetWaitForAssignNum()},init_depart:function(){var e=this;this.$axios.get(this.URL.BASEURL+this.URL.departmentList,{}).then(function(t){(t=t.data)&&0==t.errno?(e.depart_List=t.rst,e.checkVals=t.rst.map(function(e){return e.department_id})):4002!=t.errno&&e.$message({message:t.err,type:"warning"})})},init:function(e,t){var i=this;this.handleInitCustomerData(),this.page=e||this.page,this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.memberList,{params:{user_name:t,department_list:this.checkVals,user_ids:this.user_ids?this.user_ids.join(","):"",is_active:this.is_active,app_id:this.app_id,account_id:this.account_id,operator_id:this.operator_id,expire_days:this.expire_days,page:this.page,page_size:this.page_size}}).then(function(e){e=e.data;i.loading=!1,e&&0==e.errno?(i.tableData=e.rst.data,i.total=e.rst.pageInfo.total,i.pages=e.rst.pageInfo.pages,i.customerData.customer_count=e.rst.extra.customer_count,i.customerData.user_add_yesterday=e.rst.extra.user_add_yesterday,i.customerData.user_loss_yesterday=e.rst.extra.user_loss_yesterday):4002!=e.errno&&(i.$message({message:e.err,type:"warning"}),i.tableData=[],i.pages=0,i.handleInitCustomerData())}).catch(function(e){i.loading=!1})},handleExport:function(){var e=this;0!=this.total?(this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.memberList,{params:{user_name:this.keyword,department_list:this.checkVals,user_ids:this.user_ids?this.user_ids.join(","):"",is_active:this.is_active,app_id:this.app_id,account_id:this.account_id,operator_id:this.operator_id,expire_days:this.expire_days,page:1,page_size:this.$store.state.exportNumber}}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno?e.exportEvent(t.rst.data):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(t){e.loading=!1})):this.$message({message:"暂无数据可导出",type:"warning"})},exportEvent:function(e){var t=this,i=e;i.forEach(function(e){e.self_department_list=e.department_list&&e.department_list.length?e.department_list.join(","):"",e.self_status=1==e.status?"已授权":"未授权",e.self_order_type=t.getOrderTypeDesc(e.order_type)});var s=[{tHeader:["成员","客户数","所属部门","授权状态","所属类型","ADQ投放账号ID","公众号","运营人员","昨日流失客户数","昨日新增客户数","激活时间","过期时间"],filterVal:["name","customer_number","self_department_list","self_status","self_order_type","account_id","app_name","operator_name","loss_contact_cnt","new_contact_cnt","active_time","expire_time"],tableDatas:i,sheetName:""}];this.$exportOrder({excelDatas:s,name:"成员管理(导出时间:"+this.$getDay(0)+")"})},handleInitCustomerData:function(){this.total=0,this.customerData.customer_count=0,this.customerData.user_add_yesterday=0,this.customerData.user_loss_yesterday=0},handleCurrentChange:function(e){this.init(e,this.keyword),this.handleGetWaitForAssignNum()},checkDepartId:function(e){-1==this.checkVals.indexOf(e)?this.checkVals.push(e):this.checkVals.splice(this.checkVals.indexOf(e),1),this.init(1,this.keyword),this.handleGetWaitForAssignNum()},onClickInfoBind:function(e){var t=this,i=e.name,s=void 0===i?"":i,a=e.user_id,n=void 0===a?"":a,r=e.account_id,o=void 0===r?"":r,c=e.app_id,d=void 0===c?"":c,f=e.operator_id,h=void 0===f?"":f;return u()(l.a.mark(function e(){var i;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!o){e.next=5;break}return i=t.$createElement,e.next=5,t.$confirm("",{message:i("div",null,[i("span",{style:"color: #32B38A;"},""+s),i("span",null,"已经关联投放账号,是否确认修改?")]),confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 5:t.currentBindInfo={user_id:n,account_id:o,app_id:d,operator_id:h},t.infoBindDialogVisible=!0,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.log(e.t0);case 12:case"end":return e.stop()}},e,t,[[0,9]])}))()},handleInfoBindCancel:function(){this.currentBindInfo={},this.infoBindDialogVisible=!1},handleInfoBindConfirm:function(){this.infoBindDialogVisible=!1,this.init(void 0,this.keyword),this.handleGetWaitForAssignNum()},getOrderTypeDesc:function(e){return W.get(String(e))||"-"},onChangeUserIds:function(e){this.user_ids=e||[],this.init(1,this.keyword),this.handleGetWaitForAssignNum()},onChangeActiveStatus:function(e){this.is_active=e,this.init(1,this.keyword),this.handleGetWaitForAssignNum()},onChangeAccountId:function(e){this.account_id=e,this.init(1,this.keyword),this.handleGetWaitForAssignNum()},onChangeAppId:function(e){this.app_id=e,this.init(1,this.keyword),this.handleGetWaitForAssignNum()},onChangeOperatorId:function(e){this.operator_id=e,this.init(1,this.keyword),this.handleGetWaitForAssignNum()},onChangeExpireDays:function(e){this.expire_days=e,this.init(1,this.keyword),this.handleGetWaitForAssignNum()},resetEvent:function(){this.resetFlag=!this.resetFlag,this.is_active="",this.user_ids=[],this.keyword="",this.account_id="",this.app_id="",this.operator_id="",this.expire_days="",this.init(1,this.keyword)},handleGetWaitForAssignNum:function(){var e,t=this;return new r.a((e=u()(l.a.mark(function e(i,s){var a,n,r,o,c;return l.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,a=""+t.URL.BASEURL+t.URL.member_licenseCount,n={corpid:t.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=t.$localSelfStore.getLocal("defaultCorp")?JSON.parse(t.$localSelfStore.getLocal("defaultCorp")).corpid:""},e.next=6,t.$axios.get(a,{params:n});case 6:r=e.sent,o=r.data,(c=void 0===o?{}:o)&&0==c.errno?(t.waitForAssignNum=c.rst.count,i(t.waitForAssignNum)):4002!=c.errno&&(t.$message.warning(c.err),t.waitForAssignNum=0,s(t.waitForAssignNum)),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),console.log("error => ",e.t0),t.waitForAssignNum=0,s(t.waitForAssignNum);case 17:return e.prev=17,t.loading=!1,e.finish(17);case 20:case"end":return e.stop()}},e,t,[[0,12,17,20]])})),function(t,i){return e.apply(this,arguments)}))},onClickAssign:function(e){var t=this;return u()(l.a.mark(function i(){return l.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return t.currentAssignInfo=a()({},e),i.next=3,t.handleGetWaitForAssignNum();case 3:if(i.sent){i.next=6;break}return i.abrupt("return",t.$message.warning("暂无待分配许可"));case 6:t.assignDialogVisible=!0;case 7:case"end":return i.stop()}},i,t)}))()},handleAssignCancel:function(){this.currentAssignInfo={},this.assignDialogVisible=!1},handleAssignConfirm:function(){this.assignDialogVisible=!1,this.init(void 0,this.keyword),this.handleGetWaitForAssignNum()},onClickTransfer:function(e){this.currentTransferInfo=a()({},e),this.transferDialogVisible=!0},handleTransferCancel:function(){this.currentTransferInfo={},this.transferDialogVisible=!1},handleTransferConfirm:function(){this.transferDialogVisible=!1,this.init(void 0,this.keyword),this.handleGetWaitForAssignNum()},onResBatchAssign:function(e){var t=this;this.init(void 0,this.keyword),this.handleGetWaitForAssignNum(),setTimeout(function(){t.handleShowAssignResult(a()({},e))},500)},handleShowAssignResult:function(e){this.currentAssignResult=a()({},e),this.assignResultVisible=!0},handleAssignResultCancel:function(){this.currentAssignResult={},this.assignResultVisible=!1},handleAssignResultConfirm:function(){this.assignResultVisible=!1,this.init(void 0,this.keyword),this.handleGetWaitForAssignNum()}}},J={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e._m(0),e._v(" "),i("div",{staticClass:"screenBox",staticStyle:{background:"#fff",padding:"0 16px","margin-bottom":"10px","margin-top":"10px"}},[i("selfChannel",{attrs:{reset:e.resetFlag,title:"激活状态",type:"isActive"},on:{channelDefine:e.onChangeActiveStatus}}),e._v(" "),i("selfCustomerservice",{attrs:{reset:e.resetFlag,title:"成员",source:"memberManage"},on:{customerDefine:e.onChangeUserIds}}),e._v(" "),i("selfinput",{attrs:{reset:e.resetFlag,label_name:"客户"},on:{inputChange:e.inputChange}}),e._v(" "),i("selfChannel",{attrs:{reset:e.resetFlag,title:"ADQ账号",type:"adqAccount"},on:{channelDefine:e.onChangeAccountId}}),e._v(" "),i("selfChannel",{attrs:{reset:e.resetFlag,title:"公众号",type:"officialAccount",placeholder:"公众号"},on:{channelDefine:e.onChangeAppId}}),e._v(" "),i("selfChannel",{attrs:{reset:e.resetFlag,title:"运营人员",type:"circleCreate",placeholder:"运营人员"},on:{channelDefine:e.onChangeOperatorId}}),e._v(" "),i("selfChannel",{attrs:{reset:e.resetFlag,title:"到期时间",type:"expireDays",placeholder:"到期时间"},on:{channelDefine:e.onChangeExpireDays}}),e._v(" "),i("div",{staticClass:"reset",on:{click:e.resetEvent}},[e._v("重置")])],1),e._v(" "),i("div",{staticClass:"tableInfo"},[i("div",{staticClass:"flex"},[e.isShowCustomerData?i("div",{staticClass:"totalCustom"},[e._v("\n 共"),i("span",[e._v(e._s(e.customerData.customer_count))]),e._v("个客户;\n 昨日新增"),i("span",[e._v(e._s(e.customerData.user_add_yesterday))]),e._v(";\n 昨日流失"),i("span",[e._v(e._s(e.customerData.user_loss_yesterday))]),e._v(";\n ")]):[i("div",{staticClass:"totalCustom"},[i("i",{staticClass:"el-icon-user-solid"}),e._v(" 共"),i("span",[e._v(e._s(e.total))]),e._v("个成员\n ")]),e._v(" "),i("div",{staticClass:"totalCustom ml-20"},[e._v("\n 待分配许可"),i("span",[e._v(e._s(e.waitForAssignNum))]),e._v(" "),i("el-tooltip",{staticClass:"disinblock",attrs:{"popper-class":"member-tooltip"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("p",[e._v("购买许可—需要联系开发人员进行许可购买")]),e._v(" "),i("p",[e._v("分配许可—只能将许可分配给未激活的成员,激活时间为分配时间")]),e._v(" "),i("p",[e._v("转移许可—转移许可为离职成员或不在服务商应用可见范围内的成员时,不限转移时间间隔,转移许可的成员为在职成员在服务商应用可见范围内时,转移后30天才可进行下一次转移;转移许可接收成员不能与转移成员的许可重叠")])]),e._v(" "),i("i",{staticClass:"el-icon-question c-999"})])],1)]],2),e._v(" "),i("div",{staticClass:"flex"},[i("batchAssign",{ref:"batchAssign",attrs:{waitForAssignNum:e.waitForAssignNum},on:{updateAssignNum:e.handleGetWaitForAssignNum,res:e.onResBatchAssign}}),e._v(" "),i("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"primary",plain:"",size:"mini"},on:{click:e.handleExport}},[e._v("导出Excel")])],1)]),e._v(" "),i("div",{staticStyle:{display:"flex"}},[i("div",{staticStyle:{width:"300px","flex-shrink":"0","margin-right":"10px","background-color":"#fff",padding:"15px"}},[i("div",{staticClass:"fWeight600"},[e._v("\n 部门信息\n ")]),e._v(" "),i("div",e._l(e.depart_List,function(t){return i("div",{key:t.department_id,staticClass:"tMar20 flex-align-center pointer f15",on:{click:function(i){return e.checkDepartId(t.department_id)}}},[e.checkVals.indexOf(t.department_id)>-1?i("i",{staticClass:"el-icon-success c-00B38A f16 rMar7"}):i("i",{staticClass:"el-icon-circle rMar7"}),e._v("\n "+e._s(t.department_name)+"\n ")])}),0)]),e._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{flex:"1",overflow:"hidden"}},[i("el-table",{ref:"multipleTable",attrs:{height:e.height,data:e.tableData,"tooltip-effect":"dark"}},[i("el-table-column",{attrs:{"min-width":"180",label:"成员列表","show-overflow-tooltip":"",fixed:"left"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{staticClass:"flex-align-center"},[i("div",[i("img",{staticStyle:{width:"40px","margin-right":"10px","border-radius":"3px"},attrs:{src:t.row.avatar,alt:""}})]),e._v(" "),i("div",[i("div",[e._v(e._s(t.row.name))]),e._v(" "),i("div",[e._v("共有"+e._s(t.row.customer_number)+"个客户")])])])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"200",label:"所属部门",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",[i("span",{staticClass:"rMar7"},[e._v(e._s(t.row.department_list&&t.row.department_list.join(",")))])])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"授权状态",align:"center","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{staticClass:"flex-align-jus-center"},[1==t.row.status?i("i",{staticClass:"el-icon-circle-check f16 c-00B38A rMar7"}):e._e(),e._v(" "),4==t.row.status?i("i",{staticClass:"el-icon-warning-outline f16 c-FF604D rMar7"}):e._e(),e._v("\n "+e._s(1==t.row.status?"已授权":"未授权")+"\n ")])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"所属类型",align:"center","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[i("span",[e._v(e._s(e.getOrderTypeDesc(s.order_type)))])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"ADQ投放账号ID",align:"center","min-width":"130"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[i("span",[e._v(e._s(s.account_id||"-"))])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"公众号",align:"center","min-width":"130"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[i("span",[e._v(e._s(s.app_name||"-"))])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"运营人员",align:"center","min-width":"130"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[i("span",[e._v(e._s(s.operator_name||"-"))])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"昨日流失客户数",prop:"loss_contact_cnt","min-width":"120",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{label:"昨日新增客户数",prop:"new_contact_cnt","min-width":"120",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{label:"激活时间","min-width":"170",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[i("span",[e._v(e._s(s.active_time||"-"))])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"过期时间","min-width":"170",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[s.expire_time?i("div",[i("div",[e._v(e._s(s.expire_time))]),e._v(" "),"已到期"===s.active_desc?i("div",{staticClass:"expired-tips"},[e._v("已到期")]):e._e(),e._v(" "),"即将到期"===s.active_desc?i("div",{staticClass:"expired-tips danger"},[e._v("即将到期")]):e._e()]):i("span",[e._v(" - ")])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"操作",align:"center","min-width":"170",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",{staticClass:"c-00B38A pointer",on:{click:function(i){return e.detailEvent(t.row)}}},[e._v("详情")]),e._v(" "),i("span",{staticClass:"c-00B38A pointer ml-3",on:{click:function(i){return e.onClickInfoBind(t.row)}}},[e._v("信息绑定")]),e._v(" "),[1==t.row.is_active?i("span",{staticClass:"c-00B38A pointer ml-3",on:{click:function(i){return e.onClickTransfer(t.row)}}},[e._v("转移许可")]):i("span",{staticClass:"c-00B38A pointer ml-3",on:{click:function(i){return e.onClickAssign(t.row)}}},[e._v("分配许可")])]]}}])})],1),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],staticClass:"pagination"},[i("el-pagination",{attrs:{background:"","current-page":e.page,layout:"prev, pager, next","page-count":Number(e.pages)},on:{"current-change":e.handleCurrentChange}})],1)],1)]),e._v(" "),i("el-drawer",{attrs:{size:e.drawerSize,visible:e.userDetailFlag,"with-header":!1},on:{"update:visible":function(t){e.userDetailFlag=t}}},[e.userDetailFlag?i("user-detail",{attrs:{user_id:e.user_detail_id},on:{changeDrawerSize:e.changeDrawerSize,closeDrawer:e.closeDrawer}}):e._e()],1),e._v(" "),i("memberInfoBind",{attrs:{dialogVisible:e.infoBindDialogVisible,userInfo:e.currentBindInfo},on:{cancel:e.handleInfoBindCancel,confirm:e.handleInfoBindConfirm}}),e._v(" "),i("assignDialog",{attrs:{dialogVisible:e.assignDialogVisible,userInfo:e.currentAssignInfo,waitForAssignNum:e.waitForAssignNum},on:{cancel:e.handleAssignCancel,confirm:e.handleAssignConfirm}}),e._v(" "),i("transferDialog",{attrs:{dialogVisible:e.transferDialogVisible,userInfo:e.currentTransferInfo},on:{cancel:e.handleTransferCancel,confirm:e.handleTransferConfirm}}),e._v(" "),i("assignResult",{attrs:{dialogVisible:e.assignResultVisible,resInfo:e.currentAssignResult},on:{cancel:e.handleAssignResultCancel,confirm:e.handleAssignResultConfirm}})],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"self-hint"},[t("i",{staticClass:"el-icon-message-solid"}),this._v(" "),t("div",[t("p",[this._v("购买许可—需要联系开发人员提供企微主体和购买数量进行许可购买")]),this._v(" "),t("p",[this._v("分配许可—只能将许可分配给未激活的成员,激活时间为分配时间")]),this._v(" "),t("p",[this._v("转移许可—转移许可为离职成员或不在服务商应用可见范围内的成员时,不限转移时间间隔,转移许可的成员为在职成员在服务商应用可见范围内时,转移后30天才可进行下一次转移;转移许可接收成员不能与转移成员的许可重叠")])])])}]};var j=i("VU/8")(M,J,!1,function(e){i("8hLK"),i("dWoc")},"data-v-0e3372ac",null);t.default=j.exports},dWoc:function(e,t){},i25K:function(e,t){}});
|