刘翔宇-旅管家 3 years ago
parent 2e7f9a6c7c
commit b340c37e7e

@ -1,6 +1,11 @@
<template> <template>
<div> <div>
<div class="block" style="padding-top: 10px;display: flex;
justify-content: flex-end;">
<el-date-picker v-model="month" type="month" placeholder="选择月" @change="loadData()">
</el-date-picker>
</div>
<div class="statistics"> <div class="statistics">
<panel-group :totaldata="list" /> <panel-group :totaldata="list" />
</div> </div>
@ -39,18 +44,21 @@
customerArr: [], customerArr: [],
orderArr: [], orderArr: [],
chartData: {}, chartData: {},
month: ''
} }
}, },
watch: { watch: {
chartData(val, newval) { chartData(val, newval) {
if (newval){ if (newval) {
this.init(); this.init();
} }
} }
}, },
methods: { methods: {
async loadData() { async loadData() {
await getChartsHome().then((res) => { await getChartsHome({
month: this.month
}).then((res) => {
console.log(res); console.log(res);
this.list = res.list; this.list = res.list;
this.chartData = res; this.chartData = res;
@ -179,6 +187,7 @@
} }
}, },
created() { created() {
this.month=this.$moment().format("YYYY-MM")
this.loadData(); this.loadData();
}, },

Loading…
Cancel
Save