From 34aedd9998b5572488e49db884b2f7966d960a57 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期一, 18 十一月 2024 14:06:43 +0800 Subject: [PATCH] 订单统计页面 --- src/components/page/orderRecord/indexDay.vue | 48 +++++++++++++++++++++++++++++++++++++----------- 1 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/components/page/orderRecord/indexDay.vue b/src/components/page/orderRecord/indexDay.vue index 7509b7f..84402f9 100644 --- a/src/components/page/orderRecord/indexDay.vue +++ b/src/components/page/orderRecord/indexDay.vue @@ -1,6 +1,6 @@ <template> - <div> - <div style="padding: 10px 10px 0px 10px;"> + <div class="mod-config" style="padding: 10px 10px 0px 10px;"> + <div> <el-form :inline="true" :model="searchForm"> <el-form-item label="鍋滆溅鍦�"> <el-select v-model="searchForm.parkId" clearable> @@ -23,16 +23,27 @@ </el-form> </div> - <el-table :data="table2" border style="width:55%;border:1px solid #bcbec2;" show-summary> + <el-table + :height="tableHeight" + :data="table2" + border + style="width:100%;border:1px solid #bcbec2;" + show-summary> <el-table-column - prop="ti" + prop="day" align="center" label="鏃ユ湡" + fixed="left" width="120"> </el-table-column> - <el-table-column prop="parkName" label="鍋滆溅鍦�" align="center" > - <el-table-column prop="num" label="鏈夋晥璁㈠崟鏁�" align="center" ></el-table-column> - <el-table-column prop="price" label="璁㈠崟鎬婚噾棰�(鍏�)" align="center" ></el-table-column> + <el-table-column + v-for="(item,index) in headTable" + :key="index" + :label="item.parkName" + :prop="item.parkId + ''" + align="center"> + <el-table-column :prop="item.parkName + 'num'" label="鏈夋晥璁㈠崟鏁�" align="right" header-align="center"></el-table-column> + <el-table-column :prop="item.parkName + 'price'" label="璁㈠崟鎬婚噾棰�(鍏�)" align="right" header-align="center"></el-table-column> </el-table-column> </el-table> </div> @@ -59,9 +70,14 @@ urlPath:this.$systemconfig.basePath + '/ffzf/orderrecord/', table1:[], table2:[], + headTable:[], + tableHeight:500 } }, - mounted() { + created() { + this.tableHeight = window.innerHeight - 170 + }, + mounted() { this.defaultDate(); this.$byutil.postData(this, this.$systemconfig.basePath+'/ffzf/park/findAll', this.formData, res => { this.table1 = res.data; @@ -69,9 +85,19 @@ }, methods: { loadData() { - this.$byutil.postData(this, this.urlPath+'findCountPageByDay', this.searchForm,res => { - this.table2 = res.data; - }); + this.table2 = [] + this.$byutil.postData(this, this.urlPath+'findCountPageByDay', this.searchForm,res => { + this.headTable = res.data[0].data + let temp = res.data + temp.forEach(item => { + let row = {day:item.day}; + item.data.forEach(e=>{ + row[e.parkName + 'num']=e.num; + row[e.parkName + 'price']=e.price; + }) + this.table2.push(row) + }) + }); }, onSearch() { this.loadData(); -- Gitblit v1.9.1