webpackJsonp([73],{"OM/b":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("Gu7T"),i=a.n(n),r=a("Dd8w"),s=a.n(r),o=a("//Fk"),l=a.n(o),c=a("d7EF"),u=a.n(c),d=a("u2KI"),p=a.n(d),f=a("Xxa5"),h=a.n(f),m=a("exGp"),g=a.n(m),_=a("erru"),v=a("pdUL"),C={name:"setStatusDialog",components:{selfChannel:_.a},props:{dialogVisible:{type:Boolean,default:function(){return!1}},currentCustomer:{type:Object,default:function(){return{}}}},data:function(){return{loading:!1,form:{status:""}}},computed:{dialogTitle:function(){return"客服状态"}},watch:{dialogVisible:function(t){t?this.handleInitData():this.form.status=""}},methods:{handleInitData:function(){var t=this;return g()(h.a.mark(function e(){var a;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading=!1,a=t.currentCustomer.status,t.form.status=a||"",e.next=5,t.$nextTick();case 5:t.form.status?t.$refs.statusEl&&t.$refs.statusEl.init_afferent():t.$refs.statusEl&&t.$refs.statusEl.clear();case 6:case"end":return e.stop()}},e,t)}))()},handleConfirm:function(){var t=this;return g()(h.a.mark(function e(){var a,n,i,r,s;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.handleFormValidate();case 3:return a=""+t.URL.BASEURL+t.URL.dataBoard_customerStaff_setStatus,n={corp_id:t.currentCustomer.corpid,user_id:t.currentCustomer.user_id,status:t.form.status},t.loading=!0,e.next=8,t.$axios.post(a,n);case 8:i=e.sent,r=i.data,(s=void 0===r?{}:r)&&0==s.errno?(t.$message.success("操作成功"),t.$emit("confirm")):4002!=s.errno&&t.$message.warning(s.err||"操作失败"),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.log(e.t0);case 17:return e.prev=17,t.loading=!1,e.finish(17);case 20:case"end":return e.stop()}},e,t,[[0,14,17,20]])}))()},handleCancel:function(){this.$emit("cancel")},handleFormValidate:function(){var t=this;return new l.a(function(e,a){t.form.status?e("表单校验通过"):(t.$message.warning("请选择客服状态"),a("表单校验未通过"))})},onChangeStatus:function(t){this.form.status=t}}},b={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{staticClass:"setStatus-dialog",attrs:{visible:t.dialogVisible,"before-close":t.handleCancel,title:t.dialogTitle,width:"450px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[a("div",{staticClass:"form-item"},[a("span",{staticClass:"lable"},[t._v("请选择")]),t._v(" "),a("selfChannel",{ref:"statusEl",attrs:{title:"",type:"customerStaffStatus",placeholder:"状态",labelWidth:!0,width:"240px",afferent_value:t.form.status},on:{channelDefine:t.onChangeStatus}})],1)]),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{size:"mini",type:"primary",disabled:t.loading},on:{click:t.handleConfirm}},[t._v("确 定")])],1)])},staticRenderFns:[]};var x=a("VU/8")(C,b,!1,function(t){a("yQqN")},"data-v-13db79b3",null).exports,y=a("la//"),S={components:{selfChannel:_.a,selfInputV2:v.a,setStatusDialog:x},data:function(){return{reset:!1,pageLoading:!1,height:"",detailLoading:!1,detailsTableCol:[],summaryTableCol:[],pagination:{page:1,page_size:20,pages:0,total:0},system_enterprise:[],enterpriseList:[],enterprise:{},filter:{sort_field:"daily_new_contact_cnt",sort_type:"desc",corpid:"",user_name:"",status:"",operator_uid:"",active_status:""},updateTime:"",setStatusDialogVisible:!1,currentCustomer:{}}},computed:{isCanExport:function(){return!!this.$store.state.dataBoardAuth.can_export}},created:function(){this.initTableHeight(),this.handleInitCorpOptions(),this.handleGetData()},methods:{handleGetStatus:function(t){return y.i.get(t)||"-"},handleGetActiveStatus:function(t){return y.s.get(t)||"-"},handleGetData:function(t){this.handleGetList(),(t||{}).totalFlag||this.handleGetCustomerServiceDataTotal()},handleGetUpdateTime:function(){var t=this;return g()(h.a.mark(function e(){var a,n,i,r;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a={type:""},e.next=4,t.$axios.get(""+t.URL.BASEURL+t.URL.dataBoard_uptime,{params:a});case 4:n=e.sent,i=n.data,(r=void 0===i?{}:i)&&0==r.errno?t.updateTime=r.rst.uptime:4002!=r.errno&&(t.$message.warning(r.err),t.updateTime=""),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),t.updateTime="";case 13:case"end":return e.stop()}},e,t,[[0,10]])}))()},handleGetCustomerServiceDataTotal:function(){var t=this;return g()(h.a.mark(function e(){var a,n,i,r,s,o,l;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a={corp_id:t.filter.corpid,user_name:t.filter.user_name,status:t.filter.status,operator_uid:t.filter.operator_uid,active_status:t.filter.active_status},n=""+t.URL.BASEURL+t.URL.statistics_customerServiceDataTotal,e.next=5,t.$axios.get(n,{params:a});case 5:if(i=e.sent,r=i.data,!(s=void 0===r?{}:r)||0!=s.errno){e.next=18;break}return o=[{column:"self_total",name:"综合",notes:""}],s.err.forEach(function(t){t.name&&t.name.length>6&&(t.min_width=25*t.name.length),o.push(t)}),t.summaryTableCol=p()(o),e.next=14,t.$nextTick();case 14:l=Array.isArray(s.rst)?s.rst:[s.rst],t.$refs.summaryTable.reloadData(l),e.next=19;break;case 18:4002!=s.errno&&(t.$message.warning(s.err),t.$refs.summaryTable.reloadData([]));case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(0),t.$refs.summaryTable.reloadData([]);case 24:case"end":return e.stop()}},e,t,[[0,21]])}))()},handleGetList:function(){var t=this;return g()(h.a.mark(function e(){var a,n,i,r,s,o,l;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.detailLoading=!0,a={corp_id:t.filter.corpid,user_name:t.filter.user_name,status:t.filter.status,operator_uid:t.filter.operator_uid,active_status:t.filter.active_status,sort_field:t.filter.sort_field,sort_type:t.filter.sort_type,page:t.pagination.page,page_size:t.pagination.page_size},n=""+t.URL.BASEURL+t.URL.dataBoard_customerStaff_list,e.next=6,t.$axios.get(n,{params:a});case 6:if(i=e.sent,r=i.data,!(s=void 0===r?{}:r)||0!=s.errno){e.next=22;break}return s.rst.extra[0].fixed="left",o=[],s.rst.extra.forEach(function(t){t.name&&t.name.length>6&&(t.min_width=25*t.name.length),o.push(t)}),t.detailsTableCol=p()(o),e.next=16,t.$nextTick();case 16:l=Array.isArray(s.rst.data)?s.rst.data:[],t.$refs.detailsTable.reloadData(l),t.pagination.total=s.rst.pageInfo.total,t.pagination.pages=s.rst.pageInfo.pages,e.next=23;break;case 22:4002!=s.errno&&(t.$message.warning(s.err),t.$refs.detailsTable.reloadData([]),t.pagination.total=0,t.pagination.pages=0);case 23:e.next=31;break;case 25:e.prev=25,e.t0=e.catch(0),console.log(e.t0),t.$refs.detailsTable.reloadData([]),t.pagination.total=0,t.pagination.pages=0;case 31:return e.prev=31,t.detailLoading=!1,e.finish(31);case 34:case"end":return e.stop()}},e,t,[[0,25,31,34]])}))()},onClickSort:function(t,e){this.filter.sort_field===t?this.filter.sort_type===e?(this.filter.sort_field="daily_new_contact_cnt",this.filter.sort_type="desc"):this.filter.sort_type=e:(this.filter.sort_field=t,this.filter.sort_type=e),this.pagination.page=1,this.handleGetData({totalFlag:!0})},handleCurrentChange:function(t){this.pagination.page=t,this.handleGetData({totalFlag:!0})},handleSizeChange:function(t){this.pagination.page_size=t,this.pagination.page=1,this.handleGetData({totalFlag:!0})},onChangeUserName:function(t){this.filter.user_name=t,this.pagination.page=1,this.handleGetData()},onChangeStatus:function(t){this.filter.status=t,this.pagination.page=1,this.handleGetData()},onChangeOperatorUid:function(t){this.filter.operator_uid=t,this.pagination.page=1,this.handleGetData()},onChangeActiveStatus:function(t){this.filter.active_status=t,this.pagination.page=1,this.handleGetData()},onClickReset:function(){this.reset=!this.reset,this.system_enterprise=[],this.enterprise={},this.filter.corpid="",this.filter.user_name="",this.filter.status="",this.filter.operator_uid="",this.filter.active_status="",this.filter.sort_field="daily_new_contact_cnt",this.filter.sort_type="desc",this.pagination.page=1,this.handleGetData()},onClickExport:function(){var t=this;return g()(h.a.mark(function e(){var a,n,i,r,o,c;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.pagination.total){e.next=2;break}return e.abrupt("return",t.$message.warning("暂无数据可导出"));case 2:return e.prev=2,t.pageLoading=!0,a={detail:""+t.URL.BASEURL+t.URL.dataBoard_customerStaff_list},n={corp_id:t.filter.corpid,user_name:t.filter.user_name,status:t.filter.status,operator_uid:t.filter.operator_uid,active_status:t.filter.active_status},e.next=8,l.a.all([t.$axios.get(a.detail,{params:s()({},n,{sort_field:t.filter.sort_field,sort_type:t.filter.sort_type,page:1,page_size:t.$store.state.exportNumber})})]);case 8:i=e.sent,r=u()(i,1),o=r[0].data,(c=void 0===o?{}:o)&&0==c.errno?t.handleExport({detailData:c.rst}):4002!=c.errno&&t.$message.warning(c.err),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),console.log(e.t0),t.$message.warning("导出失败,请重试");case 19:return e.prev=19,t.pageLoading=!1,e.finish(19);case 22:case"end":return e.stop()}},e,t,[[2,15,19,22]])}))()},handleExport:function(t){var e=this,a=t.detailData,n=void 0===a?{}:a;n.data.forEach(function(t){t.status=e.handleGetStatus(t.status),t.active_status=e.handleGetActiveStatus(t.active_status)});var r=[{tHeader:[].concat(i()(n.extra.map(function(t){return""+t.name}))),filterVal:[].concat(i()(n.extra.map(function(t){return t.column}))),tableDatas:[].concat(i()(n.data)),sheetName:""}];this.$exportOrder({excelDatas:r,name:"客服数据统计(导出时间:"+this.$getDay(0)+")"})},getHeaderCellStyle:function(){return{backgroundColor:"#FFFFFF !important",border:"none!important"}},initTableHeight:function(){this.height=document.documentElement.clientHeight-240>400?document.documentElement.clientHeight-240:400},onChangeCorpidSystem:function(t){var e=this;t.length<1?this.enterprise={}:this.enterpriseList.forEach(function(a){a.manage_corp_list.forEach(function(a){a.corpid==t[1]&&(e.enterprise=a)})}),this.filter.corpid=this.enterprise.corpid||"",this.pagination.page=1,this.handleGetData()},onChangeCorpid:function(t){if(t){var e=this.enterpriseList.filter(function(e){return e.corpid==t})[0];this.enterprise=e||{}}else this.enterprise={};this.filter.corpid=this.enterprise.corpid||"",this.pagination.page=1,this.handleGetData()},handleInitCorpOptions:function(){if(1==this.$cookie.getCookie("isSuperManage")){var t=this.$store.state.authorize_corpList;t.forEach(function(t){t.self_id=t.group_id.toString(),t.self_name=t.group_name,t.manage_corp_list.forEach(function(t){t.self_id=t.corpid,t.self_name=t.corp_name})}),this.enterpriseList=t}else this.enterpriseList=this.$store.state.authorize_corpList},onClickStatus:function(t){this.currentCustomer=s()({},t),this.setStatusDialogVisible=!0},handleSetStatusConfirm:function(){this.currentCustomer={},this.setStatusDialogVisible=!1,this.handleGetData()},handleSetStatusCancel:function(){this.currentCustomer={},this.setStatusDialogVisible=!1}}},w={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.pageLoading,expression:"pageLoading"}],staticClass:"customerStaff-wrap"},[a("div",{staticClass:"screenBox",staticStyle:{"padding-right":"100px"}},[a("div",{staticClass:"common-screen-item"},[a("label",{staticClass:"common-screen-label"},[t._v("企微主体")]),t._v(" "),1==t.$cookie.getCookie("isSuperManage")?a("el-cascader",{staticClass:"select-cls cascader",attrs:{size:"small",options:t.enterpriseList,props:{value:"self_id",label:"self_name",children:"manage_corp_list"},clearable:"",filterable:"",placeholder:"请选择"},on:{change:t.onChangeCorpidSystem},model:{value:t.system_enterprise,callback:function(e){t.system_enterprise=e},expression:"system_enterprise"}}):a("el-select",{staticClass:"select-cls",attrs:{size:"small",filterable:"",placeholder:"请选择",clearable:""},on:{change:t.onChangeCorpid},model:{value:t.filter.corpid,callback:function(e){t.$set(t.filter,"corpid",e)},expression:"filter.corpid"}},t._l(t.enterpriseList,function(t,e){return a("el-option",{key:e+"enterpriseList",attrs:{label:t.corp_name?t.corp_name:t.corp_full_name?t.corp_full_name:t.corpid,value:t.corpid}})}),1)],1),t._v(" "),a("selfInputV2",{attrs:{label_name:"成员",placeholder:"请输入"},on:{change:t.onChangeUserName},model:{value:t.filter.user_name,callback:function(e){t.$set(t.filter,"user_name",e)},expression:"filter.user_name"}}),t._v(" "),a("selfChannel",{attrs:{title:"客服状态",type:"customerStaffStatus",reset:t.reset,placeholder:"请选择"},on:{channelDefine:t.onChangeStatus}}),t._v(" "),a("selfChannel",{attrs:{title:"激活状态",type:"isActive",reset:t.reset,placeholder:"请选择"},on:{channelDefine:t.onChangeActiveStatus}}),t._v(" "),a("selfChannel",{attrs:{title:"运营人员",type:"circleCreate",reset:t.reset,placeholder:"请选择"},on:{channelDefine:t.onChangeOperatorUid}}),t._v(" "),a("div",{staticClass:"reset",on:{click:t.onClickReset}},[t._v("重置")]),t._v(" "),t.isCanExport?a("el-button",{staticClass:"export-btn",attrs:{type:"primary",size:"mini"},on:{click:t.onClickExport}},[t._v("导出Excel")]):t._e()],1),t._v(" "),a("ux-grid",{ref:"summaryTable",staticStyle:{"margin-top":"10px"},attrs:{border:!1,"header-cell-style":function(){return{backgroundColor:"#FFFFFF !important",border:"none!important"}},"show-footer-overflow":"tooltip","show-overflow":"tooltip",size:"mini"},on:{"row-click":function(){}}},t._l(t.summaryTableCol,function(e){return a("ux-table-column",{key:e.column+e.name,attrs:{resizable:!0,field:e.column,title:e.name,"min-width":e.min_width?e.min_width:140,fixed:e.fixed?e.fixed:"",align:"center"},scopedSlots:t._u([{key:"header",fn:function(){return[a("div",{staticClass:"flex-align-jus-center"},[t._v("\n "+t._s(e.name)+"\n "),e.notes?a("el-tooltip",{attrs:{content:e.notes,placement:"top"}},[a("div",[a("i",{staticClass:"el-icon-question"})])]):t._e()],1)]},proxy:!0},{key:"default",fn:function(n){var i=n.row;return[a("span",[t._v(t._s("self_total"==e.column?"综合":i[e.column]||0==i[e.column]?t.$formatNum(i[e.column]):"-"))])]}}],null,!0)})}),1),t._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.detailLoading,expression:"detailLoading"}]},[a("ux-grid",{ref:"detailsTable",staticClass:"detailsTable",attrs:{border:!1,"header-cell-style":t.getHeaderCellStyle,"show-footer-overflow":"tooltip","show-overflow":"tooltip",size:"mini",height:t.height},on:{"row-click":function(){}}},[t._l(t.detailsTableCol,function(e,n){return a("ux-table-column",{key:e.column+e.name,attrs:{resizable:!0,field:e.column,title:e.name,"min-width":e.min_width?e.min_width:160,fixed:e.fixed?e.fixed:"",align:"center"},scopedSlots:t._u([{key:"header",fn:function(){return[a("div",{staticClass:"flex-align-jus-center"},[t._v("\n "+t._s(e.name)+"\n "),e.notes?a("el-tooltip",{attrs:{content:e.notes,placement:"top"}},[a("div",[a("i",{staticClass:"el-icon-question"})])]):t._e(),t._v(" "),e.enable_to_sort?a("div",{staticClass:"sort-wrap"},[a("i",{staticClass:"el-icon-caret-top",class:{active:t.filter.sort_field===e.column&&"asc"===t.filter.sort_type},on:{click:function(a){return t.onClickSort(e.column,"asc")}}}),t._v(" "),a("i",{staticClass:"el-icon-caret-bottom",class:{active:t.filter.sort_field===e.column&&"desc"===t.filter.sort_type},on:{click:function(a){return t.onClickSort(e.column,"desc")}}})]):t._e()],1)]},proxy:!0},{key:"default",fn:function(n){var i=n.row;return["status"===e.column?a("span",[t._v(t._s(t.handleGetStatus(i.status)))]):"active_status"===e.column?a("span",[t._v(t._s(t.handleGetActiveStatus(i.active_status)))]):"operator_name"===e.column?a("span",[t._v(t._s(i.operator_name||"-"))]):a("span",[t._v(t._s(i[e.column]||0==i[e.column]?t.$formatNum(i[e.column]):"-"))])]}}],null,!0)})}),t._v(" "),t.detailsTableCol&&t.detailsTableCol.length?a("ux-table-column",{attrs:{width:120,fixed:"right",align:"center",title:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("span",{staticClass:"c-00B38A pointer",on:{click:function(e){return t.onClickStatus(n)}}},[t._v("客服状态")])]}}],null,!1,3089576540)}):t._e()],2),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.pagination.page,layout:"prev, pager, next, sizes, jumper","page-sizes":[20,50,100],"page-count":Number(t.pagination.pages)},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}})],1)],1),t._v(" "),a("setStatusDialog",{attrs:{dialogVisible:t.setStatusDialogVisible,currentCustomer:t.currentCustomer},on:{confirm:t.handleSetStatusConfirm,cancel:t.handleSetStatusCancel}})],1)},staticRenderFns:[]};var k=a("VU/8")(S,w,!1,function(t){a("VoN8")},"data-v-3d4b3aff",null);e.default=k.exports},VoN8:function(t,e){},yQqN:function(t,e){}});