first commit
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-col > .el-cascader, .el-col > .el-select, .el-col > .el-date-editor {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-date-picker v-model="pageForm.year"
|
||||
placeholder="年度"
|
||||
type="year"
|
||||
@change="yearChange"
|
||||
value-format="yyyy"></el-date-picker>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select v-model="pageForm.hdid">
|
||||
<el-option v-for="i in hdxxlist"
|
||||
:key="i.value"
|
||||
:label="i.label"
|
||||
:value="i.value"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6" v-if="hasSuperAdminOrXghRole">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.union"
|
||||
style="width: 200px;"
|
||||
clearable="true"
|
||||
filterable="true" @change="unionChange">
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unit" style="width: 200px;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20" class="mt20">
|
||||
<el-col :span="6">
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch"
|
||||
clearable>
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 120px;"
|
||||
clearable>
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工资号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-card>
|
||||
<el-card class="mt20" shadow="never">
|
||||
<vi-title2 title="获奖列表">
|
||||
<template #func>
|
||||
<el-button size="medium" @click="exportExcel(1)" type="primary">
|
||||
<i class="el-icon-tickets"></i>
|
||||
导出获奖人员名单
|
||||
</el-button>
|
||||
<el-button size="small" @click="exportExcel(2)" v-if="hasSuperAdminOrXghRole"
|
||||
type="primary">
|
||||
<i class="el-icon-tickets"></i>
|
||||
导出分工会获奖信息
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="序号" type="index" header-align="center" align="center"
|
||||
width="50">
|
||||
<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"
|
||||
sortable></el-table-column>
|
||||
<el-table-column prop="loginname" label="工资号" header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
|
||||
show-overflow-tooltip
|
||||
sortable></el-table-column>
|
||||
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
|
||||
show-overflow-tooltip
|
||||
sortable></el-table-column>
|
||||
<el-table-column prop="hjcount" label="获奖次数" header-align="center" align="center"
|
||||
show-overflow-tooltip></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>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
unions: [],
|
||||
units: [],
|
||||
|
||||
hasSuperAdminOrXghRole: "${@shiro.hasAnyRoles('sysadmin','A06')}" === 'true' ? true : false,
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + '',
|
||||
searchName: "u.username",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
hdid: ''
|
||||
},
|
||||
tableData: [],
|
||||
hdxxlist: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/*hdchange(v) {
|
||||
this.$set(this.pageForm, 'hdlb', '');
|
||||
this.$set(this.pageForm, 'zplb', '');
|
||||
$.post('/platform/hd/childhd/zpxx/gethdlblist', {id: v}).then(data => {
|
||||
if (data.code == 0) {
|
||||
this.hdlblist = data.data;
|
||||
}
|
||||
});
|
||||
},*/
|
||||
async unionChange() {
|
||||
this.$set(this.pageForm, "unit", null)
|
||||
this.units = await getUnits(this.pageForm.union)
|
||||
},
|
||||
async pageData() {
|
||||
sublime.showLoadingbar();
|
||||
const data = await $.post(base + "/platform/hd/wmhdhjxx/pageData", this.pageForm)
|
||||
sublime.closeLoadingbar();
|
||||
if (data.code == 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
}
|
||||
|
||||
},
|
||||
pageSizeChange: function (val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange: function (val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
exportExcel: function (num) {
|
||||
var self = this;
|
||||
var hdid = self.pageForm.hdid;
|
||||
if (num === 1) {
|
||||
if (hdid === '') {
|
||||
self.$message.warning('请先选择活动主题');
|
||||
return;
|
||||
}
|
||||
}
|
||||
window.location.href = base + '/platform/hd/wmhdhjxx/exportExcel?num=' + num + '&hdid=' + hdid;
|
||||
},
|
||||
doSearch: function () {
|
||||
this.pageForm.pageNumber = 1;
|
||||
this.pageData();
|
||||
},
|
||||
yearChange(val) {
|
||||
this.$nextTick(() => {
|
||||
this.hdxxlist = []
|
||||
})
|
||||
this.$set(this.pageForm, "hdid", "")
|
||||
let activityList = []
|
||||
console.log(val)
|
||||
if (val === null) {
|
||||
this.yearActivityList.map(v => {
|
||||
activityList = activityList.concat(v.children)
|
||||
})
|
||||
} else {
|
||||
let enen = this.yearActivityList.filter(v => v.value == val)
|
||||
enen.map(v => {
|
||||
activityList = activityList.concat(v.children)
|
||||
})
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.hdxxlist = activityList
|
||||
})
|
||||
},
|
||||
async initHdxxlist() {
|
||||
const resp = await $.post(base + '/platform/hd/wmhd/initHdxxlist')
|
||||
if (resp.code === 0) {
|
||||
this.yearActivityList = resp.data
|
||||
let activityList = []
|
||||
resp.data.map(v => {
|
||||
activityList = activityList.concat(v.children)
|
||||
})
|
||||
this.hdxxlist = activityList
|
||||
if (this.hdxxlist) {
|
||||
this.pageForm.hdid = this.hdxxlist[0].value
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.initHdxxlist();
|
||||
await this.pageData();
|
||||
this.unions = await getUnions()
|
||||
this.units = await getUnits()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user