Files
UNION_HUTB/target/classes/views/platform/jdh/zzjg/dbt.html
T
2026-09-09 09:14:28 +08:00

521 lines
21 KiB
HTML

<!--#
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>
<!--#
}
#-->