204 lines
9.3 KiB
HTML
204 lines
9.3 KiB
HTML
<!--#
|
||
layout("/layouts/platform.html"){
|
||
#-->
|
||
<style>
|
||
.query-row {
|
||
height: 70px;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.query-row:not(:last-child) {
|
||
border-bottom: 1px dashed rgb(230, 230, 230);
|
||
}
|
||
|
||
.query-row-title {
|
||
width: 120px;
|
||
}
|
||
</style>
|
||
<div id="app" v-cloak>
|
||
<guava ref="guava">
|
||
<template>
|
||
<el-card shadow="never" style="margin-top: 10px">
|
||
<el-row type="flex" align="middle" class="query-row">
|
||
<el-col class="query-row-content">
|
||
<el-row>
|
||
<el-col :span="12">
|
||
<template v-if="searchType==='按分工会统计'">
|
||
<span class="ml20">所属工会:</span>
|
||
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 33%;"
|
||
@change="unionChange"
|
||
clearable="true"
|
||
filterable="true">
|
||
<el-option v-for="item in unions" :label="item.unionname"
|
||
:value="item.id"></el-option>
|
||
</el-select>
|
||
</template>
|
||
<template v-if="searchType==='按单位统计'">
|
||
<span class="ml20">所在单位:</span>
|
||
<el-select placeholder="单位" v-model="pageForm.unitId" style="width: 33%;"
|
||
@change="unitChange"
|
||
clearable
|
||
filterable>
|
||
<el-option v-for="item in units" :label="item.name"
|
||
:value="item.id"></el-option>
|
||
</el-select>
|
||
</template>
|
||
|
||
<el-radio-group v-model="searchType" @change="searchTypeChange" style="margin-left: 10px">
|
||
<el-radio-button label="按分工会统计"></el-radio-button>
|
||
<el-radio-button label="按单位统计"></el-radio-button>
|
||
</el-radio-group>
|
||
<el-button @click="doExport" class="ml10" type="primary">导出</el-button>
|
||
</el-col>
|
||
|
||
</el-row>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
<el-row type="flex" align="middle" class="query-row">
|
||
<el-col class="query-row-title">人员类型:</el-col>
|
||
<el-col class="query-row-content">
|
||
<el-tag
|
||
style="margin-right: 10px;cursor: pointer"
|
||
v-for="item in personTypeOptions"
|
||
:key="item.code"
|
||
:type="item.name"
|
||
:effect="pageForm.personTypes.includes(item.name)?'dark':'plain'"
|
||
@click="checkPersonType(item.name)">
|
||
{{ item.name }}
|
||
</el-tag>
|
||
<el-link type="danger" v-if="personTypeOptions.length&&pageForm.personTypes.length"
|
||
:underline="false"
|
||
@click="pageForm.personTypes=[];doSearch()">清空
|
||
</el-link>
|
||
</el-col>
|
||
</el-row>
|
||
</el-card>
|
||
|
||
|
||
<el-card shadow="never" class="mt10" v-loading="tableLoading">
|
||
<vi-title title="单身教工统计"></vi-title>
|
||
<el-table :data="tableData" show-summary>
|
||
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
|
||
width="80px"></el-table-column>
|
||
<el-table-column v-if="searchType==='按分工会统计'" align="center" header-align="center" label="分工会"
|
||
width="220px">
|
||
<template scope="{row}">
|
||
<!--{{isDisPlayCode?'('+row.unionCode+')':null}}-->{{row.unionName}}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column v-if="searchType==='按单位统计'" align="center" header-align="center" label="单位"
|
||
width="220px">
|
||
<template scope="{row}">
|
||
<!--{{isDisPlayCode?'('+row.unitCode+')':null}}-->{{row.unitName}}
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="totalNumber" label="总人数" align="center" sortable></el-table-column>
|
||
<el-table-column prop="male" label="男" align="center" sortable></el-table-column>
|
||
<el-table-column prop="female" label="女" align="center" sortable></el-table-column>
|
||
<el-table-column prop="lessTwentyFive" label="小于25岁" align="center" sortable></el-table-column>
|
||
<el-table-column prop="thirty" label="26-30岁" align="center" sortable></el-table-column>
|
||
<el-table-column prop="thirtyFive" label="31-35岁" align="center" sortable></el-table-column>
|
||
<el-table-column prop="forty" label="36-40岁" align="center" sortable></el-table-column>
|
||
<el-table-column prop="fortyFive" label="41-45岁" align="center" sortable></el-table-column>
|
||
<el-table-column prop="fifty" label="46-50岁" align="center" sortable></el-table-column>
|
||
<el-table-column prop="fiftyFive" label="51-55岁" align="center" sortable></el-table-column>
|
||
<el-table-column prop="moreFiftyFive" label="大于55岁" align="center" sortable></el-table-column>
|
||
</el-table>
|
||
</el-card>
|
||
|
||
</template>
|
||
</guava>
|
||
</div>
|
||
<script>
|
||
var vue = new Vue({
|
||
el:'#app',
|
||
mixins: [initTableMixins],
|
||
data(){
|
||
return{
|
||
fullTableData: [],
|
||
personTypeOptions: [],
|
||
unions: [],
|
||
units: [],
|
||
pageForm: {
|
||
personTypes: [],
|
||
unionId: '',
|
||
unitId: '',
|
||
analyze : '0'
|
||
},
|
||
searchType: '按分工会统计',
|
||
|
||
}
|
||
},
|
||
methods:{
|
||
searchTypeChange() {
|
||
this.pageForm.analyze=this.searchType === '按分工会统计' ? '0' : '1'
|
||
this.pageData()
|
||
},
|
||
unionChange(val) {
|
||
if (val == null || val == '') {
|
||
this.tableData = this.fullTableData
|
||
} else {
|
||
this.tableData = this.fullTableData.filter(v => v.id === val)
|
||
}
|
||
},
|
||
unitChange(val) {
|
||
if (val == null || val == '') {
|
||
this.tableData = this.fullTableData
|
||
} else {
|
||
this.tableData = this.fullTableData.filter(v => v.id === val)
|
||
}
|
||
},
|
||
async pageData() {
|
||
sublime.showLoadingbar();
|
||
this.tableLoading = true
|
||
let data = {}
|
||
const pageForm = clone(this.pageForm)
|
||
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
|
||
this.pageForm.analyze = this.searchType === '按分工会统计' ? '0' : '1'
|
||
data = await $.post(loc() + '/pageData', pageForm)
|
||
this.tableData = data.data;
|
||
this.fullTableData = data.data;
|
||
sublime.closeLoadingbar();
|
||
this.tableLoading = false
|
||
},
|
||
checkPersonType(type) {
|
||
let idx = this.pageForm.personTypes.indexOf(type)
|
||
if (idx != -1) {
|
||
this.pageForm.personTypes.splice(idx, 1)
|
||
} else {
|
||
this.pageForm.personTypes.push(type)
|
||
}
|
||
this.doSearch()
|
||
},
|
||
doExport() {
|
||
const personTypes = JSON.stringify(this.pageForm.personTypes)
|
||
const params = [
|
||
'year=' + this.pageForm.year,
|
||
'unionId=' + this.pageForm.unionId,
|
||
'unitId=' + this.pageForm.unitId,
|
||
'personTypes=' + personTypes,
|
||
'analyze=' + (this.searchType === '按分工会统计' ? '0' : '1')
|
||
]
|
||
location.href = loc() + '/doExport?' + params.join('&')
|
||
}
|
||
},
|
||
async created() {
|
||
this.personTypeOptions = await getDictOptions("UserType")
|
||
this.unions = await getUnions(null)
|
||
this.units = await getUnits(null)
|
||
this.pageData();
|
||
},
|
||
components: {
|
||
'guava': httpVueLoader('/components/plugins/Guava.vue')
|
||
},
|
||
});
|
||
</script>
|
||
|
||
<!--#
|
||
}
|
||
#-->
|