Files
UNION_NSI/target/classes/views/platform/jdh/two/unionManage.html
T
2026-09-08 19:49:21 +08:00

1251 lines
59 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-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">
<template>
<el-card style="height: calc(100vh - 70px)" shadow="never">
<tree-layout>
<template #tree>
<div style="padding: 20px;padding-bottom: 20px">
<el-input
placeholder="输入关键字进行查找"
v-model="filterText" clearable>
</el-input>
</div>
<el-tree class="v-tree" :data="data" :props="defaultProps"
default-expand-all :filter-node-method="filterNode" ref="tree"
highlight-current accordion @node-click="handleNodeClick">
<div class="custom-tree-node" 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>
<!-- <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-if="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="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 icon="el-icon-printer" type="primary" size="medium"
@click="doExport">导出
</el-button>
<el-button size="medium"
@click="time=new Date().getTime(); $refs.guava.view()">
<i
class="el-icon-s-check"></i>
基层干部审核
</el-button>
<el-button 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="campus"></el-table-column>
<el-table-column
prop="userOnline"
label="操作"
header-align="center"
align="center"
width="290">
<template scope="scope">
<el-button size="mini" :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"
@click="doDelete(scope.row.id)">删除
</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-if="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-tabs>
</div>
</template>
</tree-layout>
</el-card>
</template>
<template #view>
<union-cadre-audit :key="time"></union-cadre-audit>
</template>
<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 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 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>
</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: 'one',
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']}],
},
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: {},
jcgbshPageForm: {
searchName: "u.username",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
jcgbshMultipleSelection: [],
jcgbshUnions: [],
jcgbshTableData: [],
userLoading: false,
userOptions: [],
campusList: []
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'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.6'),
'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)
await 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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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("/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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.hytableData = []
this.hyDoSearch()
$.get(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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) {
if (item.name) {
return item.name.indexOf(query) > -1;
}
return false
},
openFzr(row) {
this.$set(row, "openFzrLoading", true)
const {id} = row
this.fzrUnionid = id
$.post(base + "/platform/sys/union/mange/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 = '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 = 'one'
this.jcgbPageForm = pageForm
// this.jcgbPageData()
}
},
doDelete(id) {
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: (a, b) => {
if ("confirm" == a) {//确认后再执行
$.post(base + "/platform/sys/union/mange/doDeleteUnion", {id: id}, (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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/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 = {};//打开新增窗口,表单先清空
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(base + "/platform/sys/union/mange/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(base + "/platform/sys/union/mange/unionTree", (data) => {
if (data.code == 0) {
this.sysadmin = data.data.sysadmin
this.data = [data.data]
if (!action) {
this.pageData()
return
}
this.sysadmin = false
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('/platform/sys/union/mange/schoolUnionRoles')
if (code == 0) {
data.map(v => {
v.manger_ids = v.manger_ids ? v.manger_ids.split(',') : []
})
this.schoolRoles = data
}
}
},
async created() {
this.node = {level: 1}
this.unionTree();
this.getSpyRoles();
this.querySchoolUnionRoles();
this.campusList = await getCampus()
// this.pageData();
}
})
</script>
</div>
<!--#
}
#-->