Files
UNION_NJUST/target/classes/views/platform/member/change/Manage.html
T
2026-09-23 09:38:39 +08:00

689 lines
33 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</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-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="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.union" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :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.unit" style="width: 100%" filterable clearable
placeholder="请选择">
<el-option
v-for="item in units"
: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>
<div class="search-item">
<div class="search-item-label">更新日期:</div>
<div class="search-item-option">
<!-- <el-date-picker-->
<!-- style="width: 100%"-->
<!-- v-model="pageForm.changeDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="更新日期">-->
<!-- </el-date-picker>-->
<el-date-picker
style="width: 100%"
v-model="pageForm.changeDateRange"
@change="changeDateRangeChange"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
align="right">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">异动类型:</div>
<div class="search-item-option">
<enum-select v-model="pageForm.changeType" value="code" label="description"
style="width: 100%"
clearable placeholder="异动类型" enum="UserChangeType"></enum-select>
</div>
</div>
<!--<div class="search-item">
<div class="search-item-label">是否异动:</div>
<div class="search-item-option">
<el-radio-group v-model="pageForm.changed" @change="doSearch">
<el-radio-button :label="true">是</el-radio-button>
<el-radio-button :label="false">否</el-radio-button>
</el-radio-group>
</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 #label_end>
<span class="text-danger">(温馨提醒:异动类型为新增的教职工,需要新入职变更操作后才能成为工会会员!)</span>
</template>
<template #func>
<span class="text-danger">人员信息是否异动:</span>
<el-radio-group v-model="pageForm.changed" @change="doSearch" class="mr5 mt5" size="small">
<el-radio-button :label="true">是</el-radio-button>
<el-radio-button :label="false">否</el-radio-button>
</el-radio-group>
<!-- <el-popconfirm-->
<!-- v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"-->
<!-- title="确定要将所有会员设为福利会员吗?"-->
<!-- @confirm="allIsWelfareMember"-->
<!-- >-->
<!-- <el-button slot="reference"-->
<!-- type="primary" :loading="welfareMemberLoading" size="small">全部设置为福利会员-->
<!-- </el-button>-->
<!-- </el-popconfirm>-->
<el-button :disabled="!checkUsers.length" type="primary" size="small" icon="el-icon-edit"
@click="openBatchEdit" class="ml5">
设置校区
</el-button>
<el-button :disabled="!checkUsers.length" type="primary" size="small" icon="el-icon-edit"
@click="openUnitMove" class="ml5">
单位调整
</el-button>
</template>
</table-tool>
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" :size="tableSize" 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==='unitname'" scope="{row}">
{{isDisPlayCode?'('+row.unitcode+')':null}}{{row.unitname}}
</template>
<template v-else-if="column.prop==='unionname'" scope="{row}">
{{isDisPlayCode?'('+row.unioncode+')':null}}{{row.unionname}}
</template>
</el-table-column>
<el-table-column label="异动信息" header-align="center">
<el-table-column label="更新时间" prop="changeTime" min-width="145px" header-align="center" sortable
align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column label="异动类型" prop="changeType" header-align="center"
align="center" show-overflow-tooltip sortable>
<template scope="{row}">
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="会员" header-align="center" align="center" prop="member"
show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.member==1" class="text-success ">
<i class="fa fa-circle ml5"></i> 是
</span>
<span v-else class="text-danger">
<i class="fa fa-circle ml5"></i> 否
</span>
</template>
</el-table-column>
<el-table-column label="变更状态" header-align="center" align="center" prop="welfareMember"
show-overflow-tooltip sortable>
<template scope="{row}">
<vi-table-state v-if="row.stateId" :state="row"></vi-table-state>
<vi-table-state v-else :state="{stateColor:'#1890ff',stateName:'暂无'}"></vi-table-state>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="100px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<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
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
:disabled="!(row.apply||row.reApply)"
:command="{type:'change',data:row}">
变更
</el-dropdown-item>
<el-dropdown-item v-show="row.changeType===2"
:command="{type:'sendSms',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>
<mem-change-apply ref="apply" :userid="userId" @submit="doSubmit" :welfare_member="true"></mem-change-apply>
</template>
<template #view>
<el-tabs v-model="active">
<el-tab-pane label="个人信息" name="info">
<member ref="memberInfo" :id="userId" view></member>
</el-tab-pane>
<el-tab-pane label="变更记录" name="changInfo">
<mem-change-records :userid="userId"></mem-change-records>
</el-tab-pane>
</el-tabs>
</template>
</guava>
<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="unitMoveVisibile"
:before-close="handleClose" size="1000px">
<el-row class="text-primary p20">
选择新单位
</el-row>
<el-row type="flex" :gutter="20" class="pl20 pr20">
<el-col :span="12">
<el-select placeholder="所属工会" v-model="unitMoveFormData.unionId" style="width: 100%;"
clearable="true"
@change="moveUnionsChange"
filterable="true">
<el-option v-for="item in unitMoveUnions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.unitId" style="width: 100%" filterable clearable
@change="moveUnitChange"
placeholder="请选择单位">
<el-option
v-for="item in unitMoveUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
<el-row class="mt10">
<el-table :data="checkUsers" style="width: 100%;padding: 20px" class="vi-table"
border
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="loginname"
width="120"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="username"
width="120"
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"
label="新单位">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新部门工会">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unionName}}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="unitMoveVisibile = false">取 消</el-button>
<el-button type="primary" @click="doUnitMove">确定</el-button>
</span>
</el-drawer>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
checkUsers: [],
batchEditVisible: false,
batchEditLoading: false,
batchFormData: {},
unitMoveVisibile: false,
unitMoveUnions: [],
unitMoveUnits: [],
unitMoveFormData: {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
},
active: 'info',
submitLoading: false,
formRules: {},
info: {},
userId: '',
formData: {},
pageForm: {
searchName: "u.username",
changed: true,
},
unions: [],
units: [],
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
{prop: 'sex', label: '性别', sortable: true, width: '100px'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unitname', label: '所在单位', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
// {prop: 'campusName', label: '所属校区', sortable: true},
],
campusOptions: [],
changeType: {},
sexOptions: ['男', '女'],
welfareMemberLoading: false,
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'),
'mem-change-apply': httpVueLoader('/components/member/MemChangeApply.vue?v=1.0.2'),
'enum-select': httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0'),
},
methods: {
openUnitMove() {
this.unitMoveVisibile = true
this.unitMoveFormData = {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
}
},
async moveUnionsChange(val) {
console.log(val)
if (val) {
this.unitMoveUnits = await getUnits(val)
this.$set(this.unitMoveFormData, 'unionName', this.unitMoveUnions.find(v => v.id === val).unionname)
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
} else {
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
this.$set(this.unitMoveFormData, 'unionName', '')
this.unitMoveUnits = []
}
},
moveUnitChange(val) {
if (val) {
this.$set(this.unitMoveFormData, 'unitName', this.unitMoveUnits.find(v => v.id === val).name)
} else {
this.$set(this.unitMoveFormData, 'unitName', '')
}
},
async doUnitMove() {
if (this.unitMoveFormData.unitId === '') {
this.notifyWarning('请选择新单位!')
return
}
const params = {
unitId: this.unitMoveFormData.unitId,
userId: this.checkUsers.map(v => v.id)
}
const resp = await $.post(loc() + '/userUnitMove', params)
requestLaterMsgFun(this, resp, async () => {
this.pageData()
this.$refs.table.clearSelection();
this.unitMoveVisibile = false
}, null, () => {
this.unitMoveVisibile = false
})
},
changeDateRangeChange(val) {
if (!val) {
this.pageForm.changeDateBefore = null
this.pageForm.changeDateEnd = null
return
}
this.pageForm.changeDateBefore = val[0]
this.pageForm.changeDateEnd = val[1]
},
async doBatchEdit() {
const batch = this.checkUsers.map(v => {
return {id: v.id, campusId: v.campusId}
})
this.batchEditLoading = true
const resp = await $.post("/platform/welfare/member/mange/batchEdit", {users: JSON.stringify(batch)});
requestLaterMsgFun(this, resp, async () => {
this.pageData()
this.$refs.table.clearSelection();
this.batchEditVisible = false
}, null, () => {
this.batchEditLoading = false
})
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
openBatchEdit() {
this.batchFormData = {}
this.batchEditVisible = true
},
tableHandleSelectionChange(val) {
this.checkUsers = val;
},
async sendSms(userid) {
const resp = await $.post(loc() + '/sendSms', {userid})
AssertResponse({
response: resp,
success: () => {
this.$notify({
title: '成功',
message: '发送成功!',
type: 'success'
});
}
})
},
async allIsWelfareMember() {
this.welfareMemberLoading = true
const resp = await $.post(loc() + "/allIsWelfareMember")
requestLaterMsgFun(this, resp, null, null, () => {
this.welfareMemberLoading = false
})
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data.id)
} else if (type === 'change') {
this.openChange(data.id)
} else if (type === 'sendSms') {
this.sendSms(data.id)
}
},
openChange(userId) {
this.userId = userId
this.$refs.guava.edit()
},
async doSubmit(formData) {
const resp = await $.post(loc() + "/change", formData)
requestLaterMsgFun(this, resp, (data) => {
this.userId = ""
this.$refs.guava.index()
this.pageData()
}, () => {
}, () => {
this.$refs.apply.closeLoading()
})
},
openView(userId) {
this.userId = userId
this.$refs.guava.view()
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.union)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async getChangeType() {
const changeType = {}
const changeTypeOptions = await getEnumOptions("UserChangeType")
changeTypeOptions.forEach(v => {
changeType[v.code] = v.description
})
return changeType
},
},
async created() {
this.pageData();
this.unions = await getUnions()
this.unitMoveUnions = await getUnions(null)
await this.flushUnits()
this.campusOptions = await getCampus()
this.changeType = await this.getChangeType()
}
})
</script>
<!--#
}
#-->