184 lines
7.9 KiB
HTML
184 lines
7.9 KiB
HTML
<!--#
|
||
layout("/layouts/platform.html"){
|
||
#-->
|
||
<style>
|
||
|
||
|
||
</style>
|
||
<div id="app" v-cloak>
|
||
|
||
<guava ref="guava">
|
||
<template>
|
||
<el-card shadow="never">
|
||
<div class="btn-group tool-button">
|
||
<el-select v-model="pageForm.hdid" placeholder="请选择活动主题"
|
||
filterable style="width: 300px">
|
||
<el-option
|
||
v-for="item in activityList"
|
||
:key="item.hdid"
|
||
:label="item.hdname"
|
||
:value="item.hdid">
|
||
</el-option>
|
||
</el-select>
|
||
</div>
|
||
<div class="btn-group tool-button ">
|
||
<el-date-picker
|
||
v-model="time" style="width: 340px" :clearable="false"
|
||
type="daterange" value-format="yyyy-MM-dd"
|
||
range-separator="至" format="yyyy-MM-dd"
|
||
start-placeholder="开始日期"
|
||
end-placeholder="结束日期">
|
||
</el-date-picker>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-input placeholder="请输入内容" v-model="pageForm.username" style="width: 200px">
|
||
<template slot="prepend">上传人</template>
|
||
</el-input>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位"
|
||
filterable clearable style="width: 240px">
|
||
<el-option
|
||
v-for="item in unitOptions"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</div>
|
||
<div class="btn-group tool-button">
|
||
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会"
|
||
filterable clearable style="width: 240px">
|
||
<el-option
|
||
v-for="item in unionOptions"
|
||
:key="item.id"
|
||
:label="item.unionname"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</div>
|
||
|
||
<div class="btn-group tool-button">
|
||
<el-button icon="el-icon-search" @click="doSearch"
|
||
style="background-color:#409eff;color: white;"></el-button>
|
||
</div>
|
||
|
||
<div class="offscreen-right pull-right ml20">
|
||
<el-button type="primary" @click="doExport">导出名单</el-button>
|
||
</div>
|
||
</el-card>
|
||
<el-card shadow="never" class="mt20">
|
||
<el-table :data="tableData" header-align="center" style="width: 100%">
|
||
<el-table-column label="序号" type="index" header-align="center" align="center">
|
||
<template scope="scope">
|
||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="username" label="上传人" header-align="center" align="center"></el-table-column>
|
||
<el-table-column prop="count" sortable label="上传次数" header-align="center" align="center"></el-table-column>
|
||
<el-table-column prop="unitname" sortable label="所属单位" header-align="center" align="center"></el-table-column>
|
||
<el-table-column prop="unionname" sortable label="所属工会" header-align="center" align="center"></el-table-column>
|
||
</el-table>
|
||
<el-row class="el-pagination-container">
|
||
<el-pagination
|
||
@size-change="pageSizeChange"
|
||
@current-change="pageNumberChange"
|
||
:current-page="pageForm.pageNumber"
|
||
:page-sizes="[10, 20, 30, 50]"
|
||
:page-size="pageForm.pageSize"
|
||
layout="total, sizes, prev, pager, next, jumper"
|
||
:total="pageForm.totalCount">
|
||
</el-pagination>
|
||
</el-row>
|
||
</el-card>
|
||
</template>
|
||
</guava>
|
||
|
||
</div>
|
||
<script>
|
||
var vue = new Vue({
|
||
el: '#app',
|
||
data: function () {
|
||
var self = this
|
||
return {
|
||
time: [],
|
||
tableData: [],
|
||
pageForm: {
|
||
searchName: "",
|
||
pageNumber: 1,
|
||
pageSize: 10,
|
||
totalCount: 0,
|
||
unitId: '',
|
||
unionId: '',
|
||
username: '',
|
||
},
|
||
unionOptions: [],
|
||
unitOptions: [],
|
||
activityList: [],
|
||
}
|
||
},
|
||
methods: {
|
||
|
||
async doSearch () {
|
||
this.pageForm.pageNumber = 1;
|
||
await this.pageData();
|
||
},
|
||
pageNumberChange: function (val) {//页码更新操作
|
||
this.pageForm.pageNumber = val;
|
||
this.pageData();
|
||
}
|
||
,
|
||
pageSizeChange: function (val) {//分页大小更新操作
|
||
this.pageForm.pageSize = val;
|
||
this.pageData();
|
||
},
|
||
async pageData () {//加载分页数据
|
||
var self = this;
|
||
if(this.time && this.time.length > 0){
|
||
this.pageForm.start = this.time[0]
|
||
this.pageForm.end = this.time[1]
|
||
}
|
||
sublime.showLoadingbar();//显示loading
|
||
await $.post(base + "/platform/hd/checkinManage/summary/data", self.pageForm, function (data) {
|
||
sublime.closeLoadingbar();//关闭loading
|
||
if (data.code === 0) {
|
||
self.tableData = data.data.list;
|
||
self.pageForm.totalCount = data.data.totalCount;
|
||
} else {
|
||
self.$message({
|
||
message: data.msg,
|
||
type: 'error'
|
||
});
|
||
}
|
||
}, "json");
|
||
},
|
||
async getAllActivity() {
|
||
const {data} = await $.post('/platform/hd/checkinManage/getAllActivity')
|
||
this.activityList = data
|
||
if (this.activityList && this.activityList.length > 0) {
|
||
this.pageForm.hdid = this.activityList[0].hdid
|
||
this.time = [moment(this.activityList[0].hdkssj).format('YYYY-MM-DD'), moment(this.activityList[0].hdjssj).format('YYYY-MM-DD')]
|
||
}
|
||
},
|
||
doExport() {
|
||
if(this.time && this.time.length > 0) {
|
||
this.pageForm.start = this.time[0]
|
||
this.pageForm.end = this.time[1]
|
||
}
|
||
window.location.href = '/platform/hd/checkinManage/summary/doExport?id=' + this.pageForm.hdid + '&username=' + this.pageForm.username
|
||
+ '&start=' + this.pageForm.start + '&end=' + this.pageForm.end + '&unitId=' + this.pageForm.unitId + '&unionId=' + this.pageForm.unionId
|
||
}
|
||
},
|
||
async created () {
|
||
this.unionOptions = await getUnions(null)
|
||
this.unitOptions = await getUnits(null)
|
||
await this.getAllActivity()
|
||
await this.pageData();
|
||
|
||
}
|
||
})
|
||
</script>
|
||
|
||
<!--#
|
||
}
|
||
#--> |