first commit
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
<div id="app" class="platform" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动时间</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="getActivityByYearOrType"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
type="year"
|
||||
placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.activityId" placeholder="请选择活动" filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in activityList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item" v-if="type==40002||type==40001">
|
||||
<div class="search-item-label">工会名称</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择工会" filterable
|
||||
clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名/工号</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入姓名/工号" clearable
|
||||
v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="姓名/工号"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginanme"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="人员列表" :app="this">
|
||||
<template #func>
|
||||
<el-button icon="el-icon-s-promotion" type="primary" @click="doExport" size="medium">导出
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
|
||||
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize"
|
||||
class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
sortable>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
unionList: {},
|
||||
activityList: {},
|
||||
pageForm: {
|
||||
unionId: '',
|
||||
searchName: "u.username",
|
||||
type: type,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'username', label: '姓名'},
|
||||
{prop: 'loginname', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'unitname', label: '所属单位'},
|
||||
{prop: 'unionname', label: '所属工会'},
|
||||
{prop: 'applyDateTime', label: '报名时间'},
|
||||
// {prop: 'notes', label: '备注'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doExport() {
|
||||
const {activityId, unionId} = this.pageForm
|
||||
window.open("/platform/activity/info/mange/doExportUser?id=" + activityId +
|
||||
"&unionId=" + unionId)
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post("/platform/activity/user/statistics/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.notifyError(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
async getActivityByYearOrType() {
|
||||
const resp = await $.get("/platform/activity/user/statistics/getActivityByYearOrType", {
|
||||
type: this.pageForm.type,
|
||||
year: this.pageForm.year,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.activityList = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.$set(this.pageForm, "activityId", resp.data[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "activityId", null)
|
||||
}
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.getActivityByYearOrType()
|
||||
this.unionList = await getUnions(null)
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user