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

934 lines
45 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.unionId"
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.unitId" 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>
<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 ml10">提醒:小组长可以查看本小组之外的人员</span>
<!-- <span class="text-danger">(温馨提醒:异动类型为新增的教职工,需要新入职变更操作后才能成为工会会员!)</span>-->
</template>
<template #func>
<span class="text-danger">人员信息有无变化:</span>
<el-select v-model="pageForm.isMember" @change="doSearch()"
:clearable="false" size="small"
style="width: 200px;margin-right: 5px">
<el-option label="全部会员" value=""></el-option>
<el-option label="是会员" value="1"></el-option>
<el-option label="不是会员" value="0"></el-option>
</el-select>
<el-radio-group v-model="pageForm.changed" @change="doSearch" class="mr5"
size="small">
<el-radio-button label="">全部({{numData.userSumNum || 0}})
</el-radio-button>
<el-radio-button :label="1">有变化({{numData.changeNum || 0}})
</el-radio-button>
<el-radio-button :label="0">无变化({{numData.notChangeNum || 0}})
</el-radio-button>
</el-radio-group>
<!-- <span class="text-danger">是否会员:</span>
<el-radio-group v-model="pageForm.isMember" @change="doSearch" class="mr5"
size="small">
<el-radio-button label="">全部({{numData.userSumNum || 0}})
</el-radio-button>
<el-radio-button label="1">是({{numData.memberNum || 0}})
</el-radio-button>
<el-radio-button label="0">否({{numData.notMemberNum || 0}})
</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-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" 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')||@shiro.hasRole('ghxzzz')}"
: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>
<template #public>
<member ref="member" :id="userId" @save="afterEdit"></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="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.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-col :span="12">
<el-select v-model="unitMoveFormData.threeUnitId" clearable filterable
placeholder="请选择新科室"
style="width: 100%" @change="threeUnitChange">
<el-option
v-for="item in threeUnits"
: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">
<member-user-select v-model="selectUsers" ref="userSelect" :page_size="10"
:sql_cnd="['(u.member is null or u.member = 0) and (c.taskId is null OR c.stateId=70)']"></member-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>
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: '',
isMember: '1'
},
unions: [],
units: [],
unionGroups:[],
threeUnits:[],
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: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true},
// {prop: 'campusName', label: '所属校区', sortable: true},
],
campusOptions: [],
changeType: {},
sexOptions: ['男', '女'],
welfareMemberLoading: false,
numData: {
changeNum: 0,
notChangeNum: 0,
userSumNum: 0,
memberNum: 0,
notMemberNum: 0,
},
threeUnits: [],
selectUserVisible: false,
selectUsers: [],
selectUserLoading: 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'),
'member-user-select': httpVueLoader('/components/plugins/MemberUserTableSelect.vue?v=1.0.0'),
},
methods: {
async afterEdit(memData) {
if (!this.userId) {
await $.post(" /platform/member/info/make/joinMemberFamily", memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
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)
}
},
pushDropdownCommand({type}) {
if (type == 'select') {
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.init()
})
} else if (type == 'add') {
this.userId = ""
this.$refs.guava.public()
if (!this.userId) {
this.$refs.member.id = null
this.$refs.member.getUserInfo()
}
}
},
async threeUnitChange(val) {
if (val) {
const threeUnit = this.threeUnits.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 getThreeUnits(val) {
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unitId, this.pageForm.unionGroupId)
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
this.getNumData()
},
openUnitMove() {
this.unitMoveVisibile = true
this.unitMoveFormData = {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
}
},
async moveUnionsChange(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 = []
}
},
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.threeUnits = await threeUnitsByUnionGroupOrUnitId(val, null)
}
},
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(loc() + '/userUnitMove', params)
if (resp.code === 0) {
this.pageData()
this.getNumData()
this.$refs.table.clearSelection();
this.unitMoveVisibile = false
} else {
this.notifyWarning(resp.msg)
}
},
changeDateRangeChange(val) {
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)});
this.batchEditLoading = false
if (resp.code === 0) {
this.pageData()
this.getNumData()
this.$refs.table.clearSelection();
this.batchEditVisible = false
} else {
this.notifyWarning(resp.msg)
}
},
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})
if (resp.code === 0) {
this.$notify({title: '成功', message: '发送成功!', type: 'success'});
}
},
async allIsWelfareMember() {
this.welfareMemberLoading = true
const resp = await $.post(loc() + "/allIsWelfareMember")
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)
this.$refs.apply.closeLoading()
if (resp.code === 0) {
this.userId = ""
this.$refs.guava.index()
this.pageData()
this.getNumData()
} else {
this.notifyWarning(resp.msg)
}
},
openView(userId) {
this.userId = userId
this.$refs.guava.view()
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.$set(this.pageForm, "unionGroupId", null)
this.$set(this.pageForm, "threeUnitId", null)
this.units = []
this.unionGroups = []
this.threeUnits = []
if (this.pageForm.unionId) {
this.units = await getUnits(this.pageForm.unionId)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
}
},
async getChangeType() {
const changeType = {}
const changeTypeOptions = await getEnumOptions("UserChangeType")
changeTypeOptions.forEach(v => {
changeType[v.code] = v.description
})
return changeType
},
async getNumData() {
const resp = await $.post(loc() + '/getButtonNum', this.pageForm)
if (resp.code === 0) {
this.numData = resp.data
} else {
this.notifyWarning(resp.msg)
}
}
},
async created() {
this.pageData();
this.getNumData()
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.unions = await getUnions(null, false)
} else {
this.unions = await getUnions(null, true)
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
this.flushUnits()
}
this.unitMoveUnions = clone(this.unions)
this.campusOptions = await getCampus()
this.changeType = await this.getChangeType()
}
})
</script>
<!--#
}
#-->