1 |
- webpackJsonp([49],{"/hW9":function(e,t){},"3XIC":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Xxa5"),i=a.n(n),r=a("exGp"),s=a.n(r),o=a("ifoU"),l=a.n(o),c=a("pdUL"),d=a("FsX6"),u=a("3uEH"),f=a("Dd8w"),p=a.n(f),h=a("mvHQ"),m=a.n(h),v=a("//Fk"),g=a.n(v),_=a("Gu7T"),w=a.n(_),C=a("fGUm"),b=a("M4fF"),y=a.n(b),x=a("McOJ"),S={name:"chatGroupOptions",components:{selfInput:x.a},props:{width:{type:String,default:function(){return""}},isHasRoomId:{type:Boolean,default:function(){return!1}},isDataIdx:{type:Boolean,default:function(){return!1}},dataIdx:{type:Number,default:function(){return 0}},chatListResult:{type:Array,default:function(){return[]}}},data:function(){return{reset:!1,loading:!1,dialogVisible:!1,ownerOptions:[],owner:"",keyword:"",chatList:[],chatListSelected:[]}},computed:{chatListResultName:function(){return this.chatListResult.map(function(e){return e.name}).join(",")}},watch:{dialogVisible:function(e){e?(this.handleGetOwnerOptions(),this.handleGetChatList()):(this.owner="",this.keyword="",this.reset=!this.reset)}},methods:{handleGetChatList:function(){var e=this;return s()(i.a.mark(function t(){var a,n,r;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,e.chatList=[],t.next=5,e.$axios.get(e.URL.BASEURL+e.URL.groupCode_chatGroupList,{params:{keyword:e.keyword,owner:e.owner,has_room_id:!!e.isHasRoomId}});case 5:a=t.sent,n=a.data,(r=void 0===n?{}:n)&&0==r.errno?(e.chatList=r.rst.map(function(e){return p()({},e,{name:e.name||"未设置群名",isSelected:!1})}),e.chatListResult.length&&e.handleGetChatListSelected(),e.handleGetIsSelectedChatStatus()):4002!=r.errno&&e.$message.warning(r.err),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.log("error => ",t.t0);case 14:return t.prev=14,e.loading=!1,t.finish(14);case 17:case"end":return t.stop()}},t,e,[[0,11,14,17]])}))()},handleGetOwnerOptions:function(){var e=this;return s()(i.a.mark(function t(){var a,n,r,s,o;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.ownerOptions=[],a=""+e.URL.BASEURL+e.URL.chatGroup_chatGroupOwnerIndex,n={},t.next=6,e.$axios.get(a,{params:n});case 6:r=t.sent,s=r.data,(o=void 0===s?{}:s)&&0==o.errno?e.ownerOptions=Array.isArray(o.rst)?o.rst:[]:4002!=o.errno&&e.$message.warning(o.err),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.log("error => ",t.t0);case 15:case"end":return t.stop()}},t,e,[[0,12]])}))()},onChangeOwner:function(e){this.owner=e,this.handleGetChatList()},onChangeKeyword:function(e){this.keyword=e,this.handleGetChatList()},handleCloseAllChatList:function(){this.chatList.forEach(function(e){e.isSelected=!1})},handleGetChatListSelected:function(){var e=this;this.chatListResult.forEach(function(t){var a=e.chatList.find(function(e){return e.chat_id===t.chat_id});a&&(!e.chatListSelected.find(function(e){return e.chat_id===a.chat_id})&&e.chatListSelected.push(a))})},handleGetIsSelectedChatStatus:function(){var e=this;this.handleCloseAllChatList(),this.chatListSelected.forEach(function(t){var a=e.chatList.findIndex(function(e){return e.chat_id===t.chat_id});-1!==a&&(e.chatList[a].isSelected=!0)})},handleSwitchChatItem:function(e,t){if(e.isSelected){this.chatList[t].isSelected=!1;var a=this.chatListSelected.findIndex(function(t){return t.chat_id===e.chat_id});-1!==a&&this.chatListSelected.splice(a,1)}else this.chatList[t].isSelected=!0,this.chatListSelected=[].concat(w()(this.chatListSelected),[e])},handleDelSelectedChat:function(e){this.chatListSelected.splice(e,1),this.handleGetIsSelectedChatStatus()},handleDelAllSelectedChat:function(){this.chatListSelected=[],this.handleGetIsSelectedChatStatus()},onClickConfirm:function(){this.chatListSelected.length?(this.isDataIdx?this.$emit("change",{idx:this.dataIdx,res:y.a.cloneDeep(this.chatListSelected)}):this.$emit("change",y.a.cloneDeep(this.chatListSelected)),this.dialogVisible=!1):this.$message.warning("请选择群聊")},handleSetChatGroupsName:function(e){var t=this;return s()(i.a.mark(function a(){var n,r,s;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,t.$axios.get(t.URL.BASEURL+t.URL.groupCode_chatGroupList,{params:{keyword:"",owner:""}});case 3:if(n=a.sent,r=n.data,!(s=void 0===r?{}:r)||0!=s.errno||!Array.isArray(s.rst)){a.next=11;break}return e.forEach(function(t,a){var n=s.rst.find(function(e){return e.chat_id===t.chat_id});n&&(e[a].name=n.name)}),a.abrupt("return",g.a.resolve([].concat(w()(e))));case 11:return a.abrupt("return",g.a.resolve([].concat(w()(e))));case 12:a.next=17;break;case 14:return a.prev=14,a.t0=a.catch(0),a.abrupt("return",g.a.resolve([].concat(w()(e))));case 17:case"end":return a.stop()}},a,t,[[0,14]])}))()}}},k={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"common-screen-item",staticStyle:{"margin-top":"0"}},[a("el-popover",{attrs:{"append-to-body":"",placement:"bottom",trigger:"click"},model:{value:e.dialogVisible,callback:function(t){e.dialogVisible=t},expression:"dialogVisible"}},[a("div",{class:["common-screen-self-box","common-input-select",e.chatListResult.length?"common-input-select-hover":""],style:e.width?"width:"+e.width:"",attrs:{slot:"reference"},slot:"reference"},[a("div",{class:["common-screen-self-con",e.chatListResult.length?"":"common-screen-self-placeholder"]},[a("div",{staticClass:"common-screen-self-con-div"},[e.chatListResult.length?a("span",[e._v(e._s(e.chatListResultName))]):a("span",[e._v("请选择群聊")])])]),e._v(" "),a("div",{staticClass:"common-screen-self-icon"},[a("i",{staticClass:"el-icon-arrow-down"})])]),e._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"flex",staticStyle:{padding:"10px"}},[a("div",{staticClass:"propoverItem"},[a("div",{staticClass:"filter-wrap"},[a("el-select",{staticClass:"select-wrap",attrs:{size:"small",placeholder:"全部群主",clearable:""},on:{change:e.onChangeOwner},model:{value:e.owner,callback:function(t){e.owner=t},expression:"owner"}},e._l(e.ownerOptions,function(e){return a("el-option",{key:e.user_id,attrs:{label:e.name,value:e.user_id}})}),1),e._v(" "),a("self-input",{staticStyle:{"margin-top":"0","margin-bottom":"0"},attrs:{reset:e.reset,hasLabel:!1,label_name:"群名称",width:"180px"},on:{inputChange:e.onChangeKeyword}})],1),e._v(" "),a("div",{staticClass:"allMember"},[e._v("全部群聊("+e._s(e.chatList&&e.chatList.length)+"):")]),e._v(" "),a("div",{staticClass:"memberBoxBig self-scrollbar-3"},e._l(e.chatList,function(t,n){return a("div",{key:t.chat_id,staticClass:"memberBox"},[a("div",{staticClass:"meberList"},[a("div",{staticClass:"memberItem",on:{click:function(a){return e.handleSwitchChatItem(t,n)}}},[a("div",{staticClass:"flex",staticStyle:{flex:"1"}},[a("i",{staticClass:"el-icon-chat-dot-round chat-icon"}),e._v(" "),a("div",{staticClass:"memberInfo"},[a("div",{staticClass:"name"},[e._v(e._s(t.name))]),e._v(" "),a("div",{staticClass:"other"},[e._v("群主:"+e._s(t.owner_name))])])]),e._v(" "),a("div",{class:["checkbox",t.isSelected?"checkbox_active":""]},[a("i",{staticClass:"el-icon-check"})])])])])}),0)]),e._v(" "),a("div",{staticClass:"line"}),e._v(" "),a("div",{staticClass:"propoverItem",staticStyle:{"padding-left":"20px"}},[a("div",{staticClass:"title"},[e._v("已选择的群聊")]),e._v(" "),a("div",{staticClass:"choice_result_top"},[a("div",{staticClass:"clear",on:{click:e.handleDelAllSelectedChat}},[e._v("全部清空")]),e._v(" "),a("div",{staticClass:"result_num"},[e._v("已选择"),a("span",[e._v(e._s(e.chatListSelected.length))]),e._v("个群")])]),e._v(" "),a("div",{staticClass:"member_result self-scrollbar-3"},e._l(e.chatListSelected,function(t,n){return a("div",{key:t.chat_id,staticClass:"memberItem"},[a("div",{staticClass:"flex",staticStyle:{flex:"1"}},[a("i",{staticClass:"el-icon-chat-dot-round chat-icon"}),e._v(" "),a("div",{staticClass:"memberInfo"},[a("div",{staticClass:"name"},[e._v(e._s(t.name))]),e._v(" "),a("div",{staticClass:"other"},[e._v("群主:"+e._s(t.owner_name))])])]),e._v(" "),a("i",{staticClass:"el-icon-close",staticStyle:{"margin-left":"10px"},on:{click:function(t){return e.handleDelSelectedChat(n)}}})])}),0),e._v(" "),a("div",{staticClass:"buttons"},[a("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onClickConfirm}},[e._v("确定")])],1)])])])],1)},staticRenderFns:[]};var L=a("VU/8")(S,k,!1,function(e){a("YaDj")},"data-v-74c81143",null).exports,R={components:{serviceSingle:u.a,selfCustomerservice:C.a,selfChatGroupOptions:L},props:{value:{type:Boolean,default:function(){return!1}},config_id:{type:String|Number,default:function(){return""}}},data:function(){return{pickerOptions:{disabledDate:function(e){return e<Date.now()-864e5}},loading:!1,reset:!1,isShowService:!0,form:{title:"",type:1,filter_type:1,new_owner:"",old_owners:[],chat_ids:[],transfer_type:1,transfer_at:""}}},computed:{isEdit:function(){return!!this.config_id},title:function(){return this.isEdit?"编辑客户群分配配置":"新建客户群分配配置"},visible:{get:function(){return this.value},set:function(e){this.$emit("input",e)}}},watch:{visible:function(e){var t=this;return s()(i.a.mark(function a(){return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e?t.isEdit&&t.handleGetDetail():t.handleClearForm();case 1:case"end":return a.stop()}},a,t)}))()}},methods:{handleCloseDrawer:function(){this.visible=!1},handleGetDetail:function(){var e=this;return s()(i.a.mark(function t(){var a,n,r,s,o,l,c,d,u,f,p,h,m,v;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.isShowService=!1,t.next=3,e.$nextTick();case 3:return t.prev=3,e.loading=!0,a=""+e.URL.BASEURL+e.URL.groupTransfer_configDetail,n={config_id:e.config_id},t.next=9,e.$axios.get(a,{params:n});case 9:if(r=t.sent,s=r.data,!(o=void 0===s?{}:s)||0!=o.errno){t.next=30;break}return l=o.rst,c=l.title,d=l.type,u=l.filter_type,f=l.condition,p=void 0===f?"{}":f,h=l.new_owner,m=l.transfer_type,v=l.transfer_at,e.form.title=c,e.form.type=d||1,e.form.filter_type=u||1,e.form.new_owner=h,e.form.transfer_type=m||1,2==e.form.transfer_type&&(e.form.transfer_at=v),2==e.form.filter_type&&(e.form.old_owners=JSON.parse(p).owner_list),1==e.form.filter_type&&(e.form.chat_ids=JSON.parse(p).chat_ids.map(function(e){return{chat_id:e,name:""}})),e.isShowService=!0,t.next=25,e.$nextTick();case 25:return t.next=27,e.$refs.selfChatGroupOptions.handleSetChatGroupsName([].concat(w()(e.form.chat_ids)));case 27:e.form.chat_ids=t.sent,t.next=31;break;case 30:4002!=o.errno&&e.$message.warning(o.err||"获取失败");case 31:t.next=36;break;case 33:t.prev=33,t.t0=t.catch(3),console.log(t.t0);case 36:return t.prev=36,e.loading=!1,t.finish(36);case 39:case"end":return t.stop()}},t,e,[[3,33,36,39]])}))()},onClickSave:function(){var e=this;return s()(i.a.mark(function t(){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:e.handleSubmitForm(),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.log(t.t0);case 9:case"end":return t.stop()}},t,e,[[0,6]])}))()},handleFormValidate:function(){var e=this,t=this.form,a=t.title,n=t.filter_type,i=t.chat_ids,r=t.old_owners,s=t.new_owner,o=t.transfer_type,l=t.transfer_at;return new g.a(function(t,c){a?1!=n||i&&i.length?2!=n||r&&r.length?s?2!=o||l?t("表单校验通过"):(e.$message.warning("请选择执行分配时间"),c("表单校验未通过")):(e.$message.warning("请选择新群主"),c("表单校验未通过")):(e.$message.warning("请选择群主"),c("表单校验未通过")):(e.$message.warning("请选择群聊"),c("表单校验未通过")):(e.$message.warning("请输入配置标题"),c("表单校验未通过"))})},handleSubmitForm:function(){var e=this;return s()(i.a.mark(function t(){var a,n,r,s,o;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,a=""+e.URL.BASEURL+e.URL.groupTransfer_editConfig,n={title:e.form.title,type:e.form.type,filter_type:e.form.filter_type,new_owner:e.form.new_owner,transfer_type:e.form.transfer_type,transfer_at:1==e.form.transfer_type?e.$moment().format("YYYY-MM-DD HH:mm:ss"):e.form.transfer_at},1==e.form.filter_type?n.condition=m()({chat_ids:e.form.chat_ids.map(function(e){return e.chat_id})}):2==e.form.filter_type&&(n.condition=m()({owner_list:e.form.old_owners.map(function(e){return e})})),e.isEdit&&(n.config_id=e.config_id),t.next=8,e.$axios.post(a,n);case 8:r=t.sent,s=r.data,(o=void 0===s?{}:s)&&0==o.errno?(e.$message.success("保存成功"),e.handleClearForm(),e.$emit("confirm",{isEdit:e.isEdit})):4002!=o.errno&&e.$message.warning(o.err||"保存失败"),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),console.log(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]])}))()},handleClearForm:function(){var e=this;return s()(i.a.mark(function t(){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.reset=!e.reset,e.form.title="",e.form.type=1,e.form.filter_type=1,e.form.new_owner="",e.form.old_owners=[],e.form.chat_ids=[],e.form.transfer_type=1,e.form.transfer_at="",e.isShowService=!1,t.next=12,e.$nextTick();case 12:e.isShowService=!0;case 13:case"end":return t.stop()}},t,e)}))()},onChangeNewOwner:function(e){this.form.new_owner=e?e.user_id:""},onChangeOldOwners:function(e){this.form.old_owners=e},onChangeGlobalChatGroup:function(e){e&&e.length?this.form.chat_ids=e.map(function(e){return p()({},e)}):this.form.chat_ids=[]}}},G={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-drawer",{attrs:{visible:e.visible,"close-on-press-escape":!1,wrapperClosable:!1,withHeader:!1,size:"800px"},on:{"update:visible":function(t){e.visible=t}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"content-wrap"},[a("div",{staticClass:"self_drawer_title"},[a("div",{staticClass:"flex"},[e._v("\n "+e._s(e.title)+"\n ")]),e._v(" "),a("div",{staticClass:"flex-align-center"},[a("i",{staticClass:"el-icon-close pointer",on:{click:e.handleCloseDrawer}})])]),e._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[a("div",{staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("配置标题")]),e._v(" "),a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"请输入配置标题",clearable:"",size:"small"},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title","string"==typeof t?t.trim():t)},expression:"form.title"}})],1),e._v(" "),a("div",{staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("转移类型")]),e._v(" "),a("el-radio",{attrs:{label:1},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[e._v("在职迁移")]),e._v(" "),a("el-radio",{attrs:{label:2},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[e._v("离职迁移")])],1),e._v(" "),a("div",{staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("筛选方式")]),e._v(" "),a("el-radio",{attrs:{label:1},model:{value:e.form.filter_type,callback:function(t){e.$set(e.form,"filter_type",t)},expression:"form.filter_type"}},[e._v("按群聊")]),e._v(" "),a("el-radio",{attrs:{label:2},model:{value:e.form.filter_type,callback:function(t){e.$set(e.form,"filter_type",t)},expression:"form.filter_type"}},[e._v("按群主")])],1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:1==e.form.filter_type,expression:"form.filter_type == 1"}],staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("群聊")]),e._v(" "),e.isShowService?a("selfChatGroupOptions",{ref:"selfChatGroupOptions",attrs:{width:"300px",isHasRoomId:!0,chatListResult:e.form.chat_ids},on:{change:e.onChangeGlobalChatGroup}}):e._e()],1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:2==e.form.filter_type,expression:"form.filter_type == 2"}],staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("群主")]),e._v(" "),e.isShowService?a("selfCustomerservice",{attrs:{source:"chatGroup",title:"",width:"300px",placeholder:"请选择群主",reset:e.reset,afferent_users:e.form.old_owners},on:{customerDefine:e.onChangeOldOwners}}):e._e()],1),e._v(" "),a("div",{staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("新群主")]),e._v(" "),e.isShowService?a("serviceSingle",{attrs:{source:"chatGroup",title:"",width:"300px",placeholder:"请选择新群主",reset:e.reset,afferent_userId:e.form.new_owner},on:{customerDefine:e.onChangeNewOwner}}):e._e()],1),e._v(" "),a("div",{staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("分配方式")]),e._v(" "),a("el-radio",{attrs:{label:1},model:{value:e.form.transfer_type,callback:function(t){e.$set(e.form,"transfer_type",t)},expression:"form.transfer_type"}},[e._v("立即分配")]),e._v(" "),a("el-radio",{attrs:{label:2},model:{value:e.form.transfer_type,callback:function(t){e.$set(e.form,"transfer_type",t)},expression:"form.transfer_type"}},[e._v("定时分配")])],1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:2==e.form.transfer_type,expression:"form.transfer_type == 2"}],staticClass:"form-item"},[a("span",{staticClass:"lable required"},[e._v("执行分配时间")]),e._v(" "),a("el-date-picker",{staticStyle:{width:"300px"},attrs:{type:"datetime","picker-options":e.pickerOptions,clearable:"","value-format":"yyyy-MM-dd HH:mm:ss",placeholder:"选择执行分配时间",size:"mini"},model:{value:e.form.transfer_at,callback:function(t){e.$set(e.form,"transfer_at",t)},expression:"form.transfer_at"}})],1)]),e._v(" "),a("div",{staticClass:"button_box"},[a("button",{staticClass:"button",on:{click:e.onClickSave}},[e._v("保存配置")])])])])},staticRenderFns:[]};var $=a("VU/8")(R,G,!1,function(e){a("bKq+")},"data-v-2a60b2d8",null).exports,I={components:{selfInput:x.a},props:{dialogVisible:{type:Boolean,default:function(){return!1}},config_id:{type:String|Number,default:function(){return""}}},data:function(){return{height:500,loading:!1,pagination:{page:1,page_size:100,pages:0,total:0},filter:{keyword:""},list:[]}},computed:{dialogTitle:function(){return"客户群分配结果"}},watch:{dialogVisible:function(e){e&&(this.pagination.page=1,this.filter.keyword="",this.handleInitList(),this.handleGetList())}},methods:{handleGetList:function(){var e=this;return s()(i.a.mark(function t(){var a,n,r,s,o;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,a=""+e.URL.BASEURL+e.URL.groupTransfer_record,n={config_id:e.config_id,page:e.pagination.page},t.next=6,e.$axios.get(a,{params:n});case 6:r=t.sent,s=r.data,(o=void 0===s?{}:s)&&0==o.errno&&Array.isArray(o.rst.data)?(e.list=o.rst.data,e.pagination.total=o.rst.pageInfo.total,e.pagination.pages=o.rst.pageInfo.pages,e.$refs.tableDom.bodyWrapper.scrollTop=0):4002!=o.errno&&(e.$message.warning(o.err),e.handleInitList()),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(0),console.log(t.t0),e.handleInitList();case 16:return t.prev=16,e.loading=!1,t.finish(16);case 19:case"end":return t.stop()}},t,e,[[0,12,16,19]])}))()},handleCurrentChange:function(e){this.pagination.page=e,this.handleGetList()},onInputKeyword:function(e){this.filter.keyword=e||"",this.pagination.page=1,this.handleGetList()},handleInitList:function(){this.list=[],this.pagination.total=0,this.pagination.pages=0},handleCancel:function(){this.$emit("close")}}},D={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{staticClass:"list-dialog",attrs:{visible:e.dialogVisible,"before-close":e.handleCancel,title:e.dialogTitle,width:"900px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[a("el-table",{ref:"tableDom",staticStyle:{width:"100%","margin-top":"10px"},attrs:{"max-height":e.height,data:e.list,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{label:"客户群名称",prop:"name","min-width":"120",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",[e._v(e._s(n.name||"未设置群名称"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"群主名称",prop:"owner_name","min-width":"100",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{label:"分配返回码",prop:"errno","min-width":"80",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{label:"分配结果说明",prop:"msg",align:"center","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{style:{color:0==n.errno?"#00B38A":"#EB4315"}},[e._v(e._s(n.msg||"-"))])]}}])})],1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:e.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":e.pagination.page,layout:"prev, pager, next","page-count":Number(e.pagination.pages)},on:{"current-change":e.handleCurrentChange}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"})])},staticRenderFns:[]};var V=a("VU/8")(I,D,!1,function(e){a("b/ZB")},"data-v-0a217100",null).exports,U=new l.a([[0,{label:"禁用",cls:"c-F03F5C"}],[1,{label:"待分配",cls:"c-FFB055"}],[2,{label:"分配中",cls:"c-448AFF"}],[3,{label:"分配完成",cls:"c-58BCA6"}],[4,{label:"无目标客户群",cls:"c-F03F5C"}],[5,{label:"分配失败",cls:"c-F03F5C"}]]),O={name:"groupTransfer",components:{selfInputV2:c.a,selfChannelV2:d.a,serviceSingle:u.a,configDrawer:$,transferResDialog:V},data:function(){return{height:"",loading:!1,pagination:{page:1,page_size:20,pages:0,total:0},filter:{keyword:"",new_owner:"",status:""},list:[],transferResVisible:!1,configDrawerVisible:!1,currentConfigId:""}},created:function(){this.height=document.documentElement.clientHeight-200,this.handleGetList()},methods:{handleGetStatusDesc:function(e){return U.get(Number(e))||{}},handleGetList:function(){var e=this;return s()(i.a.mark(function t(){var a,n,r,s,o;return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,a=""+e.URL.BASEURL+e.URL.groupTransfer_configList,n={keyword:e.filter.keyword,new_owner:e.filter.new_owner,status:e.filter.status,page:e.pagination.page,page_size:e.pagination.page_size},t.next=6,e.$axios.get(a,{params:n});case 6:r=t.sent,s=r.data,(o=void 0===s?{}:s)&&0==o.errno&&Array.isArray(o.rst.data)?(e.list=o.rst.data,e.pagination.total=o.rst.pageInfo.total,e.pagination.pages=o.rst.pageInfo.pages):4002!=o.errno&&(e.$message.warning(o.err),e.list=[],e.pagination.total=0,e.pagination.pages=0),t.next=18;break;case 12:t.prev=12,t.t0=t.catch(0),console.log(t.t0),e.list=[],e.pagination.total=0,e.pagination.pages=0;case 18:return t.prev=18,e.loading=!1,t.finish(18);case 21:case"end":return t.stop()}},t,e,[[0,12,18,21]])}))()},onChangeKeyword:function(e){this.filter.keyword=e,this.pagination.page=1,this.handleGetList()},onChangeNewOwner:function(e){this.filter.new_owner=e?e.user_id:"",this.pagination.page=1,this.handleGetList()},onChangeStatus:function(e){this.filter.status=e,this.pagination.page=1,this.handleGetList()},handleCurrentChange:function(e){this.pagination.page=e,this.handleGetList()},onClickStatus:function(e,t){var a=this,n=e.title,r=e.config_id;return s()(i.a.mark(function e(){return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a.$confirm("确定"+(1==t?"启用":"禁用")+"【"+n+"】?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:a.handleChangeStatus(r,t),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.log(e.t0);case 9:case"end":return e.stop()}},e,a,[[0,6]])}))()},handleChangeStatus:function(e,t){var a=this;return s()(i.a.mark(function n(){var r,s,o,l,c;return i.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,a.loading=!0,r=""+a.URL.BASEURL+a.URL.groupTransfer_changeStatus,s={config_id:e,status:t},n.next=6,a.$axios.get(r,{params:s});case 6:o=n.sent,l=o.data,(c=void 0===l?{}:l)&&0==c.errno?(a.$message.success("操作成功"),a.handleGetList()):4002!=c.errno&&a.$message.warning(c.err),n.next=15;break;case 12:n.prev=12,n.t0=n.catch(0),console.log(n.t0);case 15:return n.prev=15,a.loading=!1,n.finish(15);case 18:case"end":return n.stop()}},n,a,[[0,12,15,18]])}))()},onClickCreateBtn:function(){this.currentConfigId="",this.configDrawerVisible=!0},onClickEditBtn:function(e){this.currentConfigId=e.config_id,this.configDrawerVisible=!0},onConfirmConfig:function(e){var t=e.isEdit;this.configDrawerVisible=!1,!t&&(this.pagination.page=1),this.handleGetList()},onCancelConfig:function(){this.configDrawerVisible=!1},onClickTransferRes:function(e){this.currentConfigId=e.config_id,this.transferResVisible=!0},onCloseTransferRes:function(){this.currentConfigId="",this.transferResVisible=!1}}},B={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"customerShare-wrap"},[a("div",{staticClass:"screenBox"},[a("div",{staticClass:"filter-wrap"},[a("selfInputV2",{staticStyle:{width:"auto"},attrs:{label_name:"标题",placeholder:"请输入",labelWidth:!0},on:{change:e.onChangeKeyword},model:{value:e.filter.keyword,callback:function(t){e.$set(e.filter,"keyword",t)},expression:"filter.keyword"}}),e._v(" "),a("serviceSingle",{attrs:{title:"新群主",placeholder:"请选择",source:"chatGroup"},on:{customerDefine:e.onChangeNewOwner}}),e._v(" "),a("selfChannelV2",{attrs:{type:"groupTransfer",title:"状态",labelWidth:!0},on:{change:e.onChangeStatus},model:{value:e.filter.status,callback:function(t){e.$set(e.filter,"status",t)},expression:"filter.status"}})],1),e._v(" "),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onClickCreateBtn}},[e._v("客户群分配")])],1),e._v(" "),a("el-table",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:e.height,data:e.list,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{label:"配置标题",prop:"title","min-width":"200",align:"center",fixed:"left"}}),e._v(" "),a("el-table-column",{attrs:{label:"创建人",align:"center","min-width":"140"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("div",{staticClass:"customerServiceTagBox"},[a("div",{staticClass:"customerServiceTag"},[a("i",{staticClass:"el-icon-user-solid"}),e._v(" "+e._s(n.create_user))])])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"转移类型",align:"center","min-width":"140"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",[e._v(e._s(1==n.type?"在职迁移":"离职迁移"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"筛选方式",align:"center","min-width":"140"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",[e._v(e._s(1==n.filter_type?"按群聊":"按群主"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"新群主",prop:"new_owner_name","min-width":"200",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{label:"状态",align:"center","min-width":"120"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[a("span",{class:[e.handleGetStatusDesc(n.status).cls]},[e._v(e._s(e.handleGetStatusDesc(n.status).label))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160",align:"center",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[0==n.status?a("span",{staticClass:"btn c-007AFF",on:{click:function(t){return e.onClickStatus(n,1)}}},[e._v("启用")]):e._e(),e._v(" "),1==n.status?a("span",{staticClass:"btn c-FF604D",on:{click:function(t){return e.onClickStatus(n,0)}}},[e._v("禁用")]):e._e(),e._v(" "),3==n.status?a("span",{staticClass:"btn c-00b38a",on:{click:function(t){return e.onClickTransferRes(n)}}},[e._v("分配结果")]):e._e(),e._v(" "),0==n.status||1==n.status?a("span",{staticClass:"btn c-00b38a",on:{click:function(t){return e.onClickEditBtn(n)}}},[e._v("编辑")]):e._e()]}}])})],1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:e.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":e.pagination.page,layout:"prev, pager, next","page-count":Number(e.pagination.pages)},on:{"current-change":e.handleCurrentChange}})],1),e._v(" "),a("transferResDialog",{attrs:{dialogVisible:e.transferResVisible,config_id:e.currentConfigId},on:{close:e.onCloseTransferRes}}),e._v(" "),a("configDrawer",{attrs:{config_id:e.currentConfigId},on:{confirm:e.onConfirmConfig,cancel:e.onCancelConfig},model:{value:e.configDrawerVisible,callback:function(t){e.configDrawerVisible=t},expression:"configDrawerVisible"}})],1)},staticRenderFns:[]};var E=a("VU/8")(O,B,!1,function(e){a("/hW9")},"data-v-23270022",null);t.default=E.exports},YaDj:function(e,t){},"b/ZB":function(e,t){},"bKq+":function(e,t){}});
|