1 |
- webpackJsonp([44],{FVz6:function(t,e,a){"use strict";var i={name:"publicTable",props:["propsData"],data:function(){return{loading:!1,dataLoading:!1,page:1,pages:0,total:0,page_size:20,height:"",tableData:[]}},watch:{"propsData.initFlag":function(){this.source_init()}},created:function(){this.height=document.documentElement.clientHeight-300>400?document.documentElement.clientHeight-300:400,this.source_init()},methods:{source_init:function(t){t=t||1,"codeIndex"==this.propsData.source?(this.init(t),this.height=document.documentElement.clientHeight-220>400?document.documentElement.clientHeight-220:400):"channelAnalyse"==this.propsData.source?this.tableData=this.propsData.tableData:"customerList"==this.propsData.source?this.init_list(t):"customerAnalyse"==this.propsData.source&&this.init_analyse()},editCode:function(t){this.$router.push({path:"/createChannelCode",query:{id:t}})},downloadIamge:function(t,e){var a=new Image,i=e;a.setAttribute("crossOrigin","anonymous"),a.onload=function(){var t=document.createElement("canvas");t.width=a.width,t.height=a.height,t.getContext("2d").drawImage(a,0,0,a.width,a.height);var e=t.toDataURL("image/png"),n=document.createElement("a"),s=new MouseEvent("click");n.download=i||"photo",n.href=e,n.dispatchEvent(s)},a.src=t},forbiddenCode:function(t){var e=this;this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.channel_code_forbidden,{id:t}).then(function(t){t=t.data;e.loading=!1,e.$message({message:t.err,type:"warning"}),t&&0==t.errno&&e.init(1)}).catch(function(t){e.loading=!1})},copyCode:function(t){this.$router.push({path:"/createChannelCode",query:{id:t,type:"copy"}})},goDataAanlyse:function(t){this.$router.push("/dataAnalyse/"+t)},init:function(t,e){var a=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.channel_codeList,{params:{group_id:this.propsData.group_id,user_ids:this.propsData.userIds,name:this.propsData.channel_val,page:"export"==e?1:this.page,page_size:"export"==e?this.$store.state.exportNumber:this.page_size}}).then(function(t){t=t.data;a.loading=!1,t&&0==t.errno?"export"==e?a.exportEvent(t.rst.data):(a.tableData=t.rst.data,a.total=t.rst.pageInfo.total,a.pages=t.rst.pageInfo.pages):4002!=t.errno&&a.$message({message:t.err,type:"warning"})}).catch(function(t){a.loading=!1})},init_list:function(t,e){var a=this;if("export"!=e)this.page=t||this.page;else if(this.tableData&&0==this.tableData.length)return void this.$message({message:"暂无数据可导出",type:"warning"});this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_trend_customerList,{params:{sq_id:this.$route.params.id,name:this.propsData.name,page:this.page,page_size:this.page_size}}).then(function(t){t=t.data;a.loading=!1,t&&0==t.errno?"export"==e?a.exportEvent(t.rst.data):(a.tableData=t.rst.data,a.total=t.rst.pageInfo.total,a.pages=t.rst.pageInfo.pages):4002!=t.errno&&a.$message({message:t.err,type:"warning"})}).catch(function(t){a.loading=!1})},init_analyse:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_trend_staffList,{params:{sq_id:this.$route.params.id}}).then(function(e){e=e.data;t.loading=!1,e&&0==e.errno?t.tableData=e.rst:4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})},handleCurrentChange:function(t){this.source_init(t)},exportEvent:function(t){var e=t,a=this.propsData.desCol.map(function(t){return t.label}),i=this.propsData.desCol.map(function(t){return t.prop});e.forEach(function(t){t.desCol_list_info=t.name,t.enable=1==t.enable?"正常":0==t.enable?"已流失":"-",t.scan_user_type=1==t.scan_user_type?"存量用户":2==t.scan_user_type?"增量用户":"-"});var n=[{tHeader:a,filterVal:i,tableDatas:e,sheetName:""}];this.$exportOrder({excelDatas:n,name:"渠道活码-数据分析-客户列表(导出时间:"+this.$getDay(0)+")"})}}},n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{border:"",height:t.height,data:t.tableData,"tooltip-effect":"dark","header-cell-style":function(){return{backgroundColor:"#f9f9f9 !important"}}}},[t._l(t.propsData.desCol,function(e){return[a("el-table-column",{key:e.prop,attrs:{label:e.label,align:"center","show-overflow-tooltip":e.showOverTooltip,"min-width":e.min_width?e.min_width:120},scopedSlots:t._u([e.tooltip?{key:"header",fn:function(){return[t._v("\n "+t._s(e.label?e.label:"-")+"\n "),a("el-tooltip",{staticClass:"disinblock",attrs:{content:e.tooltip,placement:"top"}},[a("i",{staticClass:"el-icon-question"})])]},proxy:!0}:null,{key:"default",fn:function(i){return["creater"==e.prop?a("div",{staticClass:"customerServiceTagBox"},[a("div",{staticClass:"customerServiceTag"},[a("i",{staticClass:"el-icon-headset rMar3 f12"}),t._v(t._s(i.row[e.prop]?i.row[e.prop]:"-"))])]):"desCol_list_info"==e.prop?a("div",{staticClass:"flex-align-center"},[a("img",{staticStyle:{width:"30px",height:"30px","border-radius":"50%","margin-right":"4px"},attrs:{src:i.row.avatar,alt:""}}),t._v("\n "+t._s(i.row.name?i.row.name:"-")+"\n ")]):"is_open"==e.prop?a("div",[t._v("\n "+t._s(1==i.row.is_open?"是":0==i.row.is_open?"否":"-")+"\n ")]):"enable"==e.prop?a("div",[t._v("\n "+t._s(1==i.row.enable?"正常":0==i.row.enable?"已流失":"-")+"\n ")]):"scan_user_type"==e.prop?a("div",[t._v("\n "+t._s(1==i.row.scan_user_type?"存量用户":2==i.row.scan_user_type?"增量用户":"-")+"\n ")]):a("div",[t._v(t._s(i.row[e.prop]||0==i.row[e.prop]?i.row[e.prop]:"-"))])]}}],null,!0)})]}),t._v(" "),"codeIndex"==t.propsData.source?[a("el-table-column",{attrs:{label:"操作",align:"center","min-width":"180px"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex"},[a("el-popconfirm",{attrs:{disabled:1!==e.row.status,title:"禁用【"+e.row.name+"】渠道活码后,将无法启用,是否还要继续?"},on:{confirm:function(a){return t.forbiddenCode(e.row.id)}}},[a("div",{class:1==e.row.status?"c-00B38A pointer":"c-999 pointer-drop",attrs:{slot:"reference"},slot:"reference"},[t._v("禁用")])]),t._v(" "),a("div",{staticClass:"lMar8",class:1==e.row.status?"c-00B38A pointer":"c-999 pointer-drop",on:{click:function(a){1==e.row.status&&t.editCode(e.row.id)}}},[t._v("编辑")]),t._v(" "),a("el-popconfirm",{attrs:{title:"确定复制【"+e.row.name+"】渠道活码?"},on:{confirm:function(a){return t.copyCode(e.row.id)}}},[a("div",{staticClass:"c-00B38A pointer lMar8",attrs:{slot:"reference"},slot:"reference"},[t._v("复制")])]),t._v(" "),a("div",{staticClass:"c-00B38A lMar8",class:e.row.qrcode?"pointer":"pointer-drop c-999",on:{click:function(a){e.row.qrcode&&t.downloadIamge(e.row.qrcode,e.row.name)}}},[t._v("下载")]),t._v(" "),a("div",{staticClass:"c-00B38A pointer lMar8",on:{click:function(a){return t.goDataAanlyse(e.row.id)}}},[t._v("分析数据")])],1)]}}],null,!1,2249112343)})]:t._e()],2),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var s=a("VU/8")(i,n,!1,function(t){a("IbuX")},"data-v-2cb11589",null);e.a=s.exports},IbuX:function(t,e){},L1iF:function(t,e){},MAad:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("McOJ"),n=a("FVz6"),s=a("gzej"),r={name:"channelAnalyse",components:{publicTable:n.a,datePicker:s.a},data:function(){return{initFlag:!1,loading:!1,desCol:[{prop:"date",label:"统计时间"},{prop:"scan_num",label:"扫码总人数"},{prop:"keep_num",label:"留存总人数"}],default_time:[this.$getDay(-30,!1),this.$getDay(0,!1)],resetFlag:!1,myChart:null,time:[],xDate:[],scan_code_Data:[],scan_code_keep_Data:[],tableData:[],childFlag:!1}},created:function(){this.time=this.default_time,this.init()},methods:{changeTime:function(t){!t||t&&0==t.length?this.time=[]:this.time=t,this.init()},trendEvent:function(){this.myChart&&this.myChart.clear();var t={title:"",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{left:"3%",right:"3%",bottom:"3%",top:"2%",containLabel:!0},xAxis:[{type:"category",data:this.xDate,axisTick:{show:!1,alignWithLabel:!1}}],yAxis:[{type:"value"}],series:[{name:"当日扫码人数",type:"bar",barWidth:"40%",data:this.scan_code_Data},{name:"当日扫码留存人数",type:"bar",barWidth:"40%",data:this.scan_code_keep_Data}]};this.myChart=this.myChart?this.myChart:this.$echarts.init(document.getElementById("trend")),this.myChart.setOption(t,!0)},init:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_dataTrend,{params:{id:this.$route.params.id,st_date:this.time[0],en_date:this.time[1]}}).then(function(e){e=e.data;t.loading=!1,e&&0==e.errno?(t.xDate=[],t.scan_code_Data=[],t.scan_code_keep_Data=[],e.rst.forEach(function(e){t.xDate.push(e.date),t.scan_code_Data.push(e.scan_num),t.scan_code_keep_Data.push(e.keep_num)}),t.tableData=e.rst.reverse(),t.$nextTick(function(){t.trendEvent()}),t.initFlag=!t.initFlag,t.childFlag=!0):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})}}},o={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[a("div",{staticClass:"timeBox"},[a("date-picker",{attrs:{title:"",quickFlag:!0,afferent_time:t.default_time,clearFlag:!1,reset:t.resetFlag},on:{changeTime:t.changeTime}})],1),t._v(" "),a("div",{staticStyle:{width:"100%",height:"300px"},attrs:{id:"trend"}}),t._v(" "),t.childFlag?a("publicTable",{staticClass:"tMar10",attrs:{propsData:{desCol:t.desCol,source:"channelAnalyse",initFlag:t.initFlag,tableData:t.tableData}}}):t._e()],1)},staticRenderFns:[]};var l=a("VU/8")(r,o,!1,function(t){a("L1iF")},"data-v-24458b13",null).exports,c={name:"dataAnalyse",components:{publicTable:n.a,channelAnalyse:l,selfInput:i.a},data:function(){return{loading:!1,dataPreview:[{bigTitle:"扫码总客户数",smallTitle:"今日扫码总客户数",note:["扫码总人数:扫描渠道群活码的总客户数","今日扫码人数:今日扫描渠道群活码的总客户数"],bigNum:0,smallNum:0,bigParams:"scan_num_total",smallParams:"scan_num_td"},{bigTitle:"留存客户数",smallTitle:"今日留存客户数",note:["留存总人数:未删除企业成员的客户数","今日留存人数:今日扫码添加企业成员后未删除企业成员的客户数"],bigNum:0,smallNum:0,bigParams:"keep_num_total",smallParams:"keep_num_td"},{bigTitle:"净增客户数",smallTitle:"今日净增客户数",note:["净增客户数:参与活动的净增客户数(未添加过企业成员的客户)","今日净增客户数:今日净增客户数"],bigNum:0,smallNum:0,bigParams:"incr_num_total",smallParams:"incr_num_td"},{bigTitle:"流失客户数",smallTitle:"今日流失客户数",note:["流失客户人数:扫描渠道码添加企业成员之后删除了企业成员的客户数","今日流失客户人数:今日扫描渠道码添加企业成员之后删除了企业成员的客户数"],bigNum:0,smallNum:0,bigParams:"loss_num_total",smallParams:"loss_num_td"}],tagType:0,switchList:[{name:"渠道分析",id:0},{name:"客户列表",id:1},{name:"客服分析",id:2}],kehu_val:"",initFlag:!1,desCol_analyse:[{prop:"id",label:"序号"},{prop:"user_name",label:"客服信息"},{prop:"user_add_total",label:"添加客户数"},{prop:"user_add_count",label:"今日添加客户数"},{prop:"is_open",label:"当前在线状态"}],desCol_list:[{prop:"id",label:"序号"},{prop:"desCol_list_info",label:"客户信息"},{prop:"user_name",label:"所属成员"},{prop:"external_userid",label:"userId"},{prop:"enable",label:"客户状态"},{prop:"scan_user_type",label:"客户类型"},{prop:"scan_time",label:"扫码时间"}]}},created:function(){this.init()},methods:{init:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_dataView,{params:{id:this.$route.params.id}}).then(function(e){e=e.data;t.loading=!1,e&&0==e.errno?t.dataPreview.forEach(function(t){t.bigNum=e.rst.tal[t.bigParams],t.smallNum=e.rst.td[t.smallParams]}):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})}}},d={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"con"},[a("div",{staticClass:"backBox",on:{click:function(e){return t.$router.go(-1)}}},[t._m(0)]),t._v(" "),a("div",{staticClass:"dataBox"},t._l(t.dataPreview,function(e,i){return a("div",{key:i,staticClass:"box_item"},[a("div",{staticClass:"flex-align-center"},[a("span",{staticClass:"c-000 fWeight600"},[t._v(t._s(e.bigTitle?e.bigTitle:"-"))]),t._v(" "),e.note&&e.note.length>0?a("span",{staticClass:"lMarauto"},[a("el-tooltip",{staticClass:"disinblock",attrs:{placement:"top",effect:"light"}},[a("div",{attrs:{slot:"content"},slot:"content"},t._l(e.note,function(e,i){return a("div",{key:i},[t._v("\n "+t._s(e)+"\n ")])}),0),t._v(" "),a("i",{staticClass:"el-icon-question c-999"})])],1):t._e()]),t._v(" "),a("div",{staticClass:"f28 pad120"},[t._v(t._s(e.bigNum||0==e.bigNum?e.bigNum:"-"))]),t._v(" "),a("div",{staticClass:"splitLine"}),t._v(" "),a("div",{staticClass:"pad120"},[a("span",{staticClass:"c-666 f13"},[t._v(t._s(e.smallTitle?e.smallTitle:"-"))]),t._v(" "),a("span",{staticClass:"c-000 f13"},[t._v(t._s(e.smallNum||0==e.smallNum?e.smallNum:"-"))])])])}),0),t._v(" "),a("div",{staticClass:"topTagBox"},[a("div",{staticClass:"flex-align-center bMar15"},t._l(t.switchList,function(e){return a("div",{key:e.id,class:["tagItem",t.tagType==e.id?"tagItem_active":""],on:{click:function(a){t.tagType=e.id}}},[t._v("\n "+t._s(e.name?e.name:"-")+"\n ")])}),0),t._v(" "),0==t.tagType?a("channelAnalyse"):t._e(),t._v(" "),1==t.tagType?a("div",[a("div",{staticClass:"flex"},[a("self-input",{attrs:{hasLabel:!1,label_name:"搜索客户"},on:{inputChange:function(e){t.kehu_val=e,t.initFlag=!t.initFlag}}}),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.$refs.customerListRef.init_list(1,"export")}}},[t._v("导出excle")])],1),t._v(" "),a("publicTable",{ref:"customerListRef",attrs:{propsData:{desCol:t.desCol_list,source:"customerList",initFlag:t.initFlag,name:t.kehu_val}}})],1):t._e(),t._v(" "),2==t.tagType?a("publicTable",{staticStyle:{"margin-top":"30px"},attrs:{propsData:{desCol:t.desCol_analyse,source:"customerAnalyse"}}}):t._e()],1)])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"back"},[e("i",{staticClass:"el-icon-back"}),this._v(" "),e("span",[this._v("返回")]),this._v("\n (数据分析)\n ")])}]};var p=a("VU/8")(c,d,!1,function(t){a("Yq9S")},"data-v-165a0efe",null);e.default=p.exports},Yq9S:function(t,e){}});
|