first commit
This commit is contained in:
@@ -0,0 +1,518 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<el-row class="header navbar bg-white shadow">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.jdhid" filterable placeholder="请选择教代会" @change="jdhChange">
|
||||
<el-option
|
||||
v-for="item in jdhList"
|
||||
:key="item.id"
|
||||
:label="item.jdhallname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.dbtid" filterable clearable placeholder="请选择代表团"
|
||||
@change="dbtChange(pageForm.dbtid)">
|
||||
<el-option
|
||||
v-for="item in delegations"
|
||||
:key="item.id"
|
||||
:label="item.dbtname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select clearable v-model="pageForm.union_id" filterable placeholder="请选择工会">
|
||||
<el-option
|
||||
v-for="item in unionOptions"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button @click="openAdd"><i class="ti-plus"></i> 新建代表团</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-dialog title="新建代表团" :visible.sync="addDialogVisible">
|
||||
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
|
||||
<el-form-item prop="jdhid" label="所属教代会">
|
||||
<el-select v-model="formData.jdhid" @change="addJdhChange" placeholder="选择教代会" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in jdhList"
|
||||
:key="item.id"
|
||||
:label="item.jdhallname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="dbtname" label="代表团名称">
|
||||
<el-select multiple v-model="formData.dbtname" filterable placeholder="请选中代表团名称" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in dbtList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="序号" type="index">
|
||||
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="code" label="代表团编码"></el-table-column>
|
||||
<el-table-column prop="dbtname" label="代表团名称"></el-table-column>
|
||||
<el-table-column prop="jdhallname" label="所属教代会"></el-table-column>
|
||||
<el-table-column prop="cjsj" label="创建时间"></el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'fgh',data:scope.row}">
|
||||
设置组成分工会
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'tz',data:scope.row}">
|
||||
设置团长/副团长
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删     除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
<el-dialog :title="'设置'+setzcfghdbtname+'组成工会'" :visible.sync="fghDialogVisible">
|
||||
<template>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select size="mini" v-model="readySetFghId" filterable>
|
||||
<el-option v-for="i in fghList" :label="i.unionname" :value="i.id" :key="i.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button size="mini" type="primary" @click="fghdoAdd" icon="el-icon-circle-plus">
|
||||
添加
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-row>
|
||||
<el-row style="margin-top: 15px">
|
||||
<el-table :data="fghTableData" size="mini" height="300">
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column sortable prop="unionname" label="分工会名称"></el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-delete" @click="fghdoDelete(scope.row.id)" size="mini"
|
||||
type="danger"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="danger" @click="fghDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="设置团长/副团长" :visible.sync="TzDialogVisible">
|
||||
<el-row>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select
|
||||
size="mini"
|
||||
style="width: 300px"
|
||||
v-model="TzFormData.userid"
|
||||
filterable
|
||||
placeholder="请输入工号或姓名关键字">
|
||||
<el-option
|
||||
v-for="item in readyTzList"
|
||||
:key="item.id"
|
||||
:label="item.loginname+' '+item.username+' '+item.dwname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-dropdown placement="bottom">
|
||||
<el-button type="primary" size="mini">
|
||||
设置身份<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="doAddTz(2)">团 长
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="doAddTz(1)">副团长
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 15px">
|
||||
<el-table :data="TzTableData" size="mini" height="300">
|
||||
<el-table-column sortable prop="loginname" label="工号"></el-table-column>
|
||||
<el-table-column sortable prop="username" label="姓名"></el-table-column>
|
||||
<el-table-column sortable prop="dwname" label="单位"></el-table-column>
|
||||
<el-table-column prop="mobile" label="电话"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="rolename" label="身份">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.rolename==='代表团团长'" class="text-primary">设置团长</span>
|
||||
<span v-if="scope.row.rolename==='代表团副团长'" class="text-info">设置副团长</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="danger" icon="el-icon-delete"
|
||||
@click="delUser(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer" style="margin-top: 0">
|
||||
<el-button type="danger" @click="TzDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="设置操作员" :visible.sync="CzyDialogVisible">
|
||||
<el-row>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select size="mini" style="width: 300px"
|
||||
remote reserve-keyword :remote-method="queryCzyList"
|
||||
v-model="readyCzyUser" filterable placeholder="请输入工号或姓名关键字">
|
||||
<el-option
|
||||
v-for="item in readyCzyList"
|
||||
:key="item.id"
|
||||
:label="item.loginname+' '+item.username"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button size="mini" type="primary" @click="czydoAdd" icon="el-icon-circle-plus">
|
||||
添加
|
||||
</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 15px">
|
||||
<el-table :data="CzyTableData" size="mini" height="300">
|
||||
<el-table-column prop="loginname" label="工号"></el-table-column>
|
||||
<el-table-column prop="username" label="姓名"></el-table-column>
|
||||
<el-table-column prop="dwname" label="单位"></el-table-column>
|
||||
<el-table-column prop="mobile" label="电话"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-delete" @click="czydoDelete(scope.row.id)" size="mini"
|
||||
type="danger"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer" style="margin-top: 0">
|
||||
<el-button type="danger" @click="CzyDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
setzcfghdbtname: '',
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
dbtname: '',
|
||||
jdhid: '',
|
||||
union_id: ""
|
||||
},
|
||||
jdhList: [],
|
||||
delegations: [],
|
||||
dbtList: [],
|
||||
addDialogVisible: false,
|
||||
formData: {},
|
||||
fghDialogVisible: false,
|
||||
fghFormData: {},
|
||||
fghList: [],
|
||||
readySetFghId: '',
|
||||
fghTableData: [],
|
||||
TzDialogVisible: false,
|
||||
TzFormData: {},
|
||||
readyTzUser: [],
|
||||
readyTzList: [],
|
||||
TzTableData: [],
|
||||
czyFormData: {},
|
||||
CzyDialogVisible: false,
|
||||
readyCzyUser: '',
|
||||
readyCzyList: [],
|
||||
CzyTableData: [],
|
||||
rules: {
|
||||
jdhid: [{required: true, message: '请选择教代会', trigger: ['change', 'blur']}],
|
||||
dbtname: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}]
|
||||
},
|
||||
unionOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'fgh') {
|
||||
this.openFgh(data.id, data.jdhid, data.dbtname)
|
||||
} else if (type == 'tz') {
|
||||
this.openTz(data.id, data.jdhid)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
},
|
||||
async dbtChange(dbtId) {
|
||||
this.pageForm.union_id = ''
|
||||
this.unionOptions = await getUnions(dbtId)
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = {}
|
||||
if (this.jdhList.length > 0) {
|
||||
this.formData.jdhid = this.jdhList[0].id
|
||||
this.getDbtList(this.formData.jdhid)
|
||||
}
|
||||
|
||||
this.addDialogVisible = true
|
||||
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
|
||||
},
|
||||
async doAdd() {
|
||||
this.$refs['addForm'].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const resp = await $.post(base + '/platform/jdh/zzjg/dbt/doAdd', this.formData)
|
||||
loading.close()
|
||||
if(resp.code===0){
|
||||
this.pageData()
|
||||
this.addDialogVisible = false
|
||||
}else{
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
async jdhChange(val) {
|
||||
this.pageForm.dbtid = ''
|
||||
this.delegations = await getDbt(val)
|
||||
},
|
||||
addJdhChange(val) {
|
||||
this.getDbtList(val)
|
||||
},
|
||||
getDbtList(jdhid) {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/queryKyDbtMc', {jdhid: jdhid}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.dbtList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
openFgh(id, jdhid, dbtname) {
|
||||
this.setzcfghdbtname = dbtname
|
||||
this.fghFormData = {id, jdhid}
|
||||
this.getNoSetFgh(jdhid)
|
||||
this.getDbtFghData(id)
|
||||
this.fghDialogVisible = true
|
||||
},
|
||||
//查询没有被代表团设置的组成分工会
|
||||
getNoSetFgh(jdhid) {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/queryNoSetFgh', {jdhid: jdhid}).then(res => {
|
||||
this.fghList = res.data
|
||||
})
|
||||
},
|
||||
//该代表团下的组成分工会
|
||||
getDbtFghData(id) {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/getDbtFghData', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.fghTableData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
fghdoAdd() {
|
||||
if (this.readySetFghId === '') {
|
||||
this.$message.info('请先选择分工会')
|
||||
return
|
||||
}
|
||||
this.fghFormData.fghid = this.readySetFghId
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/fghdoAdd', this.fghFormData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.readySetFghId = ''
|
||||
this.getNoSetFgh(this.fghFormData.jdhid)
|
||||
this.getDbtFghData(this.fghFormData.id)
|
||||
}
|
||||
})
|
||||
},
|
||||
fghdoDelete(id) {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/fghdoDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.getNoSetFgh(this.fghFormData.jdhid)
|
||||
this.getDbtFghData(this.fghFormData.id)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//团长副团长
|
||||
openTz(id, jdhid) {
|
||||
this.TzFormData = {
|
||||
id: id,
|
||||
jdhid: jdhid
|
||||
}
|
||||
this.getNotTzList()
|
||||
this.getTzList()
|
||||
this.TzDialogVisible = true
|
||||
},
|
||||
//获取没被设置为团长副团长的代表
|
||||
getNotTzList() {
|
||||
$.get(base + '/platform/jdh/zzjg/dbt/queryUser', {id: this.TzFormData.id}).then(res => {
|
||||
this.readyTzList = res.data
|
||||
})
|
||||
},
|
||||
//获取团长副团长
|
||||
getTzList() {
|
||||
$.get(base + '/platform/jdh/zzjg/dbt/getTzList', {id: this.TzFormData.id}).then(res => {
|
||||
this.TzTableData = res.data
|
||||
})
|
||||
},
|
||||
delUser(obj) {
|
||||
let data = {
|
||||
userid: obj.id,
|
||||
dbtid: this.TzFormData.id,
|
||||
jdhid: this.TzFormData.jdhid,
|
||||
roleid: obj.roleid
|
||||
}
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/delUser', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.getTzList()
|
||||
this.getNotTzList()
|
||||
}
|
||||
})
|
||||
},
|
||||
doAddTz(num) {
|
||||
this.TzFormData.num = num
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/doAddTz', this.TzFormData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.getTzList()
|
||||
this.getNotTzList()
|
||||
this.TzFormData.userid = ''
|
||||
this.readyTzList = []
|
||||
|
||||
} else {
|
||||
this.$message.info(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//操作员
|
||||
openCzy(id, jdhid) {
|
||||
this.czyFormData = {id, jdhid}
|
||||
this.getCzyTableData()
|
||||
this.CzyDialogVisible = true
|
||||
},
|
||||
getCzyTableData() {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/getCzyTableData', {dbtid: this.czyFormData.id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.CzyTableData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
czydoAdd() {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/czydoAdd', {
|
||||
userid: this.readyCzyUser,
|
||||
dbtid: this.czyFormData.id,
|
||||
jdhid: this.czyFormData.jdhid
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.readyCzyUser = ''
|
||||
this.readyCzyList = []
|
||||
this.getCzyTableData()
|
||||
}
|
||||
})
|
||||
},
|
||||
czydoDelete(userid) {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/czydoDelete', {
|
||||
userid: userid,
|
||||
dbtid: this.czyFormData.id
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.getCzyTableData()
|
||||
}
|
||||
})
|
||||
},
|
||||
queryCzyList(keyword) {
|
||||
$.get(base + '/platform/jdh/zzjg/dbt/getReadyCzyList', {
|
||||
dbtid: this.czyFormData.id,
|
||||
keyword: keyword
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.readyCzyList = res.data.list
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
$.post(base + '/platform/jdh/zzjg/dbt/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await getUnions()
|
||||
this.jdhList = await proposal.getOpenMeeting()
|
||||
if (this.jdhList.length > 0) {
|
||||
this.pageForm.jdhid = this.jdhList[0].id
|
||||
this.delegations = await getDbt(this.jdhList[0].id)
|
||||
this.pageData()
|
||||
}
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user