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

@ -25,7 +25,7 @@
<svg-icon icon-class="password" /> <svg-icon icon-class="password" />
</span> </span>
<el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" <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> </el-form-item>

@ -7,11 +7,7 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<el-date-picker <el-date-picker v-model="searchFields.date" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
v-model="searchFields.date"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期">
</el-date-picker> </el-date-picker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button> <Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
@ -50,7 +46,9 @@
<script> <script>
import LxHeader from "@/components/LxHeader/index.vue"; import LxHeader from "@/components/LxHeader/index.vue";
import LineChart from '../components/LineChart' import LineChart from '../components/LineChart'
import { ElMapExportTable } from "table-excel"; import {
ElMapExportTable
} from "table-excel";
import { import {
detailRpt detailRpt
} from "@/api/report/visit.js"; } from "@/api/report/visit.js";
@ -85,17 +83,37 @@
/** 导出按钮操作 */ /** 导出按钮操作 */
handleGo() { handleGo() {
var data = this.tableData; // var data = this.tableData; //
const column = [ const column = [{
{ title: "时段", dataIndex: "daterange" }, // dataIndex title: "时段",
{ title: "预约人数", dataIndex: "plan_total" }, dataIndex: "daterange"
{ title: "入场人数", dataIndex: "use_total" }, }, // dataIndex
{ title: "性别男", dataIndex: "man_total" }, {
{ title: "性别女", dataIndex: "woman_total" }, title: "预约人数",
{ title: "核销比", dataIndex: "per" }, dataIndex: "plan_total"
},
{
title: "入场人数",
dataIndex: "use_total"
},
{
title: "性别男",
dataIndex: "man_total"
},
{
title: "性别女",
dataIndex: "woman_total"
},
{
title: "核销比",
dataIndex: "per"
},
]; ];
const instance = new ElMapExportTable( const instance = new ElMapExportTable({
{ column, data }, column,
{ progress: progress => console.log(progress) }// data
}, {
progress: progress => console.log(progress)
} //
); );
instance.download("时段统计报表"); // instance.download("时段统计报表"); //
}, },
@ -126,9 +144,15 @@
detailRpt({ detailRpt({
date: this.searchFields.date date: this.searchFields.date
}).then((res) => { }).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.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); xArr.push(m.daterange);
planarr.push( planarr.push(
m.plan_total m.plan_total
@ -145,8 +169,7 @@
} }
this.periodData.xArr = xArr; this.periodData.xArr = xArr;
this.periodData.series=[ this.periodData.series = [{
{
name: "预约人数", name: "预约人数",
type: 'bar', type: 'bar',
data: planarr data: planarr
@ -168,9 +191,11 @@
}, },
] ]
this.tableData = res this.tableData = _res
}).catch((res) => {}) }).catch((res) => {
console.log(res)
})
}, },
getToday() { getToday() {
let date = new Date() let date = new Date()

Loading…
Cancel
Save