230 lines
9.8 KiB
HTML
230 lines
9.8 KiB
HTML
<!--#
|
||
layout("/layouts/platform.html"){
|
||
#-->
|
||
<style>
|
||
.addColumn {
|
||
color: #c1c3c6;
|
||
}
|
||
|
||
.deleteColumn {
|
||
color: #c1c3c6;
|
||
}
|
||
</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
|
||
@change="yearChange"
|
||
style="width: 100%"
|
||
v-model="pageForm.currentYear"
|
||
value-format="yyyy"
|
||
:clearable="false"
|
||
type="year"
|
||
:picker-options="pickerOptions"
|
||
placeholder="选择年">
|
||
</el-date-picker>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="search-item" v-if="searchType==='按分工会分析'">
|
||
<div class="search-item-label">分工会:</div>
|
||
<div class="search-item-option">
|
||
<el-select placeholder="分工会" v-model="pageForm.unionId" style="width: 100%;"
|
||
@change="unionChange"
|
||
clearable
|
||
filterable>
|
||
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
|
||
</el-select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="search-item" v-if="searchType==='按单位分析'">
|
||
<div class="search-item-label">单位:</div>
|
||
<div class="search-item-option">
|
||
<el-select placeholder="单位" v-model="pageForm.unitId" style="width: 100%;"
|
||
@change="unitChange"
|
||
clearable
|
||
filterable>
|
||
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
|
||
</el-select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="offscreen-right pull-right">
|
||
<el-radio-group v-model="searchType" @change="searchTypeChange">
|
||
<el-radio-button label="按分工会分析"></el-radio-button>
|
||
<el-radio-button label="按单位分析"></el-radio-button>
|
||
</el-radio-group>
|
||
</div>
|
||
|
||
<div class="offscreen-right pull-right ml20">
|
||
<el-button type="primary" @click="doExport">导出</el-button>
|
||
</div>
|
||
</div>
|
||
</el-card>
|
||
<el-card shadow="never" class="mt20">
|
||
<vi-title title="会员分析"></vi-title>
|
||
<el-table :data="tableData" show-summary>
|
||
<el-table-column align="center" header-align="center" type="index" 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 align="center" header-align="center" label="年初数量"
|
||
sortable
|
||
prop="lastYearMemberNum"
|
||
></el-table-column>
|
||
<el-table-column align="center" header-align="center" label="新增人数"
|
||
sortable
|
||
prop="newMemberNum"
|
||
></el-table-column>
|
||
|
||
<el-table-column align="center" header-align="center" label="【新入职(恢复)"
|
||
sortable label-class-name="addColumn"
|
||
prop="newResetMemberNum"
|
||
>
|
||
<template scope="{row}">
|
||
<span style="color:#c1c3c6;">{{row.newResetMemberNum}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column align="center" header-align="center" label="校内转入】"
|
||
sortable label-class-name="addColumn"
|
||
prop="memberUnitChangeNumIn"
|
||
>
|
||
<template scope="{row}">
|
||
<span style="color:#c1c3c6;">{{row.memberUnitChangeNumIn}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column align="center" header-align="center" label="减少人数"
|
||
sortable
|
||
prop="reduceMemberNum"
|
||
></el-table-column>
|
||
|
||
<el-table-column align="center" header-align="center" label="【校内转出"
|
||
sortable label-class-name="deleteColumn"
|
||
prop="memberUnitChangeNumOut"
|
||
>
|
||
<template scope="{row}">
|
||
<span style="color:#c1c3c6;">{{row.memberUnitChangeNumOut}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column align="center" header-align="center" label="其他(离职)】"
|
||
sortable label-class-name="deleteColumn"
|
||
prop="reduceOtherNum"
|
||
>
|
||
<template scope="{row}">
|
||
<span style="color:#c1c3c6;">{{row.reduceOtherNum}}</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column align="center" header-align="center" label="当前数量"
|
||
sortable
|
||
prop="currentYearMemberNum"
|
||
></el-table-column>
|
||
</el-table>
|
||
</el-card>
|
||
</template>
|
||
</guava>
|
||
</div>
|
||
<script>
|
||
const vue = new Vue({
|
||
el: '#app',
|
||
mixins: [initTableMixins],
|
||
components: {
|
||
'guava': httpVueLoader('/components/plugins/Guava.vue')
|
||
},
|
||
data() {
|
||
return {
|
||
pickerOptions: {
|
||
disabledDate(time) {
|
||
return (
|
||
time.getFullYear() > new Date().getFullYear()
|
||
);
|
||
}
|
||
},
|
||
pageForm: {
|
||
currentYear: null,
|
||
unions: []
|
||
},
|
||
unions: [],
|
||
units: [],
|
||
tableData: [],
|
||
fullTableData: [],
|
||
searchType: '按分工会分析'
|
||
}
|
||
},
|
||
methods: {
|
||
yearChange(val) {
|
||
this.pageForm.currentYear = val
|
||
this.getData()
|
||
},
|
||
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 getData() {
|
||
const url = this.searchType === '按分工会分析' ? '/pageData' : '/pageData2'
|
||
const resp = await $.post(loc() + url, this.pageForm)
|
||
if (resp.code === 0) {
|
||
this.tableData = resp.data
|
||
this.fullTableData = this.tableData
|
||
} else {
|
||
this.notifyWarning(resp.msg)
|
||
}
|
||
},
|
||
searchTypeChange(val) {
|
||
this.getData()
|
||
console.log(val)
|
||
},
|
||
doExport() {
|
||
let url = '/platform/member/inquire/analysis/doExport?searchType=' + this.searchType
|
||
+ "¤tYear=" + this.pageForm.currentYear
|
||
if (this.pageForm.unionId) {
|
||
url += "&unionId=" + this.pageForm.currentYear
|
||
}
|
||
if (this.pageForm.unitId) {
|
||
url += "&unitId=" + this.pageForm.unitId
|
||
}
|
||
window.open(url)
|
||
|
||
}
|
||
},
|
||
async created() {
|
||
this.pageForm.currentYear = moment().format('YYYY')
|
||
await this.getData()
|
||
this.unions = await getUnions(null)
|
||
this.units = await getUnits(null)
|
||
}
|
||
})
|
||
</script>
|
||
<!--#
|
||
}
|
||
#--> |