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,755 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 5%">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch" style="width: 100%">
<el-select v-model="pageForm.searchName" slot="prepend"
style="width: 80px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">{{welfare.welfareUnitModeName}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.welfareUnit" style="width: 100%" filterable
clearable
placeholder="请选择" @change="changeWelfareUnit">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">组成单位:</div>
<div class="search-item-option">
<el-select v-model="pageForm.unit" style="width: 100%" filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in units"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工会小组:</div>
<div class="search-item-option">
<el-select v-model="pageForm.unionGroupId" style="width: 100%"
filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in unionGroups"
:key="item.id"
:label="item.groupName"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">组成科室:</div>
<div class="search-item-option">
<el-select v-model="pageForm.threeUnitId" style="width: 100%" filterable
clearable
placeholder="请选择">
<el-option
v-for="item in threeUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">所属校区:</div>
<div class="search-item-option">
<el-select v-model="pageForm.campus" style="width: 100%" clearable
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;别:</div>
<div class="search-item-option">
<el-select v-model="pageForm.sex" style="width: 100%" clearable
placeholder="请选择">
<el-option v-for="sex in sexOptions" :label="sex"
:value="sex"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" style="width: 100%"
clearable
placeholder="人员类型"
code="UserType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.userState" style="width: 100%"
clearable
placeholder="在职状态"
code="userState"></dict-select>
</div>
</div>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="福利会员" :app="this">
<template #func>
<el-dropdown style="margin: 0 10px" @command="pushDropdownCommand">
<el-button type="primary" size="small" icon="el-icon-plus">
添加
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'select'}">选择加入</el-dropdown-item>
<el-dropdown-item :command="{type:'add'}">新增用户</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button v-show="checkUsers.length" type="primary" size="small"
icon="el-icon-edit"
@click="openBatchEdit">
设置校区
</el-button>
<el-button v-show="checkUsers.length" type="danger" size="small"
icon="el-icon-delete"
@click="kickWelfareMembers">
移除
</el-button>
<el-button type="primary" size="small" icon="el-icon-document-add"
v-if="welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
@click="openImport">导入名单
</el-button>
<el-button type="primary" size="small" icon="el-icon-download"
@click="doExportList">导出列表
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder" :size="tableSize"
v-loading="tableLoading" ref="table" class="vi-table"
@selection-change="tableHandleSelectionChange">
<el-table-column type="selection" :reserve-selection="true"></el-table-column>
<el-table-column align="center" header-align="center" type="index"
:index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop=='loginname'" scope="{row}">
<el-link type="primary" @click="openView(row.id)">{{row.loginname}}
</el-link>
</template>
<template v-else-if="column.prop=='unionname'" scope="{row}">
( {{row.unioncode}}){{row.unionname}}
</template>
<template v-else-if="column.prop=='unitname'" scope="{row}">
( {{row.unitcode}}){{row.unitname}}
</template>
<template v-else-if="column.prop=='welfareUnitName'" scope="{row}">
<span v-if="!row.editWelfareUnit">{{row.welfareUnitName}}</span>
<div v-else>
<el-select v-model="row.modifiedWelfareUnitId" style="width: 160px"
clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</el-option>
</el-select>
</div>
</template>
<template v-else-if="column.prop=='campusName'" scope="{row}">
<span v-if="!row.editCampus">{{row.campusName}}</span>
<div v-else>
<el-select v-model="row.modifiedCampusId" style="width: 160px"
clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center"
label="操作"
width="180px" fixed="right">
<template scope="{row}">
<div v-if="row.editCampus">
<el-button size="mini" :loading="row.editCampusLoading"
type="primary"
@click="doEditCampus(row)">确定
</el-button>
<el-button size="mini" :disabled="row.editCampusLoading"
@click="row.editCampus=!row.editCampus">取消
</el-button>
</div>
<el-dropdown @command="dropdownCommand" v-else>
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<!-- <el-dropdown-item :command="{type:'editCampus',data:row}">
修改校区
</el-dropdown-item>-->
<el-dropdown-item :command="{type:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
移除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" @click="$refs.member.save()">提交</el-button>
</template>
<template #edit>
<member ref="member" :id="userId" @save="afterEdit"></member>
</template>
<template #view>
<member ref="memberInfo" :id="userId" view></member>
</template>
</guava>
<el-dialog
title="福利名单导入"
:visible.sync="importVisible"
:close-on-click-modal="false"
width="50%"
>
<el-timeline>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-button size="medium" type=""
@click="location.href='/platform/basics/downloadTemplate?filePath=welfare/WelfareMemberImportTemplate.xls&fileName=模板.xls'"
icon="el-icon-download">下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-form>
<!-- <el-form-item label="年&emsp;&emsp;度">
<el-date-picker
:clearable="false"
v-model="importData.year"
type="year"
size="medium"
style="width: 200px"
value-format="yyyy"
placeholder="年度">
</el-date-picker>
</el-form-item>-->
<el-form-item label="是否覆盖现有的福利会员">
<el-radio-group v-model="importData.isfg">
<el-radio-button label="true"></el-radio-button>
<el-radio-button label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
}"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload"
style="width: 200px">选择文件
</el-button>
<div class="el-upload__tip" slot="tip" style="color: #F56C6C">
只能上传 xls/xlsx 文件
</div>
</el-upload>
</el-form>
</el-card>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
</span>
</el-dialog>
<el-drawer
title="设置校区"
:visible.sync="batchEditVisible"
:before-close="handleClose" size="1000px">
<el-timeline style="margin-right: 40px">
<el-timeline-item timestamp="" placement="top">
<el-form ref="batchForm" :model="batchFormData" label-width="100px">
<el-row :gutter="60">
<el-col :span="12">
<el-form-item label="所属校区">
<el-select v-model="batchFormData.campus" style="width: 300px"
clearable
size="medium"
placeholder="请选择"
@change="checkUsers.map(v=>$set(v,'campusId',batchFormData.campus))">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-timeline-item>
<el-timeline-item timestamp="" placement="top">
<el-table :data="checkUsers" style="width: 100%" row-key="id" class="vi-table"
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="loginname"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="username"
label="姓名"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="unitname"
label="所属单位"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="unionname"
label="所属工会"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="campusId"
label="所属校区" width="300px">
<template scope="{row}">
<el-select v-model="row.campusId" style="width: 200px" clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</el-timeline-item>
</el-timeline>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="batchEditVisible = false"
:disabled="batchEditLoading">取 消</el-button>
<el-button type="primary" @click="doBatchEdit"
:loading="batchEditLoading">确定</el-button>
</span>
</el-drawer>
<el-drawer
title="添加福利会员"
:visible.sync="selectUserVisible"
:before-close="handleClose" size="1200px">
<user-select v-model="selectUsers" ref="userSelect" :page_size="10"
:sql_cnd="['(u.welfareMember is null or u.welfareMember = 0)']"></user-select>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="selectUserVisible = false"
:disabled="selectUserLoading">取 消</el-button>
<el-button type="primary" @click="doBatchJoinMember"
:loading="selectUserLoading">确定</el-button>
</span>
</el-drawer>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
selectUserLoading: false,
selectUserVisible: false,
selectUsers: [],
checkUsers: [],
batchEditVisible: false,
batchEditLoading: false,
batchFormData: {},
importVisible: false,
importData: {
fileList: [],
year: 0,
isfg: true
},
importLoading: false,
campusOptions: [],
pageForm: {
searchName: 'username',
},
tableColumns: [{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别', sortable: true, width: '100px'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true}
],
welfareUnits: [],
welfareImportUnitList: [],
units: [],
threeUnits: [],
unionGroups: [],
userId: '',
unitId: '',
judgmentAuthority,
welfare,
welfareUnitMode,
sexOptions
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'user-select': httpVueLoader('/components/plugins/UserTableSelect.vue?v=1.0.0'),
},
methods: {
async doBatchJoinMember() {
if (!this.selectUsers.length) {
this.notifyWarning("请先勾选需要设置为福利会员的用户")
return
}
this.selectUserLoading = true
const resp = await $.post(welfareCommonUrl + "/joinWelfareMember", {userIds: JSON.stringify(this.selectUsers)});
this.selectUserLoading = false
if(resp.code===0){
this.pageData()
this.$refs.userSelect.init()
this.selectUserVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
doExportList() {
window.open(loc() + "/exportList?" + $.param(this.pageForm))
},
pushDropdownCommand({type}) {
if (type == 'select') {
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.init()
})
} else if (type == 'add') {
this.openEdit('')
}
},
kickWelfareMembers() {
this.$confirm('确定要移除福利会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(welfareCommonUrl + "/kickWelfareMember", {
userIds: JSON.stringify(this.checkUsers.map(v => v.id))
});
if(resp.code===0){
this.$refs.table.clearSelection();
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
})
},
async doBatchEdit() {
const batch = this.checkUsers.map(v => {
return {id: v.id, campusId: v.campusId}
})
this.batchEditLoading = true
const resp = await $.post(loc() + "/batchEdit", {users: JSON.stringify(batch)});
this.batchEditLoading = false
if(resp.code===0){
this.pageData()
this.$refs.table.clearSelection();
this.batchEditVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
openBatchEdit() {
this.batchFormData = {}
this.batchEditVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
tableHandleSelectionChange(val) {
this.checkUsers = val;
},
async doEditCampus(row) {
const {id, modifiedCampusId} = row
this.$set(row, "editCampusLoading", true)
const resp = await $.post(loc() + "/batchEdit", {
users: JSON.stringify([{
id: id,
campusId: modifiedCampusId,
}])
});
this.$set(row, "editCampusLoading", false)
if(resp.code===0){
this.$set(row, "editCampus", false)
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
},
doImport() {
if (this.importData.fileList.length === 0) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
data.append("isfg", this.importData.isfg)
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
this.importLoading = true
$.ajax({
url: loc() + "/importMember",
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
this.importLoading = false
if(data.code===0){
this.pageData();
this.importVisible = false
}else{
this.notifyWarning(data.msg)
}
},
error: (data) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
});
},
openImport() {
this.importData = {
fileList: [],
year: moment().format('YYYY'),
isfg: true
}
this.importVisible = true;
},
doDelete(userId) {
this.$confirm('确定要移除福利会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(welfareCommonUrl + "/kickWelfareMember", {userIds: JSON.stringify([userId])});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data.id)
} else if (type == 'edit') {
this.openEdit(data.id)
} else if (type == 'delete') {
this.doDelete(data.id)
} else if (type == 'editCampus') {
this.$set(data, 'modifiedCampusId', data.campusId)
this.$set(data, 'editCampus', true)
}
},
async joinWelfareMember(memData) {
await $.post(welfareCommonUrl + "/joinWelfareMember", {userIds: JSON.stringify([memData.id])})
},
async afterEdit(memData) {
if (!this.userId) {
await this.joinWelfareMember(memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
openEdit(userId) {
this.userId = userId
this.$refs.guava.edit()
if (!userId) {
this.$refs.member.getUserInfo()
}
},
openView(userId) {
this.active = 'info'
this.userId = userId
this.$refs.guava.view()
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unit', '')
this.units = await getComponentUnit(this.pageForm.welfareUnit)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.welfareUnit)
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", null)
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unit, this.pageForm.unionGroupId)
}
},
async created() {
this.welfareImportUnitList = await getDictOptions("welfareImportUnit")
this.unitId = "${@shiro.getPrincipalProperty('unit').getId()}"
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
this.campusOptions = await getCampus()
this.changeWelfareUnit()
this.pageData();
}
})
</script>
<!--#
}
#-->