刘翔宇-旅管家 3 years ago
parent 9800ae7fef
commit 2fb0b76aaa

@ -25,7 +25,7 @@
<svg-icon icon-class="password" />
</span>
<el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType"
placeholder="请输入密码" auto-complete="off" name="password" tabindex="2" auto-complete="off" @keyup.enter.native="handleLogin" />
placeholder="请输入密码" name="password" tabindex="2" auto-complete="off" @keyup.enter.native="handleLogin" />
</el-form-item>

@ -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()

Loading…
Cancel
Save