12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-cc3be6b8"],{"0c3f":function(t,e,a){},"0fb6":function(t,e,a){},2627:function(t,e,a){"use strict";var n=a("0c3f"),i=a.n(n);i.a},"386d":function(t,e,a){"use strict";var n=a("cb7c"),i=a("83a1"),r=a("5f1b");a("214f")("search",1,function(t,e,a,s){return[function(a){var n=t(this),i=void 0==a?void 0:a[e];return void 0!==i?i.call(a,n):new RegExp(a)[e](String(n))},function(t){var e=s(a,t,this);if(e.done)return e.value;var o=n(t),l=String(this),c=o.lastIndex;i(c,0)||(o.lastIndex=0);var u=r(o,l);return i(o.lastIndex,c)||(o.lastIndex=c),null===u?-1:u.index}]})},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,l=function l(){var c=+new Date-s;c<e&&c>0?n=setTimeout(l,e-c):(n=null,a||(o=t.apply(r,i),n||(r=i=null)))};return function(){for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];r=this,s=+new Date;var d=a&&!n;return n||(n=setTimeout(l,e)),d&&(o=t.apply(r,c),r=c=null),o}}var l={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 c={mixins:[l],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"}]})}}},u=c,d=a("2877"),h=Object(d["a"])(u,n,i,!1,null,null,null);e["a"]=h.exports},"69d9":function(t,e,a){"use strict";a("8e6e"),a("456d"),a("7f7f"),a("ac6a");var n=a("bd86");function i(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,n)}return a}function r(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?i(a,!0).forEach(function(e){Object(n["a"])(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):i(a).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}var s,o,l={name:"SearchForm",data:function(){return{form:{},show:!0}},props:{fields:Array,resetCurrentPage:{type:Boolean,default:!0}},created:function(){this.initFormShow()},methods:{onSubmit:function(){var t=this,e=r({},this.$route.query);this.resetCurrentPage&&delete e.page,this.fields.forEach(function(a){var n=a.field,i=t.form[n];"string"===typeof i&&(i=i.trim()),""===i||void 0===i?delete e[n]:(e[n]=i,"time_between"===n&&(e[n]=null==i?i:[i[0],i[1]]))}),this.$router.push({path:this.$route.path,query:e})},dateFormat:function(t){var e=t.getFullYear()+"-"+this.p(t.getMonth()+1)+"-"+this.p(t.getDate()),a=this.p(t.getHours())+":"+this.p(t.getMinutes())+":"+this.p(t.getSeconds());return e+a},p:function(t){return t<10?"0"+t:t},onReset:function(){this.form={},this.onSubmit()},initFormShow:function(){var t=this;this.fields.some(function(e){if(t.$route.query[e.field])return t.show=!0,!0})},setFormValueFromQuery:function(){var t=this,e=this.$route.query;this.fields.forEach(function(a){var n=a.field,i=e[n];t.$set(t.form,n,i)})},toggleShow:function(){this.show=!this.show},getOffsetHeight:function(){var t=document.getElementById("div-searchForm"),e=t.clientWidth||t.offsetWidth;this.formHeight=e}},watch:{$route:{handler:function(){this.setFormValueFromQuery()},immediate:!0}},render:function(t){var e=this;return t("el-collapse-transition",[t("div",{directives:[{name:"show",value:this.show}]},[t("el-form",{attrs:{inline:!0},nativeOn:{keydown:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?(t.preventDefault(),e.onSubmit(t)):null}}},[this.fields.map(function(a){var n;switch(a.type){case"el-select":n=t("el-select",{style:"width:150px;",attrs:{placeholder:a.label,filterable:!0,clearable:!0},model:{value:e.form[a.field],callback:function(t){e.$set(e.form,a.field,t)}}},[a.options.map(function(e){return t("el-option",{key:e.value||e.id,attrs:{label:e.label||e.name,value:String(e.value||e.id)}})})]);break;case"time-between":n=t("el-date-picker",{attrs:{type:"datetimerange","value-format":"yyyy-MM-dd HH:mm:ss","start-placeholder":a.label1,"end-placeholder":a.label2},model:{value:e.form[a.field],callback:function(t){e.$set(e.form,a.field,t)}}});break;case"super-input":n=t("el-input",{attrs:{placeholder:a.label,clearable:!0},model:{value:e.form[a.field],callback:function(t){e.$set(e.form,a.field,t)}}});break;default:n=t("el-input",{attrs:{placeholder:a.label,clearable:!0},model:{value:e.form[a.field],callback:function(t){e.$set(e.form,a.field,t)}}})}return t("el-form-item",{key:a.field},[n])}),t("el-form-item",{class:"actions"},[t("el-button",{attrs:{type:"primary"},on:{click:this.onSubmit}},["查询"]),t("el-button",{on:{click:this.onReset}},["重置"])])])])])}},c=l,u=(a("cafd"),a("2877")),d=Object(u["a"])(c,s,o,!1,null,"6dd66826",null);e["a"]=d.exports},"6f90":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("el-tabs",{on:{"tab-click":t.handleClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"收益分析",name:"first"}},[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",{staticClass:"div_mch"},[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.profit)+"\n ")]}}])})],1)],1)],1),a("el-tab-pane",{attrs:{label:"收益明细",name:"second"}},[a("search-form",{ref:"searchForm",attrs:{fields:t.search}}),a("el-table",{staticClass:"table-font",staticStyle:{width:"100%"},attrs:{data:t.profitData}},[a("el-table-column",{attrs:{label:"时间",align:"center","show-overflow-tooltip":"","min-width":"8%"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.created_at)+"\n ")]}}])}),a("el-table-column",{attrs:{label:"用户昵称",align:"center","show-overflow-tooltip":"","min-width":"5%"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.nickname)+"\n ")]}}])}),a("el-table-column",{attrs:{label:"手机号",align:"center","show-overflow-tooltip":"","min-width":"5%"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.mobile)+"\n ")]}}])}),a("el-table-column",{attrs:{label:"支付方式",align:"center","show-overflow-tooltip":"","min-width":"7%"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.type)+"\n ")]}}])}),a("el-table-column",{attrs:{label:"金额",align:"center","show-overflow-tooltip":"","min-width":"3%"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.money)+"\n ")]}}])})],1),a("div",{staticClass:"card-footer"},[a("pagination",{attrs:{page:t.page}})],1)],1)],1)],1)},i=[],r=(a("386d"),a("ac6a"),a("5df3"),a("768b")),s=(a("96cf"),a("3b8d")),o=a("5115"),l=a("1146"),c=a.n(l),u=a("b64d"),d=a("81df"),h=a("69d9"),p=a("bf9a");function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p["b"].get("profit",{params:t})}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p["b"].get("profit/statistics",{params:t})}function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p["b"].get("profit/profitTotal",{params:t})}var v=a("873a"),g=a("323a"),_={name:"Index",components:{LineChart:o["a"],Pagination:d["a"],SearchForm:h["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:"9999",name:"全部"}],search:[{field:"mobile",label:"手机号"},{field:"nickname",label:"昵称"},{type:"el-select",field:"area_id",label:"骑行区域",options:[{id:"",name:"全部"}]},{type:"el-select",field:"merchant_id",label:"商户",options:[{id:"",name:"全部"}]}],area_id:"9999",todayNewAdd:0,thisMonthTotal:0,profitTotal:0,tableData:[],profitData:[],page:null,first_blood:!0,activeName:"first",lineChartData:{expectedData:{data:[],date:[]}},merchant_data:{},merchant_id_show:!1,merchant_id:null}},mixins:[v["m"]],watch:{$route:{handler:function(){var t=Object(s["a"])(regeneratorRuntime.mark(function t(e){var a,n,i;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.autoPageSize(44,e);case 2:return t.next=4,Promise.all([f(e.query)]);case 4:a=t.sent,n=Object(r["a"])(a,1),i=n[0].data,this.profitData=i.data,this.page=i.meta;case 9:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),immediate:!0}},created:function(){var t=Object(s["a"])(regeneratorRuntime.mark(function t(){var e,a,n,i,s,o,l,c,d,h,p,f,v,_,w,y=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([Object(u["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),this.search[2].options.push.apply(this.search[2].options,n),t.next=9,Promise.all([b({area_id:"9999"})]);case 9:return i=t.sent,s=Object(r["a"])(i,1),o=s[0].data,this.profitTotal=o,t.next=15,Promise.all([m({area_id:"9999"})]);case 15:if(l=t.sent,c=Object(r["a"])(l,1),d=c[0].data,this.todayNewAdd=d.new_add_profit,this.thisMonthTotal=d.this_month_total_profit,this.tableData=d.profit_statistics,d.profit_statistics.map(function(t){y.lineChartData.expectedData.data.push(t.profit),y.lineChartData.expectedData.date.push(t.date)}),this.lineChartData.expectedData.data.reverse(),this.lineChartData.expectedData.date.reverse(),"administrator"!==this.$store.state.users.user.roles[0]){t.next=33;break}return this.merchant_id_show=!0,this.merchant_data={options:[{id:"",name:"全部"}]},t.next=29,Promise.all([Object(g["c"])({all:1})]);case 29:h=t.sent,p=Object(r["a"])(h,1),f=p[0].data,this.merchant_data.options.push.apply(this.merchant_data.options,f.data);case 33:if("administrator"!==this.$store.state.users.user.roles[0]){t.next=42;break}return t.next=36,Promise.all([Object(g["c"])({all:1})]);case 36:v=t.sent,_=Object(r["a"])(v,1),w=_[0].data,this.search[3].options.push.apply(this.search[3].options,w.data),t.next=43;break;case 42:this.search.splice(3,1);case 43: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,l,c=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([b(e)]);case 6:return a=t.sent,n=Object(r["a"])(a,1),i=n[0].data,this.profitTotal=i,t.next=12,Promise.all([m(e)]);case 12:s=t.sent,o=Object(r["a"])(s,1),l=o[0].data,this.todayNewAdd=l.new_add_profit,this.thisMonthTotal=l.this_month_total_profit,this.tableData=l.profit_statistics,l.profit_statistics.map(function(t){c.lineChartData.expectedData.data.push(t.profit),c.lineChartData.expectedData.date.push(t.date)}),this.lineChartData.expectedData.data.reverse(),this.lineChartData.expectedData.date.reverse();case 21:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),handleClick:function(t,e){this.$router.push({path:this.$route.path+"#"})},tableRowClassName:function(t){t.row;var e=t.rowIndex;return 1===e?"warning-row":3===e?"success-row":""},exportExcel:function(){var t=c.a.utils.table_to_book(document.getElementById("table"));try{c.a.writeFile(t,"profit.xlsx")}catch(e){console.log(e,t),this.$message.error("导出失败请联系管理员")}}}},w=_,y=(a("2627"),a("2877")),x=Object(y["a"])(w,n,i,!1,null,"6af85bee",null);e["default"]=x.exports},"81df":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.page?a("el-pagination",t._b({ref:"page",attrs:{"page-sizes":t.pageSizes,"current-page":t.currentPage,"page-size":t.perPage,total:t.page.total,layout:t.layout,background:""},on:{"size-change":t.onSizeChange,"current-change":t.onChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.perPage=e},"update:page-size":function(e){t.perPage=e}}},"el-pagination",t.$attrs,!1)):t._e()},i=[],r={name:"Pagination",data:function(){return{currentPage:1,perPage:10}},props:{page:Object,layout:{type:String,default:"total, prev, pager, next, sizes, jumper"},autoPush:{type:Boolean,default:!0}},computed:{pageSizes:function(){var t=[10,30,50,100,200],e=this.page.per_page;return-1===t.indexOf(e)?[this.page.per_page].concat(t):t}},methods:{push:function(){var t=Object.assign({},this.$route.query,{page:this.currentPage,per_page:this.perPage});this.$router.push({path:this.$route.path,query:t})},onSizeChange:function(t){this.$emit("size-change",t),this.autoPush&&(this.currentPage=1,this.push())},onChange:function(t){this.$emit("current-change",t),this.autoPush&&this.push()}},watch:{page:{handler:function(t){var e=this;t&&(this.currentPage=t.current_page,this.perPage=t.per_page,this.$nextTick(function(){e.$refs.page.internalCurrentPage=t.current_page}))},immediate:!0}}},s=r,o=a("2877"),l=Object(o["a"])(s,n,i,!1,null,"f691fd2e",null);e["a"]=l.exports},"83a1":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},cafd:function(t,e,a){"use strict";var n=a("0fb6"),i=a.n(n);i.a}}]);
- //# sourceMappingURL=chunk-cc3be6b8.6e043c7c.js.map
|