1 |
- {"version":3,"sources":["webpack:///./resources/src/components/ECharts/LineChart.vue?2a1b","webpack:///./resources/src/components/ECharts/mixins/debounce.js","webpack:///./resources/src/components/ECharts/mixins/resize.js","webpack:///resources/src/components/ECharts/LineChart.vue","webpack:///./resources/src/components/ECharts/LineChart.vue?aa72","webpack:///./resources/src/components/ECharts/LineChart.vue","webpack:///./resources/src/views/recharge-order/Statistics.vue?9604","webpack:///./resources/src/views/recharge-order/Statistics.vue?b0bd","webpack:///resources/src/views/recharge-order/Statistics.vue","webpack:///./resources/src/views/recharge-order/Statistics.vue?b0c0","webpack:///./resources/src/views/recharge-order/Statistics.vue","webpack:///./resources/src/api/recharge-order.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","class","className","style","height","width","staticRenderFns","debounce","func","wait","immediate","timeout","args","context","timestamp","result","later","last","Date","setTimeout","apply","callNow","data","$_sidebarElm","mounted","$_initResizeEvent","$_initSidebarResizeEvent","beforeDestroy","$_destroyResizeEvent","$_destroySidebarResizeEvent","activated","deactivated","methods","$_resizeHandler","chart","resize","window","addEventListener","removeEventListener","$_sidebarResizeHandler","e","propertyName","document","getElementsByClassName","mixins","props","type","String","default","autoResize","Boolean","chartData","Object","required","watch","deep","handler","setOptions","val","$nextTick","dispose","getDay","today","targetday_milliseconds","getTime","day","setTime","tYear","getFullYear","tMonth","getMonth","tDate","getDate","doHandleMonth","m","month","toString","length","initChart","setOption","xAxis","expectedData","date","boundaryGap","axisTick","show","axisLabel","rotate","grid","left","right","bottom","top","containLabel","tooltip","trigger","axisPointer","padding","yAxis","legend","series","name","itemStyle","normal","color","lineStyle","smooth","animationDuration","animationEasing","component","scopedSlots","_u","key","fn","proxy","staticClass","attrs","pickerOptions","model","value","callback","$$v","dateBetween","expression","area_id","_l","item","id","merchant_id","merchant_data","_e","on","SearchData","_v","_s","todayNewAdd","thisMonthTotal","profitTotal","staticStyle","lineChartData","exportExcel","tableData","tableRowClassName","scope","row","components","LineChart","shortcuts","text","onClick","start","picker","$emit","end","put_areas","budata","push","rowIndex","console","log","workbook","$message","error","getRechargeOrder","params","axios","get","statisticsRecharge","totalRecharge","rechargeChart","post"],"mappings":"yIAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,MAAMN,EAAIO,UAAUC,MAAM,CAAEC,OAAOT,EAAIS,OAAOC,MAAMV,EAAIU,UAC9JC,EAAkB,G,iCCMf,SAASC,EAASC,EAAMC,EAAMC,GACnC,IAAIC,EAASC,EAAMC,EAASC,EAAWC,EAEjCC,EAAQ,SAARA,IAEJ,IAAMC,GAAQ,IAAIC,KAASJ,EAGvBG,EAAOR,GAAQQ,EAAO,EACxBN,EAAUQ,WAAWH,EAAOP,EAAOQ,IAEnCN,EAAU,KAELD,IACHK,EAASP,EAAKY,MAAMP,EAASD,GACxBD,IAASE,EAAUD,EAAO,SAKrC,OAAO,WAAmB,2BAANA,EAAM,yBAANA,EAAM,gBACxBC,EAAUjB,KACVkB,GAAa,IAAII,KACjB,IAAMG,EAAUX,IAAcC,EAQ9B,OANKA,IAASA,EAAUQ,WAAWH,EAAOP,IACtCY,IACFN,EAASP,EAAKY,MAAMP,EAASD,GAC7BC,EAAUD,EAAO,MAGZG,GCpCI,OACbO,KADa,WAEX,MAAO,CACLC,aAAc,OAGlBC,QANa,WAOX5B,KAAK6B,oBACL7B,KAAK8B,4BAEPC,cAVa,WAWX/B,KAAKgC,uBACLhC,KAAKiC,+BAIPC,UAhBa,WAiBXlC,KAAK6B,oBACL7B,KAAK8B,4BAEPK,YApBa,WAqBXnC,KAAKgC,uBACLhC,KAAKiC,+BAEPG,QAAS,CAGPC,gBAHO,WAGW,WAChB,OAAO1B,GAAS,WACV,EAAK2B,OACP,EAAKA,MAAMC,WAEZ,IAJI5B,IAMTkB,kBAVO,WAWLW,OAAOC,iBAAiB,SAAUzC,KAAKqC,kBAEzCL,qBAbO,W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PJ,6LAQA,wCACA,wCAEA,sDACA,0BACA,oFAbA,SAgBA,aACA,mBAjBA,6CAgBA,EAhBA,KAgBA,KAGA,mBAnBA,UAqBA,aACA,oBAtBA,8CAqBA,EArBA,KAqBA,KArBA,UAwBA,aACA,oBAzBA,uCAwBA,EAxBA,KAwBA,KAGA,iCACA,wCACA,iBAEA,mBACA,gDACA,kDAjCA,yGAwCI6D,kBAxCJ,YAwCA,uBACM,OAAiB,IAAbe,EACK,cACf,MACe,cAEF,IAETjB,YAhDJ,WAiDM,IAAN,4DACM,IACE,EAAR,+BACA,SACQkB,QAAQC,IAAIvH,EAAGwH,GACfpK,KAAKqK,SAASC,MAAM,kBC/RsV,I,wBCQ9WrD,EAAY,eACd,EACAnH,EACAY,GACA,EACA,KACA,WACA,MAIa,aAAAuG,E,2CCnBf,wJAEO,SAASsD,IAA8B,IAAbC,EAAa,uDAAJ,GACxC,OAAOC,OAAMC,IAAI,iBAAkB,CAAEF,WAGhC,SAASG,IAAgC,IAAbH,EAAa,uDAAJ,GAC1C,OAAOC,OAAMC,IAAI,oCAAqC,CAAEF,WAGnD,SAASI,IAA2B,IAAbJ,EAAa,uDAAJ,GACrC,OAAOC,OAAMC,IAAI,+BAAgC,CAAEF,WAG9C,SAASK,IAA2B,IAAbL,EAAa,uDAAJ,GACrC,OAAOC,OAAMK,KAAK,+BAAgCN","file":"js/chunk-9bd932d0.df1d67b2.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:_vm.className,style:({height:_vm.height,width:_vm.width})})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n/**\r\n * @param {Function} func\r\n * @param {number} wait\r\n * @param {boolean} immediate\r\n * @return {*}\r\n */\r\nexport function debounce(func, wait, immediate) {\r\n let timeout, args, context, timestamp, result\r\n\r\n const later = function () {\r\n // 据上一次触发时间间隔\r\n const last = +new Date() - timestamp\r\n\r\n // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait\r\n if (last < wait && last > 0) {\r\n timeout = setTimeout(later, wait - last)\r\n } else {\r\n timeout = null\r\n // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用\r\n if (!immediate) {\r\n result = func.apply(context, args)\r\n if (!timeout) context = args = null\r\n }\r\n }\r\n }\r\n\r\n return function (...args) {\r\n context = this\r\n timestamp = +new Date()\r\n const callNow = immediate && !timeout\r\n // 如果延时不存在,重新设定延时\r\n if (!timeout) timeout = setTimeout(later, wait)\r\n if (callNow) {\r\n result = func.apply(context, args)\r\n context = args = null\r\n }\r\n\r\n return result\r\n }\r\n}\r\n","import { debounce } from './debounce.js'\r\n\r\nexport default {\r\n data() {\r\n return {\r\n $_sidebarElm: null,\r\n }\r\n },\r\n mounted() {\r\n this.$_initResizeEvent()\r\n this.$_initSidebarResizeEvent()\r\n },\r\n beforeDestroy() {\r\n this.$_destroyResizeEvent()\r\n this.$_destroySidebarResizeEvent()\r\n },\r\n // to fixed bug when cached by keep-alive\r\n // https://github.com/PanJiaChen/vue-element-admin/issues/2116\r\n activated() {\r\n this.$_initResizeEvent()\r\n this.$_initSidebarResizeEvent()\r\n },\r\n deactivated() {\r\n this.$_destroyResizeEvent()\r\n this.$_destroySidebarResizeEvent()\r\n },\r\n methods: {\r\n // use $_ for mixins properties\r\n // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential\r\n $_resizeHandler() {\r\n return debounce(() => {\r\n if (this.chart) {\r\n this.chart.resize()\r\n }\r\n }, 100)()\r\n },\r\n $_initResizeEvent() {\r\n window.addEventListener('resize', this.$_resizeHandler)\r\n },\r\n $_destroyResizeEvent() {\r\n window.removeEventListener('resize', this.$_resizeHandler)\r\n },\r\n $_sidebarResizeHandler(e) {\r\n if (e.propertyName === 'width') {\r\n this.$_resizeHandler()\r\n }\r\n },\r\n $_initSidebarResizeEvent() {\r\n this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]\r\n this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)\r\n },\r\n $_destroySidebarResizeEvent() {\r\n this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)\r\n },\r\n },\r\n}\r\n","<template>\r\n <div :class=\"className\" :style=\"{height:height,width:width}\"/>\r\n</template>\r\n\r\n<script>\r\nimport echarts from 'echarts' // echarts theme\r\nimport resize from './mixins/resize'\r\nrequire('echarts/theme/macarons')\r\n\r\nexport default {\r\n mixins: [resize],\r\n props: {\r\n className: {\r\n type: String,\r\n default: 'chart',\r\n },\r\n width: {\r\n type: String,\r\n default: '100%',\r\n },\r\n height: {\r\n type: String,\r\n default: '350px',\r\n },\r\n autoResize: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n chartData: {\r\n type: Object,\r\n required: true,\r\n },\r\n },\r\n data() {\r\n return {\r\n chart: null,\r\n }\r\n },\r\n watch: {\r\n chartData: {\r\n deep: true,\r\n handler(val) {\r\n this.setOptions(val)\r\n },\r\n },\r\n },\r\n mounted() {\r\n this.$nextTick(() => {\r\n this.initChart()\r\n })\r\n },\r\n beforeDestroy() {\r\n if (!this.chart) {\r\n return\r\n }\r\n this.chart.dispose()\r\n this.chart = null\r\n },\r\n methods: {\r\n getDay(day) {\r\n var today = new Date()\r\n\r\n var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day\r\n\r\n today.setTime(targetday_milliseconds) // 注意,这行是关键代码\r\n\r\n var tYear = today.getFullYear()\r\n var tMonth = today.getMonth()\r\n var tDate = today.getDate()\r\n tMonth = this.doHandleMonth(tMonth + 1)\r\n tDate = this.doHandleMonth(tDate)\r\n return tYear + '-' + tMonth + '-' + tDate\r\n },\r\n doHandleMonth(month) {\r\n var m = month\r\n if (month.toString().length == 1) {\r\n m = '0' + month\r\n }\r\n return m\r\n },\r\n initChart() {\r\n this.chart = echarts.init(this.$el, 'macarons')\r\n this.setOptions(this.chartData)\r\n },\r\n setOptions({ expectedData } = {}) {\r\n // console.log(expectedData)\r\n this.chart.setOption({\r\n xAxis: {\r\n // data: [this.getDay(-15), this.getDay(-14), this.getDay(-13), this.getDay(-12), this.getDay(-11), this.getDay(-10), this.getDay(-9), this.getDay(-8), this.getDay(-7), this.getDay(-6), this.getDay(-5), this.getDay(-4), this.getDay(-3), this.getDay(-2), this.getDay(-1)],\r\n data: expectedData.date,\r\n boundaryGap: false,\r\n axisTick: {\r\n show: false,\r\n },\r\n axisLabel: {\r\n rotate: 60,\r\n },\r\n },\r\n grid: {\r\n left: 10,\r\n right: 10,\r\n bottom: 20,\r\n top: 30,\r\n containLabel: true,\r\n },\r\n tooltip: {\r\n trigger: 'axis',\r\n axisPointer: {\r\n type: 'cross',\r\n },\r\n padding: [5, 10],\r\n },\r\n yAxis: {\r\n axisTick: {\r\n show: false,\r\n },\r\n },\r\n legend: {\r\n data: ['expected'],\r\n },\r\n series: [{\r\n name: '每日新增',\r\n itemStyle: {\r\n normal: {\r\n color: '#FF005A',\r\n lineStyle: {\r\n color: '#FF005A',\r\n width: 2,\r\n },\r\n },\r\n },\r\n smooth: true,\r\n type: 'line',\r\n data: expectedData.data,\r\n animationDuration: 2800,\r\n animationEasing: 'cubicInOut',\r\n }],\r\n })\r\n },\r\n },\r\n}\r\n</script>\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LineChart.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LineChart.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./LineChart.vue?vue&type=template&id=c53dbfc8&\"\nimport script from \"./LineChart.vue?vue&type=script&lang=js&\"\nexport * from \"./LineChart.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Statistics.vue?vue&type=style&index=0&id=bc7e9348&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Statistics.vue?vue&type=style&index=0&id=bc7e9348&lang=scss&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-card',{scopedSlots:_vm._u([{key:\"header\",fn:function(){return [_c('content-header')]},proxy:true}])},[_c('div',{staticClass:\"block\"},[_c('div',{staticClass:\"filters\"},[_c('el-date-picker',{attrs:{\"type\":\"daterange\",\"align\":\"right\",\"unlink-panels\":\"\",\"range-separator\":\"至\",\"start-placeholder\":\"开始日期\",\"end-placeholder\":\"结束日期\",\"value-format\":\"yyyy-MM-dd\",\"picker-options\":_vm.pickerOptions},model:{value:(_vm.dateBetween),callback:function ($$v) {_vm.dateBetween=$$v},expression:\"dateBetween\"}}),_c('el-select',{staticClass:\"selectwidth\",attrs:{\"size\":\"small\",\"placeholder\":\"请选择区域\"},model:{value:(_vm.area_id),callback:function ($$v) {_vm.area_id=$$v},expression:\"area_id\"}},_vm._l((_vm.put_areas),function(item){return _c('el-option',{key:item.id,attrs:{\"label\":item.name,\"value\":item.id}})}),1),(_vm.merchant_id_show)?_c('div',[_c('el-select',{staticClass:\"selectwidth\",attrs:{\"size\":\"small\",\"placeholder\":\"商户\"},model:{value:(_vm.merchant_id),callback:function ($$v) {_vm.merchant_id=$$v},expression:\"merchant_id\"}},_vm._l((_vm.merchant_data.options),function(item){return _c('el-option',{key:item.id,attrs:{\"label\":item.name,\"value\":item.id}})}),1)],1):_vm._e(),_c('el-button',{on:{\"click\":_vm.SearchData}},[_vm._v(\"查询\")])],1)]),_c('p',[_vm._v(\"充值概况\")]),_c('div',{staticClass:\"gaikuang\"},[_c('el-card',{staticClass:\"min-card\"},[_c('p',[_vm._v(\"今日新增充值(元)\")]),_c('p',{staticClass:\"bolod-p\"},[_vm._v(\" \"+_vm._s(_vm.todayNewAdd)+\" \")])]),_c('el-card',{staticClass:\"min-card\"},[_c('p',[_vm._v(\"本月累计充值(元)\")]),_c('p',{staticClass:\"bolod-p\"},[_vm._v(\" \"+_vm._s(_vm.thisMonthTotal)+\" \")])]),_c('el-card',{staticClass:\"min-card\"},[_c('p',[_vm._v(\"总充值(元)\")]),_c('p',{staticClass:\"bolod-p\"},[_vm._v(\" \"+_vm._s(_vm.profitTotal)+\" \")])])],1),_c('p',[_vm._v(\"充值增长趋势\")]),_c('el-row',{staticStyle:{\"background\":\"#fff\",\"padding\":\"16px 16px 0\",\"margin-bottom\":\"32px\"}},[_c('line-chart',{attrs:{\"chart-data\":_vm.lineChartData}})],1),_c('el-row',[_c('p',[_vm._v(\"每日充值增长明细 \"),_c('el-button',{staticClass:\"excel-import\",on:{\"click\":_vm.exportExcel}},[_vm._v(\"导出excel\")])],1),_c('div',{staticClass:\"excel-import\"}),_c('el-table',{staticStyle:{\"width\":\"100%\"},attrs:{\"data\":_vm.tableData,\"id\":\"table\",\"row-class-name\":_vm.tableRowClassName}},[_c('el-table-column',{attrs:{\"label\":\"日期\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(\"\\n \"+_vm._s(scope.row.date)+\"\\n \")]}}])}),_c('el-table-column',{attrs:{\"label\":\"新增充值(元)\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(\"\\n \"+_vm._s(scope.row.value)+\"\\n \")]}}])})],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <el-card>\r\n <template #header>\r\n <content-header/>\r\n </template>\r\n <div class=\"block\">\r\n <div class=\"filters\">\r\n <el-date-picker\r\n v-model=\"dateBetween\"\r\n type=\"daterange\"\r\n align=\"right\"\r\n unlink-panels\r\n range-separator=\"至\"\r\n start-placeholder=\"开始日期\"\r\n end-placeholder=\"结束日期\"\r\n value-format=\"yyyy-MM-dd\"\r\n :picker-options=\"pickerOptions\"\r\n />\r\n\r\n <el-select\r\n v-model=\"area_id\"\r\n size=\"small\"\r\n placeholder=\"请选择区域\"\r\n class=\"selectwidth\"\r\n >\r\n <el-option\r\n v-for=\"item in put_areas\"\r\n :key=\"item.id\"\r\n :label=\"item.name\"\r\n :value=\"item.id\"\r\n />\r\n </el-select>\r\n <div v-if=\"merchant_id_show\">\r\n <el-select\r\n v-model=\"merchant_id\"\r\n size=\"small\"\r\n placeholder=\"商户\"\r\n class=\"selectwidth\"\r\n >\r\n <el-option\r\n v-for=\"item in merchant_data.options\"\r\n :key=\"item.id\"\r\n :label=\"item.name\"\r\n :value=\"item.id\"\r\n />\r\n </el-select>\r\n </div>\r\n\r\n <el-button @click=\"SearchData\">查询</el-button>\r\n </div>\r\n </div>\r\n <!-- <div class=\"filters\" display:flex>\r\n <span>选择区域:</span>\r\n <el-select\r\n v-model=\"area_id\"\r\n @change=\"AreaChange\"\r\n size=\"small\"\r\n placeholder=\"请选择\"\r\n class=\"selectwidth\"\r\n >\r\n <el-option\r\n v-for=\"item in put_areas\"\r\n :key=\"item.id\"\r\n :label=\"item.name\"\r\n :value=\"item.id\"\r\n />\r\n </el-select>\r\n </div> -->\r\n <p>充值概况</p>\r\n <div class=\"gaikuang\">\r\n <el-card class=\"min-card\">\r\n <p>今日新增充值(元)</p>\r\n <p class=\"bolod-p\"> {{ todayNewAdd }} </p>\r\n </el-card>\r\n <el-card class=\"min-card\">\r\n <p>本月累计充值(元)</p>\r\n <p class=\"bolod-p\"> {{ thisMonthTotal }} </p>\r\n </el-card>\r\n <el-card class=\"min-card\">\r\n <p>总充值(元)</p>\r\n <p class=\"bolod-p\"> {{ profitTotal }} </p>\r\n </el-card>\r\n </div>\r\n <p>充值增长趋势</p>\r\n <el-row style=\"background:#fff;padding:16px 16px 0;margin-bottom:32px;\">\r\n <line-chart :chart-data=\"lineChartData\"/>\r\n </el-row>\r\n <el-row>\r\n <p>每日充值增长明细 <el-button class=\"excel-import\" @click=\"exportExcel\">导出excel</el-button></p>\r\n\r\n <div class=\"excel-import\"/>\r\n\r\n <el-table\r\n :data=\"tableData\"\r\n style=\"width: 100%\"\r\n id=\"table\"\r\n :row-class-name=\"tableRowClassName\"\r\n >\r\n <el-table-column\r\n label=\"日期\"\r\n >\r\n <template slot-scope=\"scope\">\r\n {{ scope.row.date }}\r\n </template>\r\n </el-table-column>\r\n <el-table-column\r\n label=\"新增充值(元)\"\r\n >\r\n <template slot-scope=\"scope\">\r\n {{ scope.row.value }}\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n </el-row>\r\n </el-card>\r\n</template>\r\n\r\n<script>\r\nimport LineChart from '@c/ECharts/LineChart'\r\nimport XLSX from 'xlsx'\r\n// import { getDepositOrders } from '@/api/deposit'\r\nimport { getAreas } from '@/api/area'\r\n\r\nimport { statisticsRecharge, totalRecharge, rechargeChart } from '@/api/recharge-order'\r\nimport { getAdminUsersMerchant } from '@/api/admin-merchant'\r\n\r\nexport default {\r\n name: 'Index',\r\n components: {\r\n LineChart,\r\n },\r\n data() {\r\n return {\r\n\r\n pickerOptions: {\r\n shortcuts: [{\r\n text: '最近一周',\r\n onClick(picker) {\r\n const end = new Date()\r\n const start = new Date()\r\n start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)\r\n picker.$emit('pick', [start, end])\r\n },\r\n }, {\r\n text: '最近一个月',\r\n onClick(picker) {\r\n const end = new Date()\r\n const start = new Date()\r\n start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)\r\n picker.$emit('pick', [start, end])\r\n },\r\n }, {\r\n text: '最近三个月',\r\n onClick(picker) {\r\n const end = new Date()\r\n const start = new Date()\r\n start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)\r\n picker.$emit('pick', [start, end])\r\n },\r\n }],\r\n },\r\n dateBetween: '',\r\n put_areas: [\r\n {\r\n id: null,\r\n name: '全部',\r\n },\r\n ],\r\n area_id: null,\r\n\r\n todayNewAdd: 0,\r\n thisMonthTotal: 0,\r\n profitTotal: 0,\r\n tableData: [],\r\n lineChartData: {\r\n expectedData: {\r\n data: [],\r\n date: [],\r\n },\r\n },\r\n merchant_data:{},\r\n merchant_id_show:false,\r\n merchant_id: null,\r\n }\r\n },\r\n\r\n async created() {\r\n const [{ data: areas }] = await Promise.all([\r\n getAreas({ all: 1 }),\r\n ])\r\n\r\n this.put_areas.push.apply(this.put_areas, areas)\r\n\r\n const [{ data: profitTotal }] = await Promise.all([\r\n totalRecharge(),\r\n ])\r\n this.profitTotal = profitTotal\r\n\r\n const [{ data }] = await Promise.all([\r\n rechargeChart(),\r\n ])\r\n const [{ data: statistics }] = await Promise.all([\r\n statisticsRecharge(),\r\n ])\r\n this.todayNewAdd = statistics.todayRecharge\r\n this.thisMonthTotal = statistics.thisMonthRecharge\r\n this.tableData = data\r\n // 遍历给折线统计图赋值\r\n data.map(i => {\r\n this.lineChartData.expectedData.data.push(i.value)\r\n this.lineChartData.expectedData.date.push(i.date)\r\n })\r\n\r\n if(this.$store.state.users.user.roles[0]==='administrator'){\r\n this.merchant_id_show = true\r\n this.merchant_data = {\r\n options: [\r\n {\r\n id: '',\r\n name: '全部',\r\n },\r\n ],\r\n }\r\n const [{ data: merchant }] = await Promise.all([\r\n getAdminUsersMerchant({ all: 1 }),\r\n ])\r\n this.merchant_data.options.push.apply(this.merchant_data.options, merchant.data)\r\n }\r\n\r\n // 反转数据\r\n // this.lineChartData.expectedData.data.reverse()\r\n // this.lineChartData.expectedData.date.reverse()\r\n },\r\n methods: {\r\n budata(expectedData) {\r\n if (expectedData.length < 15) {\r\n expectedData.push(0)\r\n this.budata(expectedData)\r\n }\r\n },\r\n async SearchData() {\r\n this.lineChartData.expectedData.data = []\r\n this.lineChartData.expectedData.date = []\r\n // console.log(this.dateBetween)\r\n var params = { area_id: this.area_id,merchant_id:this.merchant_id }\r\n if (this.dateBetween !== null) {\r\n params = { area_id: this.area_id, dateBetween: this.dateBetween,merchant_id:this.merchant_id }\r\n }\r\n\r\n const [{ data: profitTotal }] = await Promise.all([\r\n totalRecharge(),\r\n ])\r\n this.profitTotal = profitTotal\r\n\r\n const [{ data }] = await Promise.all([\r\n rechargeChart(params),\r\n ])\r\n const [{ data: statistics }] = await Promise.all([\r\n statisticsRecharge(params),\r\n ])\r\n this.todayNewAdd = statistics.todayRecharge\r\n this.thisMonthTotal = statistics.thisMonthRecharge\r\n this.tableData = data\r\n // 遍历给折线统计图赋值\r\n data.map(i => {\r\n this.lineChartData.expectedData.data.push(i.value)\r\n this.lineChartData.expectedData.date.push(i.date)\r\n })\r\n\r\n // this.lineChartData.expectedData.data.reverse()\r\n // this.lineChartData.expectedData.date.reverse()\r\n },\r\n\r\n tableRowClassName({ row, rowIndex }) {\r\n if (rowIndex === 1) {\r\n return 'warning-row'\r\n } else if (rowIndex === 3) {\r\n return 'success-row'\r\n }\r\n return ''\r\n },\r\n exportExcel() {\r\n let workbook = XLSX.utils.table_to_book(document.getElementById('table'))\r\n try {\r\n XLSX.writeFile(workbook, 'recharge.xlsx')\r\n } catch (e) {\r\n console.log(e, workbook)\r\n this.$message.error('导出失败请联系管理员')\r\n }\r\n },\r\n },\r\n\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.gaikuang{\r\n display: flex;\r\n .min-card{\r\n width: 350px;\r\n padding: 10px 20px;\r\n margin: 5px 25px;\r\n background: rgba(3, 134, 128, 0.1);\r\n // align-items: center;\r\n text-align: center;\r\n font-size: 20px;\r\n p{\r\n margin: 10px;\r\n }\r\n .bolod-p{\r\n font-size:2rem;\r\n }\r\n }\r\n}\r\n\r\n .el-table .warning-row {\r\n background: oldlace;\r\n }\r\n\r\n .el-table .success-row {\r\n background: #f0f9eb;\r\n }\r\n\r\n .el-table .warning-row {\r\n background: oldlace;\r\n }\r\n\r\n .el-table .success-row {\r\n background: #f0f9eb;\r\n }\r\n.table-font {\r\n font-size: 12px;\r\n}\r\n.filters {\r\n margin-right: 15px;\r\n text-align: right;\r\n margin: 10px;\r\n .selectwidth {\r\n padding-left: 30px;\r\n width: 200px;\r\n margin-right: 15px;\r\n }\r\n}\r\n.block{\r\n margin: 10px 0px;\r\n display: flex;\r\n justify-content:space-between ;\r\n\r\n}\r\n.excel-import{\r\n float:right;\r\n margin-bottom: 10px;\r\n}\r\n</style>\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Statistics.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Statistics.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Statistics.vue?vue&type=template&id=bc7e9348&scoped=true&\"\nimport script from \"./Statistics.vue?vue&type=script&lang=js&\"\nexport * from \"./Statistics.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Statistics.vue?vue&type=style&index=0&id=bc7e9348&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"bc7e9348\",\n null\n \n)\n\nexport default component.exports","import axios from '@/plugins/axios'\r\n\r\nexport function getRechargeOrder(params = {}) {\r\n return axios.get('recharge_order', { params })\r\n}\r\n\r\nexport function statisticsRecharge(params = {}) {\r\n return axios.get('recharge_order/statisticsRecharge', { params })\r\n}\r\n\r\nexport function totalRecharge(params = {}) {\r\n return axios.get('recharge_order/totalRecharge', { params })\r\n}\r\n\r\nexport function rechargeChart(params = {}) {\r\n return axios.post('recharge_order/rechargeChart', params)\r\n}\r\n"],"sourceRoot":""}
|