企微助手 ,仓库名 短剧

39.535e8a02b7d1cdceee04.js 29KB

1
  1. webpackJsonp([39],{"4aKH":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAAXNSR0IArs4c6QAAAz9JREFUSA3tVktIVGEU/s51tAiZyMp8EEZBREWLclFg0WBgOQYVLqIgiwKjReBjLGoRQfRwhhYilEQQWEjtpBlLCiwMemBUhJGUthBKMLSUfI5zOveO3TvTf0cdH7Tph5k5/znfd853z/0fQ5jJeFSzEMN9hQC7AMqU3wFJ1wbNUY/80qdTSU1TAdliAr5jYL4inxTbOKEZGo4gv6LdNj7unJ4Av/eyFD41UWIjRtQD4ly4K97GwsYvIOA9gBDfiZVQ9VMnFqWsQ87RfjUGadJko6Um0YS03ksCo9KcT8ng5ejtKYsFnVhAwFuMrr5mk9zRuUNaL4stzkFcFIthL4CZcL/ymrT6ujzxqEUe22LZcViMFQhUptkx7AU0+EoEfNwgEHeaRKKlph234bDlqgIaqpzy5Ges/JRu2oQe047XCNlzVQGh0e2Se7GZn3m1ZVOLacdjEH1DQclXO4oqgMbW/gXMwOPqsKBEboS+t+MdjDrhsR1NFcBakgIcGjxh+PI8v2RRnlPiEzl0wcl0KRZEFaBRmwJmnERLzQLDv9tTLed+rYKxcxCG5KgphKv8u11Y96kCkPgAhJ8RhAGZ30YvrAOpoFz2NZ2Xtg5H4KJNwickaNtQUNYUHYie2R/Ffu9+OXDqBPpCJO6Vs7wrmjY+C/iy5AY8LLvGZdyGxIMS+QjW6pG86S5crqAtL8JpL0AH6KfgMmctsov1KzY8Gn1rMMqr4C5viLWo/kDN30ZvKoLyEMw9SJRdlOf5YsbEsBfQ1OSIUu+/uhUI3pIFuNIgEz0R5mm4PS8jk0XZDVXzMDZ8SHwXpUtLrBi9gZZQBHfpe91nCfB718v8gijdLE93FgWemwYp/Dr0209dL0Svxf9QCrwDUzc0ng9OyACHcsTvFn+qkUP9GoFDy8Wu8mdhAX7fPiHp71y2IP1AujPTaL3evhH+IH7rYFKTTc9D1I405wYtfEnwjXBxI9dz870H6aB4Zr+4XoZlLXX175S2antkEvG3ijoMGWHQRtOeC4M4W5Pi0UU07rZqsWyzORwhZOkCnHNYYtLU6sqelDK7gP8C/nkHHNCoESGyrkvCK/MtM1rlVFT/H5iAmRr8+Teb3/JfFlt2sQAAAABJRU5ErkJggg=="},AfMk:function(t,e){},VRQ0:function(t,e){},eLUo:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i("//Fk"),n=i.n(s),a=i("Xxa5"),c=i.n(a),l=i("exGp"),o=i.n(l),r=i("Gu7T"),d=i.n(r),u=i("YLOf"),h=i("M4fF"),m=i.n(h),v=i("McOJ"),p={name:"adqAccountOptions",components:{selfInput:v.a},props:{width:{type:String,default:function(){return""}},clearable:{type:Boolean,default:function(){return!1}},accountListResult:{type:Array,default:function(){return[]}}},data:function(){return{reset:!1,loading:!1,dialogVisible:!1,keyword:"",accountList:[],accountListSelected:[],isSelectAll:!1}},computed:{accountListResultName:function(){return this.accountListResult.map(function(t){return t.name}).join(",")},accountListFilter:function(){var t=this,e=this.accountList.filter(function(e){var i=e.name.toLowerCase(),s=t.keyword.toLowerCase();return i.includes(s)});return e}},watch:{dialogVisible:function(t){t?this.handleGetAccountList():(this.keyword="",this.reset=!this.reset)}},methods:{handleGetAccountList:function(){var t=this;return o()(c.a.mark(function e(){var i,s,n;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,t.accountList=[],e.next=5,t.$axios.get(t.URL.BASEURL+t.URL.adqAccount_list,{params:{is_select:1}});case 5:i=e.sent,s=i.data,(n=void 0===s?{}:s)&&0==n.errno?(t.accountList=n.rst.map(function(t){return{id:t.account_id,name:t.account_id,isSelected:!1}}),t.handleGetAccountListSelected(),t.handleGetIsSelectedChatStatus(),t.handleGetIsSelectAll()):4002!=n.errno&&t.$message.warning(n.err),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("error => ",e.t0);case 14:return e.prev=14,t.loading=!1,e.finish(14);case 17:case"end":return e.stop()}},e,t,[[0,11,14,17]])}))()},onChangeKeyword:function(t){this.keyword=t},handleCloseAllChatList:function(){this.accountList.forEach(function(t){t.isSelected=!1})},handleGetAccountListSelected:function(){var t=this;this.accountListSelected=[],this.accountListResult.forEach(function(e){var i=t.accountList.find(function(t){return t.id===e.id});i&&(!t.accountListSelected.find(function(t){return t.id===i.id})&&t.accountListSelected.push(i))})},handleGetIsSelectedChatStatus:function(){var t=this;this.handleCloseAllChatList(),this.accountListSelected.forEach(function(e){var i=t.accountList.findIndex(function(t){return t.id===e.id});-1!==i&&(t.accountList[i].isSelected=!0)})},handleSwitchAccountItem:function(t){if(t.isSelected){var e=this.accountList.findIndex(function(e){return e.id===t.id});-1!==e&&(this.accountList[e].isSelected=!1);var i=this.accountListSelected.findIndex(function(e){return e.id===t.id});-1!==i&&this.accountListSelected.splice(i,1)}else{var s=this.accountList.findIndex(function(e){return e.id===t.id});-1!==s&&(this.accountList[s].isSelected=!0),this.accountListSelected=[].concat(d()(this.accountListSelected),[t])}this.handleGetIsSelectAll()},handleDelSelectedAccount:function(t){this.accountListSelected.splice(t,1),this.handleGetIsSelectAll(),this.handleGetIsSelectedChatStatus()},handleDelAllSelectedAccount:function(){this.accountListSelected=[],this.handleGetIsSelectAll(),this.handleGetIsSelectedChatStatus()},onClickConfirm:function(){this.$emit("change",{selectedList:m.a.cloneDeep(this.accountListSelected),isSelectAll:this.isSelectAll}),this.dialogVisible=!1},onClickCancel:function(){var t=this;this.accountListSelected.length?this.$confirm("当前已选择的账号未保存, 确定关闭吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.dialogVisible=!1}).catch(function(){console.log("取消")}):this.dialogVisible=!1},onClickSelectAll:function(t){var e=t.isSelectAll;this.isSelectAll=e,e?(this.accountListSelected=[].concat(d()(this.accountList)),this.handleGetIsSelectedChatStatus()):this.handleDelAllSelectedAccount()},handleGetIsSelectAll:function(){var t=this.accountListSelected.length;this.accountList.length&&t===this.accountList.length?this.isSelectAll=!0:this.isSelectAll=!1},onClickClearBtn:function(){this.handleDelAllSelectedAccount(),this.onClickConfirm()}}},_={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"common-screen-item"},[i("el-popover",{attrs:{"append-to-body":"",placement:"bottom",trigger:"manual"},model:{value:t.dialogVisible,callback:function(e){t.dialogVisible=e},expression:"dialogVisible"}},[i("div",{class:["common-screen-self-box","common-input-select",t.accountListResult.length&&t.clearable?"common-input-select-hover":""],style:t.width?"width:"+t.width:"",attrs:{slot:"reference"},on:{click:function(e){t.dialogVisible=!0}},slot:"reference"},[i("div",{class:["common-screen-self-con",t.accountListResult.length?"":"common-screen-self-placeholder"]},[i("div",{staticClass:"common-screen-self-con-div"},[t.accountListResult.length?i("span",[t._v(t._s(t.accountListResultName))]):i("span",[t._v("请选择")])]),t._v(" "),i("i",{staticClass:"el-icon-circle-close other-icon",on:{click:function(e){return e.stopPropagation(),t.onClickClearBtn.apply(null,arguments)}}})]),t._v(" "),i("div",{staticClass:"common-screen-self-icon"},[i("i",{staticClass:"el-icon-arrow-down"})])]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"flex",staticStyle:{padding:"10px"}},[i("div",{staticClass:"propoverItem"},[i("div",{staticClass:"filter-wrap"},[i("self-input",{staticStyle:{"margin-top":"0","margin-bottom":"0"},attrs:{reset:t.reset,hasLabel:!1,inputFlag:!0,label_name:"账号",width:"270px"},on:{inputChange:t.onChangeKeyword}})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:!t.keyword,expression:"!keyword"}],staticClass:"allMember"},[i("span",[t._v("全部账号("+t._s(t.accountList&&t.accountList.length)+"):")]),t._v(" "),i("div",[t.isSelectAll?i("div",{staticClass:"checkbox checkbox_active",on:{click:function(e){return t.onClickSelectAll({isSelectAll:!1})}}},[i("i",{staticClass:"el-icon-check"})]):i("div",{staticClass:"checkbox",on:{click:function(e){return t.onClickSelectAll({isSelectAll:!0})}}})])]),t._v(" "),i("div",{staticClass:"memberBoxBig self-scrollbar-3"},t._l(t.accountListFilter,function(e,s){return i("div",{key:e.id,staticClass:"memberBox"},[i("div",{staticClass:"meberList"},[i("div",{staticClass:"memberItem",on:{click:function(i){return t.handleSwitchAccountItem(e)}}},[i("div",{staticClass:"flex",staticStyle:{flex:"1"}},[i("i",{staticClass:"el-icon-tickets chat-icon"}),t._v(" "),i("div",{staticClass:"memberInfo"},[i("div",{staticClass:"name"},[t._v(t._s(e.name))])])]),t._v(" "),i("div",{class:["checkbox",e.isSelected?"checkbox_active":""]},[i("i",{staticClass:"el-icon-check"})])])])])}),0)]),t._v(" "),i("div",{staticClass:"line"}),t._v(" "),i("div",{staticClass:"propoverItem",staticStyle:{"padding-left":"20px"}},[i("div",{staticClass:"title"},[t._v("已选择的账号")]),t._v(" "),i("div",{staticClass:"choice_result_top"},[i("div",{staticClass:"clear",on:{click:t.handleDelAllSelectedAccount}},[t._v("全部清空")]),t._v(" "),i("div",{staticClass:"result_num"},[t._v("已选择"),i("span",[t._v(t._s(t.accountListSelected.length))]),t._v("个账号")])]),t._v(" "),i("div",{staticClass:"member_result self-scrollbar-3"},t._l(t.accountListSelected,function(e,s){return i("div",{key:e.id,staticClass:"memberItem"},[i("div",{staticClass:"flex",staticStyle:{flex:"1"}},[i("i",{staticClass:"el-icon-tickets chat-icon"}),t._v(" "),i("div",{staticClass:"memberInfo"},[i("div",{staticClass:"name"},[t._v(t._s(e.name))])])]),t._v(" "),i("i",{staticClass:"el-icon-close",staticStyle:{"margin-left":"10px"},on:{click:function(e){return t.handleDelSelectedAccount(s)}}})])}),0),t._v(" "),i("div",{staticClass:"buttons"},[i("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:t.onClickCancel}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickConfirm}},[t._v("确定")])],1)])])])],1)},staticRenderFns:[]};var f=i("VU/8")(p,_,!1,function(t){i("AfMk")},"data-v-b04a2ad0",null).exports,g={name:"adqAccountOptions",components:{selfInput:v.a},props:{width:{type:String,default:function(){return""}},clearable:{type:Boolean,default:function(){return!1}},accountListResult:{type:Array,default:function(){return[]}}},data:function(){return{reset:!1,loading:!1,dialogVisible:!1,keyword:"",accountList:[],accountListSelected:[],isSelectAll:!1}},computed:{accountListResultName:function(){return this.accountListResult.map(function(t){return t.name}).join(",")},accountListFilter:function(){var t=this,e=this.accountList.filter(function(e){var i=e.name.toLowerCase(),s=t.keyword.toLowerCase();return i.includes(s)});return e}},watch:{dialogVisible:function(t){t?this.handleGetAccountList():(this.keyword="",this.reset=!this.reset)}},methods:{handleGetAccountList:function(){var t=this;return o()(c.a.mark(function e(){var i,s,n;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,t.accountList=[],e.next=5,t.$axios.get(t.URL.BASEURL+t.URL.pitcher_wxAccountList,{params:{is_select:1}});case 5:i=e.sent,s=i.data,(n=void 0===s?{}:s)&&0==n.errno?(t.accountList=n.rst.map(function(t){return{id:t.wechat_account_id,name:t.account_name,isSelected:!1}}),t.handleGetAccountListSelected(),t.handleGetIsSelectedChatStatus(),t.handleGetIsSelectAll()):4002!=n.errno&&t.$message.warning(n.err),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("error => ",e.t0);case 14:return e.prev=14,t.loading=!1,e.finish(14);case 17:case"end":return e.stop()}},e,t,[[0,11,14,17]])}))()},onChangeKeyword:function(t){this.keyword=t},handleCloseAllChatList:function(){this.accountList.forEach(function(t){t.isSelected=!1})},handleGetAccountListSelected:function(){var t=this;this.accountListSelected=[],this.accountListResult.forEach(function(e){var i=t.accountList.find(function(t){return t.id===e.id});i&&(!t.accountListSelected.find(function(t){return t.id===i.id})&&t.accountListSelected.push(i))})},handleGetIsSelectedChatStatus:function(){var t=this;this.handleCloseAllChatList(),this.accountListSelected.forEach(function(e){var i=t.accountList.findIndex(function(t){return t.id===e.id});-1!==i&&(t.accountList[i].isSelected=!0)})},handleSwitchAccountItem:function(t){if(t.isSelected){var e=this.accountList.findIndex(function(e){return e.id===t.id});-1!==e&&(this.accountList[e].isSelected=!1);var i=this.accountListSelected.findIndex(function(e){return e.id===t.id});-1!==i&&this.accountListSelected.splice(i,1)}else{var s=this.accountList.findIndex(function(e){return e.id===t.id});-1!==s&&(this.accountList[s].isSelected=!0),this.accountListSelected=[].concat(d()(this.accountListSelected),[t])}this.handleGetIsSelectAll()},handleDelSelectedAccount:function(t){this.accountListSelected.splice(t,1),this.handleGetIsSelectAll(),this.handleGetIsSelectedChatStatus()},handleDelAllSelectedAccount:function(){this.accountListSelected=[],this.handleGetIsSelectAll(),this.handleGetIsSelectedChatStatus()},onClickConfirm:function(){this.$emit("change",{selectedList:m.a.cloneDeep(this.accountListSelected),isSelectAll:this.isSelectAll}),this.dialogVisible=!1},onClickCancel:function(){var t=this;this.accountListSelected.length?this.$confirm("当前已选择的账号未保存, 确定关闭吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.dialogVisible=!1}).catch(function(){console.log("取消")}):this.dialogVisible=!1},onClickSelectAll:function(t){var e=t.isSelectAll;this.isSelectAll=e,e?(this.accountListSelected=[].concat(d()(this.accountList)),this.handleGetIsSelectedChatStatus()):this.handleDelAllSelectedAccount()},handleGetIsSelectAll:function(){var t=this.accountListSelected.length;this.accountList.length&&t===this.accountList.length?this.isSelectAll=!0:this.isSelectAll=!1},onClickClearBtn:function(){this.handleDelAllSelectedAccount(),this.onClickConfirm()}}},L={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"common-screen-item"},[i("el-popover",{attrs:{"append-to-body":"",placement:"bottom",trigger:"manual"},model:{value:t.dialogVisible,callback:function(e){t.dialogVisible=e},expression:"dialogVisible"}},[i("div",{class:["common-screen-self-box","common-input-select",t.accountListResult.length&&t.clearable?"common-input-select-hover":""],style:t.width?"width:"+t.width:"",attrs:{slot:"reference"},on:{click:function(e){t.dialogVisible=!0}},slot:"reference"},[i("div",{class:["common-screen-self-con",t.accountListResult.length?"":"common-screen-self-placeholder"]},[i("div",{staticClass:"common-screen-self-con-div"},[t.accountListResult.length?i("span",[t._v(t._s(t.accountListResultName))]):i("span",[t._v("请选择")])]),t._v(" "),i("i",{staticClass:"el-icon-circle-close other-icon",on:{click:function(e){return e.stopPropagation(),t.onClickClearBtn.apply(null,arguments)}}})]),t._v(" "),i("div",{staticClass:"common-screen-self-icon"},[i("i",{staticClass:"el-icon-arrow-down"})])]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"flex",staticStyle:{padding:"10px"}},[i("div",{staticClass:"propoverItem"},[i("div",{staticClass:"filter-wrap"},[i("self-input",{staticStyle:{"margin-top":"0","margin-bottom":"0"},attrs:{reset:t.reset,hasLabel:!1,inputFlag:!0,label_name:"账号",width:"270px"},on:{inputChange:t.onChangeKeyword}})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:!t.keyword,expression:"!keyword"}],staticClass:"allMember"},[i("span",[t._v("全部账号("+t._s(t.accountList&&t.accountList.length)+"):")]),t._v(" "),i("div",[t.isSelectAll?i("div",{staticClass:"checkbox checkbox_active",on:{click:function(e){return t.onClickSelectAll({isSelectAll:!1})}}},[i("i",{staticClass:"el-icon-check"})]):i("div",{staticClass:"checkbox",on:{click:function(e){return t.onClickSelectAll({isSelectAll:!0})}}})])]),t._v(" "),i("div",{staticClass:"memberBoxBig self-scrollbar-3"},t._l(t.accountListFilter,function(e,s){return i("div",{key:e.id,staticClass:"memberBox"},[i("div",{staticClass:"meberList"},[i("div",{staticClass:"memberItem",on:{click:function(i){return t.handleSwitchAccountItem(e)}}},[i("div",{staticClass:"flex",staticStyle:{flex:"1"}},[i("i",{staticClass:"el-icon-tickets chat-icon"}),t._v(" "),i("div",{staticClass:"memberInfo"},[i("div",{staticClass:"name"},[t._v(t._s(e.name))])])]),t._v(" "),i("div",{class:["checkbox",e.isSelected?"checkbox_active":""]},[i("i",{staticClass:"el-icon-check"})])])])])}),0)]),t._v(" "),i("div",{staticClass:"line"}),t._v(" "),i("div",{staticClass:"propoverItem",staticStyle:{"padding-left":"20px"}},[i("div",{staticClass:"title"},[t._v("已选择的账号")]),t._v(" "),i("div",{staticClass:"choice_result_top"},[i("div",{staticClass:"clear",on:{click:t.handleDelAllSelectedAccount}},[t._v("全部清空")]),t._v(" "),i("div",{staticClass:"result_num"},[t._v("已选择"),i("span",[t._v(t._s(t.accountListSelected.length))]),t._v("个账号")])]),t._v(" "),i("div",{staticClass:"member_result self-scrollbar-3"},t._l(t.accountListSelected,function(e,s){return i("div",{key:e.id,staticClass:"memberItem"},[i("div",{staticClass:"flex",staticStyle:{flex:"1"}},[i("i",{staticClass:"el-icon-tickets chat-icon"}),t._v(" "),i("div",{staticClass:"memberInfo"},[i("div",{staticClass:"name"},[t._v(t._s(e.name))])])]),t._v(" "),i("i",{staticClass:"el-icon-close",staticStyle:{"margin-left":"10px"},on:{click:function(e){return t.handleDelSelectedAccount(s)}}})])}),0),t._v(" "),i("div",{staticClass:"buttons"},[i("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:t.onClickCancel}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickConfirm}},[t._v("确定")])],1)])])])],1)},staticRenderFns:[]};var C=i("VU/8")(g,L,!1,function(t){i("kHBj")},"data-v-cecf0434",null).exports,S={name:"roleManage",components:{noData:u.a,adqAccountOptions:f,mpAccountOptions:C},data:function(){return{loading:!1,dialogLoading:!1,dialogTableVisible:!1,dialogTitleName:"添加账号",tableData:[],name:"",is_super_admin:"",password:"",id:"",role_ids:[],corp_ids:[],roleList:[],corpList:[],is_promoter:!1,adq_account:[],is_all_adq:!1,mp_account:[],is_all_mp:!1,can_export:!1}},created:function(){this.init(),this.get_roleList(),this.get_corpList()},methods:{deleteSystemAccount:function(t){var e=this;this.$confirm("确定要删除账号("+t.name+")?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$loading(e.$loadingConfig),e.$axios.post(e.URL.BASEURL+e.URL.admin_del,{id:t.id}).then(function(t){t=t.data;e.$loading(e.$loadingConfig).close(),t&&0==t.errno?e.init():e.$message({message:t.err,type:"warning"})}).catch(function(){e.$loading(e.$loadingConfig).close()})}).catch(function(){})},init:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.manager_list,{params:{page:1,page_size:50}}).then(function(e){(e=e.data)&&0==e.errno?t.tableData=e.rst.data:4002!=e.errno&&t.$message({message:e.err,type:"warning"}),t.loading=!1}).catch(function(){t.loading=!1})},get_roleList:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.all_permission_list,{}).then(function(e){(e=e.data)&&0==e.errno?t.roleList=e.rst:t.$message({message:e.err,type:"warning"})}).catch(function(){})},get_corpList:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.all_corp_list,{}).then(function(e){(e=e.data)&&0==e.errno?t.corpList=e.rst:t.$message({message:e.err,type:"warning"})}).catch(function(){})},addManager:function(){var t=this;if(""==this.name)return this.$message({message:"权限名为必填项",type:"warning"}),!1;this.dialogLoading=!0,this.$axios.post(this.URL.BASEURL+this.URL.manager_add,{name:this.name,password:this.password,role_id:this.role_ids,corp_id:this.corp_ids,is_promoter:this.is_promoter?1:0,is_all_adq:this.is_all_adq?1:0,adq_account:this.is_all_adq?"":this.adq_account.map(function(t){return t.id}).join(",")||"",is_all_mp:this.is_all_mp?1:0,mp_account:this.is_all_mp?"":this.mp_account.map(function(t){return t.id}).join(",")||"",can_export:this.can_export?1:0}).then(function(e){e=e.data;t.dialogLoading=!1,e&&0==e.errno?(t.dialogTableVisible=!1,t.$message.success("操作成功"),t.init()):t.$message({message:e.err,type:"warning"})}).catch(function(){t.dialogLoading=!1})},editManager:function(){var t=this;if(""==this.id)return this.$message({message:"id获取不到",type:"warning"}),!1;this.dialogLoading=!0,this.$axios.post(this.URL.BASEURL+this.URL.manager_edit,{password:this.password,role_id:this.role_ids,corp_id:this.corp_ids,id:this.id,is_promoter:this.is_promoter?1:0,is_all_adq:this.is_all_adq?1:0,adq_account:this.is_all_adq?"":this.adq_account.map(function(t){return t.id}).join(",")||"",is_all_mp:this.is_all_mp?1:0,mp_account:this.is_all_mp?"":this.mp_account.map(function(t){return t.id}).join(",")||"",can_export:this.can_export?1:0}).then(function(e){e=e.data;t.dialogLoading=!1,e&&0==e.errno?(t.dialogTableVisible=!1,t.$message.success("操作成功"),t.init()):t.$message({message:e.err,type:"warning"})}).catch(function(){t.dialogLoading=!1})},rebackInfo:function(t){var e=this;if(!t)return this.$message({message:"id没有获取到",type:"warning"}),!1;this.dialogLoading=!0,this.$axios.get(this.URL.BASEURL+this.URL.manager_info,{params:{id:Number(t)}}).then(function(t){(t=t.data)&&0==t.errno?(e.name=t.rst.name,e.role_ids=t.rst.role_id,e.corp_ids=t.rst.corp_id,e.handleGetAccountData(t.rst)):e.$message({message:t.err,type:"warning"}),e.dialogLoading=!1}).catch(function(){e.dialogLoading=!1})},openDialog:function(t,e){this.password="","edit"==t?(this.dialogTitleName="编辑账号",this.id=e.id,this.is_super_admin=e.is_super_admin,this.is_promoter=1==e.is_promoter,this.rebackInfo(e.id)):(this.dialogTitleName="添加账号",this.id="",this.name="",this.role_ids=[],this.corp_ids=[],this.is_promoter=!1,this.adq_account=[],this.is_all_adq=!1,this.mp_account=[],this.is_all_mp=!1,this.can_export=!1),this.dialogTableVisible=!0},onChangeAdqAccount:function(t){var e=t.isSelectAll,i=t.selectedList;this.adq_account=[].concat(d()(i)),this.is_all_adq=e},onChangeMpAccount:function(t){var e=t.isSelectAll,i=t.selectedList;this.mp_account=[].concat(d()(i)),this.is_all_mp=e},handleGetAccountData:function(t){var e=this;return o()(c.a.mark(function i(){var s,n,a,l,o,r,u,h;return c.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return s=t.is_all_adq,n=t.is_all_mp,a=t.can_export,l=t.adq_account,o=t.mp_account,e.is_all_adq=1==s,e.is_all_mp=1==n,e.can_export=1==a,e.adq_account=[],e.mp_account=[],i.next=8,e.handleGetAdqAccount();case 8:return r=i.sent,e.is_all_adq?e.adq_account=[].concat(d()(r)):l&&(e.adq_account=l.split(",").map(function(t){return{id:t,name:t}})),i.next=12,e.handleGetMpAccount();case 12:u=i.sent,e.is_all_mp?e.mp_account=[].concat(d()(u)):o&&((h=o.split(",").map(function(t){return{id:t,name:""}})).forEach(function(t){var e=u.find(function(e){return t.id===e.id});e&&(t.name=e.name)}),e.mp_account=[].concat(d()(h)));case 14:case"end":return i.stop()}},i,e)}))()},handleGetAdqAccount:function(){var t,e=this;return new n.a((t=o()(c.a.mark(function t(i,s){var n,a,l,o;return c.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.dialogLoading=!0,t.next=4,e.$axios.get(e.URL.BASEURL+e.URL.adqAccount_list,{params:{is_select:1}});case 4:n=t.sent,a=n.data,(l=void 0===a?{}:a)&&0==l.errno?(o=l.rst.map(function(t){return{id:t.account_id,name:t.account_id}}),i(o)):4002!=l.errno&&(e.$message.warning(l.err),s(l.err)),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),console.log("error => ",t.t0);case 13:return t.prev=13,e.dialogLoading=!1,t.finish(13);case 16:case"end":return t.stop()}},t,e,[[0,10,13,16]])})),function(e,i){return t.apply(this,arguments)}))},handleGetMpAccount:function(){var t,e=this;return new n.a((t=o()(c.a.mark(function t(i,s){var n,a,l,o;return c.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.dialogLoading=!0,t.next=4,e.$axios.get(e.URL.BASEURL+e.URL.pitcher_wxAccountList,{params:{is_select:1}});case 4:n=t.sent,a=n.data,(l=void 0===a?{}:a)&&0==l.errno?(o=l.rst.map(function(t){return{id:t.wechat_account_id,name:t.account_name}}),i(o)):4002!=l.errno&&(e.$message.warning(l.err),s(l.err)),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),console.log("error => ",t.t0);case 13:return t.prev=13,e.dialogLoading=!1,t.finish(13);case 16:case"end":return t.stop()}},t,e,[[0,10,13,16]])})),function(e,i){return t.apply(this,arguments)}))}}},A={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"con"},[s("div",[s("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(e){return t.openDialog("add")}}},[t._v("添加账号")])],1),t._v(" "),s("table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"tableCon"},[t._m(0),t._v(" "),t.tableData&&t.tableData.length>0?[s("tbody",t._l(t.tableData,function(e,n){return s("tr",{key:e.id},[s("td",[t._v("\n "+t._s(e.name?e.name:"-")+"\n "),s("el-tooltip",{attrs:{effect:"dark",content:"系统管理员"}},[s("div",{staticStyle:{display:"inline-block"}},[1==e.is_system_admin?s("img",{staticClass:"pointer",staticStyle:{width:"14px"},attrs:{src:i("4aKH"),alt:""}}):t._e()])])],1),t._v(" "),s("td",[s("div",{staticClass:"lableBox_dad"},[e.corp&&e.corp.length>0?t._l(e.corp,function(e,i){return s("div",{key:i,staticClass:"lableBox"},[t._v("\n "+t._s(e)+"\n ")])}):[t._v("-")]],2)]),t._v(" "),s("td",[s("div",{staticClass:"lableBox_dad"},[e.role&&e.role.length>0?t._l(e.role,function(e,i){return s("div",{key:i,staticClass:"lableBox"},[t._v("\n "+t._s(e)+"\n ")])}):[t._v("-")]],2)]),t._v(" "),s("td",[t._v("\n "+t._s(1==e.is_promoter?"是":"否")+"\n ")]),t._v(" "),s("td",[1==e.can_del?[s("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(i){return t.openDialog("edit",e)}}},[t._v("编辑")]),t._v(" "),1!=e.is_system_admin?s("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(i){return t.deleteSystemAccount(e)}}},[t._v("删除\n ")]):t._e()]:s("span",{staticClass:"f12 c-A5A5A5"},[t._v("无权限操作")])],2)])}),0)]:t._e()],2),t._v(" "),t.tableData&&0==t.tableData.length?s("noData"):t._e(),t._v(" "),s("el-dialog",{staticClass:"dialogCon_permission",attrs:{title:t.dialogTitleName,visible:t.dialogTableVisible,"append-to-body":!0,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogTableVisible=e}}},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.dialogLoading,expression:"dialogLoading"}],staticClass:"dialogCon"},[s("div",{staticClass:"itemBox",staticStyle:{"margin-top":"0"}},[s("div",{staticClass:"name"},[t._v("名称:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("el-input",{attrs:{size:"small",disabled:"编辑账号"==t.dialogTitleName,placeholder:"请输入名称"},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}})],1)]),t._v(" "),s("div",{staticClass:"itemBox"},[s("div",{staticClass:"name"},[t._v("密码:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("el-input",{attrs:{size:"small",placeholder:"请输入密码"},model:{value:t.password,callback:function(e){t.password=e},expression:"password"}}),t._v(" "),"编辑账号"==t.dialogTitleName?s("div",{staticStyle:{color:"red","font-size":"12px","margin-top":"6px","margin-left":"4px"}},[t._v("\n *密码不填不修改,填写后将覆盖原密码")]):t._e()],1)]),t._v(" "),s("div",{staticClass:"itemBox"},[s("div",{staticClass:"name"},[t._v("选择主体:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("el-select",{staticClass:"select-cls",staticStyle:{width:"100%"},attrs:{size:"small",disabled:1==t.is_super_admin,multiple:"",placeholder:"请选择",filterable:""},model:{value:t.corp_ids,callback:function(e){t.corp_ids=e},expression:"corp_ids"}},t._l(t.corpList,function(t){return s("el-option",{key:t.id,attrs:{label:t.corp_name,value:t.id}})}),1)],1)]),t._v(" "),s("div",{staticClass:"itemBox"},[s("div",{staticClass:"name"},[t._v("选择角色:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("el-select",{staticClass:"select-cls",staticStyle:{width:"100%"},attrs:{size:"small",disabled:1==t.is_super_admin,multiple:"",placeholder:"请选择",filterable:""},model:{value:t.role_ids,callback:function(e){t.role_ids=e},expression:"role_ids"}},t._l(t.roleList,function(t){return s("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1)]),t._v(" "),s("div",{staticClass:"itemBox"},[s("div",{staticClass:"name"},[t._v("关联ADQ账号:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("adqAccountOptions",{staticStyle:{margin:"0"},attrs:{width:"330px",clearable:"",accountListResult:t.adq_account},on:{change:t.onChangeAdqAccount}})],1)]),t._v(" "),s("div",{staticClass:"itemBox"},[s("div",{staticClass:"name"},[t._v("关联MP账号:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("mpAccountOptions",{staticStyle:{margin:"0"},attrs:{width:"330px",clearable:"",accountListResult:t.mp_account},on:{change:t.onChangeMpAccount}})],1)]),t._v(" "),s("div",{staticClass:"itemBox"},[s("div",{staticClass:"name"},[t._v("数据导出:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ccc"},model:{value:t.can_export,callback:function(e){t.can_export=e},expression:"can_export"}})],1)]),t._v(" "),s("div",{staticClass:"itemBox"},[s("div",{staticClass:"name"},[t._v("是否为投手:")]),t._v(" "),s("div",{staticClass:"ipt"},[s("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ccc"},model:{value:t.is_promoter,callback:function(e){t.is_promoter=e},expression:"is_promoter"}})],1)])]),t._v(" "),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{size:"mini"},on:{click:function(e){t.dialogTableVisible=!1}}},[t._v("取 消")]),t._v(" "),s("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(e){"添加账号"==t.dialogTitleName?t.addManager():t.editManager()}}},[t._v("确 定\n ")])],1)])],1)},staticRenderFns:[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("thead",[i("tr",[i("th",[t._v("账号名称")]),t._v(" "),i("th",{staticStyle:{width:"40%"}},[t._v("主体")]),t._v(" "),i("th",{staticStyle:{width:"15%"}},[t._v("角色")]),t._v(" "),i("th",{staticStyle:{width:"10%"}},[t._v("是否为投手")]),t._v(" "),i("th",[t._v("操作")])])])}]};var b=i("VU/8")(S,A,!1,function(t){i("VRQ0")},"data-v-6994b6ba",null);e.default=b.exports},kHBj:function(t,e){}});