1 |
- webpackJsonp([32],{Y9pu:function(t,a){},nfhc:function(t,a){},nvpU:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n={props:["report_id"],data:function(){return{dataInfo:{},loading:!1}},created:function(){this.init()},methods:{init:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.gmvView,{params:{id:this.report_id}}).then(function(a){t.loading=!1,(a=a.data)&&0==a.errno?(t.dataInfo=a.rst,t.$nextTick(function(){t.gmvChannelEcharts(),t.gmvBrandEcharts(),t.gmvUserEcharts(),t.gmvCommodityEcharts()})):4003!=a.errno&&t.$message({message:a.err,type:"warning"})}).catch(function(a){t.loading=!1})},gmvChannelEcharts:function(){var t=this,a=[],e=[];this.dataInfo.data.topChannel.forEach(function(n){a.push(n.platform),e.push({value:(Number(n.sell_money_sum)/Number(t.dataInfo.data.overview["总销售额"])*100).toFixed(1),sell_money:n.sell_money_sum,sell_count:n.sell_count_sum})});var n=this,o={tooltip:{trigger:"axis",show:!0,formatter:function(t){return(t=t[0]).name+":"+(t.value?t.value+"%":"-")+"<br/>总销售额:"+n.$NumberHandle(t.data.sell_money,1)+"<br/>总销量:"+n.$NumberHandle(t.data.sell_count,1)}},grid:{left:"1%",right:"2%",bottom:"1%",containLabel:!0},xAxis:[{type:"category",data:a,axisLine:{lineStyle:{color:"#ECEDF2"}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:"#999999",fontSize:12,rotate:30}}],yAxis:[{type:"value",name:"%",axisLine:{lineStyle:{color:"#ECEDF2"}},max:0==e.length?1e5:"dataMax",min:function(t){return t.min<=0?t.min:0},axisTick:{show:!1},splitLine:{lineStyle:{color:"#DADADA",type:"dashed"}},nameTextStyle:{color:"#999999",fontSize:14,padding:[0,35,0,0]},axisLabel:{color:"#999999",fontSize:13,formatter:function(t){var a=t;return n.$NumberHandle(a)}}}],series:[{type:"bar",barWidth:100/a.length>14?14:100/a.length,yAxisIndex:0,barGap:0,label:{show:!0,position:"top",fontSize:10,color:"#999999",formatter:function(t){return t.value?t.value+"%\nGMV:"+n.$NumberHandle(t.data.sell_money,1):""}},data:e,itemStyle:{color:"#4B76FB",barBorderRadius:[4,4,4,4],borderType:"dotted"}}]};this.$echarts.init(document.getElementById("gmv_channel_echarts")).setOption(o)},gmvBrandEcharts:function(){var t=[],a=[];this.dataInfo.data.topBrand.forEach(function(e){t.push(e.brand),a.push({value:e.sell_money_sum,sell_money:e.sell_money_sum,sell_count:e.sell_count_sum,doc_count:e.doc_count})});var e=this,n={tooltip:{trigger:"axis",show:!0,formatter:function(t){return(t=t[0]).name+":"+(t.value?t.value+"%":"-")+"<br/>总销售额:"+e.$NumberHandle(t.data.sell_money,1)+"<br/>总销量:"+e.$NumberHandle(t.data.sell_count,1)+"<br/>渠道下商品数:"+e.$NumberHandle(t.data.doc_count,1)}},grid:{left:"1%",right:"2%",bottom:"1%",containLabel:!0},xAxis:[{type:"category",data:t,axisLine:{lineStyle:{color:"#ECEDF2"}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:"#999999",fontSize:12,rotate:30}}],yAxis:[{type:"value",axisLine:{lineStyle:{color:"#ECEDF2"}},max:0==a.length?1e5:"dataMax",min:function(t){return t.min<=0?t.min:0},axisTick:{show:!1},splitLine:{lineStyle:{color:"#DADADA",type:"dashed"}},nameTextStyle:{color:"#999999",fontSize:14,padding:[0,35,0,0]},axisLabel:{color:"#999999",fontSize:13,formatter:function(t){var a=t;return e.$NumberHandle(a)}}}],series:[{type:"bar",barWidth:100/t.length>14?14:100/t.length,yAxisIndex:0,barGap:0,label:{show:!0,position:"top",fontSize:10,color:"#999999",formatter:function(t){return t.value?t.value+"%\nGMV:"+e.$NumberHandle(t.data.sell_money,1):""}},data:a,itemStyle:{color:"#4B76FB",barBorderRadius:[4,4,4,4],borderType:"dotted"}}]};this.$echarts.init(document.getElementById("gmv_brand_echarts")).setOption(n)},gmvUserEcharts:function(){var t=[],a=[];this.dataInfo.data.topUser.slice(0,20).forEach(function(e){t.push(e.user_name),a.push({value:e.sell_money_sum,sell_money:e.sell_money_sum,sell_count:e.sell_count_sum,doc_count:e.doc_count,fan:e.fan,user_id:e.uid})});var e={tooltip:{trigger:"axis",show:!0,formatter:function(t){return"达人:"+(t=t[0]).name+"<br/>达人粉丝数:"+t.data.fan+"<br/>达人ID:"+t.data.user_id+"<br/>达人售卖商品数:"+t.data.doc_count+"<br/>总销售额:"+t.data.sell_money+"<br/>总销量:"+t.data.sell_count}},grid:{top:10,bottom:30,left:150,right:80},xAxis:{max:"dataMax",label:{formatter:function(t){return Math.round(t)}},axisLine:{lineStyle:{color:"#ECEDF2"}},axisTick:{show:!1},splitLine:{lineStyle:{color:"#DADADA",type:"dashed"}},axisLabel:{color:"#999999",fontSize:12}},yAxis:{type:"category",inverse:!0,data:t,axisTick:{show:!1},axisLine:{lineStyle:{color:"#DADADA"}},axisLabel:{show:!0,textStyle:{fontSize:10,color:"#555"},formatter:function(t){var a=t;return a.length>12&&(a=a.substring(0,12)+"..."),a}},animationDuration:300,animationDurationUpdate:300},series:[{type:"bar",barWidth:100/t.length>14?14:100/t.length,data:a,label:{show:!0,position:"right",fontSize:10,color:"#999999",valueAnimation:!0},itemStyle:{color:"#4B76FB",barBorderRadius:[4,4,4,4],borderType:"dotted"}}]};this.$echarts.init(document.getElementById("gmv_user_echarts")).setOption(e)},gmvCommodityEcharts:function(){var t=[],a=[];this.dataInfo.data.topCommodity.slice(0,20).forEach(function(e){t.push(e.title),a.push({value:e.sell_money_sum,sell_money:e.sell_money_sum,sell_count:e.sell_count_sum,doc_count:e.doc_count})});var e={tooltip:{trigger:"axis",show:!0,formatter:function(t){return"商品名称:"+(t=t[0]).name+"<br/>商品售卖场数:"+t.data.doc_count+"<br/>总销售额:"+t.data.sell_money+"<br/>总销量:"+t.data.sell_count}},grid:{top:10,bottom:30,left:150,right:80},xAxis:{max:"dataMax",label:{formatter:function(t){return Math.round(t)}},axisLine:{lineStyle:{color:"#ECEDF2"}},axisTick:{show:!1},splitLine:{lineStyle:{color:"#DADADA",type:"dashed"}},axisLabel:{color:"#999999",fontSize:12}},yAxis:{type:"category",inverse:!0,data:t,axisTick:{show:!1},axisLine:{lineStyle:{color:"#DADADA"}},axisLabel:{show:!0,textStyle:{fontSize:10,color:"#555"},formatter:function(t){var a=t;return a.length>12&&(a=a.substring(0,12)+"..."),a}},animationDuration:300,animationDurationUpdate:300},series:[{type:"bar",barWidth:100/t.length>14?14:100/t.length,data:a,label:{show:!0,position:"right",fontSize:10,color:"#999999",valueAnimation:!0},itemStyle:{color:"#4B76FB",barBorderRadius:[4,4,4,4],borderType:"dotted"}}]};this.$echarts.init(document.getElementById("gmv_commodity_echarts")).setOption(e)},exportToExcel:function(){var t=this.dataInfo,a=[{"统计时间":t.created_at,"搜索类目":t.params.keyword,"包括":t.params.include,"排除":t.params.exclude,"筛选范围(商品上架时间)":t.params.start_time+"~"+t.params.end_time,"总销量":t.data.overview["总销量"],"总销售额":t.data.overview["总销售额"],"平均客单价":t.data.overview["平均客单价"],"品牌GMV占比":t.data.overview["品牌GMV占比"],"带货达人总数":t.data.overview["带货达人总数"]}],e=[];t.data.topChannel.forEach(function(t){e.push({"渠道":t.platform,"渠道下商品数":t.doc_count,"总销量":t.sell_count_sum,"总销售额":t.sell_money_sum})});var n=[];t.data.topBrand.forEach(function(t){n.push({"品牌":t.brand,"品牌下商品数":t.doc_count,"总销量":t.sell_count_sum,"总销售额":t.sell_money_sum})});var o=[];t.data.topUser.forEach(function(t){o.push({"达人名称":t.user_name.replace(/[\↵|\n]+$/g,""),"达人ID":t.uid,"达人粉丝数":t.fan,"达人售卖商品数":t.doc_count,"总销量":t.sell_count_sum,"总销售额":t.sell_money_sum,"达人头像":t.headurl})});var i=[];t.data.topCommodity.forEach(function(t){i.push({"商品名称":t.title.replace(/[\↵|\n]+$/g,""),"商品ID":t.product_id,"商品来源":t.platform,"商品品牌":t.brand,"商品售卖场数":t.doc_count,"总销量":t.sell_count_sum,"总销售额":t.sell_money_sum,"商品地址":t.url})});var r={"GMV统计基础信息":a,"GMV渠道占比":e,"GMV品牌Top10":n,"带货达人":o,"热卖商品榜":i},s={"GMV统计基础信息":"统计时间,搜索类目,包括,排除,筛选范围(商品上架时间),总销量,总销售额,平均客单价,品牌GMV占比,带货达人总数".split(","),"GMV渠道占比":"渠道,渠道下商品数,总销量,总销售额".split(","),"GMV品牌Top10":"品牌,品牌下商品数,总销量,总销售额".split(","),"带货达人":"达人名称,达人ID,达人粉丝数,达人售卖商品数,总销量,总销售额,达人头像".split(","),"热卖商品榜":"商品名称,商品ID,商品来源,商品品牌,商品售卖场数,总销量,总销售额,商品地址".split(",")};function l(t,a){var e=[];return e.push(a),t.forEach(function(t,n){var o=[];a.map(function(a){o.push(t[a])}),e.push(o)}),e}!function(t,a,e){var n=[],o={},i=XLSX.utils.book_new();for(var r in t){n.push(r);var d=s[r],c=l(t[r],d);o[r]=XLSX.utils.aoa_to_sheet(c),o[r]["!cols"]=a}i.SheetNames=n,i.Sheets=o,XLSX.writeFile(i,e+".xlsx")}(r,[{wch:10},{wch:10},{wch:10}],"GMV统计")}}},o={render:function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"min-height":"500px","padding-bottom":"20px"}},[t.dataInfo.params?n("div",{staticClass:"paramsDiv"},[t.dataInfo.params.keyword?n("span",[n("em",[t._v("搜索类目:")]),t._v(t._s(t.dataInfo.params.keyword))]):t._e(),t._v(" "),t.dataInfo.params.include?n("span",[n("em",[t._v("包括:")]),t._v(t._s(t.dataInfo.params.include))]):t._e(),t._v(" "),t.dataInfo.params.exclude?n("span",[n("em",[t._v("排除:")]),t._v(t._s(t.dataInfo.params.exclude))]):t._e(),t._v(" "),n("br"),t._v(" "),n("span",[n("em",[t._v("筛选范围(商品上架时间):")]),t._v(t._s(t.dataInfo.params.start_time)+" ~ "+t._s(t.dataInfo.params.end_time))])]):t._e(),t._v(" "),t.dataInfo.params?n("button",{staticClass:"export",on:{click:t.exportToExcel}},[t._v("导出")]):t._e(),t._v(" "),t.dataInfo.data?n("div",[n("div",{staticClass:"sale_trend",staticStyle:{"margin-top":"20px"}},[n("div",{staticClass:"platform_common_title clear"},[n("span",[t._v("GMV渠道占比")]),t._v(" "),t.dataInfo.data.overview?n("p",{staticStyle:{float:"right"}},[t._v("渠道GMV汇总:¥"+t._s(t.$NumberHandle(t.dataInfo.data.overview["总销售额"],1)))]):t._e()]),t._v(" "),n("div",{staticStyle:{height:"300px"},attrs:{id:"gmv_channel_echarts"}}),t._v(" "),t.dataInfo&&0!=t.dataInfo.data.topChannel.length||t.loading?t._e():n("div",{staticClass:"curve_no_data"},[n("img",{attrs:{src:e("vLvk"),alt:""}}),t._v(" "),n("span",[t._v("暂无数据")])])]),t._v(" "),n("div",{staticClass:"sale_trend",staticStyle:{"margin-top":"20px"}},[n("div",{staticClass:"platform_common_title clear"},[n("span",[t._v("GMV品牌Top10")]),t._v(" "),t.dataInfo&&t.dataInfo.data.overview?n("p",{staticStyle:{float:"right"}},[t._v("Top10品牌GMV占比:"+t._s(t.$NumberHandle(t.dataInfo.data.overview["品牌GMV占比"],1))+"%")]):t._e()]),t._v(" "),n("div",{staticStyle:{height:"300px"},attrs:{id:"gmv_brand_echarts"}}),t._v(" "),t.dataInfo&&0!=t.dataInfo.data.topBrand.length||t.loading?t._e():n("div",{staticClass:"curve_no_data"},[n("img",{attrs:{src:e("vLvk"),alt:""}}),t._v(" "),n("span",[t._v("暂无数据")])])]),t._v(" "),n("div",{staticClass:"sale_trend",staticStyle:{"margin-top":"20px"}},[n("div",{staticClass:"platform_common_title clear"},[n("span",[t._v("带货达人Top20")]),t._v(" "),t.dataInfo&&t.dataInfo.data.overview?n("p",{staticStyle:{float:"right"}},[t._v("类目带货达人总数:"+t._s(t.$NumberHandle(t.dataInfo.data.overview["带货达人总数"],1))+"人")]):t._e()]),t._v(" "),n("div",{staticStyle:{height:"400px"},attrs:{id:"gmv_user_echarts"}}),t._v(" "),t.dataInfo&&0!=t.dataInfo.data.topUser.length||t.loading?t._e():n("div",{staticClass:"curve_no_data"},[n("img",{attrs:{src:e("vLvk"),alt:""}}),t._v(" "),n("span",[t._v("暂无数据")])])]),t._v(" "),n("div",{staticClass:"sale_trend",staticStyle:{"margin-top":"20px"}},[t._m(0),t._v(" "),n("div",{staticStyle:{height:"400px"},attrs:{id:"gmv_commodity_echarts"}}),t._v(" "),t.dataInfo&&0!=t.dataInfo.data.topCommodity.length||t.loading?t._e():n("div",{staticClass:"curve_no_data"},[n("img",{attrs:{src:e("vLvk"),alt:""}}),t._v(" "),n("span",[t._v("暂无数据")])])])]):t._e()])},staticRenderFns:[function(){var t=this.$createElement,a=this._self._c||t;return a("div",{staticClass:"platform_common_title clear"},[a("span",[this._v("热卖商品Top20")])])}]};var i={components:{gmvReport:e("C7Lr")(n,o,!1,function(t){e("nfhc")},"data-v-05af75d8",null).exports},data:function(){return{loading:!1,page:1,total:0,pagesize:20,pageCount:0,infoList:[],reportFlag:!1,report_id:""}},created:function(){this.init(1)},methods:{deteleClick:function(t){var a=this;this.$confirm("确定要删除该GMV统计?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.loading=!0,a.$axios.post(a.URL.BASEURL+a.URL.gmvDelete,{id:t.id}).then(function(t){(t=t.data)&&0==t.errno?a.init(a.page):(a.loading=!1,a.$message({message:t.err,type:"warning"}))}).catch(function(){a.loading=!1})}).catch(function(){})},handleClick:function(t){"统计完成"==t.status&&(this.report_id=t.id,this.reportFlag=!0)},init:function(t){var a=this;this.loading=!0,this.page=t,this.infoList=[],this.$axios.get(this.URL.BASEURL+this.URL.gmvIndex,{params:{page:t,pagesize:this.pagesize}}).then(function(t){if(a.loading=!1,(t=t.data)&&0==t.errno){var e=t.rst.data;a.total=t.rst.pageInfo.total,a.infoList=e,a.pageCount=t.rst.pageInfo.pages}else 4003!=t.errno&&a.$message({message:t.err,type:"warning"})}).catch(function(t){a.loading=!1})},handleCurrentChange:function(t){this.init(t)}}},r={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"gmvIndex"},[e("el-table",{staticClass:"table",attrs:{data:t.infoList,border:"",size:"mini"}},[e("el-table-column",{attrs:{align:"center",prop:"created_at",label:"申请时间",width:"150"}}),t._v(" "),e("el-table-column",{attrs:{align:"center",prop:"params.keyword",label:"关键词"}}),t._v(" "),e("el-table-column",{attrs:{align:"center",prop:"params.include",label:"包括关键词"}}),t._v(" "),e("el-table-column",{attrs:{align:"center",prop:"params.exclude",label:"排除关键词"}}),t._v(" "),e("el-table-column",{attrs:{align:"center",prop:"params.start_time",label:"开始时间"}}),t._v(" "),e("el-table-column",{attrs:{align:"center",prop:"params.end_time",label:"结束时间"}}),t._v(" "),e("el-table-column",{attrs:{align:"center",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("span",{style:"统计完成"==a.row.status?"color:#62c708":""},[t._v(t._s(a.row.status))])]}}])}),t._v(" "),e("el-table-column",{attrs:{align:"center",fixed:"right",label:"操作",width:"120"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{style:"统计完成"==a.row.status?"color:#2762ff":"color:#aaa;cursor: not-allowed;",attrs:{type:"text",size:"small"},on:{click:function(e){return t.handleClick(a.row)}}},[t._v("查看报告")]),t._v(" "),e("el-button",{staticStyle:{color:"#fb4646"},attrs:{type:"text",size:"small"},on:{click:function(e){return t.deteleClick(a.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"bottom"},[e("span",{staticClass:"total"},[t._v("共"+t._s(t.total)+"条结果")]),t._v(" "),e("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":t.pageCount},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),e("my-dialog",{attrs:{visible:t.reportFlag,width:"76%",minWidth:"930px",paddingBottom:"0"},on:{"update:visible":function(a){t.reportFlag=a}}},[e("gmv-report",{attrs:{report_id:t.report_id}})],1)],1)},staticRenderFns:[]};var s=e("C7Lr")(i,r,!1,function(t){e("Y9pu")},"data-v-badf4d7e",null);a.default=s.exports}});
|