猎户系统

14.e24cf2d4885c4af3aaae.js 32KB

1
  1. webpackJsonp([14],{"0ZQu":function(t,e,s){t.exports=s.p+"static/img/chatGroupImg-2.b85013d.jpg"},"32hO":function(t,e){},C2yn:function(t,e,s){t.exports=s.p+"static/img/chatGroupImg.f708624.png"},fSDg:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s("Xxa5"),a=s.n(i),n=s("exGp"),l=s.n(n),o=s("fGUm"),r=s("mGJs"),c=s("1b6Z"),d=s("McOJ"),u=s("Dd8w"),h=s.n(u),_={name:"bindPidDialog",props:{dialogVisible:{type:Boolean,default:function(){return!1}},chatInfo:{type:Object,default:function(){return{chat_id:"",pid:""}}}},data:function(){return{loading:!1,pidOptions:[],form:{chat_id:"",pid:""}}},watch:{dialogVisible:function(t){t&&(this.handleGetPidOptions(),this.handleGetFormData())}},methods:{handleGetPidOptions:function(){var t=this;return l()(a.a.mark(function e(){var s,i,n;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$axios.get(t.URL.BASEURL+t.URL.groupList_pidList,{params:{}});case 2:s=e.sent,i=s.data,(n=void 0===i?{}:i)&&0==n.errno?t.pidOptions=n.rst:4002!=n.errno&&t.$message.warning(n.err);case 6:case"end":return e.stop()}},e,t)}))()},handleConfirm:function(){var t=this;return l()(a.a.mark(function e(){var s,i,n,l;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s=h()({},t.form),t.loading=!0,e.next=5,t.$axios.get(""+t.URL.BASEURL+t.URL.groupList_updateChatBindPid,{params:s});case 5:i=e.sent,n=i.data,(l=void 0===n?{}:n)&&0==l.errno?(t.$message.success("操作成功"),t.handleClearFormData(),t.$emit("confirm")):4002!=l.errno&&t.$message.warning(l.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]])}))()},handleCancel:function(){this.handleClearFormData(),this.$emit("cancel")},handleGetFormData:function(){var t=this.chatInfo,e=t.chat_id,s=t.pid;this.form.chat_id=e,this.form.pid=s||""},handleClearFormData:function(){this.form.pid="",this.form.chat_id=""}}},p={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-dialog",{staticClass:"bind-dialog",attrs:{visible:t.dialogVisible,"before-close":t.handleCancel,title:"绑定推广位ID",width:"600px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[s("div",{staticClass:"form-item"},[s("span",{staticClass:"lable"},[t._v("推广位ID")]),t._v(" "),s("el-select",{attrs:{size:"small",placeholder:"请选择推广位ID",clearable:"",filterable:""},model:{value:t.form.pid,callback:function(e){t.$set(t.form,"pid",e)},expression:"form.pid"}},t._l(t.pidOptions,function(t){return s("el-option",{key:t.pid,attrs:{label:t.pid+" ( "+t.pid_name+" ) ",value:t.pid}})}),1)],1)]),t._v(" "),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),s("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.handleConfirm}},[t._v("确 定")])],1)])},staticRenderFns:[]};var m=s("VU/8")(_,p,!1,function(t){s("iodS")},"data-v-c507d41e",null).exports,v={components:{createMsg:r.a,detail:c.a,selfInput:d.a,selfCustomerservice:o.a,bindPidDialog:m},data:function(){return{detialFlag:!1,loading:!1,page:1,pages:0,total:0,page_size:20,tableData:[],resetFlag:!1,height:"",detail_chat_id:"",user_id_list:"",input_keyword:"",uniqueMemberCount:"",uniqueMemberCountLoading:!1,bindPidVisible:!1,currentChatInfo:{}}},created:function(){this.height=document.documentElement.clientHeight-260>400?document.documentElement.clientHeight-260:400,this.init(1)},methods:{lookJQUser:function(){var t=this;this.uniqueMemberCountLoading=!0,this.$axios.get(this.URL.BASEURL+this.URL.chatGroup_uniqueMemberCount,{}).then(function(e){e=e.data;t.uniqueMemberCountLoading=!1,e&&0==e.errno?t.uniqueMemberCount=e.rst.member_count:4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.uniqueMemberCountLoading=!1})},detailClose:function(t){"update"==t?this.init(this.page):"update_new"==t&&(this.init(1),this.$refs.multipleTable.bodyWrapper.scrollTop=0),this.detialFlag=!1},goDetail:function(t){this.detail_chat_id=t.chat_id,this.detialFlag=!0},init:function(t,e){var s=this;if("export"!=e)this.page=t||this.page;else if(0==this.total)return void this.$message({message:"暂无数据可导出",type:"warning"});this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.chatGroup_groupList,{params:{page:"export"==e?1:this.page,page_size:"export"==e?this.$store.state.exportNumber:this.page_size,owner:this.user_id_list,keyword:this.input_keyword}}).then(function(t){t=t.data;s.loading=!1,t&&0==t.errno?"export"==e?s.exportEvent(t.rst.data):(s.tableData=t.rst.data,s.total=t.rst.pageInfo.total,s.pages=t.rst.pageInfo.pages):4002!=t.errno&&s.$message({message:t.err,type:"warning"})}).catch(function(t){s.loading=!1})},handleCurrentChange:function(t){this.init(t)},exportEvent:function(t){var e=t;e.forEach(function(t){t.self_status=1==t.status?"正常":2==t.status?"解散":""});var s=[{tHeader:["群名称","群主","群人数","群公告","创建时间","群状态"],filterVal:["name","owner_name","member_count","notice","create_time","self_status"],tableDatas:e,sheetName:""}];this.$exportOrder({excelDatas:s,name:"客户群管理(导出时间:"+this.$getDay(0)+")"})},onClickCopyID:function(t){var e=this;return l()(a.a.mark(function s(){return a.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,e.$copyText(t.share_chatid);case 3:e.$message.success("复制成功"),s.next=9;break;case 6:s.prev=6,s.t0=s.catch(0),e.$message.error("复制失败,请重试");case 9:case"end":return s.stop()}},s,e,[[0,6]])}))()},onClickBindPid:function(t){var e=t.chat_id,s=t.pid;this.currentChatInfo={chat_id:e,pid:s},this.bindPidVisible=!0},handleBindPidCancel:function(){this.currentChatInfo={},this.bindPidVisible=!1},handleBindPidConfirm:function(){this.bindPidVisible=!1,this.init(this.page)}}},f={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[s("div",{staticClass:"screenBox",staticStyle:{"align-items":"center","padding-right":"16px"}},[s("div",{staticClass:"flex-align-center",staticStyle:{flex:"1","flex-wrap":"wrap"}},[s("self-input",{attrs:{reset:t.resetFlag,label_name:"群名称"},on:{inputChange:function(e){t.input_keyword=e,t.init(1)}}}),t._v(" "),s("self-customerservice",{attrs:{source:"chatGroup",title:"群主"},on:{customerDefine:function(e){t.user_id_list=e,t.init(1)}}})],1)]),t._v(" "),s("div",{staticClass:"tableInfo"},[s("div",[s("div",{staticClass:"flex"},[s("div",{staticClass:"totalCustom"},[t._v("共有"),s("span",[t._v(t._s(t.total))]),t._v("个群聊")]),t._v(" "),s("div",{staticClass:"smalLine"}),t._v(" "),s("div",{staticClass:"excludeCustom"},[!t.uniqueMemberCount&&0!=t.uniqueMemberCount||""==t.uniqueMemberCount?s("span",{staticClass:"f14 pointer",on:{click:function(e){return t.lookJQUser()}}},[t.uniqueMemberCountLoading?s("i",{staticClass:"el-icon-loading f16"}):s("i",[t._v("查看")])]):s("span",{staticClass:"f16"},[t._v(t._s(t.uniqueMemberCount))]),t._v("\n 去重进群客户\n "),s("el-tooltip",{staticClass:"disinblock",attrs:{content:"该数据为去重后的进群客户数,若客户进入多个客户群只会统计为1个客户",placement:"top"}},[s("i",{staticClass:"el-icon-question"})])],1)])]),t._v(" "),s("div",{staticClass:"flex"},[s("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(e){return t.init(1,"export")}}},[t._v("导出Excel")])],1)]),t._v(" "),s("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{height:t.height,data:t.tableData,"tooltip-effect":"dark"}},[s("el-table-column",{attrs:{prop:"name",label:"群名称","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("div",{style:e.row.name?"":"color:#bbb"},[t._v(t._s(e.row.name?e.row.name:"未设置群名"))])]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"群主",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("div",{staticClass:"customerServiceTagBox"},[s("div",{staticClass:"customerServiceTag-v2"},[t._v(t._s(e.row.owner_name))])])]}}])}),t._v(" "),s("el-table-column",{attrs:{"min-width":"80",label:"群人数","show-overflow-tooltip":"",align:"center"},scopedSlots:t._u([{key:"header",fn:function(){return[s("div",[t._v("\n 群人数\n "),s("el-tooltip",{attrs:{content:"总人数",placement:"top"}},[s("i",{staticClass:"el-icon-question"})])],1)]},proxy:!0},{key:"default",fn:function(e){return[s("div",[t._v(t._s(e.row.member_count))]),t._v(" "),s("div",{staticClass:"c-bbb f12"},[t._v("\n 今日进群: "+t._s(t.$formatNum(e.row.join_ucnt)||"-")+"\n ")]),t._v(" "),s("div",{staticClass:"c-bbb f12"},[t._v("\n 今日退群: "+t._s(t.$formatNum(e.row.loss_ucnt)||"-")+"\n ")])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"notice",label:"群公告","show-overflow-tooltip":"",align:"center","min-width":"130px"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[s("div",{staticClass:"clampTwo",style:i.notice?"":"color:#bbb",attrs:{title:i.notice}},[t._v(t._s(i.notice?i.notice:"未设置公告"))])]}}])}),t._v(" "),s("el-table-column",{attrs:{prop:"create_time",label:"创建时间","show-overflow-tooltip":"",align:"center"}}),t._v(" "),s("el-table-column",{attrs:{label:"群状态","show-overflow-tooltip":"",align:"center","min-width":"60px"},scopedSlots:t._u([{key:"default",fn:function(e){return[2==e.row.status?s("span",{staticClass:"c-666"},[t._v("解散")]):t._e(),t._v(" "),1==e.row.status?s("span",{staticClass:"c-00B38A"},[t._v("正常")]):t._e()]}}])}),t._v(" "),s("el-table-column",{attrs:{label:"推广位Id",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[i.pid?s("span",{attrs:{title:i.pid}},[t._v(t._s(i.pid)+" ")]):s("span",{staticClass:"c-bbb"},[t._v("暂未绑定")])]}}])}),t._v(" "),s("el-table-column",{attrs:{"min-width":"80",label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("div",{staticClass:"flex",staticStyle:{"justify-content":"center"}},[s("div",{staticClass:"c-00B38A pointer table_button",on:{click:function(s){return t.goDetail(e.row)}}},[t._v("详情")]),t._v(" "),s("div",{staticClass:"c-00B38A pointer table_button",on:{click:function(s){return t.onClickBindPid(e.row)}}},[t._v("绑定推广位ID")])])]}}])})],1),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],staticClass:"pagination"},[s("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),s("el-drawer",{attrs:{size:"1200px",visible:t.detialFlag,"with-header":!1},on:{"update:visible":function(e){t.detialFlag=e}}},[t.detialFlag?s("detail",{attrs:{title:"客户群详情",chat_id:t.detail_chat_id},on:{close:t.detailClose}}):t._e()],1),t._v(" "),s("bindPidDialog",{attrs:{dialogVisible:t.bindPidVisible,chatInfo:t.currentChatInfo},on:{cancel:t.handleBindPidCancel,confirm:t.handleBindPidConfirm}})],1)},staticRenderFns:[]};var g=s("VU/8")(v,f,!1,function(t){s("32hO")},"data-v-d912afbe",null);e.default=g.exports},i3ZX:function(t,e){},iodS:function(t,e){},mGJs:function(t,e,s){"use strict";var i=s("Xxa5"),a=s.n(i),n=s("Gu7T"),l=s.n(n),o=s("exGp"),r=s.n(o),c=s("mvHQ"),d=s.n(c),u=s("fGUm"),h=s("gzej"),_=s("sazF"),p=s("UOPL"),m=s("cHmb"),v=s("Dd8w"),f=s.n(v),g=s("M4fF"),C=s.n(g),b={name:"chatGroupOptions",components:{selfInput:s("McOJ").a},props:{width:{type:String,default:function(){return""}},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(t){return t.name}).join(",")}},watch:{dialogVisible:function(t){t?(this.handleGetOwnerOptions(),this.handleGetChatList()):(this.owner="",this.keyword="",this.reset=!this.reset)}},methods:{handleGetChatList:function(){var t=this;return r()(a.a.mark(function e(){var s,i,n;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,t.chatList=[],e.next=5,t.$axios.get(t.URL.BASEURL+t.URL.groupCode_chatGroupList,{params:{keyword:t.keyword,owner:t.owner}});case 5:s=e.sent,i=s.data,(n=void 0===i?{}:i)&&0==n.errno?(t.chatList=n.rst.map(function(t){return f()({},t,{name:t.name||"未设置群名",isSelected:!1})}),t.chatListResult.length&&t.handleGetChatListSelected(),t.handleGetIsSelectedChatStatus()):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]])}))()},handleGetOwnerOptions:function(){var t=this;return r()(a.a.mark(function e(){var s,i,n,l,o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.ownerOptions=[],s=""+t.URL.BASEURL+t.URL.chatGroup_chatGroupOwnerIndex,i={},e.next=6,t.$axios.get(s,{params:i});case 6:n=e.sent,l=n.data,(o=void 0===l?{}:l)&&0==o.errno?t.ownerOptions=Array.isArray(o.rst)?o.rst:[]:4002!=o.errno&&t.$message.warning(o.err),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),console.log("error => ",e.t0);case 15:case"end":return e.stop()}},e,t,[[0,12]])}))()},onChangeOwner:function(t){this.owner=t,this.handleGetChatList()},onChangeKeyword:function(t){this.keyword=t,this.handleGetChatList()},handleCloseAllChatList:function(){this.chatList.forEach(function(t){t.isSelected=!1})},handleGetChatListSelected:function(){var t=this;this.chatListResult.forEach(function(e){var s=t.chatList.find(function(t){return t.chat_id===e.chat_id});s&&(!t.chatListSelected.find(function(t){return t.chat_id===s.chat_id})&&t.chatListSelected.push(s))})},handleGetIsSelectedChatStatus:function(){var t=this;this.handleCloseAllChatList(),this.chatListSelected.forEach(function(e){var s=t.chatList.findIndex(function(t){return t.chat_id===e.chat_id});-1!==s&&(t.chatList[s].isSelected=!0)})},handleSwitchChatItem:function(t,e){if(t.isSelected){this.chatList[e].isSelected=!1;var s=this.chatListSelected.findIndex(function(e){return e.chat_id===t.chat_id});-1!==s&&this.chatListSelected.splice(s,1)}else this.chatList[e].isSelected=!0,this.chatListSelected=[].concat(l()(this.chatListSelected),[t])},handleDelSelectedChat:function(t){this.chatListSelected.splice(t,1),this.handleGetIsSelectedChatStatus()},handleDelAllSelectedChat:function(){this.chatListSelected=[],this.handleGetIsSelectedChatStatus()},onClickConfirm:function(){this.chatListSelected.length?(this.$emit("change",C.a.cloneDeep(this.chatListSelected)),this.dialogVisible=!1):this.$message.warning("请选择群聊")}}},w={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"common-screen-item"},[s("el-popover",{attrs:{"append-to-body":"",placement:"bottom",trigger:"click"},model:{value:t.dialogVisible,callback:function(e){t.dialogVisible=e},expression:"dialogVisible"}},[s("div",{class:["common-screen-self-box","common-input-select",t.chatListResult.length?"common-input-select-hover":""],style:t.width?"width:"+t.width:"",attrs:{slot:"reference"},slot:"reference"},[s("div",{class:["common-screen-self-con",t.chatListResult.length?"":"common-screen-self-placeholder"]},[s("div",{staticClass:"common-screen-self-con-div"},[t.chatListResult.length?s("span",[t._v(t._s(t.chatListResultName))]):s("span",[t._v("请选择群聊")])])]),t._v(" "),s("div",{staticClass:"common-screen-self-icon"},[s("i",{staticClass:"el-icon-arrow-down"})])]),t._v(" "),s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"flex",staticStyle:{padding:"10px"}},[s("div",{staticClass:"propoverItem"},[s("div",{staticClass:"filter-wrap"},[s("el-select",{staticClass:"select-wrap",attrs:{size:"small",placeholder:"全部群主",clearable:""},on:{change:t.onChangeOwner},model:{value:t.owner,callback:function(e){t.owner=e},expression:"owner"}},t._l(t.ownerOptions,function(t){return s("el-option",{key:t.user_id,attrs:{label:t.name,value:t.user_id}})}),1),t._v(" "),s("self-input",{staticStyle:{"margin-top":"0","margin-bottom":"0"},attrs:{reset:t.reset,hasLabel:!1,label_name:"群名称",width:"180px"},on:{inputChange:t.onChangeKeyword}})],1),t._v(" "),s("div",{staticClass:"allMember"},[t._v("全部群聊("+t._s(t.chatList&&t.chatList.length)+"):")]),t._v(" "),s("div",{staticClass:"memberBoxBig self-scrollbar-3"},t._l(t.chatList,function(e,i){return s("div",{key:e.chat_id,staticClass:"memberBox"},[s("div",{staticClass:"meberList"},[s("div",{staticClass:"memberItem",on:{click:function(s){return t.handleSwitchChatItem(e,i)}}},[s("div",{staticClass:"flex",staticStyle:{flex:"1"}},[s("i",{staticClass:"el-icon-chat-dot-round chat-icon"}),t._v(" "),s("div",{staticClass:"memberInfo"},[s("div",{staticClass:"name"},[t._v(t._s(e.name))]),t._v(" "),s("div",{staticClass:"other"},[t._v("群主:"+t._s(e.owner_name))])])]),t._v(" "),s("div",{class:["checkbox",e.isSelected?"checkbox_active":""]},[s("i",{staticClass:"el-icon-check"})])])])])}),0)]),t._v(" "),s("div",{staticClass:"line"}),t._v(" "),s("div",{staticClass:"propoverItem",staticStyle:{"padding-left":"20px"}},[s("div",{staticClass:"title"},[t._v("已选择的群聊")]),t._v(" "),s("div",{staticClass:"choice_result_top"},[s("div",{staticClass:"clear",on:{click:t.handleDelAllSelectedChat}},[t._v("全部清空")]),t._v(" "),s("div",{staticClass:"result_num"},[t._v("已选择"),s("span",[t._v(t._s(t.chatListSelected.length))]),t._v("个群")])]),t._v(" "),s("div",{staticClass:"member_result self-scrollbar-3"},t._l(t.chatListSelected,function(e,i){return s("div",{key:e.chat_id,staticClass:"memberItem"},[s("div",{staticClass:"flex",staticStyle:{flex:"1"}},[s("i",{staticClass:"el-icon-chat-dot-round chat-icon"}),t._v(" "),s("div",{staticClass:"memberInfo"},[s("div",{staticClass:"name"},[t._v(t._s(e.name))]),t._v(" "),s("div",{staticClass:"other"},[t._v("群主:"+t._s(e.owner_name))])])]),t._v(" "),s("i",{staticClass:"el-icon-close",staticStyle:{"margin-left":"10px"},on:{click:function(e){return t.handleDelSelectedChat(i)}}})])}),0),t._v(" "),s("div",{staticClass:"buttons"},[s("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")]),t._v(" "),s("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickConfirm}},[t._v("确定")])],1)])])])],1)},staticRenderFns:[]};var x=s("VU/8")(b,w,!1,function(t){s("qe0I")},"data-v-cb1a8366",null).exports,y={components:{selfCustomerservice:u.a,datePicker:h.a,enterpriseTag:_.a,editCon:p.a,screenPay:m.a,chatGroupOptions:x},props:["title","rule_id","is_copy"],data:function(){return{pickerOptions:{disabledDate:function(t){return t<Date.now()-864e5},shortcuts:[{text:"今天",onClick:function(t){t.$emit("pick",new Date)}},{text:"明天",onClick:function(t){var e=new Date;e.setTime(e.getTime()+864e5),t.$emit("pick",e)}},{text:"一周后",onClick:function(t){var e=new Date;e.setTime(e.getTime()+6048e5),t.$emit("pick",e)}}]},loading:!0,resetFlag:!1,send_type:1,send_time:{date:"",time:""},processFlag:!1,dataInfo:{},editFlag:!1,attachments:[],content:"",name:"",is_for_all:1,user_id_list:[],customerMatchCountLoading:!1,send_mode:2,isAllGroupChat:1,chat_groups:[],isOpenGoods:0,item_id:""}},created:function(){this.rule_id?this.detail():(this.editFlag=!0,this.loading=!1)},methods:{detail:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.chatGroupMassMsg_ruleDetail,{params:{rule_id:this.rule_id}}).then(function(e){e=e.data;if(t.loading=!1,e&&0==e.errno){if(t.dataInfo=e.rst,t.send_mode=e.rst.send_mode,2==t.send_mode){if(e.rst.chat_groups&&e.rst.chat_groups.length>0){t.isAllGroupChat=0;var s=e.rst.chat_groups?e.rst.chat_groups.split(","):[];s=s.map(function(t){return{chat_id:t,name:""}}),t.handleSetChatGroups(s)}t.item_id=e.rst.item_id||"",e.rst.item_id&&(t.isOpenGoods=1)}else t.user_id_list=e.rst.senders?e.rst.senders.split(","):[],e.rst.senders&&e.rst.senders.length>0&&(t.is_for_all=0);t.send_type=e.rst.send_type,2==t.send_type&&(t.send_time={date:e.rst.send_time.split(" ")[0],time:e.rst.send_time.split(" ")[1]}),t.attachments=e.rst.attachments&&""!=e.rst.attachments&&"null"!=e.rst.attachments?JSON.parse(e.rst.attachments):[],t.content=e.rst.content,t.name=e.rst.name,t.is_copy?(t.editFlag=!0,t.send_type=2,t.send_time={date:"",time:""}):1==t.dataInfo.enable?t.editFlag=!0:t.editFlag=!1}else 4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})},getAttachment:function(t){this.attachments=t},massMsg_set:function(){var t=this;if(""!=this.name)if(2!=this.send_mode||0!=this.isAllGroupChat||this.chat_groups&&0!=this.chat_groups.length)if(1!=this.send_mode||0!=this.is_for_all||this.user_id_list&&0!=this.user_id_list.length){var e="";if(1==this.send_type)e=this.$getDay(0,!0).now;else{if(""==this.send_time.date)return void this.$message({message:"请选择定时发送的日期!",type:"warning"});if(""==this.send_time.time)return void this.$message({message:"请选择定时发送的时间!",type:"warning"});e=this.send_time.date+" "+this.send_time.time}if(""!=this.content||this.attachments&&""!=this.attachments&&0!=this.attachments.length)if(""!=this.content&&this.$getStrBytes(this.content)>4e3)this.$message({message:"请检查消息文本内容,最多4000个字节,已超出!",type:"error"});else{var s={rule_id:this.is_copy?"":this.rule_id?this.rule_id:"",name:this.name,send_type:this.send_type,send_time:e,content:this.content,attachments:""==this.attachments||0==this.attachments.length?"":d()(this.attachments),senders:1==this.send_mode&&0==this.is_for_all?this.user_id_list.join(","):"",send_mode:this.send_mode,chat_groups:2==this.send_mode&&0==this.isAllGroupChat?this.chat_groups.map(function(t){return t.chat_id}).join(","):"",item_id:2==this.send_mode&&this.isOpenGoods?this.item_id:""};this.$loading(this.$loadingConfig),console.log("params => ",JSON.parse(d()(s))),this.$axios.post(this.URL.BASEURL+this.URL.chatGroupMassMsg_setRule,s).then(function(e){e=e.data;t.$loading(t.$loadingConfig).close(),e&&0==e.errno?t.is_copy||!t.rule_id?t.$emit("close","update_new"):t.$emit("close","update"):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.$loading(t.$loadingConfig).close()})}else this.$message({message:"请输入群发内容!",type:"warning"})}else this.$message({message:"请选择群主!",type:"warning"});else this.$message({message:"请选择群聊!",type:"warning"});else this.$message({message:"请输入群发标题!",type:"warning"})},onChangeChatGroup:function(t){console.log("onChangeChatGroup selectedChat => ",t),this.chat_groups=t,console.log("this.chat_groups => ",this.chat_groups)},handleSetChatGroups:function(t){var e=this;return r()(a.a.mark(function s(){var i,n,o;return a.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,e.$axios.get(e.URL.BASEURL+e.URL.groupCode_chatGroupList,{params:{keyword:"",owner:""}});case 2:i=s.sent,n=i.data,(o=void 0===n?{}:n)&&0==o.errno&&Array.isArray(o.rst)&&(t.forEach(function(e,s){var i=o.rst.find(function(t){return t.chat_id===e.chat_id});i&&(t[s].name=i.name)}),e.chat_groups=[].concat(l()(t)),console.log("this.chat_groups => ",e.chat_groups));case 6:case"end":return s.stop()}},s,e)}))()}}},k={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"createMassMsg"},[i("div",{staticClass:"self_drawer_title"},[i("div",{staticClass:"flex"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),i("div",{staticClass:"flex-align-center"},[i("i",{staticClass:"el-icon-close pointer",on:{click:function(e){return t.$emit("close")}}})])]),t._v(" "),t.loading?t._e():i("div",{staticClass:"bg-ffffff",staticStyle:{padding:"15px 30px"}},[i("h3",{staticClass:"bigTitle"},[t._v("基础信息\n "),t.rule_id&&!t.is_copy?[-2==t.dataInfo.enable?i("span",{staticClass:"detail_status status_del"},[t._v("已删除")]):t._e(),t._v(" "),-1==t.dataInfo.enable?i("span",{staticClass:"detail_status status_fail"},[t._v("发送失败")]):t._e(),t._v(" "),0==t.dataInfo.enable?i("span",{staticClass:"detail_status status_del"},[t._v("禁用")]):t._e(),t._v(" "),1==t.dataInfo.enable?i("span",{staticClass:"detail_status status_wait"},[t._v("待发送")]):t._e(),t._v(" "),2==t.dataInfo.enable?i("span",{staticClass:"detail_status status_ing"},[t._v("正在发送中")]):t._e(),t._v(" "),3==t.dataInfo.enable?i("span",{staticClass:"detail_status status_success"},[t._v("待客服确认")]):t._e(),t._v(" "),4==t.dataInfo.enable?i("span",{staticClass:"detail_status status_success"},[t._v("发送完成")]):t._e()]:t._e()],2),t._v(" "),i("div",{staticClass:"regulations"},[t._m(0),t._v(" "),i("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"例:活动推送/拉新等",disabled:!t.editFlag,clearable:"",size:"small"},model:{value:t.name,callback:function(e){t.name="string"==typeof e?e.trim():e},expression:"name"}}),t._v(" "),i("p",{staticStyle:{"font-size":"13px","line-height":"30px",color:"#f9a527","margin-left":"10px"}},[t._v("*仅作为企业内部人员记录群发摘要,不会推送给客户")])],1),t._v(" "),i("div",{staticClass:"regulations"},[t._m(1),t._v(" "),i("div",[i("div",{staticStyle:{display:"flex"}},[i("el-radio",{attrs:{label:2,disabled:!t.editFlag},model:{value:t.send_mode,callback:function(e){t.send_mode=e},expression:"send_mode"}},[t._v("群聊")]),t._v(" "),i("el-radio",{attrs:{label:1,disabled:!t.editFlag},model:{value:t.send_mode,callback:function(e){t.send_mode=e},expression:"send_mode"}},[t._v("群主")])],1)])]),t._v(" "),2==t.send_mode?i("div",{staticClass:"regulations"},[t._m(2),t._v(" "),i("div",[i("div",{staticStyle:{display:"flex"}},[i("el-radio",{attrs:{label:1,disabled:!t.editFlag},model:{value:t.isAllGroupChat,callback:function(e){t.isAllGroupChat=e},expression:"isAllGroupChat"}},[t._v("全部群聊")]),t._v(" "),i("el-radio",{attrs:{label:0,disabled:!t.editFlag},model:{value:t.isAllGroupChat,callback:function(e){t.isAllGroupChat=e},expression:"isAllGroupChat"}},[t._v("部分群聊")])],1),t._v(" "),0==t.isAllGroupChat?i("chatGroupOptions",{ref:"chatGroupOptions",staticStyle:{"margin-top":"10"},attrs:{width:"300px",chatListResult:t.chat_groups},on:{change:t.onChangeChatGroup}}):t._e()],1)]):t._e(),t._v(" "),1==t.send_mode?[i("div",{staticClass:"regulations"},[t._m(3),t._v(" "),i("div",[i("div",{staticStyle:{display:"flex"}},[i("el-radio",{attrs:{disabled:!t.editFlag,label:1},model:{value:t.is_for_all,callback:function(e){t.is_for_all=e},expression:"is_for_all"}},[t._v("全部群主")]),t._v(" "),i("el-radio",{attrs:{disabled:!t.editFlag,label:0},model:{value:t.is_for_all,callback:function(e){t.is_for_all=e},expression:"is_for_all"}},[t._v("部分群主")])],1),t._v(" "),0==t.is_for_all?i("self-customerservice",{attrs:{disabled:!t.editFlag,source:"chatGroup",title:"",width:"300px",afferent_users:t.user_id_list},on:{customerDefine:function(e){t.user_id_list=e}}}):t._e()],1)]),t._v(" "),t._m(4)]:t._e(),t._v(" "),i("div",{staticClass:"line"}),t._v(" "),i("h3",{staticClass:"bigTitle"},[t._v("编辑群发消息")]),t._v(" "),i("div",{staticClass:"regulations regulations2"},[t._m(5),t._v(" "),i("edit-con",{attrs:{afferent_content:t.content,afferent_attachments:t.attachments,disabled:!t.editFlag},on:{editContent:function(e){t.content=e},changeAttachment:t.getAttachment}})],1),t._v(" "),2==t.send_mode?i("div",{staticClass:"regulations regulations2"},[i("label",{staticStyle:{"text-align":"right"}},[t._v("商品 ")]),t._v(" "),i("div",{staticStyle:{"margin-top":"6px"}},[i("el-switch",{attrs:{disabled:!t.editFlag,"active-value":1,"inactive-value":0},model:{value:t.isOpenGoods,callback:function(e){t.isOpenGoods=e},expression:"isOpenGoods"}}),t._v(" "),1==t.isOpenGoods?i("div",{staticStyle:{"margin-top":"15px"}},[i("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"请输入商品ID",disabled:!t.editFlag,clearable:"",size:"small"},model:{value:t.item_id,callback:function(e){t.item_id="string"==typeof e?e.trim():e},expression:"item_id"}})],1):t._e()],1)]):t._e(),t._v(" "),i("div",{staticClass:"regulations regulations2"},[t._m(6),t._v(" "),i("div",[i("el-radio",{attrs:{disabled:!t.editFlag,label:1},model:{value:t.send_type,callback:function(e){t.send_type=e},expression:"send_type"}},[t._v("立即发送")]),t._v(" "),i("el-radio",{attrs:{disabled:!t.editFlag,label:2},model:{value:t.send_type,callback:function(e){t.send_type=e},expression:"send_type"}},[t._v("定时发送")]),t._v(" "),2==t.send_type?i("div",{staticStyle:{"margin-top":"15px"}},[i("el-date-picker",{staticStyle:{width:"160px"},attrs:{"picker-options":t.pickerOptions,disabled:!t.editFlag,size:"small","value-format":"yyyy-MM-dd",type:"date",placeholder:"选择日期"},model:{value:t.send_time.date,callback:function(e){t.$set(t.send_time,"date",e)},expression:"send_time.date"}}),t._v(" "),i("el-time-picker",{staticStyle:{width:"130px"},attrs:{disabled:!t.editFlag,size:"small",format:"HH:mm","value-format":"HH:mm:ss",placeholder:"请输入时间"},model:{value:t.send_time.time,callback:function(e){t.$set(t.send_time,"time",e)},expression:"send_time.time"}})],1):t._e()],1)]),t._v(" "),1==t.send_mode?i("div",{staticClass:"regulations regulations2"},[i("label"),t._v(" "),i("div",{staticClass:"operationProcess"},[i("div",{staticClass:"process-title"},[i("h3",[t._v("企业群群发的操作流程")]),t._v(" "),i("div",{staticClass:"zhankai",on:{click:function(e){t.processFlag=!t.processFlag}}},[t._v("展开 "),i("i",{class:["el-icon-arrow-down",t.processFlag?"reversalAnimation":""]})])]),t._v(" "),i("p",{staticClass:"process-hint"},[t._v("1、创建完群发后,员工将在企业微信上收到【客户群】新消息通知")]),t._v(" "),i("p",{staticClass:"process-hint"},[t._v("2、员工点击【客户群】,打开待发送的群发消息,可一键将消息发送给客户")]),t._v(" "),t.processFlag?i("img",{staticClass:"img",attrs:{src:s("C2yn"),alt:""}}):t._e()])]):t._e(),t._v(" "),2==t.send_mode?i("div",{staticClass:"regulations regulations2"},[i("label"),t._v(" "),i("div",{staticClass:"operationProcess"},[i("div",{staticClass:"process-title"},[i("h3",[t._v("企业群群发的操作流程")]),t._v(" "),i("div",{staticClass:"zhankai",on:{click:function(e){t.processFlag=!t.processFlag}}},[t._v("展开 "),i("i",{class:["el-icon-arrow-down",t.processFlag?"reversalAnimation":""]})])]),t._v(" "),i("p",{staticClass:"process-hint"},[t._v("1、创建完群发后,员工将在企业微信上收到【猎户小助手】新消息通知")]),t._v(" "),i("p",{staticClass:"process-hint"},[t._v("2、员工点击【消息详情】,打开待发送的群发消息,选择好群聊之后,可一键将消息发送给客户")]),t._v(" "),t.processFlag?i("img",{staticClass:"img",attrs:{src:s("0ZQu"),alt:""}}):t._e()])]):t._e(),t._v(" "),i("div",{staticClass:"button_box"},[t.editFlag?i("button",{staticClass:"button",on:{click:t.massMsg_set}},[t._v("通知成员发送")]):t._e()])],2)])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("群发标题")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("群发方式:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("使用群聊:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("使用群主:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"self-hint",staticStyle:{"margin-top":"10px","font-size":"12px",width:"fit-content","margin-left":"100px",padding:"3px 10px"}},[e("span",[this._v("提示:群主收到群发任务后,可在企业微信上选择群聊发送群发消息")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",{staticStyle:{"margin-top":"4px"}},[e("em",[this._v("*")]),this._v("群发内容")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("群发时间")])}]};var S=s("VU/8")(y,k,!1,function(t){s("i3ZX")},"data-v-7b1801c1",null);e.a=S.exports},qe0I:function(t,e){}});