274 lines
12 KiB
HTML
274 lines
12 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
<style>
|
|
|
|
</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="请选择年度"
|
|
type="year"
|
|
style="width: 100%"
|
|
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 placeholder="请选择所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
|
clearable="true"
|
|
@change="flushUnits" @clear="flushUnits"
|
|
filterable="true">
|
|
<el-option v-for="item in unions" :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-select placeholder="请选择所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
|
@change="getThreeUnits"
|
|
clearable="true"
|
|
filterable="true">
|
|
<el-option v-for="item in units" :label="item.name" :value="item.id"></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 shadow="never" class="mt10">
|
|
<table-tool label="数据列表" :app="this">
|
|
<template #func>
|
|
<!-- <el-button type="primary" size="small" @click="exportSummary">-->
|
|
<!-- 导出所有分工会汇总表(zip)-->
|
|
<!-- </el-button>-->
|
|
<el-button type="primary" size="small" @click="exportXlsx">
|
|
导出分工会汇总表(xlsx)
|
|
</el-button>
|
|
<el-button type="primary" size="small" @click="exportXlsx2">
|
|
导出人员汇总表(xlsx)
|
|
</el-button>
|
|
</template>
|
|
</table-tool>
|
|
|
|
<el-table border :data="tableData">
|
|
<el-table-column header-align="center" align="center" type="index" label="序号"
|
|
width="100px"></el-table-column>
|
|
<el-table-column header-align="center" align="center" prop="unionname"
|
|
label="分工会名称"></el-table-column>
|
|
<el-table-column header-align="center" align="center" prop="teacherCount"
|
|
label="教职工人数"></el-table-column>
|
|
<el-table-column header-align="center" align="center" prop="childCount"
|
|
label="子女人数"></el-table-column>
|
|
<el-table-column header-align="center" align="center" label="操作" width="200px">
|
|
<template scope="{row}">
|
|
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
|
|
<el-button size="mini" type="primary" @click="exportByUnion(row)">导出</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-card>
|
|
</template>
|
|
</guava>
|
|
|
|
<el-dialog
|
|
title="子女信息"
|
|
:visible.sync="childDialogVisible" :close-on-click-modal="false" width="40%">
|
|
|
|
<el-table :data="childData">
|
|
<el-table-column align="center" header-align="center" label="出生年月"
|
|
prop="childBirthday"></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="备注" prop="bz"></el-table-column>
|
|
</el-table>
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="childDialogVisible = false">取 消</el-button>
|
|
</span>
|
|
|
|
</el-dialog>
|
|
|
|
<el-dialog
|
|
title="签字"
|
|
:visible.sync="signDialogVisible" :close-on-click-modal="false" width="40%">
|
|
|
|
<sign :qz.sync="exportSign"></sign>
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="signDialogVisible = false">取 消</el-button>
|
|
<el-button type="primary" @click="doExport">确 定</el-button>
|
|
</span>
|
|
|
|
</el-dialog>
|
|
|
|
<el-dialog title="详情" width="60%" :visible.sync="viewDialogVisible" :close-on-click-modal="false">
|
|
<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="mobile"></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="申请时间" prop="applyTime" width="160"></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="子女人数" prop="childCount"></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="子女信息" prop="childDesc"></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="金额">
|
|
<template scope="{row}">
|
|
{{row.childCount * 100}}
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-dialog>
|
|
|
|
</div>
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
childDialogVisible: false,
|
|
pageForm: {
|
|
pageNumber: 1,
|
|
pageSize: 10,
|
|
totalCount: 0,
|
|
year: new Date().getFullYear() + '',
|
|
searchKeyword: '',
|
|
unionId: '',
|
|
unitId: '',
|
|
},
|
|
tableData: [],
|
|
units: [],
|
|
unions: [],
|
|
childData: [],
|
|
signDialogVisible: false,
|
|
exportSign: '',
|
|
|
|
viewDialogVisible: false,
|
|
viewTableData: []
|
|
}
|
|
},
|
|
methods: {
|
|
async openView(row) {
|
|
const {code, msg, data} = await $.get(loc() + '/getTeacherByUnionId', {
|
|
year: this.pageForm.year,
|
|
unionId: row.id
|
|
})
|
|
if (code === 0) {
|
|
this.viewDialogVisible = true
|
|
this.viewTableData = data
|
|
}
|
|
},
|
|
|
|
exportByUnion(row) {
|
|
window.open('/platform/jf/childrenFaculty/summary/doExport?year=' + this.pageForm.year
|
|
+ '&unionId=' + row.id)
|
|
},
|
|
|
|
exportSummary() {
|
|
window.open('/platform/jf/childrenFaculty/summary/exportZip?year=' + this.pageForm.year)
|
|
},
|
|
exportXlsx(){
|
|
window.open('/platform/jf/childrenFaculty/summary/exportXlsx?year=' + this.pageForm.year)
|
|
},
|
|
exportXlsx2(){
|
|
window.open('/platform/jf/childrenFaculty/summary/exportXlsx2?year=' + this.pageForm.year)
|
|
},
|
|
doExport() {
|
|
// if ("${@shiro.hasRole('gh10')}" === 'true' && !this.exportSign) {
|
|
// this.$message.warning('请先签字后再导出')
|
|
// return
|
|
// }
|
|
const params = {
|
|
year: this.pageForm.year,
|
|
searchKeyword: this.pageForm.searchKeyword,
|
|
unitId: this.pageForm.unitId,
|
|
unionId: this.pageForm.unionId,
|
|
exportSign: this.exportSign,
|
|
}
|
|
axios.post('/platform/jf/childrenFaculty/summary/doExport', $.param(params), {responseType: 'blob'})
|
|
.then((res) => {
|
|
const {data, headers} = res
|
|
const fileName = headers['content-disposition'].replace(/\w+;filename=(.*)/, '$1')
|
|
// 此处当返回json文件时需要先对data进行JSON.stringify处理,其他类型文件不用做处理
|
|
const blob = new Blob([data], {type: headers['content-type']})
|
|
let dom = document.createElement('a')
|
|
let url = window.URL.createObjectURL(blob)
|
|
dom.href = url
|
|
dom.download = decodeURI(fileName)
|
|
dom.style.display = 'none'
|
|
document.body.appendChild(dom)
|
|
dom.click()
|
|
dom.parentNode.removeChild(dom)
|
|
window.URL.revokeObjectURL(url)
|
|
this.signDialogVisible = false
|
|
}).catch((err) => {
|
|
})
|
|
},
|
|
// async openView(row) {
|
|
// const resp = await $.post(loc() + '/getChildData', {
|
|
// loginName: row.loginName,
|
|
// year: row.year,
|
|
// })
|
|
// this.childData = resp.data
|
|
// this.childDialogVisible = true
|
|
// },
|
|
async yearChange() {
|
|
await this.doSearch()
|
|
},
|
|
pageData() {
|
|
sublime.showLoadingbar()
|
|
$.post(loc() + '/pageData', this.pageForm).then(res => {
|
|
sublime.closeLoadingbar()
|
|
if (res.code === 0) {
|
|
this.tableData = res.data
|
|
}
|
|
})
|
|
},
|
|
doSearch() {
|
|
this.pageForm.pageNumber = 1
|
|
this.pageData()
|
|
},
|
|
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>
|
|
<!--#
|
|
}
|
|
#-->
|
|
|
|
|