first commit
This commit is contained in:
@@ -0,0 +1,198 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-tabs__content {
|
||||
padding-top: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" 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
|
||||
:clearable="false"
|
||||
@change="yearChange"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属问卷:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select filterable="true" placeholder="所属问卷" style="width: 100%;" @change="doSearch"
|
||||
v-model="pageForm.questionId">
|
||||
<el-option :label="item.qtitle" :value="item.qid" v-for="item in questions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">工号姓名:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="输入关键字" v-model="pageForm.searchKeyword" maxlength="10"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">中奖日期:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.winDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择中奖日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="中奖名单">
|
||||
<template #func>
|
||||
<el-button :disabled="!pageForm.questionId" @click="exportWinners" icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary">导出中奖名单
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
|
||||
ref="table" row-key="id" style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column
|
||||
align="center" header-align="center" label="名次" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
:key="column.prop"
|
||||
v-for="column in tableColumns">
|
||||
</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 {
|
||||
dayDialogVisible: false,
|
||||
dayTableData: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
questions: [],
|
||||
tableLoading: false,
|
||||
tableKey: '',
|
||||
tableColumns: [
|
||||
{prop: 'username', label: '姓名'},
|
||||
{prop: 'loginname', label: '工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'unitname', label: '单位'},
|
||||
{prop: 'unionname', label: '工会'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'winDate', label: '中奖日期'},
|
||||
{prop: 'maxScore', label: '抽奖分数(最高分)'},
|
||||
],
|
||||
pageForm: {
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
year: new Date().getFullYear() + '',
|
||||
keyWord: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
exportWinners() {
|
||||
const {questionId, unionId, unitId} = this.pageForm
|
||||
window.open(loc() + "/exportWinners?questionId=" + questionId + "&unionId=" + unionId + "&unitId=" + unitId)
|
||||
},
|
||||
async yearChange() {
|
||||
this.questions = await this.getQuestion()
|
||||
this.questions = this.questions.filter(v => v.qlx === 2)
|
||||
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
|
||||
this.doSearch()
|
||||
},
|
||||
async getQuestion() {
|
||||
const {data} = await $.get("/platform/question/answer/winners/getQuestion", {year: this.pageForm.year})
|
||||
return data
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.questions = await this.getQuestion()
|
||||
this.questions = this.questions.filter(v => v.qlx === 2)
|
||||
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
|
||||
this.pageData();
|
||||
this.unions = await getUnions(null)
|
||||
this.flushUnits();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user