first commit

This commit is contained in:
2026-08-26 14:25:17 +08:00
commit 06debfd1fc
10595 changed files with 1836924 additions and 0 deletions
@@ -0,0 +1,188 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker
:clearable="false"
@change="getWelfareProjectList"
placeholder="请选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</search-item>
<search-item label="福利项目">
<el-select @change="getWelfareOptions()" filterable placeholder="福利项目" style="width: 100%" v-model="pageForm.projectId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in welfareProjectList"></el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select :clearable="clearable" clearable filterable placeholder="请选择所属工会" style="width: 100%" v-model="pageForm.unionId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unionOptions"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never" v-loading="tableLoading">
<table-tool label="工会列表">
<el-button @click="exportByWelfareOptions" icon="el-icon-printer" size="small" type="primary">按福利选项导出</el-button>
<el-button :disabled="!pageForm.projectId" @click="remindUnSelectedPlaceholder" icon="el-icon-bell" size="small" type="primary">
提醒未选择人员
</el-button>
<template v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN'])">
<el-button :disabled="!pageForm.projectId" @click="exportSummary" icon="el-icon-printer" size="small" type="primary">
导出汇总表
</el-button>
</template>
</table-tool>
<el-table
:data="tableData"
:size="tableSize"
@sort-change="pageOrder"
class="vi-table"
lazy
ref="table"
row-key="id"
show-summary
style="width: 100%"
v-if="tableData&&tableData.length>0"
>
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='welfareUnitName'">{{row.welfareUnitName}}</template>
<template scope="{row}" v-else-if="column.prop=='selectedNum'">
<el-link @click="openSelected(row)" type="primary">{{row.selectedNum}}</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='unSelectedNum'">
<el-link @click="openUnSelected(row)" type="primary">{{row.unSelectedNum}}</el-link>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</guava>
<selected-user ref="selectedUserRef"></selected-user>
<unselected-user ref="unSelectedUserRef"></unselected-user>
</div>
<script nonce="${cspNonce!}">
<!--#include('selectedUser.js'){}#-->
<!--#include('unSelectedUser.js'){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"selected-user": selectedUser,
"unselected-user": unSelectedUser
},
store,
data() {
return {
pageForm: {
searchName: "username",
year: new Date().getFullYear().toString()
},
unionOptions: [],
welfareProjectList: [],
welfareOptions: [],
projectInfo: {},
clearable: false,
tableColumns: []
}
},
methods: {
remindUnSelectedPlaceholder() {
this.$message.info("提醒未选择人员功能待开发")
},
// 导出汇总表
exportSummary() {
this.$downLoad("/platform/welfare/statistics/exportSummary", {
projectId: this.pageForm.projectId
})
},
// 查看已选择的人员
openSelected(row) {
this.$refs.selectedUserRef.onOpen(this.pageForm.projectId, row)
},
// 查看未选择的人员
async openUnSelected(row) {
this.$refs.unSelectedUserRef.onOpen(this.pageForm.projectId, row)
},
// 按福利选项导出
exportByWelfareOptions() {
this.$downLoad("/platform/welfare/statistics/exportByWelfareOptions", {
projectId: this.pageForm.projectId,
unionId: this.pageForm.unionId
})
},
async pageData() {
this.tableLoading = true
const resp = await this.$axios.post("/platform/welfare/statistics/pageData", this.pageForm)
if (resp.code === 0) {
this.tableColumns = resp.data.tableColumn
this.tableData = resp.data.tableList
}
this.tableLoading = false
},
async getWelfareProjectList() {
const res = await this.$axios.post("/platform/welfare/project/mange/getWelfareList", { year: this.pageForm.year })
this.welfareProjectList = res.data
if (res.data && res.data.length > 0) {
this.$set(this.pageForm, "projectId", res.data[0].id)
} else {
this.$set(this.pageForm, "projectId", null)
}
this.doSearch()
},
getWelfareOptions() {
const data = this.welfareProjectList.find((p) => p.id === this.pageForm.projectId)
this.projectInfo = data
this.welfareOptions = data.options
},
async init() {
await this.getWelfareProjectList()
if (
!this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN", "SCHOOL_UNION_WELFARE_ADMIN"]) &&
this.$auth.hasRoleOr(["BRANCH_UNION_CHAIRMAN"])
) {
this.unionOptions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.$set(this.pageForm, "unionId", this.unions[0].id)
this.clearable = true
} else {
this.unionOptions = await this.$businessTool.listUnion()
this.clearable = true
}
await this.pageData()
}
},
async created() {
this.init()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,97 @@
const selectedUser = {
template: /*language=HTML*/ `
<el-dialog :title="unionName+'已选择用户'" :visible.sync="visible" width="70%">
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<div>
<el-input
v-model="pageForm.searchKeyword"
placeholder="请输入姓名或工号"
style="width: 200px;"
size="small"
clearable
@keyup.enter.native="doSearch"
>
<el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
</el-input>
</div>
<div>
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
</div>
</div>
<el-table
:data="tableData"
row-key="id"
style="width: 100%"
>
<el-table-column label="序号" type="index" :index="indexMethod" width="50"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in tableColumns"
></el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-dialog>
`,
mixins: [initTableMixins],
data() {
return {
visible: false,
projectId: null,
unionId: null,
unionName: null,
searchKeyword: "",
tableColumns: [
{ label: "工号", prop: "loginName" },
{ label: "姓名", prop: "userName" },
{ label: "生日", prop: "birthday" },
{ prop: "userState", label: "在职状态", width: 120, sortable: true },
{ prop: "personType", label: "人员类型", width: 120, sortable: true },
{ prop: "postDoctoralJoinDate", label: "进站时间", sortable: true },
{ label: "单位", prop: "welfareUnitName" },
{ label: "手机号", prop: "mobile" },
{ label: "所选福利", prop: "selectOptionName" }
]
}
},
methods: {
onOpen(projectId, { id, name }) {
this.visible = true
this.projectId = projectId
this.unionId = id
this.unionName = name
this.searchKeyword = ""
this.pageData()
},
pageData() {
this.$axios
.post("/platform/welfare/statistics/selectedUnionUserPageData", {
...this.pageForm,
projectId: this.projectId,
unionId: this.unionId,
keyword: this.searchKeyword
})
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
handleSearch() {
this.pageForm.pageNum = 1
this.pageData()
},
handleExport() {
this.$downLoad("/platform/welfare/statistics/exportSelectedUnionUser", {
projectId: this.projectId,
unionId: this.unionId
})
}
}
}
@@ -0,0 +1,88 @@
const unSelectedUser = {
template: /*language=HTML*/ `
<el-dialog :title="unionName+'未选择用户'" :visible.sync="visible" width="70%">
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<div>
<el-input
v-model="pageForm.searchKeyword"
placeholder="请输入姓名或工号"
style="width: 200px;"
size="small"
clearable
@keyup.enter.native="doSearch"
>
<el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
</el-input>
</div>
<div>
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
</div>
</div>
<el-table
:data="tableData"
row-key="id"
style="width: 100%"
>
<el-table-column label="序号" type="index" :index="indexMethod" width="50"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in tableColumns"
></el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-dialog>
`,
mixins: [initTableMixins],
data() {
return {
visible: false,
projectId: null,
unionId: null,
unionName: null,
tableColumns: [
{ label: "工号", prop: "loginName" },
{ label: "姓名", prop: "userName" },
{ label: "生日", prop: "birthday" },
{ prop: "userState", label: "在职状态", width: 120, sortable: true },
{ prop: "personType", label: "人员类型", width: 120, sortable: true },
{ prop: "postDoctoralJoinDate", label: "进站时间", sortable: true },
{ label: "单位", prop: "welfareUnitName" }
]
}
},
methods: {
onOpen(projectId, { id, name }) {
this.visible = true
this.projectId = projectId
this.unionId = id
this.unionName = name
this.pageData()
},
pageData() {
this.$axios
.post("/platform/welfare/statistics/unSelectedUnionUserPageData", {
...this.pageForm,
projectId: this.projectId,
unionId: this.unionId
})
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
handleExport() {
this.$downLoad("/platform/welfare/statistics/exportUnSelectedUnionUser", {
projectId: this.projectId,
unionId: this.unionId
})
}
}
}