Commit f2f0a2ae by duanguohui

订单统计

parent 8ae8ba28
......@@ -120,6 +120,8 @@ export default {
if (this.$route.params.id) {
delete param.createDate
param.status ? param.status = 'Y' : param.status = 'N'
param.starDate = moment(param.starDate).format('YYYY-MM-DD HH:MM:SS')
param.endDate = moment(param.endDate).format('YYYY-MM-DD HH:MM:SS')
this.$axios.post('/pccook/update/cook', param).then(()=>{
this.$message.success('修改成功')
this.goBack()
......
......@@ -142,19 +142,19 @@
<el-row>
<div class="order-list">
<el-card class="box-card no-margin-card margin-bottom20">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form :inline="true" :model="statisParams" class="demo-form-inline">
<el-col :sm="12" style="margin-bottom: 10px;">
<el-form-item label="下单时间">
<el-col :sm="11">
<el-form-item prop="date1">
<el-date-picker v-model="formInline.startTime" type="datetime" placeholder="开始时间">
<el-date-picker v-model="statisParams.startTime" type="datetime" placeholder="开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col class="line" :sm="2" style="text-align: center">-</el-col>
<el-col :sm="11">
<el-form-item prop="date2">
<el-date-picker v-model="formInline.endTime" type="datetime" placeholder="结束时间">
<el-date-picker v-model="statisParams.endTime" type="datetime" placeholder="结束时间">
</el-date-picker>
</el-form-item>
</el-col>
......@@ -162,7 +162,7 @@
</el-col>
<el-col :sm="8" :offset="1">
<el-form-item label="类型" style="margin-left: 30px">
<el-select v-model="formInline.type">
<el-select v-model="statisParams.type">
<!-- <el-option label="全部" value=""></el-option> -->
<el-option label="外卖" value="WM"></el-option>
<el-option label="家政" value="JZ"></el-option>
......@@ -180,7 +180,7 @@
<el-card class="box-card no-margin-card">
<div class="order_table">
<el-table
:data="orderListData"
:data="statisData"
stripe
:key="Math.random()"
class="my-table margin-bottom20"
......@@ -195,7 +195,7 @@
>
</el-table-column>
<el-table-column
prop="titleName"
prop="name"
label="名称"
align="center"
>
......@@ -220,6 +220,7 @@
</template>
<script>
import moment from 'moment'
export default {
name: 'orderList',
data () {
......@@ -233,9 +234,17 @@ export default {
},
allPage: 1,
currentPage: 10,
allPage1: 1,
currentPage1: 100,
countPage: '',
page: '',
orderListData: [],
statisParams: {
startTime: moment().format('YYYY-MM-DD'),
endTime: moment().format('YYYY-MM-DD'),
type: 'WM'
},
statisData: [], // 统计数据
dialogVisible: false
}
},
......@@ -307,7 +316,7 @@ export default {
this.$router.push({ name: 'orderDetail', params: { id: row.id, type: row.type} })
},
searchList () {
this.getOrderList()
this.getStatisData()
},
goPage (num) {
this.allPage = Number(this.allPage) + num
......@@ -317,10 +326,29 @@ export default {
this.getOrderList()
},
statistical () {
this.formInline.type = 'WM'
this.dialogVisible = true
this.getOrderList()
this.getStatisData()
},
getStatisData () { // 获取统计信息
var params = {
'endDate': moment(this.statisParams.endTime).format('YYYY-MM-DD'),
'starDate': moment(this.statisParams.startTime).format('YYYY-MM-DD'),
'type': this.statisParams.type,
}
this.$axios({
method: 'post',
url: '/pc/trade/get/group',
data: params
}).then((res) => {
res.data.data.forEach((item)=>{
item.num = parseInt(item.num)
if (item.name == 'BJ') item.name = '保洁'
if (item.name == 'CSSM') item.name = '厨师上门'
if (item.name == 'WX') item.name = '维修'
})
this.statisData = res.data.data
})
}
},
computed: {
renderStatus (status, type) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment