144 lines
5.7 KiB
HTML
144 lines
5.7 KiB
HTML
<!--#
|
||
layout("/layouts/platform.html"){
|
||
#-->
|
||
|
||
<div id="app" v-cloak>
|
||
|
||
<guava ref="guava">
|
||
|
||
<el-card shadow="never">
|
||
<div class="search">
|
||
<div class="search-item" v-if="pageForm.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="pageForm.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="pageForm.searchType" @change="searchTypeChange">
|
||
<el-radio-button label="按分工会分析"></el-radio-button>
|
||
<el-radio-button label="按单位分析"></el-radio-button>
|
||
</el-radio-group>
|
||
</div>
|
||
</div>
|
||
</el-card>
|
||
|
||
<el-card shadow="never" class="mt10">
|
||
<table-tool label="统计" :app="this"></table-tool>
|
||
<el-table :data="tableData" :size="tableSize" style="width: 100%">
|
||
<el-table-column type="index" label="序号" width="80px"></el-table-column>
|
||
<el-table-column
|
||
align="center"
|
||
header-align="center"
|
||
v-for="column in tableColumns"
|
||
show-overflow-tooltip
|
||
:label="column.label"
|
||
:prop="column.prop"
|
||
:sortable="column.sortable"
|
||
>
|
||
<template v-if="column.prop==='unionName'" scope="{row}">
|
||
{{isDisPlayCode?'('+row.unionCode+')':null}}{{row.unionName}}
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
</el-card>
|
||
</guava>
|
||
|
||
</div>
|
||
|
||
<script>
|
||
var vue = new Vue({
|
||
el: '#app',
|
||
mixins: [initTableMixins],
|
||
data() {
|
||
return {
|
||
tableColumns: [
|
||
{prop: 'unionName', label: '分工会名称'},
|
||
{prop: 'unionCode', label: '分工会编码', sortable: true},
|
||
{prop: 'unionSum', label: '总人数', sortable: true},
|
||
{prop: 'studyNum', label: '学习人数', sortable: true},
|
||
],
|
||
unions: [],
|
||
units: [],
|
||
tableData: [],
|
||
fullTableData: [],
|
||
pageForm: {
|
||
searchType: '按分工会分析'
|
||
}
|
||
}
|
||
},
|
||
methods: {
|
||
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)
|
||
}
|
||
},
|
||
searchTypeChange() {
|
||
const searchType = this.pageForm.searchType
|
||
if (searchType === '按分工会分析') {
|
||
this.tableColumns = [
|
||
{prop: 'unionName', label: '分工会名称'},
|
||
{prop: 'unionCode', label: '分工会编码', sortable: true},
|
||
{prop: 'unionSum', label: '总人数', sortable: true},
|
||
{prop: 'studyNum', label: '学习人数', sortable: true},
|
||
]
|
||
} else {
|
||
this.tableColumns = [
|
||
{prop: 'unitName', label: '单位名称'},
|
||
{prop: 'unitCode', label: '单位编码', sortable: true},
|
||
{prop: 'unionSum', label: '总人数', sortable: true},
|
||
{prop: 'studyNum', label: '学习人数', sortable: true},
|
||
]
|
||
}
|
||
this.pageData()
|
||
},
|
||
async pageData() {
|
||
sublime.showLoadingbar()
|
||
this.tableLoading = true
|
||
const resp = await $.post(loc() + '/pageData', this.pageForm)
|
||
sublime.closeLoadingbar()
|
||
this.tableLoading = false
|
||
if (resp.code === 0) {
|
||
this.tableData = resp.data.list
|
||
this.fullTableData = resp.data.list
|
||
}
|
||
}
|
||
},
|
||
async created() {
|
||
this.pageData()
|
||
this.unions = await getUnions(null)
|
||
this.units = await getUnits(null)
|
||
}
|
||
})
|
||
</script>
|
||
|
||
<!--#
|
||
}
|
||
#--> |