Commit 28cbb247 by haowenbo

第六届长跑节,可配置活动时间,导出可搜索时间

parent 6f8241c3
...@@ -130,7 +130,12 @@ export default { ...@@ -130,7 +130,12 @@ export default {
this.totalPage = res.count this.totalPage = res.count
let list = res.list let list = res.list
list.map(item => { list.map(item => {
item.activityTitle = '第五届华夏幸福长跑节线上赛' // item.activityTitle = '第五届华夏幸福长跑节线上赛'
if (item.exerciseActivityId == 1) {
item.activityTitle = "第五届华夏幸福长跑节线上赛";
} else if (item.exerciseActivityId == 2) {
item.activityTitle = "第六届华夏幸福长跑节线上赛";
}
}) })
this.photoList = list this.photoList = list
} }
...@@ -170,7 +175,12 @@ export default { ...@@ -170,7 +175,12 @@ export default {
this.totalPage = res.count this.totalPage = res.count
let list = res.list let list = res.list
list.map(item => { list.map(item => {
item.activityTitle = '第五届华夏幸福长跑节线上赛' // item.activityTitle = '第五届华夏幸福长跑节线上赛'
if (item.exerciseActivityId == 1) {
item.activityTitle = "第五届华夏幸福长跑节线上赛";
} else if (item.exerciseActivityId == 2) {
item.activityTitle = "第六届华夏幸福长跑节线上赛";
}
}) })
this.photoList = list this.photoList = list
} }
......
<template> <template>
<div> <div>
<div class="btn-warp tr mb20"> <div class="btn-warp tr mb20">
<el-col :sm="4" class="pl12">
<el-col :sm="3" class="pl12"> <el-date-picker
<el-date-picker type="datetime"
type="datetime" :clearable="false"
:clearable="false" placeholder="选择日期"
placeholder="选择日期" v-model="startTime"
v-model="startTime" :picker-options="pickerOptionsStart"
:picker-options="pickerOptionsStart" value-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%; margin-bottom: 6px; margin-top: 5px"
style="width: 100%; margin-bottom: 6px; margin-top: 5px"> >
</el-date-picker> </el-date-picker>
</el-col> </el-col>
<el-col class="line tc" :sm="1" style="margin-bottom: 6px; margin-top: 5px"></el-col> <el-col
<el-col :sm="3"> class="line tc"
<el-date-picker :sm="1"
type="datetime" style="margin-bottom: 6px; margin-top: 10px"
:clearable="false" ></el-col
placeholder="选择日期" >
v-model="endTime" <el-col :sm="4">
:picker-options="pickerOptionsEnd" <el-date-picker
value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
style="width: 100%;margin-bottom: 6px; margin-top: 5px"> :clearable="false"
</el-date-picker> placeholder="选择日期"
</el-col> v-model="endTime"
:picker-options="pickerOptionsEnd"
<el-button type="primary" size="small" @click="searchList">搜索</el-button> value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%; margin-bottom: 6px; margin-top: 5px"
>
</el-date-picker>
</el-col>
<el-button type="primary" size="small" @click="searchList"
>搜索</el-button
>
<el-button type="primary" class="el-button-link"> <el-button type="primary" class="el-button-link">
<a :href="exportUrl">导出</a> <a :href="exportUrl">导出</a>
</el-button> </el-button>
<el-button type="primary" class="el-button-link"><router-link to="/fitness/activityShenhe" style="color: #fff">活动审核</router-link></el-button> <el-button type="primary" class="el-button-link"
><router-link to="/fitness/activityShenhe" style="color: #fff"
>活动审核</router-link
></el-button
>
</div> </div>
<el-table <el-table
:data="photoList" :data="photoList"
border border
header-cell-class-name="table-header-row"> header-cell-class-name="table-header-row"
<el-table-column >
prop="activityTitle" <el-table-column prop="activityTitle" label="活动标题"> </el-table-column>
label="活动标题"> <el-table-column prop="activityTime" width="270" label="活动时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="personIdMdm" width="180" label="账号">
prop="activityTime"
width="270"
label="活动时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="personName" width="150" label="姓名">
prop="personIdMdm"
width="180"
label="账号">
</el-table-column>
<el-table-column
prop="personName"
width="150"
label="姓名">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="createTime" prop="createTime"
align="center" align="center"
width="160" width="160"
label="报名时间"> label="报名时间"
</el-table-column> >
<el-table-column
prop="dept"
label="部门">
</el-table-column> </el-table-column>
<el-table-column prop="dept" label="部门"> </el-table-column>
</el-table> </el-table>
<div class="pagination" v-if="photoList && photoList.length"> <div class="pagination" v-if="photoList && photoList.length">
<el-pagination <el-pagination
...@@ -73,7 +72,8 @@ ...@@ -73,7 +72,8 @@
:current-page="currentPage" :current-page="currentPage"
:page-size="pageSize" :page-size="pageSize"
layout="prev, pager, next" layout="prev, pager, next"
:total="totalPage"> :total="totalPage"
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
<script> <script>
export default { export default {
name: 'fitActivity', name: "fitActivity",
data () { data() {
return { return {
photoList: [ photoList: [
// { // {
...@@ -97,87 +97,88 @@ export default { ...@@ -97,87 +97,88 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
totalPage: null, totalPage: null,
personIdMdm: '', personIdMdm: "",
dept: '', dept: "",
p: '', p: "",
c: '', c: "",
exportUrl:'', exportUrl: this.exportUrl = this.$baseURL + "exercise/exerciseActivityApplyExport",
pickerOptionsStart: { pickerOptionsStart: {
disabledDate: time => { disabledDate: (time) => {
if (this.endTime) { if (this.endTime) {
return time.getTime() > new Date(this.endTime).getTime() return time.getTime() > new Date(this.endTime).getTime();
} }
} },
}, },
pickerOptionsEnd: { pickerOptionsEnd: {
disabledDate: time => { disabledDate: (time) => {
if (this.startTime) { if (this.startTime) {
return time.getTime() < new Date(this.startTime).getTime() - 86400000 return (
time.getTime() < new Date(this.startTime).getTime() - 86400000
);
} }
} },
}, },
startTime:"", startTime: "",
endTime:"" endTime: "",
} };
}, },
mounted () { mounted() {
this.getActivityList() this.getActivityList();
}, },
methods: { methods: {
searchList(){ searchList() {
this.exportUrl = this.$baseURL + 'exercise/exerciseActivityApplyExport?' this.exportUrl = this.$baseURL + "exercise/exerciseActivityApplyExport?";
if(!!this.startTime){ if (!!this.startTime) {
this.exportUrl += 'activityStartTime='+this.startTime this.exportUrl += "activityStartTime=" + this.startTime;
} }
if(!!this.endTime){ if (!!this.endTime) {
this.exportUrl += '&activityEndTime='+this.endTime this.exportUrl += "&activityEndTime=" + this.endTime;
} }
console.log(this.exportUrl) console.log(this.exportUrl);
this.getActivityList() this.getActivityList();
}, },
handleSizeChange: function (size) { handleSizeChange: function (size) {
this.pageSize = size this.pageSize = size;
}, },
handleCurrentChange: function (currentPage) { handleCurrentChange: function (currentPage) {
this.currentPage = currentPage this.currentPage = currentPage;
this.getActivityList() this.getActivityList();
}, },
getActivityList () { getActivityList() {
let postObj = { let postObj = {
'p': this.currentPage, p: this.currentPage,
'c': this.pageSize, c: this.pageSize,
} };
if(!!this.startTime){ if (!!this.startTime) {
this.$set(postObj,'activityStartTime',this.startTime) this.$set(postObj, "activityStartTime", this.startTime);
} }
if(!!this.endTime){ if (!!this.endTime) {
this.$set(postObj,'activityEndTime',this.endTime) this.$set(postObj, "activityEndTime", this.endTime);
} }
this.$axios.get('/exercise/exerciseActivityApplyList', { this.$axios
params: postObj .get("/exercise/exerciseActivityApplyList", {
params: postObj,
}).then(res => { })
if (res) { .then((res) => {
this.totalPage = res.count if (res) {
let list = res.list this.totalPage = res.count;
list.map(item => { let list = res.list;
if(item.exerciseActivityId ==1 ){ list.map((item) => {
item.activityTitle = '第五届华夏幸福长跑节线上赛' if (item.exerciseActivityId == 1) {
item.activityTime = '2020年4月30日 16:30 -- 5月5日 22:00' item.activityTitle = "第五届华夏幸福长跑节线上赛";
} else if(item.exerciseActivityId ==2){ item.activityTime = "2020年4月30日 16:30 -- 5月5日 22:00";
item.activityTitle = '第六届华夏幸福长跑节线上赛' } else if (item.exerciseActivityId == 2) {
item.activityTime = '2022年4月29日 -- 5月22日 22:00' item.activityTitle = "第六届华夏幸福长跑节线上赛";
} item.activityTime = "2022年4月29日 -- 5月22日 22:00";
}
}) });
this.photoList = list this.photoList = list;
} }
}) });
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>
<template> <template>
<div> <div>
<el-form ref="form" style="margin-top: 3px"> <el-form ref="form" style="margin-top: 3px">
<el-form-item label="活动标题" class="label_1"> <el-form-item label="长跑活动标题" class="label_1">
<el-col :sm="7" class="pl12">{{activityName}}</el-col> <el-col :sm="7" class="pl12">{{activityName}}</el-col>
</el-form-item> </el-form-item>
<el-form-item label="报名期限" class="label_2"> <el-form-item label="活动报名期限" class="label_2">
<el-col :sm="3" class="pl12"> <el-col :sm="4" class="pl12">
<el-date-picker <el-date-picker
type="datetime" type="datetime"
:clearable="false" :clearable="false"
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</el-date-picker> </el-date-picker>
</el-col> </el-col>
<el-col class="line tc" :sm="1" style="margin-bottom: 6px; margin-top: 5px"></el-col> <el-col class="line tc" :sm="1" style="margin-bottom: 6px; margin-top: 5px"></el-col>
<el-col :sm="3"> <el-col :sm="4">
<el-date-picker <el-date-picker
type="datetime" type="datetime"
:clearable="false" :clearable="false"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="图片上传期限" class="label_2"> <el-form-item label="图片上传期限" class="label_2">
<el-col :sm="3" class="pl12"> <el-col :sm="4" class="pl12">
<el-date-picker <el-date-picker
type="datetime" type="datetime"
:clearable="false" :clearable="false"
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</el-date-picker> </el-date-picker>
</el-col> </el-col>
<el-col class="line tc" :sm="1" style="margin-bottom: 6px; margin-top: 5px"></el-col> <el-col class="line tc" :sm="1" style="margin-bottom: 6px; margin-top: 5px"></el-col>
<el-col :sm="3"> <el-col :sm="4">
<el-date-picker <el-date-picker
type="datetime" type="datetime"
:clearable="false" :clearable="false"
...@@ -167,6 +167,12 @@ export default { ...@@ -167,6 +167,12 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.pl12{
.el-input__inner{
padding-right: 0;
}
}
.avatar { .avatar {
width: 178px; width: 178px;
height: auto; height: auto;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment