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

235 lines
10 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<div class="platform" 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
placeholder="选择年"
style="width: 100%"
type="year" v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</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-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 @click="exportXlsx" size="small"
type="primary">导出分工会汇总表
</el-button>
<el-button @click="doExport" 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"
width="80px">
<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"
>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
width="200px">
<template scope="scope">
<el-button @click="openView(scope.row.id)" size="mini" type="primary">查看
</el-button>
<el-button @click="exportByUnion(scope.row.id)" size="mini" type="primary">导出
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<info ref="info"></info>
</template>
<el-dialog :close-on-click-modal="false" :visible.sync="viewDialogVisible" title="详情"
width="60%">
<el-table :data="viewTableData" border>
<el-table-column align="center" header-align="center" label="序号" type="index"
width="100px"></el-table-column>
<el-table-column align="center" header-align="center" label="姓名" prop="userName"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="工号"
prop="loginName"></el-table-column>
<el-table-column align="center" header-align="center" label="单位" prop="unitName"
width="160"></el-table-column>
<el-table-column align="center" header-align="center" label="子女出生时间"
prop="cssj"></el-table-column>
<el-table-column align="center" header-align="center" label="上报时间"
prop="sqsj"></el-table-column>
</el-table>
</el-dialog>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
units: [],
pageForm: {
unionId: "",
unitId: "",
year: new Date().getFullYear() + "",
searchName: "u.username",
},
tableColumns: [
{prop: 'unionname', label: '分工会名称'},
{prop: 'teacherCount', label: '教职工人数'},
{prop: 'childCount', label: '子女人数'},
/* {prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'unitName', label: '单位'},
{prop: 'cssj', label: '子女出生时间'},
{prop: 'sqsj', label: '上报时间'},
// {prop: 'shjg', label: '审核结果'},
{prop: 'stateName', label: '审核状态', sortable: true},*/
],
viewDialogVisible: false,
viewTableData: []
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'info': httpVueLoader('/components/singleChild/info.vue'),
},
methods: {
exportByUnion(id) {
window.open('/platform/fw/singleChild/report/doExport?year=' + this.pageForm.year+"&unionId="+id)
},
pageData() {
sublime.showLoadingbar()
$.post(loc() + '/pageData', this.pageForm).then(res => {
sublime.closeLoadingbar()
if (res.code === 0) {
this.tableData = res.data
}
})
},
exportXlsx() {
window.open('/platform/fw/singleChild/reading/exportXlsx?year=' + this.pageForm.year)
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data.id)
}
},
async openView(id) {
const {code, msg, data} = await $.get(loc() + '/getTeacherByUnionId', {
year: this.pageForm.year,
unionId: id
})
if (code === 0) {
this.viewDialogVisible = true
this.viewTableData = data
}
/* this.$refs.info.getInfo(id)
this.$refs.guava.view()*/
},
async doExport() {
const loading = this.$loading({
lock: true,
text: '正在导出名单...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
setTimeout(() => {
loading.close();
window.location.href = base + "/platform/fw/singleChild/reading/export?unitId=" + this.pageForm.unitId
+ "&unionId=" + this.pageForm.unionId
+ "&year=" + this.pageForm.year
}, 1000)
},
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.pageData();
this.unions = await getUnions()
this.flushUnits()
}
})
</script>
<!--#
}
#-->