first commit

This commit is contained in:
2026-09-09 09:14:28 +08:00
commit 5343198112
5199 changed files with 1052895 additions and 0 deletions
@@ -0,0 +1,258 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div :style="{padding:(tabShow?'0':'10px')}" 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 @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><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 align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">组员</span>
<span class="text-primary" v-if="row.sf===2">负责人</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 @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置组员
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置负责人
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加组员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小组成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
reserve-keyword
v-model="formData.cyuser">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<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 @change="jdhChange" filterable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select @change="dbtChange(pageForm.dbtid)" clearable filterable placeholder="请选择代表团"
v-model="pageForm.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable filterable placeholder="请选择工会" v-model="pageForm.union_id">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionOptions">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></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 :visible.sync="addDialogVisible" title="新建代表团">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="addJdhChange" placeholder="选择教代会" style="width: 100%" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="代表团名称" prop="dbtname">
<el-select filterable multiple placeholder="请选中代表团名称" style="width: 100%" v-model="formData.dbtname">
<el-option
:key="item.id"
:label="item.name"
:value="item.name"
v-for="item in dbtList">
</el-option>
</el-select>
</el-form-item>
</el-form>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</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 label="代表团编码" prop="code"></el-table-column>
<el-table-column label="代表团名称" prop="dbtname"></el-table-column>
<el-table-column label="所属教代会" prop="jdhallname"></el-table-column>
<el-table-column label="创建时间" prop="cjsj"></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 filterable size="mini" v-model="readySetFghId">
<el-option :key="i.id" :label="i.unionname" :value="i.id" v-for="i in fghList"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="fghdoAdd" icon="el-icon-circle-plus" size="mini" type="primary">
添加
</el-button>
</div>
</template>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="fghTableData" height="300" size="mini">
<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 @click="fghdoDelete(scope.row.id)" icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer">
<el-button @click="fghDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="TzDialogVisible" title="设置团长/副团长">
<el-row>
<div class="btn-group tool-button mt5">
<el-select
filterable
placeholder="请输入工号或姓名关键字"
size="mini"
style="width: 300px"
v-model="TzFormData.userid">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in readyTzList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-dropdown placement="bottom">
<el-button size="mini" type="primary">
设置身份<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" height="300" size="mini">
<el-table-column label="工号" prop="loginname" sortable></el-table-column>
<el-table-column label="姓名" prop="username" sortable></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="电话" prop="mobile"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份" prop="rolename">
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.rolename==='代表团团长'">设置团长</span>
<span class="text-info" v-if="scope.row.rolename==='代表团副团长'">设置副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="delUser(scope.row)" icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer" style="margin-top: 0">
<el-button @click="TzDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="CzyDialogVisible" title="设置操作员">
<el-row>
<div class="btn-group tool-button mt5">
<el-select :remote-method="queryCzyList" filterable
placeholder="请输入工号或姓名关键字" remote reserve-keyword
size="mini" style="width: 300px" v-model="readyCzyUser">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username"
:value="item.id"
v-for="item in readyCzyList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="czydoAdd" icon="el-icon-circle-plus" size="mini" type="primary">
添加
</el-button>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="CzyTableData" height="300" size="mini">
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="单位" prop="dwname"></el-table-column>
<el-table-column label="电话" prop="mobile"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button @click="czydoDelete(scope.row.id)" icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer" style="margin-top: 0">
<el-button @click="CzyDialogVisible = false" type="danger">关 闭</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 @change="jdhChange" filterable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"
accordion class="filter-tree"
default-expand-all highlight-current ref="tree">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div class="v-node" style="font-size: 16px;" v-if="node.level==1">
<i class="el-icon-office-building"></i>&nbsp;{{ data.dbtname }}
</div>
<div class="v-node" style="font-size: 14px" v-if="node.level==2">
<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 class="pl10 pr10" v-if="node.level==1">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择代表团" v-model="pageForm.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openAdd" type="primary"><i class="ti-plus"></i> 添加代表团</el-button>
</div>
</el-card>
<el-dialog :visible.sync="addDialogVisible" title="添加代表团" width="40%">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="addJdhChange" placeholder="选择教代会" style="width: 100%"
v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="代表团名称" prop="dbt">
<el-select filterable multiple placeholder="请选中代表团名称" style="width: 100%"
v-model="formData.dbt">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in dbtList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-card class="mt20" shadow="never">
<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" label="代表团名称"
prop="dbtname"></el-table-column>
<el-table-column align="center" header-align="center" label="代表团编码"
prop="dictcode"></el-table-column>
<el-table-column align="center" header-align="center" label="所属教代会"
prop="jdhallname"></el-table-column>
<el-table-column align="center" header-align="center" label="创建时间" prop="cjsj">
<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 class="pl10 pr10" v-if="node.level==2">
<el-tabs @tab-click="handleTabClick" type="card" v-model="activeName">
<el-tab-pane label="代表" name="one">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入内容"
v-model="dbPageForm.searchKeyword">
<el-select placeholder="查询类型" slot="prepend"
style="width: 120px;"
v-model="dbPageForm.searchName">
<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 @change="getUnits" clearable filterable placeholder="请选择工会"
v-model="dbPageForm.unionid">
<el-option
:label="item.unionname"
:value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择单位"
v-model="dbPageForm.unitid">
<el-option
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="dbDoSearch" icon="el-icon-search"
type="primary"></el-button>
</div>
</el-card>
<el-table :data="dbTableData" class="mt20">
<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 label="工会" prop="unionname" sortable></el-table-column>
<el-table-column label="单位" prop="unitname" sortable></el-table-column>
<el-table-column label="代表身份" prop="rolename" sortable></el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="设置组成基层工会" name="two">
<el-card class="text-right" shadow="never">
<el-button @click="fghdoAdd(adminPageForm.dbtid)" type="primary">
{{butTitle}}
</el-button>
</el-card>
<el-table :data="adminTableData" class="mt20">
<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 @click="fghdoDelete(row)" circle icon="el-icon-delete" plain
size="mini"
type="danger">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="设置团长/副团长" name="three">
<el-card class="text-right" shadow="never">
<el-button @click="openUser(adminPageForm.dbtid)" type="primary">
{{butTitle}}
</el-button>
</el-card>
<el-table :data="TzTableData" class="mt20" height="300">
<el-table-column label="工号" prop="loginname" sortable></el-table-column>
<el-table-column label="姓名" prop="username" sortable></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="电话" prop="mobile"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份" prop="rolename">
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.rolename==='代表团团长'">团长</span>
<span class="text-info" v-if="scope.row.rolename==='代表团副团长'">副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button @click="delUser(row)" circle icon="el-icon-delete" plain size="mini"
type="danger">
</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 :data="fghData" :filter-method="adminFilterMethod"
:props="{key: 'id',label: 'unionname'}"
:titles="['剩余分工会', '代表团分工会']"
filterable
v-model="fghFormData.fghValue">
</el-transfer>
</div>
<span class="dialog-footer" slot="footer">
<el-button @click="fghDialogVisible = false">取 消</el-button>
<el-button :loading="fghSubLoading" @click="dofgh" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="设置团长副团长" width="40%">
<el-form label-width="100px">
<el-form-item label="届次" prop="jdhallname">
<el-select disabled style="width: 100%" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工号或姓名" prop="userid">
<el-select @change="userChange" filterable placeholder="请输入工号或姓名关键字"
style="width: 100%" v-model="userFormData.userid">
<el-option
:key="item.id"
:label="item.username+'('+item.loginname+')'"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式" prop="mobile">
<el-input readonly v-model="leaderInfo.mobile"></el-input>
</el-form-item>
<el-form-item label="所属单位" prop="dwname">
<el-input readonly v-model="leaderInfo.dwname"></el-input>
</el-form-item>
<el-form-item label="身份" prop="sf">
<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 class="dialog-footer" slot="footer">
<el-button :disabled="userSubLoading" @click="doAddTz" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="deleDialogVisible" title="编辑代表团名称" 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 class="dialog-footer" slot="footer">
<el-button @click="deleDialogVisible = false">取 消</el-button>
<el-button @click="deleDo" type="primary">确 定</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.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" style="height: 100%" v-cloak>
<tree-layout>
<template #tree>
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick" accordion default-expand-all
highlight-current>
<div class="custom-tree-node" slot-scope="{ node, data }">
<div class="v-node" style="font-size: 16px;" v-if="node.level==1">
<i class="el-icon-school"></i>&nbsp;{{ data.label }}
</div>
<div class="v-node" style="font-size: 14px" v-if="node.level==2">
<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 :data="treeData" :expand-on-click-node="false" :filter-node-method="filterNode"
:props="defaultProps" @node-click="handleNodeClick"
accordion
class="v-tree" default-expand-all
highlight-current node-key="id"
ref="tree" v-loading="treeLoading">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div class="v-node" style="font-size: 16px;" v-if="node.level==1"><i
class="el-icon-s-home"></i>&nbsp;
{{ data.name }}
</div>
<div :title="data.name"
class="v-node" style="font-size: 15px" v-if="node.level==2">
<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 :title="data.name"
class="v-node" style="font-size: 14px" v-if="node.level==3">
<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 :title="data.name"
class="v-node" style="font-size: 14px" v-if="node.level>3">
<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 class="pl10 pr10" v-if="node.level==1">
<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 @click="openAdd()" icon="el-icon-plus"
type="primary">
新建机构
</el-button>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<el-table :data="tableData" key="1" 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 align="center" label="机构名称" prop="name"></el-table-column>
<el-table-column align="center" label="机构编码" prop="mechanismcode"></el-table-column>
<el-table-column align="center" label="备注" prop="mechanismName"
show-overflow-tooltip></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 @change="jdhChange" filterable placeholder="请选择教代会"
v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 @click="cyPageData" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="offscreen-right pull-right">
<el-button @click="openCy()" icon="el-icon-plus"
size="medium"
type="primary">
设置委员
</el-button>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<el-table :data="cyTableData" key="2" 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 align="center" label="工号" prop="loginname"></el-table-column>
<el-table-column align="center" label="姓名" prop="username"></el-table-column>
<el-table-column align="center" label="性别" prop="sex"></el-table-column>
<el-table-column align="center" label="手机" prop="mobile"></el-table-column>
<el-table-column align="center" label="单位" prop="unitname" show-overflow-tooltip>
<template slot-scope="{row}">
({{row.unitcode}}){{row.unitname}}
</template>
</el-table-column>
<el-table-column align="center" label="届次" prop="jdhallname"></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">委员</span>
<span class="text-primary" v-if="row.sf===2">副主任</span>
<span class="text-primary" v-if="row.sf===3">主任</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 @click.native="updateSf(row,3)"
class="text-primary"
v-if="row.sf!==3">设置主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row,2)"
class="text-primary"
v-if="row.sf!==2">设置副主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row,1)"
class="text-primary"
v-if="row.sf!==1">设置委员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="cyPageForm.pageNumber"
:page-size="cyPageForm.pageSize"
:page-sizes="[5,10, 20, 30, 50]"
:total="cyPageForm.totalCount"
@current-change="cyPageNumberChange"
@size-change="cyPageSizeChange"
layout="total, sizes, prev, pager, next">
</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" :rules="rules" label-width="100px" ref="addForm">
<el-row gutter="30">
<el-col :span="24">
<el-form-item label="上级机构" prop="name">
<el-input :value="checkData.name" disabled maxlength="100"
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 :disabled="formData.id!=null" maxlength="100" placeholder="请输入机构名称"
type="text"
v-model="formData.name"></el-input>
</el-form-item>
<el-form-item label="机构名称" prop="name" v-else>
<el-select :disabled="formData.id!=null" @change="wyhChange" style="width: 100%"
v-model="formData.wyh"
value-key="id">
<el-option :key="i.id" :label="i.name" :value="i" v-for="i in wyhList"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="机构代码" prop="unitcode">
<el-input maxlength="100" placeholder="请输入机构编码"
type="text"
v-model="formData.mechanismcode"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="unitcode">
<el-input :autosize="{ minRows: 4, maxRows: 8}" maxlength="100"
placeholder="请输入备注"
type="textarea"
v-model="formData.mechanismName"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display: flex;justify-content:flex-end;margin-top: 30px">
<el-button :loading="loading" @click="!formData.id?doAdd():doEdit()" type="primary">提 交
</el-button>
</div>
</template>
</guava>
<el-dialog :visible.sync="cyDialogVisible" title="设置委员" width="40%">
<el-form label-width="100px">
<el-form-item label="届次" prop="jdhallname">
<el-select disabled style="width: 100%" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工号或姓名" prop="userid">
<el-select @change="userChange" filterable placeholder="请输入工号或姓名关键字"
style="width: 100%" v-model="cyFormData.userid">
<el-option
:key="item.userid"
:label="item.username+'('+item.loginname+')'"
:value="item.userid"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式" prop="mobile">
<el-input readonly v-model="cyFormData.mobile"></el-input>
</el-form-item>
<el-form-item label="所属单位" prop="dwname">
<el-input readonly v-model="cyFormData.dwname"></el-input>
</el-form-item>
<el-form-item label="身份" prop="sf">
<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 class="dialog-footer" slot="footer">
<el-button :loading="cySubLoading" @click="doCy" type="primary">确 定</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('请先选择用户!')
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 :style="{padding:(tabShow?'0':'10px')}" 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 @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><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 align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">组员</span>
<span class="text-primary" v-if="row.sf===2">副组长</span>
<span class="text-primary" v-if="row.sf===3">组长</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 @click.native="updateSf(row.id,3)" class="text-primary"
v-if="row.sf!==3">设置组长
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置副组长
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置组员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加组员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小组成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
reserve-keyword
v-model="formData.cyuser">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<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 @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.wyhname"></el-input>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><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 align="center" header-align="center" label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="委员会名称" prop="wyhname"></el-table-column>
<el-table-column label="主任及联系方式" prop="zrmobile"></el-table-column>
<el-table-column label="工作职责" prop="gzzz" 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 :visible.sync="addDialogVisible" title="添加委员会">
<el-form :model="formData" :rules="rules" label-width="120px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会名称" prop="name">
<el-select v-model="formData.wyh" value-key="id">
<el-option :key="i.id" :label="i.name" :value="i" v-for="i in wyhList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会工作职责" prop="gzzz">
<el-input rows="5" type="textarea" v-model.trim="formData.gzzz"></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="editDialogVisible" title="编辑委员会">
<el-form :model="formData" :rules="rules" label-width="120px" ref="editForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select disabled placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会名称" prop="name">
<el-select disabled v-model="formData.wyh" value-key="i.id">
<el-option :key="i.id" :label="i.name" :value="i" v-for="i in wyhList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会工作职责" prop="gzzz">
<el-input rows="5" type="textarea" v-model.trim="formData.gzzz"></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="委员会成员设置" width="70%">
<el-row>
<div class="btn-group tool-button mt5">
<div>
<el-select
:remote-method="queryUser"
filterable
placeholder="请输入工号或姓名关键字"
remote
size="mini"
style="width: 400px"
v-model="userFormData.userid">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' ' + item.dwname"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="addUser2Tab " icon="el-icon-circle-plus" size="mini" type="primary">添加成员</el-button>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="userTableData" height="300">
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="手机号码" prop="mobile"></el-table-column>
<el-table-column label="所属单位" prop="dwname"></el-table-column>
<el-table-column label="身份" prop="sf">
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.sf===1">成员</span>
<span class="text-primary" v-if="scope.row.sf===2">副主任</span>
<span class="text-primary" v-if="scope.row.sf===3">主任</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-dropdown placement="bottom">
<el-button size="mini" type="primary">
设置身份<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="updateSf(scope.row,3)" v-if="scope.row.sf!==3">主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(scope.row,2)" v-if="scope.row.sf!==2">副主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(scope.row,1)" v-if="scope.row.sf!==1">成员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button @click="doDeleteUser(scope.row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer">
<el-button @click="userDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="viewDialogVisible" title="详情">
<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 :style="{padding:(tabShow?'0':'10px')}" 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 @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><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 align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">成员</span>
<span class="text-primary" v-if="row.sf===2">副秘书长</span>
<span class="text-primary" v-if="row.sf===3">秘书长</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 @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置组员
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置副秘书长
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,3)" class="text-primary"
v-if="row.sf!==3">设置秘书长
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加成员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="主席团成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
v-model="formData.cyuser"
value-key="id">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<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 @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><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 align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">成员</span>
<span class="text-primary" v-if="row.sf===2">副主任</span>
<span class="text-primary" v-if="row.sf===3">主任</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 @click.native="updateSf(row.id,3)" class="text-primary"
v-if="row.sf!==3">设置主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置副主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置成员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加成员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
v-model="formData.cyuser"
value-key="id">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<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>
<!--#
}
#-->