Files
UNION_HUTB/target/classes/views/platform/welfare/member/Adjustment.html
T
2026-09-09 09:14:28 +08:00

982 lines
46 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>
/* .el-table .auditing-row {
background: oldlace;
}
.el-table .audit-error-row {
background: #fa465926;
}*/
</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();getChangeData()"
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="judgmentAuthority">
<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>
<!-- <div class="search-item" style="width: 22%;">
<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>-->
<template v-if="searchMore">
<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>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">人员组成:</div>
<div class="search-item-option">
<el-select v-model="pageForm.member" style="width: 100%" clearable
placeholder="请选择">
<el-option v-for="member in memberOptions" :label="member.name"
:value="member.id"></el-option>
</el-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.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>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search"
@click="doSearch();getChangeData()">搜索
</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 ml10"
style="font-size: 13px">提醒:小组长可以查看本小组之外的人员</span>
</template>
<template #func>
<span class="text-danger" style="font-size: 13px">人员信息有无变化:</span>
<el-select v-model="pageForm.welfareMember"
@change="doSearch();getChangeData()"
:clearable="false" size="small"
style="width: 150px;margin-right: 15px">
<el-option label="全部教职工范围内" :value="0"></el-option>
<el-option label="可发放福利老师" :value="1"></el-option>
<el-option label="不发放福利老师" :value="2"></el-option>
</el-select>
<el-radio-group v-model="pageForm.changed"
@change="doSearch();getChangeData()" class="mr5"
size="small">
<el-radio-button :label="0">全部({{numberData.all}}</el-radio-button>
<el-radio-button :label="1">有变化({{numberData.have}}</el-radio-button>
<el-radio-button :label="2">无变化({{numberData.no}}</el-radio-button>
</el-radio-group>
<!--
<enum-select v-if="pageForm.changed==1" v-model="pageForm.changeType"
size="small" value="code"
label="description"
style="width:150px"
clearable placeholder="异动类型" enum="UserChangeType"
@change="doSearch();getChangeData()"></enum-select>
-->
<!-- <el-button size="small" @click="openEdit('')" type="primary" class="mt5"
icon="el-icon-plus">
添加
</el-button>-->
<template
v-if="welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority">
<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 :disabled="!checkUsers.length" type="primary" size="small"
icon="el-icon-edit"
@click="openBatchEdit">
设置校区
</el-button>
<el-button :disabled="!checkUsers.length" type="primary" size="small"
icon="el-icon-edit"
@click="openUnitMove" class="ml5 ">
单位调整
</el-button>
</template>
</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"
:row-class-name="tableRowClassName"
lazy
:load="load"
:tree-props="{hasChildren: 'hasHis'}"
@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)">{{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>
</el-table-column>
<el-table-column label="异动信息" header-align="center">
<el-table-column label="更新时间" prop="changeTime" min-width="100px"
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="welfareMember"
show-overflow-tooltip sortable>
<template scope="{row}">
<div v-if="row.flag">
<span v-if="row.welfareMember==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>
</div>
</template>
</el-table-column>
<el-table-column label="变更状态" header-align="center" align="center"
prop="welfareMember"
show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.stateId">
<vi-table-state :state="row"></vi-table-state>
</span>
<span v-else-if="row.mcrStateId"
:style="'color:'+row.mcrStateColor">{{ row.mcrStateName }}</span>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center"
label="操作" fixed="right">
<template scope="{row}">
<el-dropdown @command="dropdownCommand" v-if="row.flag">
<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
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
:disabled="row.welfareMember==1"
:command="{type:'apply',data:row}">
设为福利会员
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<el-dropdown-item
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
:disabled="row.welfareMember!=1||row.changeUnitAuditing"
:command="{type:'change',data:row}">
变更
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:row}"
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority">
编辑
</el-dropdown-item>
<el-dropdown-item v-if="row.welfareMember"
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
: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" :source="source" view></member>
</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="changeVisible"
:before-close="handleClose" size="1000px">
<div style="padding: 0 20px">
<mem-change-apply ref="apply" :userid="userId" @submit="doSubmit"></mem-change-apply>
</div>
</el-drawer>
<el-drawer
title="单位调整"
:visible.sync="unitMoveVisibile"
:before-close="handleClose" size="70%">
<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.welfareUnitName"
:value="item.welfareUnitId"></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-col :span="12">
<el-select v-model="unitMoveFormData.threeUnitId" clearable filterable
placeholder="请选择新科室"
style="width: 100%" @change="threeUnitChange">
<el-option
v-for="item in threeUnits2"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-input :value="unitMoveFormData.unionGroupName" disabled
placeholder="新工会小组"></el-input>
</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="threeUnitName"
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.threeUnitName}}</span>
</template>
</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>
<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) and c.taskId is null']"></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 {
unitId:'',
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]);
}
}]
},
changeVisible: false,
welfareImportUnitList: [],
judgmentAuthority,
campusOptions: [],
batchEditLoading: false,
batchEditVisible: false,
checkUsers: [],
batchFormData: {},
changeType: {},
pageForm: {
searchName: 'u.username',
welfareMember: 1,
member: 1,
changed: 0,
},
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: [],
units: [],
threeUnits: [],
unionGroups: [],
userId: '',
source: 'sys_user',
welfare,
welfareUnitMode,
sexOptions,
memberOptions: [{id: 1, name: '全部教职工'}, {id: 2, name: '工会会员'}, {
id: 3,
name: '非工会会员'
}],
numberData: {},
unitMoveVisibile: false,
threeUnits2: [],
unitMoveUnions: [],
unitMoveUnits: [],
unitMoveFormData: {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
},
selectUserVisible: false,
selectUsers: [],
selectUserLoading: false,
}
},
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.4'),
'user-select': httpVueLoader('/components/plugins/UserTableSelect.vue?v=1.0.0'),
'enum-select': httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0'),
'mem-change-apply': httpVueLoader('/components/member/MemChangeApply.vue?v=1.0.1'),
},
methods: {
pushDropdownCommand({type}) {
if (type == 'select') {
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.init()
})
} else if (type == 'add') {
this.openEdit('')
}
},
async doBatchJoinMember() {
if (!this.selectUsers.length) {
this.notifyWarning("请先勾选需要设置为福利会员的用户")
return
}
this.selectUserLoading = true
const resp = await $.post(loc() + "/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)
}
},
async doUnitMove() {
if (this.unitMoveFormData.unitId === '') {
this.notifyWarning('请选择新单位!')
return
}
if (this.unitMoveFormData.threeUnitId === '') {
this.notifyWarning('请选择新科室!')
return
}
const params = {
unitId: this.unitMoveFormData.unitId,
threeUnitId: this.unitMoveFormData.threeUnitId,
userId: this.checkUsers.map(v => v.id)
}
const resp = await $.post('/platform/member/change/mange/userUnitMove', params)
if(resp.code===0){
this.pageData()
this.$refs.table.clearSelection();
this.unitMoveVisibile = false
}else{
this.notifyWarning(resp.msg)
}
},
async threeUnitChange(val) {
if (val) {
const threeUnit = this.threeUnits2.find(v => v.id === val)
const groupName = threeUnit.groupname
this.$set(this.unitMoveFormData, 'threeUnitName', threeUnit.name)
this.$set(this.unitMoveFormData, 'unionGroupName', groupName)
} else {
this.$set(this.unitMoveFormData, 'unionGroupName', null)
}
},
async moveUnitChange(val) {
if (val) {
this.$set(this.unitMoveFormData, 'unitName', this.unitMoveUnits.find(v => v.id === val).name)
} else {
this.$set(this.unitMoveFormData, 'unitName', '')
}
if (val) {
this.threeUnits2 = await threeUnitsByUnionGroupOrUnitId(val, null)
}
},
async moveUnionsChange(val) {
if (val) {
this.unitMoveUnits = await getUnits(val)
this.$set(this.unitMoveFormData, 'unionName', this.unitMoveUnions.find(v => v.welfareUnitId === val).welfareUnitName)
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 = []
}
},
openUnitMove() {
this.unitMoveVisibile = true
this.unitMoveFormData = {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
}
},
async getChangeData() {
const {data} = await $.post(loc() + "/getChangeNumber", this.pageForm)
this.numberData = data
},
changeDateRangeChange(val) {
this.pageForm.changeDateBefore = val[0]
this.pageForm.changeDateEnd = val[1]
},
tableRowClassName({row: {changeUnitAuditing, changeUnitError}, rowIndex}) {
if (changeUnitAuditing) {
return 'auditing-row';
} else if (changeUnitError) {
return 'audit-error-row';
}
return '';
},
async doSubmit(formData) {
const resp = await $.post(loc() + "/change", formData)
this.$refs.apply.closeLoading()
if(resp.code===0){
this.userId = ""
this.$refs.guava.index()
this.changeVisible = false
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
},
openChange({id}) {
this.userId = id
this.changeVisible = true
},
openBatchEdit() {
this.batchFormData = {}
this.batchEditVisible = true
},
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)});
this.batchEditLoading = false
if(resp.code===0){
this.pageData()
this.$refs.table.clearSelection();
this.batchEditVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
tableHandleSelectionChange(val) {
this.checkUsers = val;
},
apply({id, username}) {
this.$confirm('确定将' + username + '设为福利会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(loc() + "/joinWelfareMember", {userIds: JSON.stringify([id])});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
async joinWelfareMember(memData) {
await $.post(loc() + "/joinWelfareMember", {userIds: JSON.stringify([memData.id])})
},
async afterEdit(memData) {
if (!this.userId) {
await this.joinWelfareMember(memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
async load(tree, treeNode, resolve) {
const {loginname} = tree
const resp = await $.get(loc() + "/historyUsers", {loginname})
if(resp.code===0){
resolve(data)
}else{
resolve([])
}
},
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)
} else if (type == 'edit') {
this.openEdit(data.id)
} else if (type == 'delete') {
this.doDelete(data.id)
} else if (type == 'apply') {
this.apply(data)
} else if (type == 'change') {
this.openChange(data)
}
},
openEdit(userId) {
this.userId = userId
this.$refs.guava.edit()
if (!userId) {
this.$refs.member.getUserInfo()
}
},
openView({id, flag}) {
this.userId = id
this.source = flag ? 'sys_user' : 'user_history'
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 getChangeType() {
const changeType = {}
const changeTypeOptions = await getEnumOptions("UserChangeType")
changeTypeOptions.forEach(v => {
changeType[v.code] = v.description
})
return changeType
},
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()}"
await this.getChangeData()
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
this.changeWelfareUnit()
this.unitMoveUnions = clone(this.welfareUnits)
this.campusOptions = await getCampus()
this.changeType = await this.getChangeType()
this.pageData();
}
})
</script>
<!--#
}
#-->