first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
@@ -0,0 +1,518 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.jdhid" filterable placeholder="请选择教代会" @change="jdhChange">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.dbtid" filterable clearable placeholder="请选择代表团"
@change="dbtChange(pageForm.dbtid)">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbtname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable v-model="pageForm.union_id" filterable placeholder="请选择工会">
<el-option
v-for="item in unionOptions"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd"><i class="ti-plus"></i> 新建代表团</el-button>
</div>
</el-row>
<el-dialog title="新建代表团" :visible.sync="addDialogVisible">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
<el-form-item prop="jdhid" label="所属教代会">
<el-select v-model="formData.jdhid" @change="addJdhChange" placeholder="选择教代会" style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="dbtname" label="代表团名称">
<el-select multiple v-model="formData.dbtname" filterable placeholder="请选中代表团名称" style="width: 100%">
<el-option
v-for="item in dbtList"
:key="item.id"
:label="item.name"
:value="item.name">
</el-option>
</el-select>
</el-form-item>
</el-form>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</span>
</el-dialog>
<el-row class="el-table-container">
<el-table :data="tableData">
<el-table-column label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="code" label="代表团编码"></el-table-column>
<el-table-column prop="dbtname" label="代表团名称"></el-table-column>
<el-table-column prop="jdhallname" label="所属教代会"></el-table-column>
<el-table-column prop="cjsj" label="创建时间"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<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:'fgh',data:scope.row}">
设置组成分工会
</el-dropdown-item>
<el-dropdown-item :command="{type:'tz',data:scope.row}">
设置团长/副团长
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">
&emsp;&emsp;&emsp;&emsp;&emsp;
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :title="'设置'+setzcfghdbtname+'组成工会'" :visible.sync="fghDialogVisible">
<template>
<div class="btn-group tool-button mt5">
<el-select size="mini" v-model="readySetFghId" filterable>
<el-option v-for="i in fghList" :label="i.unionname" :value="i.id" :key="i.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button size="mini" type="primary" @click="fghdoAdd" icon="el-icon-circle-plus">
添加
</el-button>
</div>
</template>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="fghTableData" size="mini" height="300">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column sortable prop="unionname" label="分工会名称"></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button icon="el-icon-delete" @click="fghdoDelete(scope.row.id)" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button type="danger" @click="fghDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
<el-dialog title="设置团长/副团长" :visible.sync="TzDialogVisible">
<el-row>
<div class="btn-group tool-button mt5">
<el-select
size="mini"
style="width: 300px"
v-model="TzFormData.userid"
filterable
placeholder="请输入工号或姓名关键字">
<el-option
v-for="item in readyTzList"
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-dropdown placement="bottom">
<el-button type="primary" size="mini">
设置身份<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="doAddTz(2)">&emsp;
</el-dropdown-item>
<el-dropdown-item @click.native="doAddTz(1)">副团长
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="TzTableData" size="mini" height="300">
<el-table-column sortable prop="loginname" label="工号"></el-table-column>
<el-table-column sortable prop="username" label="姓名"></el-table-column>
<el-table-column sortable prop="dwname" label="单位"></el-table-column>
<el-table-column prop="mobile" label="电话"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="rolename" label="身份">
<template slot-scope="scope">
<span v-if="scope.row.rolename==='代表团团长'" class="text-primary">设置团长</span>
<span v-if="scope.row.rolename==='代表团副团长'" class="text-info">设置副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button size="mini" type="danger" icon="el-icon-delete"
@click="delUser(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span slot="footer" class="dialog-footer" style="margin-top: 0">
<el-button type="danger" @click="TzDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
<el-dialog title="设置操作员" :visible.sync="CzyDialogVisible">
<el-row>
<div class="btn-group tool-button mt5">
<el-select size="mini" style="width: 300px"
remote reserve-keyword :remote-method="queryCzyList"
v-model="readyCzyUser" filterable placeholder="请输入工号或姓名关键字">
<el-option
v-for="item in readyCzyList"
:key="item.id"
:label="item.loginname+' '+item.username"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button size="mini" type="primary" @click="czydoAdd" icon="el-icon-circle-plus">
添加
</el-button>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="CzyTableData" size="mini" height="300">
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="dwname" label="单位"></el-table-column>
<el-table-column prop="mobile" label="电话"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button icon="el-icon-delete" @click="czydoDelete(scope.row.id)" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span slot="footer" class="dialog-footer" style="margin-top: 0">
<el-button type="danger" @click="CzyDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
setzcfghdbtname: '',
tableData: [],
pageForm: {
dbtname: '',
jdhid: '',
union_id: ""
},
jdhList: [],
delegations: [],
dbtList: [],
addDialogVisible: false,
formData: {},
fghDialogVisible: false,
fghFormData: {},
fghList: [],
readySetFghId: '',
fghTableData: [],
TzDialogVisible: false,
TzFormData: {},
readyTzUser: [],
readyTzList: [],
TzTableData: [],
czyFormData: {},
CzyDialogVisible: false,
readyCzyUser: '',
readyCzyList: [],
CzyTableData: [],
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['change', 'blur']}],
dbtname: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}]
},
unionOptions: []
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'fgh') {
this.openFgh(data.id, data.jdhid, data.dbtname)
} else if (type == 'tz') {
this.openTz(data.id, data.jdhid)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
async dbtChange(dbtId) {
this.pageForm.union_id = ''
this.unionOptions = await getUnions(dbtId)
},
openAdd() {
this.formData = {}
if (this.jdhList.length > 0) {
this.formData.jdhid = this.jdhList[0].id
this.getDbtList(this.formData.jdhid)
}
this.addDialogVisible = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
async doAdd() {
this.$refs['addForm'].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(base + '/platform/jdh/zzjg/dbt/doAdd', this.formData)
loading.close()
if(resp.code===0){
this.pageData()
this.addDialogVisible = false
}else{
this.notifyWarning(resp.msg)
}
}
})
},
async jdhChange(val) {
this.pageForm.dbtid = ''
this.delegations = await getDbt(val)
},
addJdhChange(val) {
this.getDbtList(val)
},
getDbtList(jdhid) {
$.post(base + '/platform/jdh/zzjg/dbt/queryKyDbtMc', {jdhid: jdhid}).then(res => {
if (res.code === 0) {
this.dbtList = res.data
}
})
},
openFgh(id, jdhid, dbtname) {
this.setzcfghdbtname = dbtname
this.fghFormData = {id, jdhid}
this.getNoSetFgh(jdhid)
this.getDbtFghData(id)
this.fghDialogVisible = true
},
//查询没有被代表团设置的组成分工会
getNoSetFgh(jdhid) {
$.post(base + '/platform/jdh/zzjg/dbt/queryNoSetFgh', {jdhid: jdhid}).then(res => {
this.fghList = res.data
})
},
//该代表团下的组成分工会
getDbtFghData(id) {
$.post(base + '/platform/jdh/zzjg/dbt/getDbtFghData', {id: id}).then(res => {
if (res.code === 0) {
this.fghTableData = res.data
}
})
},
fghdoAdd() {
if (this.readySetFghId === '') {
this.$message.info('请先选择分工会')
return
}
this.fghFormData.fghid = this.readySetFghId
$.post(base + '/platform/jdh/zzjg/dbt/fghdoAdd', this.fghFormData).then(res => {
if (res.code === 0) {
this.readySetFghId = ''
this.getNoSetFgh(this.fghFormData.jdhid)
this.getDbtFghData(this.fghFormData.id)
}
})
},
fghdoDelete(id) {
$.post(base + '/platform/jdh/zzjg/dbt/fghdoDelete', {id: id}).then(res => {
if (res.code === 0) {
this.getNoSetFgh(this.fghFormData.jdhid)
this.getDbtFghData(this.fghFormData.id)
}
})
},
//团长副团长
openTz(id, jdhid) {
this.TzFormData = {
id: id,
jdhid: jdhid
}
this.getNotTzList()
this.getTzList()
this.TzDialogVisible = true
},
//获取没被设置为团长副团长的代表
getNotTzList() {
$.get(base + '/platform/jdh/zzjg/dbt/queryUser', {id: this.TzFormData.id}).then(res => {
this.readyTzList = res.data
})
},
//获取团长副团长
getTzList() {
$.get(base + '/platform/jdh/zzjg/dbt/getTzList', {id: this.TzFormData.id}).then(res => {
this.TzTableData = res.data
})
},
delUser(obj) {
let data = {
userid: obj.id,
dbtid: this.TzFormData.id,
jdhid: this.TzFormData.jdhid,
roleid: obj.roleid
}
$.post(base + '/platform/jdh/zzjg/dbt/delUser', data).then(res => {
if (res.code === 0) {
this.getTzList()
this.getNotTzList()
}
})
},
doAddTz(num) {
this.TzFormData.num = num
$.post(base + '/platform/jdh/zzjg/dbt/doAddTz', this.TzFormData).then(res => {
if (res.code === 0) {
this.getTzList()
this.getNotTzList()
this.TzFormData.userid = ''
this.readyTzList = []
} else {
this.$message.info(res.msg)
}
})
},
//操作员
openCzy(id, jdhid) {
this.czyFormData = {id, jdhid}
this.getCzyTableData()
this.CzyDialogVisible = true
},
getCzyTableData() {
$.post(base + '/platform/jdh/zzjg/dbt/getCzyTableData', {dbtid: this.czyFormData.id}).then(res => {
if (res.code === 0) {
this.CzyTableData = res.data
}
})
},
czydoAdd() {
$.post(base + '/platform/jdh/zzjg/dbt/czydoAdd', {
userid: this.readyCzyUser,
dbtid: this.czyFormData.id,
jdhid: this.czyFormData.jdhid
}).then(res => {
if (res.code === 0) {
this.readyCzyUser = ''
this.readyCzyList = []
this.getCzyTableData()
}
})
},
czydoDelete(userid) {
$.post(base + '/platform/jdh/zzjg/dbt/czydoDelete', {
userid: userid,
dbtid: this.czyFormData.id
}).then(res => {
if (res.code === 0) {
this.getCzyTableData()
}
})
},
queryCzyList(keyword) {
$.get(base + '/platform/jdh/zzjg/dbt/getReadyCzyList', {
dbtid: this.czyFormData.id,
keyword: keyword
}).then(res => {
if (res.code === 0) {
this.readyCzyList = res.data.list
}
})
},
doDelete(id) {
$.post(base + '/platform/jdh/zzjg/dbt/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
},
},
async created() {
this.unionOptions = await getUnions()
this.jdhList = await proposal.getOpenMeeting()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
this.pageData()
}
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,958 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__nav {
background-color: #FFFFFF;
}
.dialog-footer .el-button {
padding: 12px 30px;
}
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-box .el-card__header {
padding: 5px 15px;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="app" v-cloak>
<guava>
<tree-layout style="height: calc(100vh - 70px)">
<template #tree>
<div style="padding: 15px;">
<el-select v-model="pageForm.jdhid" filterable placeholder="请选择教代会"
@change="jdhChange">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</div>
<el-tree class="filter-tree" :data="treeData" :props="defaultProps"
default-expand-all 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.dbtname }}
</div>
<div v-if="node.level==2" style="font-size: 14px" class="v-node">
<i class="el-icon-s-help" v-if="checkData.dbtname==data.dbtname"></i>
<i class="el-icon-help" v-else></i>
&emsp;{{ data.dbtname }}
</div>
</div>
</el-tree>
</template>
<template>
<div v-if="node.level==1" class="pl10 pr10">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-select v-model="pageForm.dbtid" filterable clearable
placeholder="请选择代表团">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbtname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="doSearch"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button type="primary" @click="openAdd"><i class="ti-plus"></i> 添加代表团
</el-button>
</div>
</el-card>
<el-dialog title="添加代表团" :visible.sync="addDialogVisible" width="40%">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
<el-form-item prop="jdhid" label="所属教代会">
<el-select v-model="formData.jdhid" @change="addJdhChange"
placeholder="选择教代会"
style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item prop="dbt" label="代表团名称">-->
<!-- <el-select multiple v-model="formData.dbt" filterable-->
<!-- placeholder="请选中代表团名称"-->
<!-- style="width: 100%">-->
<!-- <el-option-->
<!-- v-for="item in dbtList"-->
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item prop="dbtName" label="代表团名称">
<el-input v-model="formData.dbtName" placeholder="请输入代表团名称" maxlength="50"></el-input>
</el-form-item>
<el-form-item prop="code" label="代表团编码">
<el-input v-model="formData.code" placeholder="请输入代表团编码"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</span>
</el-dialog>
<el-card shadow="never" class="mt20">
<el-table :data="tableData">
<el-table-column label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" prop="dbtname"
label="代表团名称"></el-table-column>
<el-table-column align="center" header-align="center" prop="dictcode"
label="代表团编码"></el-table-column>
<el-table-column align="center" header-align="center" prop="jdhallname"
label="所属教代会"></el-table-column>
<el-table-column align="center" header-align="center" prop="cjsj"
label="创建时间">
<template slot-scope="{row:{cjsj}}">
{{moment(cjsj).format('YYYY-MM-DD')}}
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<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">
<template>
<el-dropdown-item
:command="{type:'dw',data:scope.row}"
v-if="dbtzc==='unit'">
设置组成单位
</el-dropdown-item>
<el-dropdown-item
:command="{type:'fgh',data:scope.row}"
v-else>
设置组成基层工会
</el-dropdown-item>
</template>
<el-dropdown-item :command="{type:'tz',data:scope.row}">
设置团长/副团长
</el-dropdown-item>
<el-dropdown-item
:command="{type:'editName',data:scope.row}">
编辑代表团名称
</el-dropdown-item>
<el-dropdown-item
:command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
<div v-if="node.level==2" class="pl10 pr10">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="代表" name="one">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" clearable
v-model="dbPageForm.searchKeyword">
<el-select v-model="dbPageForm.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">
<el-select v-model="dbPageForm.unionid" filterable clearable
@change="getUnits"
placeholder="请选择工会">
<el-option
v-for="item in unionList"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="dbPageForm.unitid" filterable clearable
placeholder="请选择单位">
<el-option
v-for="item in unitList"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="dbDoSearch"></el-button>
</div>
</el-card>
<el-table class="mt20" :data="dbTableData">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span>
</template>
</el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column sortable prop="unionname"
label="工会"></el-table-column>
<el-table-column sortable prop="unitname"
label="单位"></el-table-column>
<el-table-column sortable prop="rolename"
label="代表身份"></el-table-column>
</el-table>
</el-tab-pane>
<template>
<el-tab-pane label="设置组成单位" name="two" v-if="dbtzc==='unit'">
<el-card shadow="never" class="text-right">
<el-button type="primary" @click="dwdoAdd(adminPageForm.dbtid)">
{{butTitle}}
</el-button>
</el-card>
<el-table class="mt20" :data="unitTableData">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span>
</template>
</el-table-column>
<el-table-column label="单位名称" prop="unitname"></el-table-column>
<el-table-column label="操作">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete" circle
@click="dwdoDelete(row)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="设置组成基层工会" name="two" v-else>
<el-card shadow="never" class="text-right">
<el-button type="primary"
@click="fghdoAdd(adminPageForm.dbtid)">
{{butTitle}}
</el-button>
</el-card>
<el-table class="mt20" :data="adminTableData">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span>
</template>
</el-table-column>
<el-table-column label="基层工会名称"
prop="unionname"></el-table-column>
<el-table-column label="操作">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete" circle
@click="fghdoDelete(row)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</template>
<el-tab-pane label="设置团长/副团长" name="three">
<el-card shadow="never" class="text-right">
<el-button type="primary" @click="openUser(adminPageForm.dbtid)">
{{butTitle}}
</el-button>
</el-card>
<el-table class="mt20" :data="TzTableData" height="300">
<el-table-column sortable prop="loginname"
label="工号"></el-table-column>
<el-table-column sortable prop="username"
label="姓名"></el-table-column>
<el-table-column sortable prop="dwname"
label="单位"></el-table-column>
<el-table-column prop="mobile" label="电话"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="rolename" label="身份">
<template slot-scope="scope">
<span v-if="scope.row.rolename==='代表团团长'"
class="text-primary">团长</span>
<span v-if="scope.row.rolename==='代表团副团长'"
class="text-info">副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete" circle
@click="delUser(row)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template>
</tree-layout>
</guava>
<el-dialog :title="title" :visible.sync="fghDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer :titles="['剩余分工会', '代表团分工会']" filterable
:props="{key: 'id',label: 'unionname'}"
:filter-method="adminFilterMethod"
v-model="fghFormData.fghValue"
:data="fghData">
</el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="fghDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dofgh" :loading="fghSubLoading">确 定</el-button>
</span>
</el-dialog>
<el-dialog :title="title" :visible.sync="dwDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer :titles="['剩余单位', '代表团单位']" filterable
:props="{key: 'id',label: 'unitname'}"
:filter-method="unitFilterMethod"
v-model="dwFormData.dwValue"
:data="dwData">
</el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dwDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dodw" :loading="dwSubLoading">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="设置团长副团长" :visible.sync="userDialogVisible" width="40%">
<el-form label-width="100px">
<el-form-item prop="jdhallname" label="届次">
<el-select v-model="pageForm.jdhid" disabled style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="userid" label="工号或姓名">
<el-select v-model="userFormData.userid" filterable placeholder="请输入工号或姓名关键字"
style="width: 100%" @change="userChange">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+'('+item.loginname+')'"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="mobile" label="联系方式">
<el-input v-model="leaderInfo.mobile" readonly></el-input>
</el-form-item>
<el-form-item prop="dwname" label="所属单位">
<el-input v-model="leaderInfo.dwname" readonly></el-input>
</el-form-item>
<el-form-item prop="sf" label="身份">
<el-radio-group v-model="leaderInfo.sf">
<el-radio-button label="2">&emsp;</el-radio-button>
<el-radio-button label="1">副团长</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button :disabled="userSubLoading" @click="doAddTz" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="编辑代表团名称" :visible.sync="deleDialogVisible" width="30%">
<el-form :model="editForm" label-width="100px" ref="editForm">
<el-form-item prop="dbtName" label="代表团名称" ref="aa"
:rules="{required: true, message: '请填写代表团名称', trigger: 'blur'}">
<el-input v-model="editForm.dbtName"></el-input>
</el-form-item>
<el-form-item prop="code" label="代表团编号"
:rules="{required: true, message: '请填写代表团编号', trigger: 'blur'}">
<el-input v-model="editForm.code"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="deleDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="deleDo">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue')
},
data() {
return {
editForm: {dbtName: ''},
deleDialogVisible: false,
node: {
level: 1
},
pageForm: {
jdhid: ""
},
title: '',
checkData: {},
activeName: 'one',
jdhList: [],
dbtList: [],
unitList: [],
unionList: [],
delegations: [],
treeData: [],
adminTableData: [],
unitTableData: [],
dwData: [],
dwFormData: {
dwValue: []
},
dwDialogVisible: false,
dwSubLoading: false,
dbTableData: [],
adminPageForm: {},
dbPageForm: {
unitid: "",
unionid: "",
searchName: 'username',
},
TzTableData: [],
addDialogVisible: false,
fghDialogVisible: false,
fghDialog: false,
userDialogVisible: false,
fghData: [],
fghFormData: {
fghValue: []
},
leaderInfo: {
sf: '2'
},
userList: [],
userFormData: {},
fghSubLoading: false,
userSubLoading: false,
setzcfghdbtname: '',
setFghId: '',
butTitle: '设置组成基层工会',
defaultProps: {
children: 'childrens',
label: 'dbtname',
disabled: 'disabled'
},
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['change', 'blur']}],
dbtName: [{required: true, message: '请填写代表团名称', trigger: ['change', 'blur']}],
code: [{required: true, message: '请填写代表团编号', trigger: ['change', 'blur']}]
},
deleData: {},
dbtzc: "${config.dbtzc!}"
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'fgh') {
this.openFgh(data)
} else if (type == 'dw') {
this.openDw(data)
} else if (type == 'tz') {
this.openTz(data)
} else if (type == 'delete') {
this.doDelete(data.id)
} else if (type === 'editName') {
this.editName(data)
}
},
editName(data) {
this.deleData = data
this.editForm = {
dbtName: data.dbtname,
code: data.dictcode
}
this.deleDialogVisible = true
if (this.$refs['editForm']) {
this.$refs['editForm'].resetFields()
}
},
async deleDo() {
this.$refs['editForm'].validate(async (valid) => {
if (valid) {
const resp = await $.post(loc() + '/updateDelegation', {
id: this.deleData.id,
delegationName: this.editForm.dbtName,
code: this.editForm.code
})
if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg});
await this.undertakeUnitTree()
this.pageData()
this.deleDialogVisible = false
} else {
this.$notify.error({title: '失败', message: resp.msg});
}
}
})
},
async dbData() {
this.dbPageForm.jdhid = this.pageForm.jdhid
const resp = await $.get(loc() + '/dbTableData', this.dbPageForm)
if (resp.code === 0) {
this.dbTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
async dbDoSearch() {
await this.dbData()
},
openAdd() {
this.formData = {
dbtName: '',
code: ''
}
if (this.jdhList.length > 0) {
this.formData.jdhid = this.jdhList[0].id
}
this.addDialogVisible = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
addJdhChange(val) {
this.getDbtList(val)
},
async getDbtList(jdhid) {
const resp = await $.post(loc() + "/queryKyDbtMc", {jdhid: jdhid})
if (resp.code === 0) {
this.dbtList = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
async doAdd() {
this.$refs['addForm'].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
// 构建提交数据
const data = {
jdhid: this.formData.jdhid,
dbtName: this.formData.dbtName,
code: this.formData.code
}
const resp = await $.post(loc() + '/doAdd', data)
loading.close()
if (resp.code === 0) {
await this.undertakeUnitTree()
this.pageData()
this.addDialogVisible = false
} else {
this.notifyWarning(resp.msg)
}
}
})
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.undertakeUnitTree()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
fghdoDelete(row) {
const {id} = row
this.$confirm('确定要移除该分工会吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/fghdoDelete", {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.adminPageData()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
dwdoDelete(row) {
const {id} = row
this.$confirm('确定要移除该单位吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/dwdoDelete", {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.unitPageData()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
delUser(row) {
let data = {
userid: row.id,
dbtid: this.adminPageForm.dbtid,
jdhid: this.pageForm.jdhid,
roleid: row.roleid
}
this.$confirm('确定要移除该团长或副团长吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/userDoDelete", data)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getTzList()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
async jdhChange(id) {
this.pageForm.dbtid = ''
this.delegations = await getDbt(id)
await this.undertakeUnitTree()
this.pageData()
},
handleNodeClick(data, node) {
this.node = node
this.checkData = data
this.dbPageForm.dbtid = data.id
this.adminPageForm.dbtid = data.id
this.adminPageForm.flag = this.activeName === 'one'
this.dbtzc === "unit" ? this.unitPageData() : this.adminPageData()
this.getTzList()
this.dbData()
},
handleTabClick(tab) {
if (tab.name === 'one') {
this.butTitle = this.dbtzc === "unit" ? '设置组成单位' : "设置组成工会"
this.adminPageForm.flag = tab.name === 'one'
this.dbData()
} else if (tab.name === 'two') {
this.butTitle = this.dbtzc === "unit" ? '设置组成单位' : "设置组成工会"
this.adminPageForm.flag = tab.name === 'two'
this.dbtzc === "unit" ? this.unitPageData() : this.adminPageData()
} else {
this.butTitle = '设置团长/副团长'
this.adminPageForm.flag = tab.name === 'three'
this.getTzList()
}
},
adminFilterMethod(query, item) {
return item.unionname.indexOf(query) > -1;
},
unitFilterMethod(query, item) {
return item.unitname.indexOf(query) > -1;
},
//查询没有被代表团设置的组成基层工会
async fghdoAdd(dbtid) {
const jdhid = this.pageForm.jdhid
this.fghFormData.jdhid = jdhid
this.fghFormData.dbtid = dbtid
const {data} = await $.get(loc() + "/findfgh", {jdhid, dbtid})
if (data) {
this.fghData = data.data
this.fghFormData.fghValue = data.value.map(v => {
return v.fghid
})
}
this.fghDialogVisible = true
},
//查询没有被代表团设置的组成单位
async dwdoAdd(dbtid) {
const jdhid = this.pageForm.jdhid
this.dwFormData.jdhid = jdhid
this.dwFormData.dbtid = dbtid
const {data} = await $.get(loc() + "/finddw", {jdhid, dbtid})
if (data) {
this.dwData = data.data
this.dwFormData.dwValue = data.value.map(v => {
return v.dwid
})
}
this.dwDialogVisible = true
},
//查询该代表团下的没有被设为团长副团长的代表
async openUser(dbtid) {
this.userFormData = {}
this.userFormData.dbtid = dbtid
this.userFormData.jdhid = this.pageForm.jdhid
const {data} = await $.get(loc() + "/queryUser", {
dbtid: dbtid,
jdhid: this.pageForm.jdhid
})
if (data) {
this.userList = data
}
this.userDialogVisible = true
},
//添加分工会
async dofgh() {
this.fghSubLoading = true
const data = clone(this.fghFormData)
data.fghValue = JSON.stringify(data.fghValue)
const resp = await $.post(loc() + "/fghdoAdd", data)
this.fghSubLoading = false
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.fghDialogVisible = false
this.pageData()
await this.adminPageData()
} else {
this.notifyWarning(resp.msg)
}
},
//添加单位
async dodw() {
this.dwSubLoading = true
const data = clone(this.dwFormData)
data.dwValue = JSON.stringify(data.dwValue)
const resp = await $.post(loc() + "/dwdoAdd", data)
this.dwSubLoading = false
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.dwDialogVisible = false
this.pageData()
await this.unitPageData()
} else {
this.notifyWarning(resp.msg)
}
},
async undertakeUnitTree() {
const {data} = await $.get(loc() + "/undertakeUnionTree", {jdhid: this.pageForm.jdhid})
this.treeData = [data]
this.pageData()
},
//该代表团下的组成基层工会
async adminPageData() {
const resp = await $.post(loc() + "/adminPageData", this.adminPageForm)
if (resp.code === 0) {
this.adminTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
//该代表团下的组成单位
async unitPageData() {
const resp = await $.post(loc() + "/unitPageData", this.adminPageForm)
if (resp.code === 0) {
this.unitTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
//获取团长副团长
async getTzList() {
const resp = await $.get(loc() + '/getTzList', this.adminPageForm)
if (resp.code === 0) {
this.TzTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
//添加团长或者副团长
doAddTz: throttle(async function () {
if (this.userFormData.userid == null) {
this.$notify({
title: '警告',
message: '请先选择团长或副团长',
type: 'warning'
});
return
}
this.userFormData.num = this.leaderInfo.sf
const resp = await $.post(loc() + "/doAddTz", this.userFormData)
if (resp.code === 0) {
this.getTzList()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
this.userList = []
this.userFormData.userid = ''
this.userDialogVisible = false
}, 2000),
openFgh(row) {
const {dbtname} = row
const dbtid = row.id
this.setzcfghdbtname = dbtname
this.fghdoAdd(dbtid)
},
openDw(row) {
const {dbtname} = row
const dbtid = row.id
this.setzcfghdbtname = dbtname
this.dwdoAdd(dbtid)
},
userChange(val) {
const sf = this.leaderInfo.sf
this.leaderInfo = this.userList.find(v => {
if (v.id === val) {
return v
}
})
this.$set(this.leaderInfo, 'sf', sf)
},
openTz(row) {
this.leaderInfo = {
mobile: '',
dwname: '',
sf: '2'
}
const dbtid = row.id
this.openUser(dbtid)
},
async getUnits() {
this.unitList = await getUnits(this.dbPageForm.unionid)
}
},
async created() {
this.jdhList = await getAllMeeting()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
this.pageData()
}
await this.getUnits()
this.unionList = await getUnions(null)
await this.undertakeUnitTree()
}
})
</script>
<!--#
}
#-->
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,746 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.dialog-footer .el-button {
padding: 12px 30px;
}
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-box .el-card__header {
padding: 5px 15px;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<tree-layout id="treeLayout" style="height: calc(100vh - 70px)">
<template #tree>
<div style="border-right: 2px solid rgb(240,240,240);padding: 20px;">
<el-input
placeholder="输入关键字进行查找"
v-model="filterText">
</el-input>
</div>
<el-tree ref="tree" :data="treeData" class="v-tree" v-loading="treeLoading" node-key="id"
:props="defaultProps"
default-expand-all :expand-on-click-node="false"
@node-click="handleNodeClick" accordion
highlight-current :filter-node-method="filterNode">
<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-s-home"></i>&nbsp;
{{ data.name }}
</div>
<div v-if="node.level==2"
style="font-size: 15px" :title="data.name" class="v-node">
<i class="el-icon-star-on" v-if="checkData.name==data.name"></i>
<i class="el-icon-star-off" v-else></i>
&nbsp; {{ data.name }}
</div>
<div v-if="node.level==3"
style="font-size: 14px" :title="data.name" class="v-node">
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
<i class="fa fa-circle-o" v-else></i>
&nbsp; {{ data.name }}
</div>
<div v-if="node.level>3"
style="font-size: 14px" :title="data.name" class="v-node">
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
<i class="fa fa-circle-o" v-else></i>
&nbsp; {{ data.name }}
</div>
</div>
</el-tree>
</template>
<template>
<div v-if="node.level==1" class="pl10 pr10">
<div v-if="hasChildren">
<el-card shadow="never">
<el-row type="flex" justify="end">
<el-button type="primary" icon="el-icon-plus"
@click="openAdd()">
新建机构
</el-button>
</el-row>
<!-- <div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="机构名称" value="name"></el-option>
<el-option label="机构编码" value="mechanismcode"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="pageData"></el-button>
</div>-->
<!-- <div class="pull-right offscreen-right">-->
<!-- </div>-->
</el-card>
<el-card shadow="never" class="mt10">
<el-table key="1" :data="tableData" ref="table1">
<el-table-column label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="name" align="center" label="机构名称"></el-table-column>
<el-table-column prop="mechanismcode" align="center" label="机构编码"></el-table-column>
<el-table-column prop="mechanismName" show-overflow-tooltip align="center"
label="备注"></el-table-column>
<el-table-column 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:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<div v-if="!hasChildren">
<el-card shadow="never" shadow="never">
<div class="btn-group tool-button">
<el-select v-model="pageForm.jdhid" filterable placeholder="请选择教代会"
@change="jdhChange">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="us.loginname"></el-option>
<el-option label="姓名" value="us.username"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="cyPageData"></el-button>
</div>
<div class="offscreen-right pull-right">
<el-button size="medium" type="primary"
icon="el-icon-plus"
@click="openCy()">
设置委员
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table key="2" :data="cyTableData" ref="table2">
<el-table-column label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="loginname" align="center" label="工号"></el-table-column>
<el-table-column prop="username" align="center" label="姓名"></el-table-column>
<el-table-column prop="sex" align="center" label="性别"></el-table-column>
<el-table-column prop="mobile" align="center" label="手机"></el-table-column>
<el-table-column prop="unitname" align="center" label="单位" show-overflow-tooltip>
<template slot-scope="{row}">
({{row.unitcode}}){{row.unitname}}
</template>
</el-table-column>
<el-table-column prop="jdhallname" align="center" label="届次"></el-table-column>
<el-table-column sortable prop="sf" label="身份">
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">委员</span>
<span v-if="row.sf===2" class="text-primary">副主任</span>
<span v-if="row.sf===3" class="text-primary">主任</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template scope="{row}">
<el-dropdown>
<el-button size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
@click.native="doDeleteCy(row)">删除
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==3"
@click.native="updateSf(row,3)"
class="text-primary">设置主任
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==2"
@click.native="updateSf(row,2)"
class="text-primary">设置副主任
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==1"
@click.native="updateSf(row,1)"
class="text-primary">设置委员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="cyPageSizeChange"
@current-change="cyPageNumberChange"
:current-page="cyPageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="cyPageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="cyPageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</div>
</div>
</template>
</tree-layout>
</template>
<template #edit>
<el-divider content-position="left"><span style="color: rgb(121, 187, 255)">请填写以下机构信息</span>
</el-divider>
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
<el-row gutter="30">
<el-col :span="24">
<el-form-item prop="name" label="上级机构">
<el-input maxlength="100" disabled :value="checkData.name"
type="text"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item prop="jdhid" label="所属教代会">
<el-select v-model="formData.jdhid" placeholder="选择教代会" @change="ssChange"
:disabled="!nodeZm"
style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>-->
<el-col :span="12">
<el-form-item label="机构名称" prop="name" v-if="!nodeZm">
<el-input maxlength="100" placeholder="请输入机构名称" :disabled="formData.id!=null"
v-model="formData.name"
type="text"></el-input>
</el-form-item>
<el-form-item prop="name" label="机构名称" v-else>
<el-select v-model="formData.wyh" value-key="id" style="width: 100%"
@change="wyhChange"
:disabled="formData.id!=null">
<el-option v-for="i in wyhList" :label="i.name" :value="i" :key="i.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="机构代码" prop="unitcode">
<el-input maxlength="100" placeholder="请输入机构编码"
v-model="formData.mechanismcode"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="unitcode">
<el-input maxlength="100" placeholder="请输入备注"
v-model="formData.mechanismName"
:autosize="{ minRows: 4, maxRows: 8}"
type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display: flex;justify-content:flex-end;margin-top: 30px">
<el-button type="primary" :loading="loading" @click="!formData.id?doAdd():doEdit()">提 交
</el-button>
</div>
</template>
</guava>
<el-dialog :visible.sync="cyDialogVisible" title="设置委员" width="40%">
<el-form label-width="100px">
<el-form-item prop="jdhallname" label="届次">
<el-select v-model="pageForm.jdhid" disabled style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="userid" label="工号或姓名">
<el-select v-model="cyFormData.userid" filterable placeholder="请输入工号或姓名关键字"
remote reserve-keyword :remote-method="queryUser" style="width: 100%" @change="userChange">
<el-option
v-for="item in userList"
:key="item.userid"
:label="item.username+'('+item.loginname+')'"
:value="item.userid">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="mobile" label="联系方式">
<el-input v-model="cyFormData.mobile" readonly></el-input>
</el-form-item>
<el-form-item prop="dwname" label="所属单位">
<el-input v-model="cyFormData.dwname" readonly></el-input>
</el-form-item>
<el-form-item prop="sf" label="身份">
<el-radio-group v-model="cyFormData.sf">
<el-radio-button label="1">&emsp;</el-radio-button>
<el-radio-button label="2">副主任</el-radio-button>
<el-radio-button label="3">&emsp;</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCy" :loading="cySubLoading">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userList: [],
nodeZm: false,
wyhList: [],
title: '',
hasChildren: true,
TableData: [],
loading: false,
checkData: {},
jdhList: [],
treeData: [],
cyTableData: [],
cyPageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
filterText: '',
treeLoading: true,
cyDialogVisible: false,
cySubLoading: false,
defaultProps: {
children: 'child',
label: 'name',
},
cyData: [],
cyFormData: {
userid: "",
},
node: {
level: 1
},
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['change', 'blur']}],
},
tableHeight: null
}
},
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue')
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
},
methods: {
wyhChange(val) {
this.$set(this.formData, 'mechanismcode', val.code)
},
userChange(val) {
this.cyFormData = this.userList.find(v => {
if (v.userid === val) {
return v
}
})
this.$set(this.cyFormData, 'sf', '1')
},
async queryUser(query) {
const {data} = await $.get(loc() + "/queryUser", {
jdhid: this.pageForm.jdhid,
jgid: this.checkData.id,
query: query
})
if (data) {
this.userList = data
}
},
queryKyWyhMc(jdhid) {
if (jdhid !== '') {
$.get(loc() + '/queryKyWyhMc', {jdhid: jdhid}).then(res => {
if (res.code === 0) {
this.wyhList = res.data
}
})
}
},
adminFilterMethod(query, item) {
return item.username.indexOf(query) > -1;
},
async jdhChange(jdhid) {
await this.cyPageData()
await this.pageData()
this.queryKyWyhMc(jdhid)
},
async ssChange(jdhid) {
this.queryKyWyhMc(jdhid)
},
dropdownCommand: function (command) {
const {type, data} = command
if (type == 'view') {
} else if (type == 'edit') {
this.openEdit(data)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
filterNode(value, data, node) {
if (!value) return true;
return data.name.indexOf(value) !== -1
return false
},
async handleNodeClick(data, node) {
this.nodeZm = node.label === "专门委员会"
this.pageForm.mcid = data.mcid
this.pageForm.jgid = data.id
this.hasChildren = data.hasChildren
this.checkData = data
this.checkNode = node
this.pageForm.parentId = this.checkData.id
if (!this.hasChildren) {
await this.cyPageData()
} else {
this.pageData()
}
},
async loadTree(flush) {
this.treeLoading = true
const {
code,
data,
msg
} = await $.get("/platform/jdh/zzjg/mechanism/getJgszTreeData", {jdhid: this.pageForm.jdhid})
this.treeLoading = false
if (code == 0) {
this.treeData = data
} else {
this.$message({
message: msg,
type: 'error'
});
}
if (flush && code == 0) {
this.checkData = data[0]
this.pageData();
}
},
openAdd() {
const id = this.checkData
this.formData = {
parentId: id.id,
jdhid: id.jdhid,
}
this.ssChange()
this.$refs.guava.edit()
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
doAdd() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
this.loading = true
console.log(this.formData)
// this.formData.mcid = this.formData.wyh.id
// this.formData.name = this.formData.wyh.name
const resp = await $.post(loc() + "/doAdd", this.formData)
this.loading = false
if(resp.code===0){
await this.loadTree(false)
this.pageData();
this.$refs.guava.index()
}else{
this.notifyWarning(resp.msg)
}
}
});
},
async openCy() {
this.cyFormData = {
userid: '',
mobile: '',
dwname: '',
sf: '1'
}
this.cyDialogVisible = true
},
cyPageNumberChange(val) {
this.pageForm.pageNumber = val;
this.cyPageData();
},
cyPageSizeChange(val) {
this.pageForm.pageSize = val;
this.cyPageData();
},
async cyPageData() {
const jgid = this.pageForm.jgid
const jdhid = this.pageForm.jdhid
const data = await $.post(loc() + "/cyPageData", this.pageForm)
this.tableLoading = false
if (data.code == 0) {
this.cyTableData = data.data.list;
this.cyPageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
},
async doCy() {
this.cyDialogVisible = true
if (this.cyFormData.userid === '') {
this.$message.info('请先选择用户!')
return
}
this.cySubLoading = true
this.cyFormData.jgid = this.pageForm.jgid
this.cyFormData.jdhid = this.pageForm.jdhid
this.cyFormData.mcid = this.pageForm.mcid
const resp = await $.post(loc() + "/cydoAdd", this.cyFormData)
if(resp.code===0){
this.cyDialogVisible = false
this.cyPageData();
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
this.cyPageData()
this.cyFormData.userid = ''
this.userList = []
this.cyDialogVisible = false
this.cySubLoading = false
},
async openEdit(row) {
this.wyhList = this.queryKyWyhMc(row.jdhid)
this.formData = {
id: row.id,
wyh: row.name,
name: row.name,
jdhid: row.jdhid,
mechanismName: row.mechanismName,
mechanismcode: row.mechanismcode
}
this.$refs.guava.edit()
},
doEdit() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
this.loading = true
this.formData.mcid = this.formData.wyh.id
this.formData.name = this.formData.wyh.name
const resp = await $.post(loc() + "/doEdit", this.formData)
this.loading = false
if(resp.code===0){
this.loadTree(false)
this.pageData();
this.$refs.guava.index()
}else{
this.notifyWarning(resp.msg)
}
}
});
},
doDelete(id) {
this.$confirm('确定要删除该机构吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id: id})
if(resp.code===0){
this.notifySuccess(resp.msg)
this.pageData()
this.loadTree(true)
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
doDeleteCy(row) {
this.$confirm('确定要删除该委员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDeleteCy", row)
if(resp.code===0){
this.notifySuccess(resp.msg)
this.pageData()
this.cyPageData()
this.loadTree(true)
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
updateSf(row, sf) {
$.post(loc() + '/updateSf',
{
userid: row.userid,
jgid: row.jgid,
sf: sf,
jdhid: row.jdhid
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.cyPageData()
this.pageData()
}
})
},
},
async created() {
this.jdhList = await getAllMeeting()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
}
this.loadTree(true)
},
mounted() {
// setTimeout(() => {
// this.tableHeight = window.innerHeight - 88 - this.$refs.table1.$el.getBoundingClientRect().top
// this.tableHeight = window.innerHeight - 88 - this.$refs.table2.$el.getBoundingClientRect().top
// window.onresize = () => {
// this.tableHeight = window.innerHeight - 88 - this.$refs.table1.$el.getBoundingClientRect().top
// this.tableHeight = window.innerHeight - 88 - this.$refs.table2.$el.getBoundingClientRect().top
// }
// }, 100)
}
})
</script>
<!--#
}
#-->