Files
UNION_NSI/target/classes/views/platform/question/ranking.html
T
2026-09-08 19:49:21 +08:00

237 lines
11 KiB
HTML

<!--#
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.answerDate"
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="doExportInventory" icon="el-icon-printer"
size="small"
type="primary">导出得分名单
</el-button>
<!--<el-button :disabled="!pageForm.questionId" @click="doExportAll" 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
v-for="column in tableColumns">
<template v-if="column.prop=='dayCount'" scope="{row}">
<span @click="showDays(row)" style="color: #236eb4; cursor: pointer">{{ row.dayCount ? row.dayCount : 0 }}</span>
</template>
</el-table-column>
</el-table>
<!--# include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
<el-dialog title="答题次数" :visible.sync="dayDialogVisible" width="40%">
<el-table :data="dayTableData" style="width: 100%;" max-height="400">
<el-table-column align="center" header-align="center" show-overflow-tooltip label="姓名"
prop="username"></el-table-column>
<el-table-column align="center" header-align="center" show-overflow-tooltip label="工号"
prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" show-overflow-tooltip label="答题时间"
prop="day"></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dayDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</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: 'answerTotal', label: '答题次数(第几回答题)', sortable: true},
{prop: 'max_score', label: '得分'},
{prop: 'answerDate', label: '答题日期'},
],
pageForm: {
unionId: '',
unitId: '',
year: new Date().getFullYear() + '',
keyWord: '',
answerDate: moment().format("YYYY-MM-DD")
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue')
},
methods: {
showDays(row) {
if (!row.days || row.dayCount === 0) {
return
}
this.dayTableData = []
row.days.split(',').map(o => {
this.dayTableData.push({username: row.username, loginname: row.loginname, day: o})
})
this.dayDialogVisible = true
},
doExportInventory() {
let {questionId, unionId, unitId, answerDate} = this.pageForm
answerDate = answerDate == null ? '' : answerDate
window.open(loc() + "/doExport?questionId=" + questionId + "&unionId=" + unionId + "&unitId=" + unitId + "&answerDate=" + answerDate)
},
doExportAll() {
const {questionId, unionId, unitId} = this.pageForm
window.open(loc() + "/doExportAll?questionId=" + questionId)
},
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(loc()+"/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>
<!--#
}
#-->