first commit

This commit is contained in:
2026-09-23 09:38:39 +08:00
commit 98a8b8cace
6257 changed files with 1266718 additions and 0 deletions
@@ -0,0 +1,258 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div id="app" :style="{padding:(tabShow?'0':'10px')}" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable v-model="pageForm.jdhid" placeholder="请选择教代会">
<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-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" @click="openAdd"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column sortable prop="sex" label="性别"></el-table-column>
<el-table-column prop="mobile" label="手机"></el-table-column>
<el-table-column sortable prop="dwname" label="单位"></el-table-column>
<el-table-column sortable prop="jdhallname" label="教代会"></el-table-column>
<el-table-column sortable prop="sf" label="身份">
<template slot-scope="{row}">
<span v-if="row.sf===1" class="text-primary">组员</span>
<span v-if="row.sf===2" class="text-primary">负责人</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id, row.userid, row.jdhid)">
删除
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==1" @click.native="updateSf(row.id,1)"
class="text-primary">设置组员
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==2" @click.native="updateSf(row.id,2)"
class="text-primary">设置负责人
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<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="jdhChange" placeholder="选择教代会">
<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="cyuser" label="小组成员">
<el-select
v-model="formData.cyuser"
filterable
remote
multiple
reserve-keyword
placeholder="请输入用户工号或姓名关键字"
:remote-method="queryUser">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id">
</el-option>
</el-select>
</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>
</div>
</transition>
<db-info :uid="uid" :active="'1'" :show="!tabShow">
<template slot="title">
<div class="text-primary pointer" style="font-size: 20px" @click="tabShow=true">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
visible: false,
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/cbldxz/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = res.data.list
})
}
},
doDelete(id, userid, jdhid) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/cbldxz/doDelete', {
id: id,
userid: userid,
jdhid: jdhid
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/cbldxz/doAdd', {
jdhid: this.formData.jdhid,
userids: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/cbldxz/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,520 @@
<!--#
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 label="部门工会名称" prop="unionname" sortable></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',
data() {
return {
setzcfghdbtname: '',
tableData: [],
pageForm: {
...getPageForm(),
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)
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.addDialogVisible = false
}, (data, msg) => {
this.$message.error(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()
}
})
},
...pageSomeThing
},
async created() {
this.unionOptions = await getUnions()
this.jdhList = await getOpenJdh()
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,781 @@
<!--#
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>
<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">
<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:'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>
<el-tab-pane label="设置组成基层工会" name="two">
<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>
<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="设置团长副团长" :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 :rules="{required: true, message: '请填写代表团名称', trigger: 'blur'}" label="代表团名称" prop="dbtName"
ref="aa">
<el-input v-model="editForm.dbtName"></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>
const 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: [],
dbTableData: [],
adminPageForm: {},
dbPageForm: {
...getPageForm(),
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']}],
dbt: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}]
},
deleData: {},
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'fgh') {
this.openFgh(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.deleDialogVisible = true
if (this.$refs['editForm']) {
this.$refs['editForm'].resetFields()
}
},
async deleDo() {
this.$refs['editForm'].validate(async (valid) => {
if (valid) {
this.$confirm('此操作需要先在字典表中添加新的代表团名称,请确认', '提示', {
confirmButtonText: '我已添加',
cancelButtonText: '取消',
type: 'warning',
}).then(async ({value}) => {
const resp = await $.post(loc() + '/updateDelegation', {
id: this.deleData.id,
delegationName: this.editForm.dbtName
})
if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg});
} else {
this.$notify.error({title: '失败', message: resp.msg});
}
this.pageData()
this.deleDialogVisible = false
}).catch(() => {
this.deleDialogVisible = false
});
}
})
},
async dbData() {
this.dbPageForm.jdhid = this.pageForm.jdhid
const resp = await $.get(loc() + '/dbTableData', this.dbPageForm)
requestLaterFun(resp, () => {
this.dbTableData = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
async dbDoSearch() {
await this.dbData()
},
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()
}
},
addJdhChange(val) {
this.getDbtList(val)
},
async getDbtList(jdhid) {
const resp = await $.post(loc() + "/queryKyDbtMc", {jdhid: jdhid})
requestLaterFun(resp, () => {
this.dbtList = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
async doAdd() {
this.$refs['addForm'].validate(async (valid) => {
let data = clone(this.formData)
data.dbt = JSON.stringify(data.dbt)
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(loc() + '/doAdd', data)
closeLoadingFunc(loading, resp, async () => {
await this.undertakeUnitTree()
this.pageData()
this.addDialogVisible = false
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.undertakeUnitTree()
}, () => {
this.$notify.error({title: '失败', message: 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})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.adminPageData()
}, () => {
this.$notify.error({title: '失败', message: 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)
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.getTzList()
}, () => {
this.$notify.error({title: '失败', message: 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.adminPageData()
this.getTzList()
this.dbData()
},
handleTabClick(tab) {
if (tab.name === 'one') {
this.butTitle = '设置组成基层工会'
this.adminPageForm.flag = tab.name === 'one'
this.adminPageData()
} else if (tab.name === 'two') {
this.butTitle = '设置组成基层工会'
this.adminPageForm.flag = tab.name === 'two'
this.getTzList()
} else {
this.butTitle = '设置团长/副团长'
this.adminPageForm.flag = tab.name === 'three'
this.dbData()
}
},
adminFilterMethod(query, item) {
return item.unionname.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 openUser(dbtid) {
this.userFormData = {}
this.leaderInfo = {sf: '2'}
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)
requestLaterFun(resp, () => {
this.fghDialogVisible = false
this.pageData()
this.adminPageData()
this.$notify.success({title: '成功', message: resp.msg});
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
}, () => {
this.fghSubLoading = false
})
},
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)
requestLaterFun(resp, () => {
this.adminTableData = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
//获取团长副团长
async getTzList() {
const resp = await $.get(loc() + '/getTzList', this.adminPageForm)
requestLaterFun(resp, () => {
this.TzTableData = resp.data;
}, () => {
this.$notify.error({title: '失败', message: 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)
requestLaterFun(resp, () => {
this.getTzList()
this.$notify.success({title: '成功', message: resp.msg});
}, () => {
this.$notify.error({title: '失败', message: 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)
},
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 getUnit(this.dbPageForm.unionid)
}
},
async created() {
this.jdhList = await getOpenJdh()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
this.pageData()
}
this.getUnits()
this.unionList = await getUnion()
await this.undertakeUnitTree()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,164 @@
<!--#
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;
}
</style>
<div id="v" v-cloak style="height: 100%">
<tree-layout>
<template #tree>
<el-tree :data="treeData" :props="defaultProps" default-expand-all 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-school"></i>&nbsp;{{ data.label }}
</div>
<div v-if="node.level==2" style="font-size: 14px" class="v-node">
<i class="el-icon-star-on" v-if="checkData.label==data.label"></i>
<i class="el-icon-star-off" v-else></i>&emsp;{{ data.label }}
</div>
</div>
</el-tree>
</template>
<template>
<cbldxzl-info v-show="v=='cbldxzShow'"></cbldxzl-info>
<zgscxz-info v-show="v=='zgscxzShow'"></zgscxz-info>
<zxt-info v-show="v=='zxtShow'"></zxt-info>
<zmwyh-info v-show="v=='zmwyhShow'"></zmwyh-info>
<zxwyh-info v-show="v=='zxwyhShow'"></zxwyh-info>
</template>
</tree-layout>
</div>
<script>
new Vue({
el: '#v',
mixins: [initTableMixins],
components: {
'zgscxz-info': httpVueLoader('/components/jdh/ZgscxzInfo.vue'),
'db-info': httpVueLoader('/components/jdh/dbinfo.vue'),
'zxt-info': httpVueLoader('/components/jdh/ZxtInfo.vue'),
'zmwyh-info': httpVueLoader('/components/jdh/zmwyhInfo.vue'),
'zxwyh-info': httpVueLoader('/components/jdh/zxwyhInfo.vue'),
'cbldxzl-info': httpVueLoader('/components/jdh/CbldxzInfo.vue'),
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
data() {
return {
node: {
level: 1
},
checkData: {},
jdhList: [],
v: 'cbldxzShow',
treeData: [{
label: '机构设置',
children: [
{
id: 1,
label: '筹备领导小组'
},
{
id: 2,
label: '资格领导小组',
},
{
id: 3,
label: '主席团管理',
},
{
id: 4,
label: '执行委员会',
},
{
id: 5,
label: '专门委员会',
}],
}],
defaultProps: {
children: 'children',
label: 'label',
},
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
}
},
methods: {
handleNodeClick(data, node) {
this.node = node
this.checkData = data
const id = data.id
if (id === 1) {
this.v = 'cbldxzShow'
} else if (id === 2) {
this.v = 'zgscxzShow'
} else if (id === 3) {
this.v = 'zxtShow'
} else if (id === 4) {
this.v = 'zxwyhShow'
} else if (id === 5) {
this.v = 'zmwyhShow'
}
},
},
async created() {
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,740 @@
<!--#
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">
<!-- <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">
<el-button type="primary" icon="el-icon-plus"
@click="openAdd()">
新建机构
</el-button>
</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="请输入工号或姓名关键字"
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>
const 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() {
const {data} = await $.get(loc() + "/queryUser", {jdhid: this.pageForm.jdhid, jgid: this.checkData.id})
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,
}
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
this.formData.jdhallname
this.formData.mcid = this.formData.wyh.id
this.formData.name = this.formData.wyh.name
const resp = await $.post(loc() + "/doAdd", this.formData)
requestLaterMsgFun(this, resp, () => {
this.loadTree(false)
this.pageData();
}, null, () => {
this.loading = false
this.$refs.guava.index()
})
}
});
},
async openCy() {
this.cyFormData = {
userid: '',
mobile: '',
dwname: '',
sf: '1'
}
await this.queryUser()
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
this.cySubLoading = true
if (this.cyFormData.userid === '') {
this.$message.info('请先选择用户!')
this.cySubLoading = false
return
}
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)
requestLaterFun(resp, () => {
this.cyDialogVisible = false
this.cyPageData();
this.$notify.success({title: '成功', message: resp.msg});
}, () => {
this.$notify.error({title: '失败', message: 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)
requestLaterMsgFun(this, resp, () => {
this.loadTree(false)
this.pageData();
}, null, () => {
this.loading = false
this.$refs.guava.index()
})
}
});
},
doDelete(id) {
this.$confirm('确定要删除该机构吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id: id})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.pageData()
this.loadTree(true)
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
doDeleteCy(row) {
this.$confirm('确定要删除该委员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDeleteCy", row)
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.pageData()
this.cyPageData()
this.loadTree(true)
}, () => {
this.$notify.error({title: '失败', message: 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 getOpenJdh()
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>
<!--#
}
#-->
@@ -0,0 +1,258 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div id="app" :style="{padding:(tabShow?'0':'10px')}" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable v-model="pageForm.jdhid" placeholder="请选择教代会">
<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-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" @click="openAdd"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column sortable prop="sex" label="性别"></el-table-column>
<el-table-column prop="mobile" label="手机"></el-table-column>
<el-table-column sortable prop="dwname" label="单位"></el-table-column>
<el-table-column sortable prop="jdhallname" label="教代会"></el-table-column>
<el-table-column sortable prop="sf" label="身份">
<template slot-scope="{row}">
<span v-if="row.sf===1" class="text-primary">组员</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" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id,row.userid,row.jdhid)">
删除
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==3" @click.native="updateSf(row.id,3)"
class="text-primary">设置组长
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==2" @click.native="updateSf(row.id,2)"
class="text-primary">设置副组长
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==1" @click.native="updateSf(row.id,1)"
class="text-primary">设置组员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<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="jdhChange" placeholder="选择教代会">
<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="cyuser" label="小组成员">
<el-select
v-model="formData.cyuser"
filterable
remote
multiple
reserve-keyword
placeholder="请输入用户工号或姓名关键字"
:remote-method="queryUser">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id">
</el-option>
</el-select>
</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>
</div>
</transition>
<db-info :uid="uid" :active="'1'" :show="!tabShow">
<template slot="title">
<div class="text-primary pointer" style="font-size: 20px" @click="tabShow=true">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zgscxz/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = res.data.list
})
}
},
doDelete(id, userid, jdhid) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zgscxz/doDelete', {
id: id,
userid: userid,
jdhid: jdhid
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/zgscxz/doAdd', {
jdhid: this.formData.jdhid,
userids: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/zgscxz/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,444 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div id="app" v-cloak>
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.wyhname" @keyup.enter.native="doSearch"></el-input>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable v-model="pageForm.jdhid" placeholder="请选择教代会">
<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-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" @click="openAdd"><i class="ti-plus"></i> 添加委员会</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column sortable prop="jdhallname" label="教代会"></el-table-column>
<el-table-column prop="wyhname" label="委员会名称"></el-table-column>
<el-table-column prop="zrmobile" label="主任及联系方式"></el-table-column>
<el-table-column prop="gzzz" label="工作职责" show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="openEdit(row)">
编辑
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row)">
删除
</el-dropdown-item>
<el-dropdown-item @click.native="openEditUser(row)"
class="text-primary">成员管理
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog title="添加委员会" :visible.sync="addDialogVisible">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="120px">
<el-form-item prop="jdhid" label="所属教代会">
<el-select v-model="formData.jdhid" @change="jdhChange" placeholder="选择教代会">
<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="name" label="委员会名称">
<el-select v-model="formData.wyh" value-key="id">
<el-option v-for="i in wyhList" :label="i.name" :value="i" :key="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="gzzz" label="委员会工作职责">
<el-input type="textarea" rows="5" v-model.trim="formData.gzzz"></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-dialog title="编辑委员会" :visible.sync="editDialogVisible">
<el-form :model="formData" ref="editForm" :rules="rules" label-width="120px">
<el-form-item prop="jdhid" label="所属教代会">
<el-select v-model="formData.jdhid" disabled placeholder="选择教代会">
<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="name" label="委员会名称">
<el-select v-model="formData.wyh" value-key="i.id" disabled>
<el-option v-for="i in wyhList" :label="i.name" :value="i" :key="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="gzzz" label="委员会工作职责">
<el-input type="textarea" rows="5" v-model.trim="formData.gzzz"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="委员会成员设置" :visible.sync="userDialogVisible" width="70%">
<el-row>
<div class="btn-group tool-button mt5">
<div>
<el-select
size="mini"
style="width: 400px"
v-model="userFormData.userid"
filterable
remote
placeholder="请输入工号或姓名关键字"
:remote-method="queryUser">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.loginname+' '+item.username+' ' + item.dwname"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-button size="mini" type="primary" @click="addUser2Tab " icon="el-icon-circle-plus">添加成员</el-button>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="userTableData" height="300">
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="mobile" label="手机号码"></el-table-column>
<el-table-column prop="dwname" label="所属单位"></el-table-column>
<el-table-column prop="sf" label="身份">
<template slot-scope="scope">
<span v-if="scope.row.sf===1" class="text-primary">成员</span>
<span v-if="scope.row.sf===2" class="text-primary">副主任</span>
<span v-if="scope.row.sf===3" class="text-primary">主任</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<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 v-if="scope.row.sf!==3" @click.native="updateSf(scope.row,3)">主任
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.sf!==2" @click.native="updateSf(scope.row,2)">副主任
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.sf!==1" @click.native="updateSf(scope.row,1)">成员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="danger" size="mini" @click="doDeleteUser(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button type="danger" @click="userDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
<el-dialog title="详情" :visible.sync="viewDialogVisible">
<table class="tabInfo">
<tr>
<td class="title">委员会名称</td>
<td class="content">{{viewData.wyhname}}</td>
</tr>
<tr>
<td class="title">所属教代会</td>
<td class="content">{{viewData.jdhallname}}</td>
</tr>
<tr>
<td class="title">主任</td>
<td class="content">
<template v-for="u in viewData.userList">
<span class="mr5" v-if="u.sf===3">{{u.username}}</span>
</template>
</td>
</tr>
<tr>
<td class="title">副主任</td>
<td class="content">
<template v-for="u in viewData.userList">
<span class="mr5" v-if="u.sf===2">{{u.username}}</span>
</template>
</td>
</tr>
<tr>
<td class="title">成员</td>
<td class="content">
<template v-for="u in viewData.userList">
<span class="mr5" v-if="u.sf===1">{{u.username}}</span>
</template>
</td>
</tr>
<tr>
<td class="title">委员会工作职责</td>
<td class="content">{{viewData.gzzz}}</td>
</tr>
</table>
</el-dialog>
</div>
<script>
const rules = {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
wyh: [{required: true, message: '请选择委员会', trigger: ['blur', 'change']}],
gzzz: [{required: true, message: '请输入委员会工作职责', trigger: ['blur', 'change']}]
}
let vue = new Vue({
el: "#app",
data() {
return {
rules: rules,
addDialogVisible: false,
editDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
wyhname: '',
union_id: ""
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {},
wyhList: [],
userList: [],
userDialogVisible: false,
userFormData: {},
userTableData: [],
viewDialogVisible: false,
viewData: {},
}
},
methods: {
queryKyWyhMc(jdhid) {
if (jdhid !== '') {
$.get(base + '/platform/jdh/zzjg/zmwyh/queryKyWyhMc', {jdhid: jdhid}).then(res => {
if (res.code === 0) {
this.wyhList = res.data
}
})
}
},
openEdit(obj) {
this.wyhList = [{id: obj.mcid, name: obj.wyhname}]
this.formData = {
id: obj.id,
wyh: {id: obj.mcid, name: obj.wyhname},
gzzz: obj.gzzz,
jdhid: obj.jdhid
}
this.editDialogVisible = true
},
doEdit() {
this.$refs["editForm"].validate(valid => {
if (valid) {
this.formData.name = this.formData.wyh.name
this.formData.mcid = this.formData.wyh.id
$.post(base + '/platform/jdh/zzjg/zmwyh/doEdit', this.formData).then(res => {
if (res.code === 0) {
this.editDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
doDelete(obj) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zmwyh/doDelete', {id: obj.id, jdhid: obj.jdhid}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange(jdhid) {
this.queryKyWyhMc(jdhid)
},
openAdd() {
this.formData = {
jdhid: this.jdhList.length > 0 ? this.jdhList[0].id : '',
name: '',
gzzz: ''
}
this.queryKyWyhMc(this.formData.jdhid)
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
this.formData.name = this.formData.wyh.name
this.formData.mcid = this.formData.wyh.id
$.post(base + '/platform/jdh/zzjg/zmwyh/doAdd', this.formData).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
//用户管理
userData(wyhid) {
$.get(base + '/platform/jdh/zzjg/zmwyh/userData', {wyhid: wyhid}).then(res => {
if (res.code === 0) {
this.userTableData = res.data
}
})
},
openEditUser(obj) {
this.userFormData = {
userid: '',
wyhid: obj.id,
jdhid: obj.jdhid,
wyhmcid: obj.mcid
}
this.userData(obj.id)
this.userDialogVisible = true
},
queryUser(query) {
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zmwyh/queryUser', {
query: query,
jdhid: this.userFormData.jdhid
}).then(res => {
//this.userList = QC(this.users,res.data.list,'id')
this.userList = res.data.list
})
}
},
addUser2Tab() {
if (this.userFormData.userid === '') {
this.$message.info('请先选择用户!')
return
}
$.post(base + '/platform/jdh/zzjg/zmwyh/doAddUser', this.userFormData).then(res => {
if (res.code === 0) {
this.userFormData.userid = ''
this.userList = []
this.userData(this.userFormData.wyhid)
}
})
},
updateSf(obj, sf) {
$.post(base + '/platform/jdh/zzjg/zmwyh/updateSf',
{
userid: obj.id,
zmwyhid: obj.zmwyhid,
sf: sf
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.userData(obj.zmwyhid)
this.pageData()
}
})
},
doDeleteUser(obj) {
obj.jdhid = this.userFormData.jdhid
$.post(base + '/platform/jdh/zzjg/zmwyh/doDeleteUser', obj).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.userData(obj.zmwyhid)
}
})
},
async openView(row) {
this.viewDialogVisible = true
const {data} = await GET('/platform/jdh/zzjg/zmwyh/userData', {wyhid: row.id})
this.$nextTick(() => {
this.viewData = row
this.viewData.userList = data
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
this.unionOptions = await getUnions()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,257 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div id="app" :style="{padding:(tabShow?'0':'10px')}" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable v-model="pageForm.jdhid" placeholder="请选择教代会">
<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-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" @click="openAdd"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column sortable prop="sex" label="性别"></el-table-column>
<el-table-column prop="mobile" label="手机"></el-table-column>
<el-table-column sortable prop="dwname" label="单位"></el-table-column>
<el-table-column sortable prop="jdhallname" label="教代会"></el-table-column>
<el-table-column sortable prop="sf" label="身份">
<template slot-scope="{row}">
<span v-if="row.sf===1" class="text-primary">成员</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" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id)">
删除
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==1" @click.native="updateSf(row.id,1)"
class="text-primary">设置组员
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==2" @click.native="updateSf(row.id,2)"
class="text-primary">设置副秘书长
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==3" @click.native="updateSf(row.id,3)"
class="text-primary">设置秘书长
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<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="jdhChange" placeholder="选择教代会">
<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="cyuser" label="主席团成员">
<el-select
v-model="formData.cyuser"
filterable
remote
multiple
value-key="id"
placeholder="请输入用户工号或姓名关键字"
:remote-method="queryUser">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item">
</el-option>
</el-select>
</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>
</div>
</transition>
<db-info :uid="uid" :active="'1'" :show="!tabShow">
<template slot="title">
<div class="text-primary pointer" style="font-size: 20px" @click="tabShow=true">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zxt/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = QC(this.formData.cyuser, res.data.list, 'id')
})
}
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zxt/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/zxt/doAdd', {
jdhid: this.formData.jdhid,
user: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/zxt/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,259 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div id="app" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable v-model="pageForm.jdhid" placeholder="请选择教代会">
<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-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" @click="openAdd"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column sortable prop="sex" label="性别"></el-table-column>
<el-table-column prop="mobile" label="手机"></el-table-column>
<el-table-column sortable prop="dwname" label="单位"></el-table-column>
<el-table-column sortable prop="jdhallname" label="教代会"></el-table-column>
<el-table-column sortable prop="sf" label="身份">
<template slot-scope="{row}">
<span v-if="row.sf===1" class="text-primary">成员</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" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id)">
删除
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==3" @click.native="updateSf(row.id,3)"
class="text-primary">设置主任
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==2" @click.native="updateSf(row.id,2)"
class="text-primary">设置副主任
</el-dropdown-item>
<el-dropdown-item v-if="row.sf!==1" @click.native="updateSf(row.id,1)"
class="text-primary">设置成员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<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="jdhChange" placeholder="选择教代会">
<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="cyuser" label="委员会成员">
<el-select
v-model="formData.cyuser"
filterable
remote
multiple
value-key="id"
placeholder="请输入用户工号或姓名关键字"
:remote-method="queryUser">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item">
</el-option>
</el-select>
</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>
</div>
</transition>
<db-info :uid="uid" :active="'1'" :show="!tabShow">
<template slot="title">
<div class="text-primary pointer" style="font-size: 20px" @click="tabShow=true">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zxwyh/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = QC(this.formData.cyuser, res.data.list, 'id')
//this.userList = res.data.list
})
}
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zxwyh/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/zxwyh/doAdd', {
jdhid: this.formData.jdhid,
user: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/zxwyh/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->