chunk-2ea4835d.e219cfc9.js 10 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2ea4835d"],{5037:function(t,e,a){},5115:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:t.className,style:{height:t.height,width:t.width}})},i=[],r=(a("6b54"),a("313e")),s=a.n(r);function o(t,e,a){var n,i,r,s,o,c=function c(){var l=+new Date-s;l<e&&l>0?n=setTimeout(c,e-l):(n=null,a||(o=t.apply(r,i),n||(r=i=null)))};return function(){for(var i=arguments.length,l=new Array(i),d=0;d<i;d++)l[d]=arguments[d];r=this,s=+new Date;var h=a&&!n;return n||(n=setTimeout(c,e)),h&&(o=t.apply(r,l),r=l=null),o}}var c={data:function(){return{$_sidebarElm:null}},mounted:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},beforeDestroy:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},activated:function(){this.$_initResizeEvent(),this.$_initSidebarResizeEvent()},deactivated:function(){this.$_destroyResizeEvent(),this.$_destroySidebarResizeEvent()},methods:{$_resizeHandler:function(){var t=this;return o(function(){t.chart&&t.chart.resize()},100)()},$_initResizeEvent:function(){window.addEventListener("resize",this.$_resizeHandler)},$_destroyResizeEvent:function(){window.removeEventListener("resize",this.$_resizeHandler)},$_sidebarResizeHandler:function(t){"width"===t.propertyName&&this.$_resizeHandler()},$_initSidebarResizeEvent:function(){this.$_sidebarElm=document.getElementsByClassName("sidebar-container")[0],this.$_sidebarElm&&this.$_sidebarElm.addEventListener("transitionend",this.$_sidebarResizeHandler)},$_destroySidebarResizeEvent:function(){this.$_sidebarElm&&this.$_sidebarElm.removeEventListener("transitionend",this.$_sidebarResizeHandler)}}};a("817d");var l={mixins:[c],props:{className:{type:String,default:"chart"},width:{type:String,default:"100%"},height:{type:String,default:"350px"},autoResize:{type:Boolean,default:!0},chartData:{type:Object,required:!0}},data:function(){return{chart:null}},watch:{chartData:{deep:!0,handler:function(t){this.setOptions(t)}}},mounted:function(){var t=this;this.$nextTick(function(){t.initChart()})},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{getDay:function(t){var e=new Date,a=e.getTime()+864e5*t;e.setTime(a);var n=e.getFullYear(),i=e.getMonth(),r=e.getDate();return i=this.doHandleMonth(i+1),r=this.doHandleMonth(r),n+"-"+i+"-"+r},doHandleMonth:function(t){var e=t;return 1==t.toString().length&&(e="0"+t),e},initChart:function(){this.chart=s.a.init(this.$el,"macarons"),this.setOptions(this.chartData)},setOptions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.expectedData;this.chart.setOption({xAxis:{data:e.date,boundaryGap:!1,axisTick:{show:!1},axisLabel:{rotate:60}},grid:{left:10,right:10,bottom:20,top:30,containLabel:!0},tooltip:{trigger:"axis",axisPointer:{type:"cross"},padding:[5,10]},yAxis:{axisTick:{show:!1}},legend:{data:["expected"]},series:[{name:"每日新增",itemStyle:{normal:{color:"#FF005A",lineStyle:{color:"#FF005A",width:2}}},smooth:!0,type:"line",data:e.data,animationDuration:2800,animationEasing:"cubicInOut"}]})}}},d=l,h=a("2877"),u=Object(h["a"])(d,n,i,!1,null,null,null);e["a"]=u.exports},c379:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-card",{scopedSlots:t._u([{key:"header",fn:function(){return[a("content-header")]},proxy:!0}])},[a("div",{staticClass:"block"},[a("div",{staticClass:"filters"},[a("el-date-picker",{attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd","picker-options":t.pickerOptions},model:{value:t.dateBetween,callback:function(e){t.dateBetween=e},expression:"dateBetween"}}),a("el-select",{staticClass:"selectwidth",attrs:{size:"small",placeholder:"请选择区域"},model:{value:t.area_id,callback:function(e){t.area_id=e},expression:"area_id"}},t._l(t.put_areas,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1),t.merchant_id_show?a("div",[a("el-select",{staticClass:"selectwidth",attrs:{size:"small",placeholder:"商户"},model:{value:t.merchant_id,callback:function(e){t.merchant_id=e},expression:"merchant_id"}},t._l(t.merchant_data.options,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1):t._e(),a("el-button",{on:{click:t.SearchData}},[t._v("查询")])],1)]),a("p",[t._v("充值概况")]),a("div",{staticClass:"gaikuang"},[a("el-card",{staticClass:"min-card"},[a("p",[t._v("今日新增充值(元)")]),a("p",{staticClass:"bolod-p"},[t._v(" "+t._s(t.todayNewAdd)+" ")])]),a("el-card",{staticClass:"min-card"},[a("p",[t._v("本月累计充值(元)")]),a("p",{staticClass:"bolod-p"},[t._v(" "+t._s(t.thisMonthTotal)+" ")])]),a("el-card",{staticClass:"min-card"},[a("p",[t._v("总充值(元)")]),a("p",{staticClass:"bolod-p"},[t._v(" "+t._s(t.profitTotal)+" ")])])],1),a("p",[t._v("充值增长趋势")]),a("el-row",{staticStyle:{background:"#fff",padding:"16px 16px 0","margin-bottom":"32px"}},[a("line-chart",{attrs:{"chart-data":t.lineChartData}})],1),a("el-row",[a("p",[t._v("每日充值增长明细 "),a("el-button",{staticClass:"excel-import",on:{click:t.exportExcel}},[t._v("导出excel")])],1),a("div",{staticClass:"excel-import"}),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tableData,id:"table","row-class-name":t.tableRowClassName}},[a("el-table-column",{attrs:{label:"日期"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.date)+"\n ")]}}])}),a("el-table-column",{attrs:{label:"新增充值(元)"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.value)+"\n ")]}}])})],1)],1)],1)},i=[],r=(a("ac6a"),a("5df3"),a("768b")),s=(a("96cf"),a("3b8d")),o=a("5115"),c=a("1146"),l=a.n(c),d=a("b64d"),h=a("ee25"),u=a("323a"),p={name:"Index",components:{LineChart:o["a"]},data:function(){return{pickerOptions:{shortcuts:[{text:"最近一周",onClick:function(t){var e=new Date,a=new Date;a.setTime(a.getTime()-6048e5),t.$emit("pick",[a,e])}},{text:"最近一个月",onClick:function(t){var e=new Date,a=new Date;a.setTime(a.getTime()-2592e6),t.$emit("pick",[a,e])}},{text:"最近三个月",onClick:function(t){var e=new Date,a=new Date;a.setTime(a.getTime()-7776e6),t.$emit("pick",[a,e])}}]},dateBetween:"",put_areas:[{id:null,name:"全部"}],area_id:null,todayNewAdd:0,thisMonthTotal:0,profitTotal:0,tableData:[],lineChartData:{expectedData:{data:[],date:[]}},merchant_data:{},merchant_id_show:!1,merchant_id:null}},created:function(){var t=Object(s["a"])(regeneratorRuntime.mark(function t(){var e,a,n,i,s,o,c,l,p,m,f,b,_,v,w,g=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([Object(d["b"])({all:1})]);case 2:return e=t.sent,a=Object(r["a"])(e,1),n=a[0].data,this.put_areas.push.apply(this.put_areas,n),t.next=8,Promise.all([Object(h["d"])()]);case 8:return i=t.sent,s=Object(r["a"])(i,1),o=s[0].data,this.profitTotal=o,t.next=14,Promise.all([Object(h["b"])()]);case 14:return c=t.sent,l=Object(r["a"])(c,1),p=l[0].data,t.next=19,Promise.all([Object(h["c"])()]);case 19:if(m=t.sent,f=Object(r["a"])(m,1),b=f[0].data,this.todayNewAdd=b.todayRecharge,this.thisMonthTotal=b.thisMonthRecharge,this.tableData=p,p.map(function(t){g.lineChartData.expectedData.data.push(t.value),g.lineChartData.expectedData.date.push(t.date)}),"administrator"!==this.$store.state.users.user.roles[0]){t.next=35;break}return this.merchant_id_show=!0,this.merchant_data={options:[{id:"",name:"全部"}]},t.next=31,Promise.all([Object(u["c"])({all:1})]);case 31:_=t.sent,v=Object(r["a"])(_,1),w=v[0].data,this.merchant_data.options.push.apply(this.merchant_data.options,w.data);case 35:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),methods:{budata:function(t){t.length<15&&(t.push(0),this.budata(t))},SearchData:function(){var t=Object(s["a"])(regeneratorRuntime.mark(function t(){var e,a,n,i,s,o,c,l,d,u,p=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.lineChartData.expectedData.data=[],this.lineChartData.expectedData.date=[],e={area_id:this.area_id,merchant_id:this.merchant_id},null!==this.dateBetween&&(e={area_id:this.area_id,dateBetween:this.dateBetween,merchant_id:this.merchant_id}),t.next=6,Promise.all([Object(h["d"])()]);case 6:return a=t.sent,n=Object(r["a"])(a,1),i=n[0].data,this.profitTotal=i,t.next=12,Promise.all([Object(h["b"])(e)]);case 12:return s=t.sent,o=Object(r["a"])(s,1),c=o[0].data,t.next=17,Promise.all([Object(h["c"])(e)]);case 17:l=t.sent,d=Object(r["a"])(l,1),u=d[0].data,this.todayNewAdd=u.todayRecharge,this.thisMonthTotal=u.thisMonthRecharge,this.tableData=c,c.map(function(t){p.lineChartData.expectedData.data.push(t.value),p.lineChartData.expectedData.date.push(t.date)});case 24:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),tableRowClassName:function(t){t.row;var e=t.rowIndex;return 1===e?"warning-row":3===e?"success-row":""},exportExcel:function(){var t=l.a.utils.table_to_book(document.getElementById("table"));try{l.a.writeFile(t,"recharge.xlsx")}catch(e){console.log(e,t),this.$message.error("导出失败请联系管理员")}}}},m=p,f=(a("ea20"),a("2877")),b=Object(f["a"])(m,n,i,!1,null,"4f5acb86",null);e["default"]=b.exports},ea20:function(t,e,a){"use strict";var n=a("5037"),i=a.n(n);i.a},ee25:function(t,e,a){"use strict";a.d(e,"a",function(){return i}),a.d(e,"c",function(){return r}),a.d(e,"d",function(){return s}),a.d(e,"b",function(){return o});var n=a("bf9a");function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("recharge_order",{params:t})}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("recharge_order/statisticsRecharge",{params:t})}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("recharge_order/totalRecharge",{params:t})}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].post("recharge_order/rechargeChart",t)}}}]);
  2. //# sourceMappingURL=chunk-2ea4835d.e219cfc9.js.map