first commit

This commit is contained in:
2026-09-09 09:14:28 +08:00
commit 5343198112
5199 changed files with 1052895 additions and 0 deletions
@@ -0,0 +1,299 @@
<!--#
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">
<span>年度:</span>
<el-date-picker
:clearable="false"
@change="pageData"
style="width: 33%"
v-model="pageForm.year"
value-format="yyyy"
type="year"
:picker-options="pickerOptions"
placeholder="选择年">
</el-date-picker>
<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-col>
<el-col :span="12">
<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>
<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-date-picker
:clearable="false"
@change="pageData"
style="width: 33%"
v-model="pageForm.year"
value-format="yyyy"
type="year"
:picker-options="pickerOptions"
placeholder="选择年">
</el-date-picker>
</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-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 33%;"
@change="pageData"
clearable="true"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</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">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="pageData"
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
type="year"
:picker-options="pickerOptions"
placeholder="选择年">
</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%;"
@change="pageData"
clearable="true"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</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="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 prop="unionName" label="分工会名称" align="center" sortable>
<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.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="maleMember" label="男会员" align="center" sortable></el-table-column>
<el-table-column prop="femaleMember" label="女会员" align="center" sortable></el-table-column>
<el-table-column prop="smallForty" label="小于等于40岁会员" align="center" sortable></el-table-column>
<el-table-column prop="smallFifty" label="40-50" align="center" sortable></el-table-column>
<el-table-column prop="smallFiftyFive" label="50-55" align="center" sortable></el-table-column>
<el-table-column prop="smallFiftyFive2" label="大于55" align="center" sortable></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 {
fullTableData: [],
personTypeOptions: [],
unions: [],
units: [],
pageForm: {
personTypes: [],
year: new Date().getFullYear() + "",
unionId: '',
unitId: ''
},
searchType: '按分工会分析',
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
}
},
methods: {
searchTypeChange(val) {
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)
const url = this.searchType === '按分工会分析' ? '/pageData' : '/pageData1'
data = await $.post(loc() + url, pageForm)
/*if (this.pageForm.year == null || this.pageForm.year == new Date().getFullYear() + "") {
data = await $.post(loc() + "/pageData", pageForm)
} else {
data = await $.post(loc() + "/historyMember", pageForm)
}*/
this.tableData = data;
this.fullTableData = 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,
'union=' + (this.searchType === '按分工会分析' ? true : false)
]
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();
}
})
</script>
<!--#
}
#-->