|
|
|
|
@ -7,11 +7,12 @@
|
|
|
|
|
</lx-header>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-bottom:20px">
|
|
|
|
|
<el-date-picker v-model="dateRange" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
|
|
|
|
|
<el-date-picker v-model="dateRange" type="daterange" value-format="yyyy-MM-dd" range-separator="至"
|
|
|
|
|
start-placeholder="开始日期" end-placeholder="结束日期" @change="dateChange">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<xy-table :isPage='false' :list="list" :table-item="table">
|
|
|
|
|
<xy-table :isPage='false' :sumText="'合计'" :showSummary='true' :summaryMethod='summaryMethod' :list="list"
|
|
|
|
|
:table-item="table">
|
|
|
|
|
<template slot="btns">
|
|
|
|
|
<div></div>
|
|
|
|
|
</template>
|
|
|
|
|
@ -33,11 +34,11 @@
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
select: {
|
|
|
|
|
start_date:'2000-01-01',
|
|
|
|
|
end_date:""
|
|
|
|
|
},
|
|
|
|
|
today:'',
|
|
|
|
|
dateRange:[],
|
|
|
|
|
start_date: '2000-01-01',
|
|
|
|
|
end_date: ""
|
|
|
|
|
},
|
|
|
|
|
today: '',
|
|
|
|
|
dateRange: [],
|
|
|
|
|
list: [],
|
|
|
|
|
table: [{
|
|
|
|
|
prop: 'name',
|
|
|
|
|
@ -53,11 +54,11 @@
|
|
|
|
|
prop: 'total_order_all',
|
|
|
|
|
label: '下单总订单数(不含取消)',
|
|
|
|
|
width: 180
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'total_order_cancel_all',
|
|
|
|
|
label: '下单取消数',
|
|
|
|
|
width: 180
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'total_order_cancel_all',
|
|
|
|
|
label: '下单取消数',
|
|
|
|
|
width: 180
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'total_order',
|
|
|
|
|
@ -80,38 +81,68 @@
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
dateChange(e){
|
|
|
|
|
if(e){
|
|
|
|
|
this.select.start_date = e[0]
|
|
|
|
|
this.select.end_date = e[1]
|
|
|
|
|
}else{
|
|
|
|
|
this.select.start_date = '2000-01-01'
|
|
|
|
|
this.select.end_date = this.today
|
|
|
|
|
}
|
|
|
|
|
this.getTotal()
|
|
|
|
|
},
|
|
|
|
|
async initTotal(){
|
|
|
|
|
const res = await reporttotal({
|
|
|
|
|
start_date:'2000-01-01',
|
|
|
|
|
end_date:this.select.end_date
|
|
|
|
|
})
|
|
|
|
|
// this.total = res.total
|
|
|
|
|
this.list = res
|
|
|
|
|
methods: {
|
|
|
|
|
summaryMethod(param) {
|
|
|
|
|
console.log("para", param)
|
|
|
|
|
const {
|
|
|
|
|
columns,
|
|
|
|
|
data
|
|
|
|
|
} = param;
|
|
|
|
|
const sums = [];
|
|
|
|
|
columns.forEach((column, index) => {
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
sums[index] = '合计';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const values = data.map(item => Number(item[column.property]));
|
|
|
|
|
if (!values.every(value => isNaN(value))) {
|
|
|
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
|
|
|
const value = Number(curr);
|
|
|
|
|
if (!isNaN(value)) {
|
|
|
|
|
return prev + curr;
|
|
|
|
|
} else {
|
|
|
|
|
return prev;
|
|
|
|
|
}
|
|
|
|
|
}, 0);
|
|
|
|
|
sums[index] += '';
|
|
|
|
|
} else {
|
|
|
|
|
sums[index] = '';
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return sums;
|
|
|
|
|
},
|
|
|
|
|
dateChange(e) {
|
|
|
|
|
if (e) {
|
|
|
|
|
this.select.start_date = e[0]
|
|
|
|
|
this.select.end_date = e[1]
|
|
|
|
|
} else {
|
|
|
|
|
this.select.start_date = '2000-01-01'
|
|
|
|
|
this.select.end_date = this.today
|
|
|
|
|
}
|
|
|
|
|
this.getTotal()
|
|
|
|
|
},
|
|
|
|
|
async initTotal() {
|
|
|
|
|
const res = await reporttotal({
|
|
|
|
|
start_date: '2000-01-01',
|
|
|
|
|
end_date: this.select.end_date
|
|
|
|
|
})
|
|
|
|
|
// this.total = res.total
|
|
|
|
|
this.list = res
|
|
|
|
|
},
|
|
|
|
|
async getTotal() {
|
|
|
|
|
const res = await reporttotal({
|
|
|
|
|
start_date:this.select.start_date,
|
|
|
|
|
end_date:this.select.end_date
|
|
|
|
|
start_date: this.select.start_date,
|
|
|
|
|
end_date: this.select.end_date
|
|
|
|
|
})
|
|
|
|
|
this.list = res
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
let date = new Date()
|
|
|
|
|
let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1):date.getMonth()+1
|
|
|
|
|
let dateDay = date.getDate() < 10 ? '0'+(date.getDate()):date.getDate()
|
|
|
|
|
this.today = date.getFullYear()+'-'+month+'-'+dateDay
|
|
|
|
|
mounted() {
|
|
|
|
|
let date = new Date()
|
|
|
|
|
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
|
|
|
|
let dateDay = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()
|
|
|
|
|
this.today = date.getFullYear() + '-' + month + '-' + dateDay
|
|
|
|
|
this.select.end_date = this.today
|
|
|
|
|
this.initTotal()
|
|
|
|
|
}
|
|
|
|
|
|