|
|
|
|
@ -7,11 +7,7 @@
|
|
|
|
|
<div slot="content"></div>
|
|
|
|
|
<slot>
|
|
|
|
|
<div>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="searchFields.date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期">
|
|
|
|
|
<el-date-picker v-model="searchFields.date" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
|
|
|
|
|
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
|
|
|
|
@ -50,7 +46,9 @@
|
|
|
|
|
<script>
|
|
|
|
|
import LxHeader from "@/components/LxHeader/index.vue";
|
|
|
|
|
import LineChart from '../components/LineChart'
|
|
|
|
|
import { ElMapExportTable } from "table-excel";
|
|
|
|
|
import {
|
|
|
|
|
ElMapExportTable
|
|
|
|
|
} from "table-excel";
|
|
|
|
|
import {
|
|
|
|
|
detailRpt
|
|
|
|
|
} from "@/api/report/visit.js";
|
|
|
|
|
@ -85,17 +83,37 @@
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleGo() {
|
|
|
|
|
var data = this.tableData; // 这里面是数据列表
|
|
|
|
|
const column = [
|
|
|
|
|
{ title: "时段", dataIndex: "daterange" }, // dataIndex为数据列表中的数据字段
|
|
|
|
|
{ title: "预约人数", dataIndex: "plan_total" },
|
|
|
|
|
{ title: "入场人数", dataIndex: "use_total" },
|
|
|
|
|
{ title: "性别男", dataIndex: "man_total" },
|
|
|
|
|
{ title: "性别女", dataIndex: "woman_total" },
|
|
|
|
|
{ title: "核销比", dataIndex: "per" },
|
|
|
|
|
const column = [{
|
|
|
|
|
title: "时段",
|
|
|
|
|
dataIndex: "daterange"
|
|
|
|
|
}, // dataIndex为数据列表中的数据字段
|
|
|
|
|
{
|
|
|
|
|
title: "预约人数",
|
|
|
|
|
dataIndex: "plan_total"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "入场人数",
|
|
|
|
|
dataIndex: "use_total"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "性别男",
|
|
|
|
|
dataIndex: "man_total"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "性别女",
|
|
|
|
|
dataIndex: "woman_total"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "核销比",
|
|
|
|
|
dataIndex: "per"
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
const instance = new ElMapExportTable(
|
|
|
|
|
{ column, data },
|
|
|
|
|
{ progress: progress => console.log(progress) }// 进度条回调
|
|
|
|
|
const instance = new ElMapExportTable({
|
|
|
|
|
column,
|
|
|
|
|
data
|
|
|
|
|
}, {
|
|
|
|
|
progress: progress => console.log(progress)
|
|
|
|
|
} // 进度条回调
|
|
|
|
|
);
|
|
|
|
|
instance.download("时段统计报表"); // 导出的文件名
|
|
|
|
|
},
|
|
|
|
|
@ -126,9 +144,15 @@
|
|
|
|
|
detailRpt({
|
|
|
|
|
date: this.searchFields.date
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
for (var m of res) {
|
|
|
|
|
console.log(res)
|
|
|
|
|
var _res = [];
|
|
|
|
|
Object.keys(res).map((key, item) => {
|
|
|
|
|
_res.push(res[key])
|
|
|
|
|
});
|
|
|
|
|
for (var m of _res) {
|
|
|
|
|
console.log(m)
|
|
|
|
|
m.per = ((m.use_total / (m.plan_total == 0 ? 1 : m.plan_total)) * 100).toFixed(2) + "%"
|
|
|
|
|
m.daterange = m.start_time+"-"+m.end_time;
|
|
|
|
|
m.daterange = m.time;
|
|
|
|
|
xArr.push(m.daterange);
|
|
|
|
|
planarr.push(
|
|
|
|
|
m.plan_total
|
|
|
|
|
@ -145,8 +169,7 @@
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.periodData.xArr = xArr;
|
|
|
|
|
this.periodData.series=[
|
|
|
|
|
{
|
|
|
|
|
this.periodData.series = [{
|
|
|
|
|
name: "预约人数",
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: planarr
|
|
|
|
|
@ -168,9 +191,11 @@
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
this.tableData = res
|
|
|
|
|
this.tableData = _res
|
|
|
|
|
|
|
|
|
|
}).catch((res) => {})
|
|
|
|
|
}).catch((res) => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getToday() {
|
|
|
|
|
let date = new Date()
|
|
|
|
|
|