lion 3 years ago
commit 3e40167831

@ -64,3 +64,12 @@ export function detailRpt(params) {
})
}
export function teamtotalRpt(params) {
return request({
url: '/api/admin/chart/team-total',
method: 'get',
params: params
})
}

@ -27,13 +27,13 @@
<Button ghost size="small" @click="edit(scope.row)" type="primary"
style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" type="error" @click="del(scope.row)" style="margin-left: 10px;">删除</Button>
<Button v-if="scope.row['status']==1" ghost size="small" type="info" @click="changeStatus(scope.row)"
style="margin-left: 10px;">下架</Button>
<Button v-if="scope.row['status']==1" ghost size="small" type="info"
@click="dialogConfirmVisible=true,currentId=scope.row.id" style="margin-left: 10px;">下架</Button>
<Button v-if="scope.row['status']==0" ghost size="small" type="warning" @click="changeStatus(scope.row)"
style="margin-left: 10px;">上架</Button>
</div>
<div v-else-if="column.type=='dateRange'">
<div v-else-if="column.type=='dateRange'">
<!-- {{dateRange}} -->
{{scope.row["start_time"]+"-"+changeEndTime(scope.row["end_time"])}}
</div>
@ -92,8 +92,8 @@
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="地址" prop="address">
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform" ></avue-input-map>
<el-form-item label="地址" prop="address">
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform"></avue-input-map>
</el-form-item>
</el-col>
@ -131,26 +131,35 @@
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预定截止" prop="end_plan">
<el-date-picker style="width:100%" v-model="form.end_plan" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择预定截止时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动时间" prop="dateRange">
<el-date-picker
style="width:100%"
v-model="dateRange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="活动开始日期"
end-placeholder="活动结束日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参加范围" prop="group">
<el-select v-model="form.join_type" placeholder="请选择参加范围" style="width:100%">
<el-option v-for="item in parameters.joinTypes" :key="item.value" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预定截止" prop="end_plan">
<el-date-picker style="width:100%" v-model="form.end_plan" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择预定截止时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="活动时间" prop="dateRange">
<el-date-picker style="width:100%" v-model="dateRange" type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="活动开始日期"
end-placeholder="活动结束日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item class='nextlabel' label="海报图(建议上传图片宽度750px)" prop="cover">
@ -206,11 +215,29 @@
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
<el-dialog :visible.sync="dialogConfirmVisible" title="下架确认" width="40%">
<el-form>
<el-form-item label="是否取消预约" prop="content">
<el-switch v-model="cancel_all" active-text="" inactive-text=""
active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogConfirmVisible=false"> </el-button>
<el-button type="primary" @click="toCancel()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import Tinymce from '@/components/Tinymce'
import Tinymce from '@/components/Tinymce'
import AvueMap from 'avue-plugin-map'
import {
getToken
@ -226,11 +253,14 @@
export default {
components: {
LxHeader,
Tinymce,
Tinymce,
AvueMap
},
data() {
return {
currentId: 0,
dialogConfirmVisible: false,
cancel_all: false,
dialogFormVisible: false,
formLabelWidth: "120px",
selectedValue: null,
@ -252,6 +282,16 @@
token: ""
},
parameters: {
joinTypes: [{
id: 0,
value: "不限制"
}, {
id: 1,
value: "仅团体参与"
}, {
id: 2,
value: "仅个人参与"
}],
activityArea: [{
id: 1,
value: "本馆"
@ -293,10 +333,10 @@
value: "不限"
}]
},
mapparams:{
zoom: 11,
},
mapform:[] ,
mapparams: {
zoom: 11,
},
mapform: [],
form: {
name: "",
area: "",
@ -314,9 +354,10 @@
price: "",
longitude: "",
latitude: "",
banners_list: []
},
dateRange:"",
banners_list: [],
join_type: 0,
},
dateRange: "",
showTime: "",
coverlist: [],
bannersList: [],
@ -412,11 +453,11 @@
},
watch: {
mapform(newVal, oldVal) {
this.form.longitude = newVal[0];
this.form.latitude = newVal[1];
this.form.address = newVal[2];
mapform(newVal, oldVal) {
this.form.longitude = newVal[0];
this.form.latitude = newVal[1];
this.form.address = newVal[2];
}
},
methods: {
@ -449,9 +490,9 @@
get(obj.id).then(res => {
that.coverlist = [];
let result = Object.assign(that.form, res);
that.form = result;
that.dateRange = [result.start_time, result.end_time];
that.mapform = [result.longitude,result.latitude,result.address]
that.form = result;
that.dateRange = [result.start_time, result.end_time];
that.mapform = [result.longitude, result.latitude, result.address]
console.log(that.dateRange);
// that.showTime = result.start_time.substring(11, result.start_time.length);
// that.form.end_time = result.end_time.substring(11, result.end_time.length);
@ -478,36 +519,36 @@
if (obj) {
var that = this;
that.info(obj);
} else {
this.dateRange=[];
this.mapform = ['','',''];
} else {
this.dateRange = [];
this.mapform = ['', '', ''];
}
this.dialogFormVisible = true;
},
compareDate (d1, d2) {
  let reg = new RegExp('-', 'g')
  return ((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/'))))
},
compareDate(d1, d2) {
let reg = new RegExp('-', 'g')
return ((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/'))))
},
submitForm(formName) {
var that = this;
that.form.start_time = this.dateRange[0];
that.form.end_time = this.dateRange[1];
if(!that.form.start_time||!that.form.end_time){
that.$message.error('请选择活动时间');
return false;
}
//
let checktime = that.compareDate(that.form.start_time,that.form.end_plan);
if(!checktime){
that.$message.error('截止时间不能晚于开始时间');
return false;
}
// console.log(a)
// that.form.end_time = that.form.start_time.substring(0, 10) + " " + that.form.end_time;
var that = this;
that.form.start_time = this.dateRange[0];
that.form.end_time = this.dateRange[1];
if (!that.form.start_time || !that.form.end_time) {
that.$message.error('请选择活动时间');
return false;
}
//
let checktime = that.compareDate(that.form.start_time, that.form.end_plan);
if (!checktime) {
that.$message.error('截止时间不能晚于开始时间');
return false;
}
// console.log(a)
// that.form.end_time = that.form.start_time.substring(0, 10) + " " + that.form.end_time;
let listUrl = [];
for (var m of that.bannersList) {
if (m.response)
@ -518,7 +559,7 @@
listUrl.push({
"upload_id": m.upload_id
});
}
}
that.form.banners_list = listUrl;
this.$refs[formName].validate((valid) => {
if (valid) {
@ -550,21 +591,13 @@
let status = obj.status == 0 ? 1 : 0;
let para = {
id: obj.id,
status: status
status: status,
cancel_all: 0
}
this.$Modal.confirm({
title: '确认要变更状态?',
onOk: () => {
chanStatus({
id: para.id,
status: para.status
}).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
that.toChangeStatus(para);
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
@ -572,6 +605,26 @@
});
}
},
toCancel() {
let para = {
id: this.currentId,
status: 0,
cancel_all: 0
}
this.toChangeStatus(para);
},
toChangeStatus(para) {
let that = this;
chanStatus({
id: para.id,
status: para.status,
cancel_all: para.cancel_all
}).then(response => {
that.dialogConfirmVisible=false;
this.$Message.success('操作成功');
that.load();
}).catch(error => {})
},
resetForm(formName) {
var that = this;
this.coverlist = [];
@ -650,12 +703,12 @@
this.load();
},
toactive(obj) {
if (obj.id) {
this.$router.push({
path: '/order/activeorder',
query: {
activity_id: obj.id
}
if (obj.id) {
this.$router.push({
path: '/order/activeorder',
query: {
activity_id: obj.id
}
})
}
},
@ -671,11 +724,11 @@
},
}
};
</script>
<style>
.nextlabel label{
display: block;
width: 100%!important;
text-align: left;
}
</script>
<style>
.nextlabel label {
display: block;
width: 100% !important;
text-align: left;
}
</style>

@ -5,11 +5,12 @@
<div class="boxtitle">
预约参观
</div>
<div class="boxcontentsubtitle">总预约人数/总入场人数</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总预约人数 / 总入场人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.visit_list.total.appointment.total" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.visit_list.total.appointment.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.visit_list.total.appointment.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.visit_list.total.appointment.person}}</div>
@ -17,7 +18,7 @@
<div class="boxline"></div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.visit_list.total.enter.total" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.visit_list.total.enter.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.visit_list.total.enter.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.visit_list.total.enter.person}}</div>
@ -27,11 +28,14 @@
核销比{{toCaculateper(totaldata.visit_list.total.enter.total,totaldata.visit_list.total.appointment.total)}}
</div>
<div class="boxcontentsubtitle">今日预约人数/今日入场人数</div>
<div class="boxcline"></div>
<div class="boxcontentsubtitle">今日预约人数 / 今日入场人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.visit_list.today.appointment.total" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.visit_list.today.appointment.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.visit_list.today.appointment.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.visit_list.today.appointment.person}}</div>
@ -39,7 +43,7 @@
<div class="boxline"></div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.visit_list.today.enter.total" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.visit_list.today.enter.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.visit_list.today.enter.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.visit_list.today.enter.person}}</div>
@ -55,12 +59,13 @@
<div class="boxtitle">
活动参加
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总报名人数/总核销人数</div>
<div class="boxcontentsubtitle">总报名人数 / 总核销人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.activity_list.total.appointment.total" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.activity_list.total.appointment.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.activity_list.total.appointment.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.activity_list.total.appointment.person}}</div>
@ -68,7 +73,7 @@
<div class="boxline"></div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.activity_list.total.enter.total" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.activity_list.total.enter.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.activity_list.total.enter.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.activity_list.total.enter.person}}</div>
@ -78,24 +83,25 @@
核销比{{toCaculateper(totaldata.activity_list.total.enter.total,totaldata.activity_list.total.appointment.total)}}
</div>
<div class="boxcontentsubtitle">今日报名人数/今日核销人数</div>
<div class="boxcline"></div>
<div class="boxcontentsubtitle">今日报名人数 / 今日核销人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.activity_list.today.appointment.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.activity_list.today.appointment.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.activity_list.today.appointment.person}}</div>
</div>
<div class="boxline"></div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.activity_list.today.enter.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.activity_list.today.enter.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.activity_list.today.enter.person}}</div>
</div>
</div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to separator="" :start-val="0" :end-val="totaldata.activity_list.today.appointment.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.activity_list.today.appointment.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.activity_list.today.appointment.person}}</div>
</div>
<div class="boxline"></div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to separator="" :start-val="0" :end-val="totaldata.activity_list.today.enter.total" :duration="3600" />
</div>
<div class="boxcontentitem-small">团队{{totaldata.activity_list.today.enter.team}}</div>
<div class="boxcontentitem-small">个人{{totaldata.activity_list.today.enter.person}}</div>
</div>
</div>
<div class="boxfooter"></div>
<img src="../../../assets/imgs/index_icon_2.png" class="index_icon" />
<img src="../../../assets/imgs/index_icon_bg_1-21.png" class="index_bg" />
@ -104,40 +110,48 @@
<div class="boxtitle">
停车预约
</div>
<div class="boxcontentsubtitle">总预约数/总核销数</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总预约数 / 总核销数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.park_list.total.appointment" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.park_list.total.appointment" :duration="3600" />
</div>
<div class="boxcontentitem-small"> </div>
<div class="boxcontentitem-small"> </div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
</div>
<div class="boxline"></div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.park_list.total.enter" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.park_list.total.enter" :duration="3600" />
</div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
</div>
</div>
<div class="boxfooter">核销比{{toCaculateper(totaldata.park_list.total.enter,totaldata.park_list.total.appointment)}}</div>
<div class="boxcontentsubtitle">今日预约数/今日核销数</div>
<div class="boxfooter">
核销比{{toCaculateper(totaldata.park_list.total.enter,totaldata.park_list.total.appointment)}}</div>
<div class="boxcline"></div>
<div class="boxcontentsubtitle">今日预约数 / 今日核销数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.park_list.today.appointment" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.park_list.today.appointment" :duration="3600" />
</div>
<div class="boxcontentitem-small"> </div>
<div class="boxcontentitem-small"> </div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
</div>
<div class="boxline"></div>
<div class="boxcontentitem">
<div class="boxcontentitem-big">
<count-to :start-val="0" :end-val="totaldata.park_list.today.enter" :duration="3600" />
<count-to separator="" :start-val="0" :end-val="totaldata.park_list.today.enter" :duration="3600" />
</div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
<div class="boxcontentitem-small"><span style="visibility: hidden;">0</span></div>
</div>
</div>
<div class="boxfooter">核销比{{toCaculateper(totaldata.park_list.today.enter,totaldata.park_list.today.appointment)}}</div>
<div class="boxfooter">
核销比{{toCaculateper(totaldata.park_list.today.enter,totaldata.park_list.today.appointment)}}</div>
<img src="../../../assets/imgs/index_icon_4.png" class="index_icon" />
<img src="../../../assets/imgs/index_icon_bg_4.png" class="index_bg" />
</div>
@ -227,9 +241,9 @@
methods: {
handleRoute(type) {
this.$emit('handleRoute', type)
},
toCaculateper(f1,f2){
return ((f1 / (f2 == 0 ? 1 : f2)) * 100).toFixed(2) + "%"
},
toCaculateper(f1, f2) {
return ((f1 / (f2 == 0 ? 1 : f2)) * 100).toFixed(2) + "%"
}
}
}
@ -254,6 +268,8 @@
width: 100%;
}
.box {
position: relative;
width: 33%;
@ -263,8 +279,8 @@
box-shadow: 0px 8px 15px 0px rgba(212, 84, 32, 0.3100);
border-radius: 8px;
box-sizing: border-box;
padding: 1.25rem;
opacity: 0.8;
padding: 1.25rem 0;
.boxcontentsubtitle {
color: #FFFFFF;
@ -289,6 +305,7 @@
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
padding: 0 1.25rem;
}
.boxcontent {
@ -299,12 +316,14 @@
.boxline {
width: 1px;
height: 4.0625rem;
background: #FFFFFF;
background: #FFFFFF00;
opacity: 0.3;
margin-left: 2.0625rem;
margin-right: 2.0625rem;
}
.boxcontentitem {
display: flex;
flex-direction: column;
@ -329,20 +348,59 @@
.box1 {
background: linear-gradient(134deg, #D1AC7B, #DFC69C);
.boxcline {
width: 100%;
background: #DFC69C;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.bline {
background: linear-gradient(to right, rgba(255,255,255,0.3), rgba(255,255,255,0) 60%);
height: 0.25rem;
width: 100%;
margin-top: 1.25rem;
}
.box2 {
background: linear-gradient(134deg, #9193BC, #B7B9D4);
.boxcline {
width: 100%;
background: #B7B9D4;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.box3 {
background: linear-gradient(-55deg, #F6A868, #F4C59E);
.boxcline {
width: 100%;
background: #F4C59E;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.box4 {
background: linear-gradient(-55deg, #64A48E, #9ECABB);
.boxcline {
width: 100%;
background: #9ECABB;
height: 0.125rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
}
.panel-group {

@ -33,7 +33,7 @@
</el-table-column>
<el-table-column prop="cancel_total" label="取消人数" sortable>
</el-table-column>
<el-table-column prop="expire_total" label="超时人数" sortable>
<el-table-column prop="expire_total" label="过期人数" sortable>
</el-table-column>
<el-table-column prop="per" label="核销比" sortable>
</el-table-column>

@ -33,7 +33,7 @@
</el-table-column>
<el-table-column prop="cancel_total" label="取消车辆数" sortable>
</el-table-column>
<el-table-column prop="expire_total" label="超时车辆数" sortable>
<el-table-column prop="expire_total" label="过期车辆数" sortable>
</el-table-column>
</el-table>
</div>

@ -0,0 +1,147 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="团队统计报表" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<el-date-picker
v-model="searchFields.year"
type="year"
value-format="yyyy"
placeholder="选择年份">
</el-date-picker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="viewPart" style="margin-left: 10px">{{btnText}}</Button>
<Button type="primary" style="margin-left: 10px" @click="handleGo"></Button>
</div>
</slot>
</LxHeader>
</div>
<div class="table-tree" v-if="showData">
<el-table :data="tableData" :height="tableHeight" class="v-table" style="width: 100%">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="month" label="月份" sortable width="180">
</el-table-column>
<el-table-column prop="total" label="团队预约数" sortable>
</el-table-column>
<el-table-column prop="use_total" label="团队核销数" sortable>
</el-table-column>
</el-table>
</div>
<div v-else>
<line-chart :chartData="rptData" :height="chartHeight"/>
</div>
</div>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import LineChart from '../components/LineChart'
import { ElMapExportTable } from "table-excel";
// import {export_json_to_excel} from '@/Excel/Export2Excel';
import {
teamtotalRpt
} from "@/api/report/visit.js";
export default {
components: {
LxHeader,
LineChart
},
created() {
this.initLoad()
this.load()
},
mounted() {},
data() {
return {
showData: false,
searchFields: {
year:""
},
tableData: [],
tableHeight: 0,
chartHeight:"",
btnText:"数据展示",
rptData: {
xArr:[],
series:{},
legendArr:["预约人数","入场人数"]
}
}
},
methods: {
/** 导出按钮操作 */
handleGo(){
var data = this.tableData; //
const column = [
{ title: "月份", dataIndex: "month" }, // dataIndex
{ title: "团队预约数", dataIndex: "total" },
{ title: "团队核销数", dataIndex: "use_total" },
];
const instance = new ElMapExportTable(
{ column, data },
{ progress: progress => console.log(progress) }//
);
instance.download("团队年度统计报表"); //
},
viewPart() {
this.showData = !this.showData;
this.btnText = this.showData ? "图表展示" : "数据展示"
},
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
that.chartHeight = tableHeight+"px"
},
load() {
// this.showData = true;
var xarr = [];
var planarr=[];
var usearr=[];
teamtotalRpt({
year:this.searchFields.year
}).then((res) => {
for (var m of res) {
m.month = m.month;
xarr.push(m.month);
planarr.push(
m.total
)
usearr.push(
m.use_total
)
}
this.rptData.xArr = xarr;
this.rptData.series=[
{
name:"团队预约数",
type: 'bar',
data:planarr
},
{
name:"团队核销数",
type: 'bar',
data:usearr
}
]
this.tableData = res;
}).catch((res) => {})
}
}
};
</script>

@ -23,21 +23,21 @@
<div v-if="column.type=='opt'">
<Button ghost size="small" @click="edit(scope.row)" type="primary"
style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" type="error" @click="del(scope.row)" style="margin-left: 10px;">删除</Button>
</div>
<div v-else-if="column.type=='type'" v-for="item in parameters.visitType">
<div v-if="item.id==scope.row[column.field]">
{{item.value}}
</div>
<Button ghost size="small" type="error" @click="del(scope.row)" style="margin-left: 10px;">删除</Button>
</div>
<div v-else-if="column.type=='type'" v-for="item in parameters.visitType">
<div v-if="item.id==scope.row[column.field]">
{{item.value}}
</div>
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div>
</div>
</div>
@ -52,34 +52,26 @@
<el-option v-for="item in parameters.visitType" :key="item.value" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-row>
<el-col :span="10">
<el-form-item label="开始时间" prop="start_date">
<template slot-scope="scope">
<el-date-picker
style="width:100%"
v-model="form.start_date"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</template>
</el-form-item>
</el-col>
<el-col :span="10" :offset="4">
<el-form-item label="结束时间" prop="end_date">
<template slot-scope="scope">
<el-date-picker
style="width:100%"
v-model="form.end_date"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</template>
</el-form-item>
</el-col>
</el-form-item>
<el-row>
<el-col :span="10">
<el-form-item label="开始时间" prop="start_date">
<template slot-scope="scope">
<el-date-picker style="width:100%" v-model="form.start_date" type="date" value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</template>
</el-form-item>
</el-col>
<el-col :span="10" :offset="4">
<el-form-item label="结束时间" prop="end_date">
<template slot-scope="scope">
<el-date-picker style="width:100%" v-model="form.end_date" type="date" value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</template>
</el-form-item>
</el-col>
</el-row>
<div v-if="isRules" style="padding: 20px 0px;" class="form-sub-title">
<span>预约时间
@ -87,76 +79,67 @@
</div>
<div v-if="isRules" class="table-tree tableswidth">
<div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;">
<el-select v-model="form.selectId" placeholder="请选择" style="width:100%">
<el-option v-for="item in listVisitArr" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<Button type="primary" @click="copyRow()" size="small" style="margin-left: 10px;" ghost>导入</Button>
<Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增</Button>
</div>
<el-table :data="form.rules_list" height="400" class="v-table" style="width: 100%;margin-bottom: 20px;">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="start_time" label="开始时间">
<template slot-scope="scope">
<el-time-select
style="width:100%"
v-model="scope.row.start_time"
:picker-options="{
start: '00:00',
step: '00:15',
end: '24:00'
}"
placeholder="选择开始时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="show_start_time" label="实际开始时间">
<template slot-scope="scope">
<el-time-select
style="width:100%"
v-model="scope.row.show_start_time"
:picker-options="{
start: '00:00',
step: '00:15',
end: '24:00'
}"
placeholder="选择开始时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="end_time" label="结束时间">
<template slot-scope="scope">
<el-time-select
style="width:100%"
v-model="scope.row.end_time"
:picker-options="{
start: '00:00',
step: '00:15',
end: '24:00',
minTime: scope.row.start_time
}"
placeholder="选择结束时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="show_end_time" label="实际结束时间">
<template slot-scope="scope">
<el-time-select
style="width:100%"
v-model="scope.row.show_end_time"
:picker-options="{
start: '00:00',
step: '00:15',
end: '24:00',
minTime: scope.row.start_time
}"
placeholder="选择结束时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="total" label="可预约人数">
<template slot-scope="scope">
<el-input v-model="scope.row.total" placeholder="请填写可预约人数" autocomplete="off"></el-input>
</template>
<el-table-column prop="start_time" label="开始时间">
<template slot-scope="scope">
<el-time-select style="width:100%" v-model="scope.row.start_time" :picker-options="{
start: '00:00',
step: '00:15',
end: '24:00'
}" placeholder="选择开始时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="show_start_time" label="实际开始时间">
<template slot-scope="scope">
<el-time-select style="width:100%" v-model="scope.row.show_start_time" :picker-options="{
start: '00:00',
step: '00:15',
end: '24:00'
}" placeholder="选择开始时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="end_time" label="结束时间">
<template slot-scope="scope">
<el-time-select style="width:100%" v-model="scope.row.end_time" :picker-options="{
start: '00:00',
step: '00:15',
end: '24:00',
minTime: scope.row.start_time
}" placeholder="选择结束时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="show_end_time" label="实际结束时间">
<template slot-scope="scope">
<el-time-select style="width:100%" v-model="scope.row.show_end_time" :picker-options="{
start: '00:00',
step: '00:15',
end: '24:00',
minTime: scope.row.start_time
}" placeholder="选择结束时间">
</el-time-select>
</template>
</el-table-column>
<el-table-column prop="total" label="可预约人数">
<template slot-scope="scope">
<el-input v-model="scope.row.total" placeholder="请填写可预约人数" autocomplete="off"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="120px" align="center">
<template slot-scope="scope">
<template slot-scope="scope">
<el-input style="display: none;" type="hidden" v-model="scope.row.id"></el-input>
<Button type="error" @click="delRow(scope.$index,scope.row.id)" size="small" style="margin-left: 10px;"
ghost>删除</Button>
@ -175,16 +158,23 @@
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
listvisitspecial,
store,
save,
del,
get,
listvisitspecial,
store,
save,
del,
get,
delrule
} from "../../api/resource/visitspecial.js";
import {
getparameteritem
} from "../../api/resource/visitspecial.js";
import {
listvisit,
get as getresource
} from "../../api/resource/visitresource.js";
import {
getparameteritem
} from "../../api/system/dictionary.js"
import {
Message
} from "element-ui";
export default {
components: {
LxHeader
@ -192,56 +182,60 @@
data() {
return {
dialogFormVisible: false,
formLabelWidth: "120px",
tableHeight: 0,
isRules:false,
//
searchFields: {
name: ""
},
tableData: [],
paginations: {
page: 1,
page_size: 15,
total: 0
formLabelWidth: "120px",
tableHeight: 0,
isRules: false,
//
searchFields: {
name: ""
},
listVisitArr: [],
tableData: [],
paginations: {
page: 1,
page_size: 15,
total: 0
},
parameters: {
visitType:[{
id:1,
value:"闭馆"
},{
id:2,
value:"修改预约时间"
visitType: [{
id: 1,
value: "闭馆"
}, {
id: 2,
value: "修改预约时间"
}, {
id: 3,
value: "开馆"
}]
},
},
form: {
name: "",
type:1,
start_date:"",
end_date:"",
rules_list:[{
id:"",
start_time:"",
end_time:"",
show_start_time:"",
show_end_time:"",
total:""
selectId: "",
name: "",
type: 1,
start_date: "",
end_date: "",
rules_list: [{
id: "",
start_time: "",
end_time: "",
show_start_time: "",
show_end_time: "",
total: ""
}]
},
},
columns: [
{
field: "name",
title: "名称",
type: "string",
},
{
field: "type",
title: "类型",
type: "type",
width:300,
align:"center"
columns: [{
field: "name",
title: "名称",
type: "string",
},
{
field: "type",
title: "类型",
type: "type",
width: 300,
align: "center"
},
{
field: "操作",
@ -264,6 +258,7 @@
created() {
this.initLoad();
this.load();
this.listvisit();
},
mounted() {},
methods: {
@ -278,28 +273,56 @@
},
load() {
var that = this;
listvisitspecial({
page: this.paginations.page,
page_size: this.paginations.page_size,
name:this.searchFields.name
}).then(res => {
this.tableData = res.data;
this.paginations.total = res.total
}).catch(error => {
listvisitspecial({
page: this.paginations.page,
page_size: this.paginations.page_size,
name: this.searchFields.name
}).then(res => {
this.tableData = res.data;
this.paginations.total = res.total
}).catch(error => {
})
},
listvisit() {
var that = this;
listvisit({
page_size: 999
}).then(res => {
this.listVisitArr = res.data;
}).catch(error => {
})
},
getresource(id) {
var that = this;
getresource(id).then(res => {
//let result = Object.assign(that.form, res);
//that.form = result;
that.form.rules_list = res.rules;
}).catch(error => {
//reject(error)
})
},
copyRow() {
if (this.form.selectId == "") {
Message.error("请选择需要导入的模版");
return false;
}
this.getresource(this.form.selectId);
},
info(obj) {
var that = this;
get(obj.id).then(res => {
let result = Object.assign(that.form, res);
that.form = result;
if(result.type==2){
this.isRules = true;
}
that.form.rules_list = result.rules;
}).catch(error => {
//reject(error)
var that = this;
get(obj.id).then(res => {
let result = Object.assign(that.form, res);
that.form = result;
if (result.type == 2||result.type == 3) {
this.isRules = true;
}
that.form.rules_list = result.rules;
}).catch(error => {
//reject(error)
})
},
@ -315,16 +338,16 @@
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
if(!this.isRules){
that.form.rules_list = [{
id:"",
start_time:"",
end_time:"",
show_start_time:"",
show_end_time:"",
total:""
}]
if (valid) {
if (!this.isRules) {
that.form.rules_list = [{
id: "",
start_time: "",
end_time: "",
show_start_time: "",
show_end_time: "",
total: ""
}]
}
if (that.form.id) {
save(that.form).then(response => {
@ -349,7 +372,7 @@
});
},
resetForm(formName) {
var that = this;
var that = this;
this.isRules = false;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
@ -373,39 +396,39 @@
}
});
}
},
showYy(val){
console.log(val)
this.isRules = !this.isRules
},
showYy(val) {
console.log(val)
this.isRules = (val != 1);
},
addRow() {
var len = this.form.rules_list.length;
this.form.rules_list.push({
id:"",
start_time:"",
end_time:"",
show_start_time:"",
show_end_time:"",
total:""
this.form.rules_list.push({
id: "",
start_time: "",
end_time: "",
show_start_time: "",
show_end_time: "",
total: ""
});
},
delRow(index,id) {
var that = this
if(id){
delrule(id).then(response => {
that.$Message.success('删除成功');
that.form.rules_list.splice(index, 1);
}).catch(error => {
console.log(error)
reject(error)
})
}else{
this.form.rules_list.splice(index, 1);
delRow(index, id) {
var that = this
if (id) {
delrule(id).then(response => {
that.$Message.success('删除成功');
that.form.rules_list.splice(index, 1);
}).catch(error => {
console.log(error)
reject(error)
})
} else {
this.form.rules_list.splice(index, 1);
}
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
}
}
};

Loading…
Cancel
Save