first commit

This commit is contained in:
2026-09-20 15:46:34 +08:00
parent 72fb5eae10
commit e558339dcc
3340 changed files with 671310 additions and 251 deletions
@@ -0,0 +1,951 @@
<!--#
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-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<tree-layout style="height: calc(100vh - 70px)">
<template #tree>
<div style="padding: 15px;">
<el-select v-model="pageForm.gdh_id" filterable placeholder="请选择工代会代会"
@change="gdhChange">
<el-option
v-for="item in gdhList"
:key="item.id"
:label="item.gdhAllName"
:value="item.id">
</el-option>
</el-select>
</div>
<el-tree class="filter-tree" :data="treeData" :props="defaultProps"
default-expand-all ref="tree"
highlight-current accordion @node-click="handleNodeClick">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node">
<i class="el-icon-office-building"></i>&nbsp;{{ data.dbt_name }}
</div>
<div v-if="node.level==2" style="font-size: 14px" class="v-node">
<i class="el-icon-s-help" v-if="checkData.dbt_name==data.dbt_name"></i>
<i class="el-icon-help" v-else></i>
&emsp;{{ data.dbt_name }}
</div>
</div>
</el-tree>
</template>
<template>
<div v-if="node.level==1" class="pl10 pr10">
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.dbt_id" filterable clearable
placeholder="请选择代表团"
@change="doSearch">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbt_name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAddDbt"><i class="ti-plus"></i> 新建代表团</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10 d">
<el-row class="el-table-container" class="mt10 d">
<el-table :data="tableData" row-key="id"
ref="multipleTable">
<el-table-column
type="index" label="序号" header-align="center" align="center"
width="100">
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template scope="{row}" v-if="column.prop=='tzUserName'">
{{row.tzUserName}}
<template v-if="row.ftzusername">
({{row.ftzUserName}})
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete"
circle
@click="delDbt(row.id)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
<div v-if="node.level==2" class="pl10 pr10">
<el-card shadow="never">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="代表" name="one">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" clearable
v-model="dbPageForm.searchKeyword">
<el-select v-model="dbPageForm.searchName"
slot="prepend"
placeholder="查询类型"
style="width: 120px;">
<el-option label="姓名"
value="u.username"></el-option>
<el-option label="工号"
value="u.loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select v-model="dbPageForm.unionid" filterable clearable
@change="getUnits"
placeholder="请选择工会">
<el-option
v-for="item in unionList"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="dbPageForm.unitid" filterable clearable
placeholder="请选择单位">
<el-option
v-for="item in unitList"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<template class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="getDbTableData"></el-button>
</template>
<template>
<el-button class="pull-right offscreen-right" type="primary"
icon="el-icon-sort" @click="openSetXld">
代表调整
</el-button>
</template>
</el-card>
<el-table highlight-current-row :data="dbTableData" size="small"
style="width: 100%;"
height="70vh">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="姓名"
prop="username"
align="center"></el-table-column>
<el-table-column align="center" header-align="center" label="工号"
prop="loginname"
align="center"></el-table-column>
<el-table-column align="center" header-align="center" sortable
prop="unionname"
label="工会"></el-table-column>
<el-table-column align="center" header-align="center" sortable
prop="unitname"
label="单位"></el-table-column>
<el-table-column sortable prop="rolename"
label="代表身份"></el-table-column>
<el-table-column header-align="center" align="center" label="操作"
width="100">
<template slot-scope="{row}">
<el-dropdown @command="dbDropdownCommand">
<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:'view',data:row}">
查看
</el-dropdown-item>
<el-dropdown-item
:command="{type:'modify',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item
:command="{type:'doDelete',data:row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="设置组成基层工会" name="two">
<el-table highlight-current-row :data="unionTableData" size="small"
style="width: 100%;">
<el-table-column label="序号" width="60px"
type="index"></el-table-column>
<el-table-column label="基层工会名称" prop="unionname"
align="center"></el-table-column>
</el-table>
<el-row class="el-pagination-container"
style="text-align: right;margin-top: 20px">
<span style="color: red">设置组成基层工会</span>
<el-button size="medium" type="primary" circle
@click="unionOpenAdd()">
<i class="el-icon-plus"></i>
</el-button>
</el-row>
</el-tab-pane>
<el-tab-pane label="设置团长/副团长" name="three">
<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="unitname"
label="单位"></el-table-column>
<el-table-column prop="mobile" label="电话"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="rolename" label="身份">
<template slot-scope="scope">
<span v-if="scope.row.rolename==='代表团团长'"
class="text-primary">团长</span>
<span v-if="scope.row.rolename==='代表团副团长'"
class="text-info">副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete" circle
@click="delUser(row)">
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container"
style="text-align: right;margin-top: 20px">
<span style="color: red">设置团长/副团长</span>
<el-button size="medium" type="primary" circle
@click="openUserTz()">
<i class="el-icon-plus"></i>
</el-button>
</el-row>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
</tree-layout>
<template #view>
<member ref="memberInfo" :id="userId" view></member>
</template>
</guava>
<el-dialog title="新建代表团" :visible.sync="addDialogVisible" width="40%"
:close-on-click-modal="false">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
<el-form-item prop="gdhAllName" label="所属教代会">
<el-input v-model="formData.gdhAllName" disabled placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item prop="dbt_id" label="代表团名称">
<el-select multiple v-model="formData.dbt_id" filterable placeholder="请选中代表团名称"
style="width: 100%">
<el-option
v-for="item in dbtList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAddDbt">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="设置组成基层工会" :visible.sync="unionDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer :titles="['剩余分工会', '代表团分工会']" filterable
:props="{key: 'id',label: 'unionname'}"
:filter-method="unionFilterMethod"
v-model="unionFormData.unionValue"
:data="unionData">
</el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="unionDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doUnion" :loading="unionSubLoading">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="设置团长副团长" :visible.sync="userDialogVisible" width="40%">
<el-form label-width="100px">
<el-form-item prop="gdhAllName" label="届次">
<el-input v-model="userFormData.gdhAllName" disabled></el-input>
</el-form-item>
<el-form-item prop="userid" label="工号或姓名">
<el-select v-model="userFormData.userid" filterable placeholder="请输入工号或姓名关键字"
style="width: 100%" @change="userChange">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+'('+item.loginname+')'+item.unitname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="mobile" label="联系方式">
<el-input v-model="leaderInfo.mobile" readonly></el-input>
</el-form-item>
<el-form-item prop="dwname" label="所属单位">
<el-input v-model="leaderInfo.unitname" readonly></el-input>
</el-form-item>
<el-form-item prop="sf" label="身份">
<el-radio-group v-model="leaderInfo.sf">
<el-radio-button label="2">团&emsp;长</el-radio-button>
<el-radio-button label="1">副团长</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="userDialogVisible=false">取 消</el-button>
<el-button type="primary" @click="doAddTz">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="xldDialogVisible" title="代表名单调整">
<el-select @change="xldJdhChange" v-model="xldFormData.gdhid">
<el-option :label="item.gdhAllName" :value="item.id"
v-for="item in gdhList"></el-option>
</el-select>
<div class="pull-right offscreen-right">
<el-select :remote-method="remotexldMethod"
filterable placeholder="请输入工号和姓名"
remote reserve-keyword v-model="xldFormData.userid">
<el-option :key="u.id" :label="u.username+'-'+u.loginname"
:value="u.id" v-for="u in xldUserList"></el-option>
</el-select>
<el-button @click="addXldUser">
添加人员
</el-button>
</div>
<el-table :data="xldTableData" height="350">
<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="unionname"></el-table-column>
<el-table-column label="所属单位" prop="unitname"></el-table-column>
<el-table-column label="代表团">
<template slot-scope="scope">
<el-select clearable filterable v-model="scope.row.dbtid">
<el-option :label="d.dbt_name" :value="d.id"
v-for="d in delegations"></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
<span class="dialog-footer" slot="footer">
<el-button @click="xldDialogVisible = false">取 消</el-button>
<el-button @click="doSetxlddbt" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="编辑工代会代表" :visible.sync="modifyDialogVisible" width="50%">
<el-form :model="formData" ref="form" :rules="formRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item prop="username" label="姓名">
<el-input disabled :value="representativeInfo.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="loginname" label="工号">
<el-input disabled :value="representativeInfo.loginname"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="jdhid" label="届次">
<el-select v-model="representativeInfo.gdh_id" filterable placeholder="届次"
style="width: 100%"
@change="xldJdhChange">
<el-option v-for="item in gdhList" :key="item.id"
:label="item.gdhAllName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="dbtid" label="代表团">
<el-select v-model="representativeInfo.dbt_id" filterable style="width: 100%">
<el-option v-for="i in delegations" :label="i.dbt_name" :key="i.id"
:value="i.id"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item prop="dbfghid" label="所属工会">-->
<!-- <el-select v-model="representativeInfo.dbfghid" filterable disabled-->
<!-- @change="representativeInfo.dbunitid = '';modifyUnitList = allUnitList.filter(v => representativeInfo.dbfghid?v.unionid === representativeInfo.dbfghid:true)">-->
<!-- <el-option v-for="i in unionList" :label="i.unionname" :key="i.id"-->
<!-- :value="i.id"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item prop="dbunitid" label="所属单位">-->
<!-- <el-select v-model="representativeInfo.dbunitid" filterable disabled>-->
<!-- <el-option v-for="i in modifyUnitList" :label="i.name" :key="i.id"-->
<!-- :value="i.id"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item prop="roleid" label="代表类型">
<el-select v-model="representativeInfo.roleId" style="width: 100%">
<el-option v-for="i in representativeRoleOptions" :label="i.label"
:key="i.value"
:value="i.value"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="modifyDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="modifying">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
},
data() {
return {
unitList: [],
unionList: [],
pageForm: {
gdh_id: ""
},
leaderInfo: {},
userList: [],
userFormData: {},
unionData: [],
unionFormData: {
unionValue: []
},
unionTableData: [],
unionDialogVisible: false,
userDialogVisible: false,
addDialogVisible: false,
unionSubLoading: false,
treeData: [],
dbTableData: [],
dbPageForm: {},
tzTableData: [],
checkData: {},
activeName: 'one',
label: "",
gdhList: [],
delegations: [],
dbtList: [],
node: {
level: 1
},
defaultProps: {
children: 'childrens',
label: 'dbtname',
disabled: 'disabled'
},
tableColumns: [
{prop: 'dbt_name', label: '代表团名称', sortable: true},
{prop: 'code', label: '代表团编号', sortable: true},
{prop: 'gdhAllName', label: '所属教代会', sortable: true},
{prop: 'tzUserName', label: '团长(副团长)', sortable: true},
{prop: 'found_time', label: '创建时间', 所属教代会: true}
],
rules: {
dbt_id: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}]
},
userId: '',
modifyDialogVisible: false,
representativeRoleOptions: [],
representativeInfo: {},
modifyUnitList: [],
xldFormData: {
gdhid: '',
userid: ''
},
xldDialogVisible: false,
xldUserList: [],
xldTableData: [],
}
},
methods: {
async doSetxlddbt() {
let flag = true
for (let o of this.xldTableData) {
if (!('dbtid' in o)) {
flag = false
break
}
}
if (!flag) {
this.$message.info('请先选择要分配的代表团!')
return
}
const data = await $.post('/platform/workersCongress/delegate/fpXldToDbt', {
user: this.xldTableData,
gdhid: this.xldFormData.gdhid
})
if (data.code === 0) {
this.$message.success(data.msg)
this.xldTableData = []
await this.getDbTableData()
}
},
addXldUser() {
if (this.xldFormData.userid === '') {
this.$message.info('请先选择用户!')
return
}
let u = this.xldTableData.find(u => {
return u.id === this.xldFormData.userid
})
if (u) {
this.$message.info('不要重复添加')
return
}
let user = this.xldUserList.find(u => {
return u.id === this.xldFormData.userid
})
this.xldTableData.push(user)
this.xldFormData.userid = ''
this.xldUserList = []
},
async openSetXld() {
if (this.gdhList && this.gdhList.length > 0) {
this.xldFormData.gdhid = this.gdhList[0].id
}
this.$set(this.xldFormData, "userid", "")
this.xldUserList = []
this.xldTableData = []
this.xldDialogVisible = true
},
async xldJdhChange(jdhid) {
this.delegations = await getDbt(jdhid)
},
async remotexldMethod(key) {
if (this.xldFormData.gdhid === '') {
this.$message.info('请先选择工代会!')
return
}
if (key !== '') {
const {data} = await $.get('/platform/workersCongress/delegate/queryXldUser', {
query: key,
gdhid: this.xldFormData.gdhid
})
this.xldUserList = data
}
},
dbDropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data)
} else if (type === 'doDelete') {
this.doDbDelete(data)
} else if (type === 'modify') {
this.modify(data.id)
}
},
async modify(id) {
const resp = await $.get('/platform/workersCongress/delegate/representativeInfo/' + id)
AssertResponseMessage2({
response: resp,
success: ({data}) => {
this.modifyUnitList = this.allUnitList;
this.representativeInfo = data
this.modifyDialogVisible = true
},
})
},
async modifying() {
const response = await $.post('/platform/workersCongress/delegate/modifyRepresentativeInfo', this.representativeInfo)
AssertResponseMessage({
response,
success: () => {
this.modifyDialogVisible = false
this.getDbTableData()
}
})
},
doDbDelete(row) {
const data = {
userId: row.userid,
dbt_id: row.dbt_id,
roleId: row.roleid,
gdh_id: row.gdh_id,
identity: row.identity
}
this.$confirm('确定要移除该代表吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post("/platform/workersCongress/delegate/userDoDelete", data)
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.getDbTableData()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
openView(row) {
const {userid} = row
this.userId = userid
this.$refs.memberInfo.getUserInfo()
this.$refs.guava.view()
},
handleTabClick(tab) {
if (tab.name === 'one') {
this.butTitle = '设置组成基层工会'
this.getDbTableData()
} else if (tab.name === 'two') {
this.butTitle = '设置组成基层工会'
this.unionPageData()
} else {
this.butTitle = '设置团长/副团长'
this.getTzList()
}
},
handleNodeClick(data, node) {
this.node = node
this.checkData = data
if (node.level == 2) {
this.getDbTableData()
this.unionPageData()
this.getTzList()
}
},
gdhChange() {
this.undertakeUnitTree()
this.getDbTableData()
this.unionPageData()
this.getTzList()
},
async delUser(row) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.get(loc() + "/delUser", {
userId: row.id,
roleId: row.roleid,
gdh_id: this.pageForm.gdh_id
})
requestLaterFun(resp, () => {
this.getTzList()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
async undertakeUnitTree() {
const {data} = await $.get(loc() + "/undertakeUnionTree", {gdh_id: this.pageForm.gdh_id})
this.treeData = [data]
this.pageData()
},
openAddDbt() {
const gdhFind = this.gdhList.find(v => v.id = this.pageForm.gdh_id)
this.$set(this.formData, "gdhAllName", gdhFind.gdhAllName)
this.getDbtList()
this.addDialogVisible = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
async getDbtList() {
const resp = await $.post(loc() + "/getDbtFind", {gdh_id: this.pageForm.gdh_id})
this.dbtList = resp
},
doAddDbt() {
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(loc() + '/doAddDbt', {
dbtList: JSON.stringify(this.formData.dbt_id),
gdh_id: this.pageForm.gdh_id
})
closeLoadingFunc(loading, resp, async () => {
await this.undertakeUnitTree()
this.pageData()
this.addDialogVisible = false
this.delegations = await getGdhDbt(this.pageForm.gdh_id)
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
delDbt(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/delDbt", {
dbt_id: id,
gdh_id: this.pageForm.gdh_id
})
requestLaterFun(resp, async () => {
this.$notify.success({title: '成功', message: resp.msg});
this.undertakeUnitTree()
this.pageData()
this.delegations = await getGdhDbt(this.pageForm.gdh_id)
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
async unionOpenAdd() {
const {data} = await $.get(loc() + "/unionOpenAddList", {
gdh_id: this.pageForm.gdh_id,
dbt_id: this.checkData.id
})
this.unionData = data.data
this.unionFormData.unionValue = data.value.map(v => {
return v.union_id
})
this.unionDialogVisible = true
},
async doUnion() {
const resp = await $.post(loc() + "/doUnion", {
unionValue: JSON.stringify(this.unionFormData.unionValue),
gdh_id: this.pageForm.gdh_id,
dbt_id: this.checkData.id
})
await this.unionPageData()
this.unionDialogVisible = false
this.$notify.success({title: '成功', message: resp.msg});
},
async unionPageData() {
const resp = await $.post(loc() + "/unionPageData", {
gdh_id: this.pageForm.gdh_id,
dbt_id: this.checkData.id
})
this.unionTableData = resp
},
unionFilterMethod(query, item) {
return item.unionname.indexOf(query) > -1;
},
async getDbTableData() {
this.dbPageForm.gdh_id = this.pageForm.gdh_id
this.dbPageForm.dbt_id = this.checkData.id
const resp = await $.post(loc() + "/getDbTableData", this.dbPageForm)
this.dbTableData = resp
},
async openUserTz() {
this.userFormData = {}
this.leaderInfo = {
mobile: '',
unitname: '',
sf: '2'
}
const aa = this.gdhList.find(v => v.id == this.pageForm.gdh_id)
this.$set(this.userFormData, 'gdhAllName', aa.gdhAllName)
const data = await $.get(loc() + "/queryUser", {
dbt_id: this.checkData.id,
gdh_id: this.pageForm.gdh_id
})
this.userList = data
this.userDialogVisible = true
},
userChange(val) {
this.leaderInfo = this.userList.find(v => {
if (v.id === val) {
return v
}
})
this.$set(this.leaderInfo, 'sf', 2)
},
async doAddTz() {
if (!this.userFormData.userid) {
this.$notify.warning({title: '警告', message: "请先选择需要添加的教职工"});
return
}
this.userFormData.sf = this.leaderInfo.sf
this.userFormData.dbt_id = this.checkData.id
this.userFormData.gdh_id = this.pageForm.gdh_id
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
})
},
async getTzList() {
const resp = await $.get(loc() + '/getTzList', {
dbt_id: this.checkData.id,
gdh_id: this.pageForm.gdh_id
})
requestLaterFun(resp, () => {
this.tzTableData = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
async getUnits() {
this.unitList = await getUnit(this.dbPageForm.unionid)
},
async getRepresentativeRoleOptions() {
const {
code,
data
} = await $.get('/platform/workersCongress/delegate/representativeRoleOptions')
if (!code) {
this.representativeRoleOptions = data
}
},
},
async created() {
this.gdhList = await getOpenGdh()
if (this.gdhList.length > 0) {
this.pageForm.gdh_id = this.gdhList[0].id
this.delegations = await getGdhDbt(this.gdhList[0].id)
}
await this.getUnits()
this.unionList = await getUnion()
this.pageData()
this.undertakeUnitTree()
await this.getRepresentativeRoleOptions()
}
})
</script>
<!--#
}
#-->