Files
2026-09-08 19:49:21 +08:00

1480 lines
73 KiB
HTML
Raw Permalink 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-tag {
border-radius: 50%;
height: 22px;
}
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-input
placeholder="输入关键字进行查找"
v-model="filterText" clearable>
</el-input>
</div>
<el-tree :data="data" ref="tree" :expand-on-click-node="false" class="v-tree"
:props="defaultProps"
default-expand-all
@node-click="handleNodeClick" :filter-node-method="filterNode"
highlight-current style="padding: 10px 0">
<div class="custom-tree-node" style="display: inline-block;"
slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node"><i
class="el-icon-office-building"></i>&nbsp;
{{ data.unionname }}
</div>
<div v-if="node.level==2"
style="font-size: 15px" :title="data.unionname" class="v-node">
<i class="el-icon-school"></i>
&nbsp; {{ data.unionname }}
</div>
</div>
</el-tree>
</template>
<template>
<div v-show="node.level==1&&sysadmin" style="padding: 5px 10px">
<el-tabs v-model="indexActive" type="card" style="box-shadow: none">
<el-tab-pane :name="0">
<span slot="label"><i class="el-icon-school"></i> 院级工会信息</span>
<el-card shadow="never" style="width: 100%;">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName"
slot="prepend"
placeholder="查询类型"
style="width: 120px;">
<el-option label="工会名称"
value="un.unionname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search"
@click="doSearch"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<!-- <el-button size="medium"
@click="time=new Date().getTime();v='cadreAudit'">
<i
class="el-icon-s-check"></i>
基层干部审核
</el-button>-->
<el-button type="primary" size="medium" @click="openAdd"><i
class="ti-plus"></i>
新建临时联合工会
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table
:data="tableData"
size="medium"
@sort-change='pageOrder'
header-align="center"
style="width: 100%"
>
<el-table-column align="center" header-align="center" label="序号"
type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
prop="unionname"
label="工会名称"
header-align="center"
align="center" show-overflow-tooltip
>
<template slot-scope="{row:{unionname}}">
{{unionname}}
</template>
</el-table-column>
<el-table-column
prop="unioncode"
label="工会编码"
header-align="center"
align="center" show-overflow-tooltip
>
<template slot-scope="{row:{unioncode}}">
{{unioncode}}
</template>
</el-table-column>
<el-table-column
prop="fzr"
label="管理员"
header-align="center"
align="center"
:show-overflow-tooltip="true">
<template slot-scope="scope">
{{scope.row.fzr | none2str}}
</template>
</el-table-column>
<el-table-column
prop="telephone"
label="联系电话"
header-align="center"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
{{scope.row.telephone | none2str}}
</template>
</el-table-column>
<el-table-column label="是否启用" prop="isEnable">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isEnable"
active-color="#13ce66"
inactive-color="#ff4949"
@change="isEnableChange(scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column label="所属校区" prop="campus"></el-table-column>
<el-table-column
prop="userOnline"
label="操作"
header-align="center"
align="center"
width="400">
<template scope="scope">
<el-button size="mini"
type="primary"lian
:loading="scope.row.openFzrLoading"
@click="openFzr(scope.row)">设置管理员
</el-button>
<el-button type="primary" size="mini"
@click="openEdit(scope.row.id)">
编辑
</el-button>
<el-button type="danger" size="mini"
v-if="!scope.row.unisEnable&&scope.row.unitnum==0"
@click="doDelete(scope.row.id,true)">
删除
</el-button>
<el-button type="danger" size="mini"
v-if="!scope.row.unisEnable&&scope.row.unitnum>0"
@click="doDelete(scope.row.id,false)">
还原单位
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-tab-pane>
<!-- <el-tab-pane :name="1">
<span slot="label"><i class="el-icon-office-building"></i> 校工会信息</span>
<union-cadre></union-cadre>
</el-tab-pane>-->
</el-tabs>
</div>
<div v-show="node.level==2||(node.level==1&&!sysadmin)" style="padding: 5px 10px">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"
style="box-shadow: none">
<!-- <el-tab-pane name="one">
<span slot="label"><i class="el-icon-user-solid"></i> 基层干部</span>
<union-cadre-mange :union="jcgbPageForm.unionid"></union-cadre-mange>
</el-tab-pane>-->
<el-tab-pane name="two">
<span slot="label"><i class="el-icon-user"></i> 会员档案</span>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" clearable
v-model="hyPageForm.searchKeyword"
@keyup.enter.native="hyDoSearch">
<el-select v-model="hyPageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 120px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="hyPageForm.unitid" filterable clearable
placeholder="请选择单位">
<el-option
v-for="item in unitOptions"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search"
@click="hyDoSearch"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="hyTableData" size="medium" v-loading="tabloading">
<el-table-column align="center" header-align="center" label="序号"
type="index">
<template scope="scope"><span>{{scope.$index+(hyPageForm.pageNumber - 1) * hyPageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="工号"
show-overflow-tooltip
prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" label="姓名"
show-overflow-tooltip
prop="username"></el-table-column>
<el-table-column align="center" header-align="center" label="性别"
show-overflow-tooltip
prop="sex"></el-table-column>
<el-table-column align="center" header-align="center" label="单位"
show-overflow-tooltip
prop="unitname"></el-table-column>
<el-table-column align="center" header-align="center" label="电话"
show-overflow-tooltip
prop="mobile"></el-table-column>
</el-table>
</el-card>
<el-row class="el-pagination-container">
<el-pagination
@size-change="hyPageSizeChange"
@current-change="hyPageNumberChange"
:current-page="hyPageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="hyPageForm.pageSize"
layout="total, prev, pager, next"
:total="hyPageForm.totalCount">
</el-pagination>
</el-row>
</el-tab-pane>
<el-tab-pane name="three">
<span slot="label"><i class="el-icon-tickets"></i> 成员单位</span>
<el-card shadow="never" class="text-right">
<el-button type="primary" @click="openZcdw"><i
class="el-icon-plus"></i>
设置成员单位
</el-button>
</el-card>
<el-card shadow="never" class="mt10" style="padding-top: 0">
<el-table :data="zcdwTableData" style="max-height: 70vh;overflow: auto"
v-loading="tabloading" size="medium">
<el-table-column align="center" header-align="center" label="序号"
type="index"></el-table-column>
<el-table-column align="center" header-align="center" label="单位编码"
prop="unitcode">
</el-table-column>
<el-table-column align="center" header-align="center" label="单位名称"
prop="name">
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
<!-- <el-tab-pane name="four">
<span slot="label"><i class="el-icon-user"></i> 审批员管理</span>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" clearable
v-model="spyPageForm.searchKeyword"
@keyup.enter.native="spyDoSearch">
<el-select v-model="spyPageForm.searchName" clearable slot="prepend"
placeholder="查询类型"
style="width: 120px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="spyPageForm.qxid" placeholder="请选择角色权限" clearable>
<el-option
v-for="item in spyRoles"
:key="item.roleid"
:label="item.name"
:value="item.roleid">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button icon="el-icon-search" @click="spyDoSearch"
type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" type="primary" @click="openAddSpy"><i
class="el-icon-plus"></i>
添加审批员
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="spyTableData" size="medium" v-loading="tabloading">
<el-table-column align="center" header-align="center" label="序号"
type="index">
<template scope="scope"><span>{{scope.$index+(spyPageForm.pageNumber - 1) * spyPageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" prop="loginname"
label="工号"></el-table-column>
<el-table-column align="center" header-align="center" prop="username"
label="姓名"></el-table-column>
<el-table-column align="center" header-align="center" prop="unitname"
label="单位"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" prop="unionname"
label="院级工会"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" prop="rolename"
label="用户角色"
show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" header-align="center" label="操作"
fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="danger"
@click="delSpy(scope.row.userid,scope.row.roleid)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-row class="el-pagination-container">
<el-pagination
@size-change="spyPageSizeChange"
@current-change="spyPageNumberChange"
:current-page="spyPageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="spyPageForm.pageSize"
layout="total, prev, pager, next"
:total="spyPageForm.totalCount">
</el-pagination>
</el-row>
</el-tab-pane>-->
</el-tabs>
</div>
</template>
</tree-layout>
<div v-show="v=='cadreAudit'" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5 mr10">
<el-button icon="el-icon-back" type="text" @click="v='index'">返回</el-button>
</div>
</el-row>
<union-cadre-audit :key="time"></union-cadre-audit>
</div>
</el-row>
<el-dialog
title="设置成员单位"
:visible.sync="zcdwDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer
:titles="['可选二级单位', '当前成员单位']"
filterable
:props="{
key: 'id',
label: 'name'
}"
:filter-method="zdwFilterMethod"
v-model="zcdwValue"
:data="zcdwData">
</el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="zcdwDialogVisible = false" :disabled="subDis">取 消</el-button>
<el-button :disabled="subDis" type="primary" :loading="subDis" @click="doSzZcdw">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="设置管理员"
:visible.sync="fzrDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer
:titles="['单位成员', '管理员']"
filterable
:props="{
key: 'id',
label: 'name'
}"
:filter-method="fzrFilterMethod"
v-model="fzrValue"
:data="fzrData">
</el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="fzrDialogVisible = false" :disabled="subDis">取 消</el-button>
<el-button :disabled="subDis" type="primary" :loading="subDis" @click="doSzFzr">确 定</el-button>
</span>
</el-dialog>
<!--新建工会-->
<el-dialog
title="新建院级工会"
:visible.sync="addDialogVisible" width="40%">
<el-form :model="formData" ref="addForm" :rules="formRules" size="small" label-width="100px">
<el-form-item prop="unionname" label="工会名称">
<el-input maxlength="100" placeholder="工会名称"
v-model="formData.unionname"
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
<el-form-item prop="unioncode" label="工会编码">
<el-input maxlength="100" placeholder="工会编码"
v-model="formData.unioncode"
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
<!-- <el-form-item prop="dwcode" label="院级工会编号">-->
<!-- <el-input maxlength="100" placeholder="院级工会编号"-->
<!-- v-model="formData.dwcode" clearable-->
<!-- auto-complete="off" tabindex="4" type="text"></el-input>-->
<!-- </el-form-item>-->
<el-form-item prop="telephone" label="联系电话">
<el-input maxlength="100" placeholder="联系电话"
v-model="formData.telephone" clearable
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
<el-form-item label="校区" prop="campus">
<el-select v-model="formData.campus">
<el-option :key="item.campus_id"
:label="item.campus_name"
:value="item.campus_name"
v-for="item in campusList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否启用" prop="isEnable">
<el-switch
v-model="formData.isEnable"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item prop="unionaddress" label="工会地址">
<el-input maxlength="100" placeholder="工会地址"
v-model="formData.unionaddress"
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false" :disabled="subDis">取 消</el-button>
<el-button type="primary" :disabled="subDis" :loading="subDis" @click="doAdd">确 定</el-button>
</span>
</el-dialog>
<!--编辑工会-->
<el-dialog
title="修改院级工会"
:visible.sync="editDialogVisible" width="40%">
<el-form :model="formData" ref="editForm" :rules="formRules" size="small" label-width="100px">
<el-form-item prop="unionname" label="工会名称">
<el-input maxlength="100" placeholder="工会名称"
v-model="formData.unionname"
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
<el-form-item prop="unioncode" label="工会编码">
<el-input maxlength="100" placeholder="工会编码"
v-model="formData.unioncode"
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
<!-- <el-form-item prop="dwcode" label="院级工会编号">-->
<!-- <el-input maxlength="100" placeholder="院级工会编号"-->
<!-- v-model="formData.dwcode" clearable-->
<!-- auto-complete="off" tabindex="4" type="text"></el-input>-->
<!-- </el-form-item>-->
<el-form-item prop="telephone" label="联系电话">
<el-input maxlength="100" placeholder="联系电话"
v-model="formData.telephone" clearable
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
<el-form-item label="校区" prop="campus">
<el-select v-model="formData.campus">
<el-option :key="item.campus_id"
:label="item.campus_name"
:value="item.campus_name"
v-for="item in campusList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否启用" prop="isEnable">
<el-switch
v-model="formData.isEnable"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item prop="unionaddress" label="工会地址">
<el-input maxlength="100" placeholder="工会地址"
v-model="formData.unionaddress"
auto-complete="off" tabindex="4" type="text"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button :disabled="subDis" @click="editDialogVisible = false">取 消</el-button>
<el-button type="primary" :disabled="subDis" :loading="subDis" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="spyAddDialogVisible" title="添加审批员" width="45%" :close-on-click-modal="false">
<el-form :model="spyFormData" ref="spyAddForm" rules="formRules" label-width="100px" size="medium">
<div>
<div>
<el-row>
<el-col :span="24">
<el-form-item label="用户">
<el-select
style="width: 100%"
v-model="spyFormData.userids"
multiple
filterable
remote
placeholder="请输入关键词"
:remote-method="lxrUserRemoteMethod"
:loading="lxrUserLoading">
<el-option
v-for="item in lxrUserOptions"
:key="item.id"
:label="item.username+''+item.loginname+''"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="权限">
<el-checkbox-group v-model="spyFormData.roleids">
<el-checkbox v-for="item in spyRoles" :label="item.roleid">{{item.name}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
</div>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="spyAddDialogVisible = false">取 消</el-button>
<el-button type="primary" :disabled="subDis" @click="doAddSpy">确 定</el-button>
</span>
</el-dialog>
</el-card>
</guava>
<script>
let vue = new Vue({
el: '#app',
data() {
return {
time: new Date().getTime(),
filterText: '',
indexActive: 0,
schoolRoles: [],
v: 'index',
jcgbTableData: [],
lxrUserOptions: [],
lxrUserLoading: false,
zcdwData: [],
zcdwValue: [],
unitOptions: [],
tabloading: false,
lxrData: {
idx: -1,
type: 'add'
},
zwOptions: [],
activeName: 'two',
subDis: false,
fzrUnionid: '',
fzrData: [],
fzrValue: [],
data: [],
zcdwTableData: [],
lxrTableData: [],
defaultProps: {
children: 'childrens',
label: 'name',
disabled: 'disabled'
},
jcgbZt: {
true: '添加',
false: '删除',
},
sysadmin: true,
gxOptions: [],
formData: {},
zcdwDialogVisible: false,
addLxrDialogVisible: false,
editLxrDialogVisible: false,
fzrDialogVisible: false,
addDialogVisible: false,
editDialogVisible: false,
addJcgbJcDialogVisible: false,
editJcgbJcDialogVisible: false,
tableData: [],
spyTableData: [],
hyTableData: [],
pageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 20,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
hyPageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
jcgbPageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
spyPageForm: {
searchName: "username",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
spyRoles: [],
node: {},
formRules: {
// parentUnit: [{validator: validateUnit, trigger: ['blur', 'change']}],
unionname: [{required: true, message: '必填', trigger: ['blur', 'change']}],
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
sex: [{required: true, message: '必填', trigger: ['blur', 'change']}],
zw: [{required: true, message: '必填', trigger: ['blur', 'change']}],
mobile: [{required: true, message: '必填', trigger: ['blur', 'change']}],
email: [{required: true, message: '必填', trigger: ['blur', 'change']}],
userids: [{required: true, message: '必填', trigger: ['blur', 'change']}],
roleids: [{required: true, message: '必填', trigger: ['blur', 'change']}],
jc: [{required: true, message: '必选', trigger: ['blur', 'change']}],
zw: [{required: true, message: '必选', trigger: ['blur', 'change']}],
},
isNull(val) {
if (val === undefined || val === null || val === '') {
return true
}
return false
},
spyFormData: {},
spyAddDialogVisible: false,
spyUserLoading: false,
jcOptions: [],
jcgbOptions: [],
jcgbUserOptions: [],
jcgbUserLoading: false,
jcgbJcFormData: {jcgb: {}},
selectRoleid: '',
jcgbUser: {},
jcgbFormData: {},
jcgbUserOptions: [],
jcgbUserLoading: false,
jcgbshPageForm: {
searchName: "u.username",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
jcgbshMultipleSelection: [],
jcgbshUnions: [],
jcgbshTableData: [],
userLoading: false,
userOptions: [],
campusList: []
}
},
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue'),
'union-cadre': httpVueLoader('/components/sys/union/UnionCadreMange.vue?v=1.0.89'),
// 'union-cadre-mange': httpVueLoader('/components/sys/union/cadre/Mange.vue?v=1.0.5'),
'union-cadre-audit': httpVueLoader('/components/sys/union/cadre/Audit.vue?v=1.0.5'),
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
filters: {
none2str(val) {
if (val === undefined || val === null || val === '') {
return "暂无"
}
return val
},
},
methods: {
doExport() {
window.location.href = loc() + "/doExport"
},
filterNode(value, data, node) {
if (!value || node.level == 1) return true;
return data.unionname.indexOf(value) !== -1
return false
},
async userDoEdit(row) {
this.$set(row, "editLoading", true)
this.$set(row, "_manger_ids", row.manger_ids)
const {code} = await $.post(loc() + '/changeSchoolUnionRole', {
roleId: row.roleid,
userIds: JSON.stringify(row.manger_ids)
})
if (code == 0) {
this.$set(row, "edit", false)
this.querySchoolUnionRoles()
}
this.$notify({
title: code == 0 ? '成功' : '失败',
type: code == 0 ? 'success' : 'error'
});
this.$set(row, "editLoading", false)
},
async userEdit(row) {
this.$set(row, "openLoading", true)
this.$set(row, "_manger_ids", row.manger_ids)
this.$set(row, "userOptions", await queryUserByIds(row.manger_ids))
this.$set(row, "edit", true)
this.$set(row, "openLoading", false)
},
async userRemoteMethod(query, row) {
if (!query) {
this.$set(row, "userOptions", [])
return
}
this.$set(row, "userLoading", true)
const users = await searchUser(query)
this.$set(row, "userOptions", row.userOptions.filter(v => {
return row.manger_ids.includes(v.id)
}).concat(users.filter(v => {
return !row.manger_ids.includes(v.id)
})))
this.$set(row, "userLoading", false)
},
lxrUserRemoteMethod(query) {
this.lxrUserOptions = []
this.lxrUserLoading = true
$.get(loc() + "/getUserByUnionId", {
unionid: this.node.data.id,
query: query
}, (data) => {
if (data.code == 0) {
this.lxrUserOptions = data.data.list;
}
this.lxrUserLoading = false
}, "json");
},
doSzZcdw() {
this.subDis = true
$.post(loc() + "/doEditZcdw", {
unionid: this.node.data.id,
unitids: JSON.stringify(this.zcdwValue)
}, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.getZcdwTabData();
this.zcdwDialogVisible = false;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.subDis = false
}, "json");
},
getZcdwTabData() {
this.zcdwTableData = []
this.tabloading = true
$.get(loc() + "/getUnitsByUnion", {unionid: this.node.data.id}, (data) => {
if (data.code == 0) {
this.zcdwTableData = data.data;//加载后台表单数据
}
this.tabloading = false
}, "json");
},
zdwFilterMethod(query, item) {
return item.name.indexOf(query) > -1;
},
openZcdw() {
$.get(loc() + "/getDwAndZcdw", {unionid: this.node.data.id}, (data) => {
if (data.code == 0) {
this.zcdwData = data.data.data
this.zcdwValue = []
data.data.value.forEach(val => {
this.zcdwValue.push(val.id)
})
this.zcdwDialogVisible = true;//打开编辑窗口
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
doAddSpy() {
this.$refs["spyAddForm"].validate((valid) => {
if (valid) {
this.subDis = true
$.post(loc() + "/doAddSpy", {
userids: JSON.stringify(this.spyFormData.userids),
roleids: JSON.stringify(this.spyFormData.roleids)
}, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.spyPageData();
this.spyAddDialogVisible = false;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.subDis = false
}, "json");
}
});
},
openAddSpy() {
this.lxrUserOptions = [];
this.spyFormData = {
userids: [],
roleids: [],
};
this.spyAddDialogVisible = true;
if (this.$refs['spyAddForm']) {
this.$refs['spyAddForm'].resetFields()
}
},
delSpy(userid, roleid) {
var self = this
this.$confirm('确定要删除该角色权限吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
closeOnClickModal: false,
type: 'warning',
callback(a) {
if ("confirm" === a) {
$.post(loc() + "/delSpy", {
userid: userid,
roleid: roleid
}).then(res => {
if (res.code == 0) {
self.spyDoSearch();
self.$message.success(res.msg);
} else {
self.$message.error(res.msg);
}
})
}
}
});
},
spyDoSearch() {
this.spyPageForm.pageNumber = 1
this.spyPageData()
},
spyPageOrder(column) {//按字段排序
this.spyPageForm.pageOrderName = column.prop;
this.spyPageForm.pageOrderBy = column.order;
this.spyPageData();
},
spyPageNumberChange(val) {//页码更新操作
this.spyPageForm.pageNumber = val;
this.spyPageData();
},
spyPageSizeChange(val) {//分页大小更新操作
this.spyPageForm.pageSize = val;
this.spyPageData();
},
spyPageData() {//加载分页数据
sublime.showLoadingbar();//显示loading
this.tabloading = true
$.post(loc() + "/spyPageData", this.spyPageForm, (data) => {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
this.spyTableData = data.data.list;
this.spyPageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.tabloading = false
}, "json");
},
async getSpyRoles() {
this.spyRoles = await getSpyJs()
},
hyDoSearch() {
this.hyPageForm.pageNumber = 1
this.hyPageData()
},
hyPageOrder(column) {//按字段排序
this.hyPageForm.pageOrderName = column.prop;
this.hyPageForm.pageOrderBy = column.order;
this.hyPageData();
},
hyPageNumberChange(val) {//页码更新操作
this.hyPageForm.pageNumber = val;
this.hyPageData();
},
hyPageSizeChange(val) {//分页大小更新操作
this.hyPageForm.pageSize = val;
this.hyPageData();
},
hyPageData() {//加载分页数据
sublime.showLoadingbar();//显示loading
this.tabloading = true
$.post(loc() + "/hyPageData", this.hyPageForm, (data) => {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
this.hyTableData = data.data.list;
this.hyPageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.tabloading = false
}, "json");
},
doDeleteLxr(id) {
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: (a, b) => {
if ("confirm" == a) {//确认后再执行
$.post(loc() + "/deleteLxr", {id: id}, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.getLxrTabData(this.node.data.id);
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
}
});
},
doEditLxr() {
this.$refs["editForm"].validate((valid) => {
if (valid) {
this.subDis = true
$.post(loc() + "/doEditLxr", this.formData, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.getLxrTabData(this.node.data.id);
this.editLxrDialogVisible = false;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
this.subDis = false
}
});
},
openEditLxr(id) {
$.post(loc() + "/findOneLxr", {id: id}, (data) => {
if (data.code == 0) {
this.formData = data.data;//加载后台表单数据
this.editLxrDialogVisible = true;//打开编辑窗口
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
doAddLxr() {
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.subDis = true
$.post(loc() + "/doAddLxr", this.formData, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.getLxrTabData(this.node.data.id);
this.addLxrDialogVisible = false;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.subDis = false
}, "json");
}
});
},
openAddLxr() {
this.formData = {
unionid: this.node.data.id
};//打开新增窗口,表单先清空
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
this.addLxrDialogVisible = true;
},
getLxrTabData(id) {
this.lxrTableData = []
this.tabloading = true
$.post(loc() + "/getLxrTabData", {id: id}, (data) => {
if (data.code == 0) {
this.lxrTableData = data.data;//加载后台表单数据
}
this.tabloading = false
}, "json");
},
handleClick(tab, event) {
if (tab.name == 'one') {
} else if (tab.name == 'two') {
this.hyPageForm.searchName = 'username'
this.hyDoSearch()
$.get(loc() + "/getUnitsByUnion", {unionid: this.node.data.id}, (data) => {
if (data.code == 0) {
this.unitOptions = data.data;//加载后台表单数据
}
}, "json");
} else if (tab.name == 'three') {
this.getZcdwTabData()
} else if (tab.name == 'four') {
this.spyPageForm.searchName = 'username'
this.spyPageForm.unionid = this.node.data.id
this.spyTableData = []
this.spyDoSearch()
}
},
doSzFzr() {
this.subDis = true
$.post(loc() + "/doEditFzr", {
unionid: this.fzrUnionid,
userids: JSON.stringify(this.fzrValue)
}, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.pageData();
this.fzrDialogVisible = false;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.subDis = false
}, "json");
},
fzrFilterMethod(query, item) {
return item.name.indexOf(query) > -1;
},
openFzr(row) {
this.$set(row, "openFzrLoading", true)
const {id} = row
this.fzrUnionid = id
$.post(loc() + "/getUserAndFzr", {id: id}, (data) => {
if (data.code == 0) {
this.fzrData = data.data.data
this.fzrValue = []
data.data.value.forEach(val => {
this.fzrValue.push(val.id)
})
this.fzrDialogVisible = true;//打开编辑窗口
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.$set(row, "openFzrLoading", false)
}, "json");
},
handleNodeClick(data, node) {
this.node = node
var pageForm = {
unionid: this.isNull(node.data) ? '-1' : node.data.id,
unionName: "",
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
}
if (node.level == 1 && this.sysadmin) {
pageForm.searchName = 'un.unionname'
this.pageForm = pageForm
this.doSearch()
} else if (node.level == 1 && !this.sysadmin) {
if (this.data[0].childrens && this.data[0].childrens.length > 0) {
this.node.data.id = this.data[0].childrens[0].id
this.hyPageForm = pageForm
this.activeName = 'one'
this.jcgbPageData()
}
} else if (node.level == 2) {
this.hyPageForm = pageForm
this.activeName = 'two'
this.jcgbPageForm = pageForm
this.hyPageData();
// this.jcgbPageData()
}
},
doDelete(id, flag) {
let msg = flag ? '请确认是否要删除本联合工会,一旦删除相关数据将无法查询!!!' : '选择后系统将组成单位还原到所在分工会!!!'
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: (a, b) => {
if ("confirm" == a) {//确认后再执行
$.post(loc() + "/doDeleteUnion", {id: id, flag: flag}, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.unionTree(false);
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
}
});
},
doEdit() {
this.$refs["editForm"].validate((valid) => {
if (valid) {
this.subDis = true
$.post(loc() + "/doEditUnion", this.formData, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.unionTree(false);
this.editDialogVisible = false;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.subDis = false
}, "json");
}
});
},
openEdit(id) {
$.post(loc() + "/editUnion", {id: id}, (data) => {
if (data.code == 0) {
this.formData = data.data;//加载后台表单数据
this.editDialogVisible = true;//打开编辑窗口
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
doAdd() {
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.subDis = true
$.post(loc() + "/doAddUnion", this.formData, (data) => {
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.unionTree(false);
this.addDialogVisible = false;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.subDis = false
}, "json");
}
});
},
openAdd() {
this.formData = {
isEnable: true,
unioncode: "999"
};//打开新增窗口,表单先清空
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
this.addDialogVisible = true;
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageOrder(column) {//按字段排序
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange(val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange(val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
pageData() {//加载分页数据
sublime.showLoadingbar();//显示loading
$.post(loc() + "/unionPageData", this.pageForm, (data) => {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
unionTree(action = true) {
$.get(loc() + "/unionTree", (data) => {
if (data.code == 0) {
this.sysadmin = data.data.sysadmin
this.data = [data.data]
if (!action) {
this.pageData()
return
}
if (this.sysadmin) {
this.handleNodeClick(null, {
level: 1
})
} else {
this.handleNodeClick(null, {
level: 2, data: {
id: data.data.childrens ? data.data.childrens[0].id : ''
}
})
}
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
async querySchoolUnionRoles() {
const {code, data} = await $.get(loc() + '/schoolUnionRoles')
if (code == 0) {
data.map(v => {
v.manger_ids = v.manger_ids ? v.manger_ids.split(',') : []
})
this.schoolRoles = data
}
},
async isEnableChange(row) {
const data = await $.get(loc() + '/isEnableChange', {
id: row.id,
isEnable: row.isEnable
})
if (data.code == 0) {
this.doSearch()
this.$message({
message: data.msg,
type: 'success'
});
} else {
this.$message({
message: data.msg,
type: 'warning'
});
}
}
},
async created() {
this.node = {level: 1}
this.unionTree();
this.getSpyRoles();
this.querySchoolUnionRoles();
this.campusList = await getCampus()
}
})
</script>
</div>
<!--#
}
#-->