Files
UNION_NSI/target/classes/views/platform/jdh/zzjg/delegation.html
T
2026-09-08 19:49:21 +08:00

959 lines
42 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__nav {
background-color: #FFFFFF;
}
.dialog-footer .el-button {
padding: 12px 30px;
}
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-box .el-card__header {
padding: 5px 15px;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="app" v-cloak>
<guava>
<tree-layout style="height: calc(100vh - 70px)">
<template #tree>
<div style="padding: 15px;">
<el-select v-model="pageForm.jdhid" filterable placeholder="请选择教代会"
@change="jdhChange">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</div>
<el-tree class="filter-tree" :data="treeData" :props="defaultProps"
default-expand-all ref="tree"
highlight-current accordion @node-click="handleNodeClick">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node">
<i class="el-icon-office-building"></i>&nbsp;{{ data.dbtname }}
</div>
<div v-if="node.level==2" style="font-size: 14px" class="v-node">
<i class="el-icon-s-help" v-if="checkData.dbtname==data.dbtname"></i>
<i class="el-icon-help" v-else></i>
&emsp;{{ data.dbtname }}
</div>
</div>
</el-tree>
</template>
<template>
<div v-if="node.level==1" class="pl10 pr10">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-select v-model="pageForm.dbtid" filterable clearable
placeholder="请选择代表团">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbtname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="doSearch"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button type="primary" @click="openAdd"><i class="ti-plus"></i> 添加代表团
</el-button>
</div>
</el-card>
<el-dialog title="添加代表团" :visible.sync="addDialogVisible" width="40%">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
<el-form-item prop="jdhid" label="所属教代会">
<el-select v-model="formData.jdhid" @change="addJdhChange"
placeholder="选择教代会"
style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item prop="dbt" label="代表团名称">-->
<!-- <el-select multiple v-model="formData.dbt" filterable-->
<!-- placeholder="请选中代表团名称"-->
<!-- style="width: 100%">-->
<!-- <el-option-->
<!-- v-for="item in dbtList"-->
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item prop="dbtName" label="代表团名称">
<el-input v-model="formData.dbtName" placeholder="请输入代表团名称" maxlength="50"></el-input>
</el-form-item>
<el-form-item prop="code" label="代表团编码">
<el-input v-model="formData.code" placeholder="请输入代表团编码"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</span>
</el-dialog>
<el-card shadow="never" class="mt20">
<el-table :data="tableData">
<el-table-column label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" prop="dbtname"
label="代表团名称"></el-table-column>
<el-table-column align="center" header-align="center" prop="dictcode"
label="代表团编码"></el-table-column>
<el-table-column align="center" header-align="center" prop="jdhallname"
label="所属教代会"></el-table-column>
<el-table-column align="center" header-align="center" prop="cjsj"
label="创建时间">
<template slot-scope="{row:{cjsj}}">
{{moment(cjsj).format('YYYY-MM-DD')}}
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<template>
<el-dropdown-item
:command="{type:'dw',data:scope.row}"
v-if="dbtzc==='unit'">
设置组成单位
</el-dropdown-item>
<el-dropdown-item
:command="{type:'fgh',data:scope.row}"
v-else>
设置组成基层工会
</el-dropdown-item>
</template>
<el-dropdown-item :command="{type:'tz',data:scope.row}">
设置团长/副团长
</el-dropdown-item>
<el-dropdown-item
:command="{type:'editName',data:scope.row}">
编辑代表团名称
</el-dropdown-item>
<el-dropdown-item
:command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
<div v-if="node.level==2" class="pl10 pr10">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="代表" name="one">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" clearable
v-model="dbPageForm.searchKeyword">
<el-select v-model="dbPageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 120px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select v-model="dbPageForm.unionid" filterable clearable
@change="getUnits"
placeholder="请选择工会">
<el-option
v-for="item in unionList"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="dbPageForm.unitid" filterable clearable
placeholder="请选择单位">
<el-option
v-for="item in unitList"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="dbDoSearch"></el-button>
</div>
</el-card>
<el-table class="mt20" :data="dbTableData">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span>
</template>
</el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column sortable prop="unionname"
label="工会"></el-table-column>
<el-table-column sortable prop="unitname"
label="单位"></el-table-column>
<el-table-column sortable prop="rolename"
label="代表身份"></el-table-column>
</el-table>
</el-tab-pane>
<template>
<el-tab-pane label="设置组成单位" name="two" v-if="dbtzc==='unit'">
<el-card shadow="never" class="text-right">
<el-button type="primary" @click="dwdoAdd(adminPageForm.dbtid)">
{{butTitle}}
</el-button>
</el-card>
<el-table class="mt20" :data="unitTableData">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span>
</template>
</el-table-column>
<el-table-column label="单位名称" prop="unitname"></el-table-column>
<el-table-column label="操作">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete" circle
@click="dwdoDelete(row)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="设置组成基层工会" name="two" v-else>
<el-card shadow="never" class="text-right">
<el-button type="primary"
@click="fghdoAdd(adminPageForm.dbtid)">
{{butTitle}}
</el-button>
</el-card>
<el-table class="mt20" :data="adminTableData">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span>
</template>
</el-table-column>
<el-table-column label="基层工会名称"
prop="unionname"></el-table-column>
<el-table-column label="操作">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete" circle
@click="fghdoDelete(row)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</template>
<el-tab-pane label="设置团长/副团长" name="three">
<el-card shadow="never" class="text-right">
<el-button type="primary" @click="openUser(adminPageForm.dbtid)">
{{butTitle}}
</el-button>
</el-card>
<el-table class="mt20" :data="TzTableData" height="300">
<el-table-column sortable prop="loginname"
label="工号"></el-table-column>
<el-table-column sortable prop="username"
label="姓名"></el-table-column>
<el-table-column sortable prop="dwname"
label="单位"></el-table-column>
<el-table-column prop="mobile" label="电话"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="rolename" label="身份">
<template slot-scope="scope">
<span v-if="scope.row.rolename==='代表团团长'"
class="text-primary">团长</span>
<span v-if="scope.row.rolename==='代表团副团长'"
class="text-info">副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button plain type="danger" size="mini"
icon="el-icon-delete" circle
@click="delUser(row)">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template>
</tree-layout>
</guava>
<el-dialog :title="title" :visible.sync="fghDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer :titles="['剩余分工会', '代表团分工会']" filterable
:props="{key: 'id',label: 'unionname'}"
:filter-method="adminFilterMethod"
v-model="fghFormData.fghValue"
:data="fghData">
</el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="fghDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dofgh" :loading="fghSubLoading">确 定</el-button>
</span>
</el-dialog>
<el-dialog :title="title" :visible.sync="dwDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer :titles="['剩余单位', '代表团单位']" filterable
:props="{key: 'id',label: 'unitname'}"
:filter-method="unitFilterMethod"
v-model="dwFormData.dwValue"
:data="dwData">
</el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dwDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dodw" :loading="dwSubLoading">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="设置团长副团长" :visible.sync="userDialogVisible" width="40%">
<el-form label-width="100px">
<el-form-item prop="jdhallname" label="届次">
<el-select v-model="pageForm.jdhid" disabled style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="userid" label="工号或姓名">
<el-select v-model="userFormData.userid" filterable placeholder="请输入工号或姓名关键字"
style="width: 100%" @change="userChange">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+'('+item.loginname+')'"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="mobile" label="联系方式">
<el-input v-model="leaderInfo.mobile" readonly></el-input>
</el-form-item>
<el-form-item prop="dwname" label="所属单位">
<el-input v-model="leaderInfo.dwname" readonly></el-input>
</el-form-item>
<el-form-item prop="sf" label="身份">
<el-radio-group v-model="leaderInfo.sf">
<el-radio-button label="2">&emsp;</el-radio-button>
<el-radio-button label="1">副团长</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button :disabled="userSubLoading" @click="doAddTz" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="编辑代表团名称" :visible.sync="deleDialogVisible" width="30%">
<el-form :model="editForm" label-width="100px" ref="editForm">
<el-form-item prop="dbtName" label="代表团名称" ref="aa"
:rules="{required: true, message: '请填写代表团名称', trigger: 'blur'}">
<el-input v-model="editForm.dbtName"></el-input>
</el-form-item>
<el-form-item prop="code" label="代表团编号"
:rules="{required: true, message: '请填写代表团编号', trigger: 'blur'}">
<el-input v-model="editForm.code"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="deleDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="deleDo">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
var 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: [],
unitTableData: [],
dwData: [],
dwFormData: {
dwValue: []
},
dwDialogVisible: false,
dwSubLoading: false,
dbTableData: [],
adminPageForm: {},
dbPageForm: {
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']}],
dbtName: [{required: true, message: '请填写代表团名称', trigger: ['change', 'blur']}],
code: [{required: true, message: '请填写代表团编号', trigger: ['change', 'blur']}]
},
deleData: {},
dbtzc: "${config.dbtzc!}"
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'fgh') {
this.openFgh(data)
} else if (type == 'dw') {
this.openDw(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.editForm = {
dbtName: data.dbtname,
code: data.dictcode
}
this.deleDialogVisible = true
if (this.$refs['editForm']) {
this.$refs['editForm'].resetFields()
}
},
async deleDo() {
this.$refs['editForm'].validate(async (valid) => {
if (valid) {
const resp = await $.post(loc() + '/updateDelegation', {
id: this.deleData.id,
delegationName: this.editForm.dbtName,
code: this.editForm.code
})
if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg});
await this.undertakeUnitTree()
this.pageData()
this.deleDialogVisible = false
} else {
this.$notify.error({title: '失败', message: resp.msg});
}
}
})
},
async dbData() {
this.dbPageForm.jdhid = this.pageForm.jdhid
const resp = await $.get(loc() + '/dbTableData', this.dbPageForm)
if (resp.code === 0) {
this.dbTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
async dbDoSearch() {
await this.dbData()
},
openAdd() {
this.formData = {
dbtName: '',
code: ''
}
if (this.jdhList.length > 0) {
this.formData.jdhid = this.jdhList[0].id
}
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})
if (resp.code === 0) {
this.dbtList = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
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 data = {
jdhid: this.formData.jdhid,
dbtName: this.formData.dbtName,
code: this.formData.code
}
const resp = await $.post(loc() + '/doAdd', data)
loading.close()
if (resp.code === 0) {
await this.undertakeUnitTree()
this.pageData()
this.addDialogVisible = false
} else {
this.notifyWarning(resp.msg)
}
}
})
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.undertakeUnitTree()
} else {
this.notifyWarning(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})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.adminPageData()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
dwdoDelete(row) {
const {id} = row
this.$confirm('确定要移除该单位吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/dwdoDelete", {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.unitPageData()
} else {
this.notifyWarning(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)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getTzList()
} else {
this.notifyWarning(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.dbtzc === "unit" ? this.unitPageData() : this.adminPageData()
this.getTzList()
this.dbData()
},
handleTabClick(tab) {
if (tab.name === 'one') {
this.butTitle = this.dbtzc === "unit" ? '设置组成单位' : "设置组成工会"
this.adminPageForm.flag = tab.name === 'one'
this.dbData()
} else if (tab.name === 'two') {
this.butTitle = this.dbtzc === "unit" ? '设置组成单位' : "设置组成工会"
this.adminPageForm.flag = tab.name === 'two'
this.dbtzc === "unit" ? this.unitPageData() : this.adminPageData()
} else {
this.butTitle = '设置团长/副团长'
this.adminPageForm.flag = tab.name === 'three'
this.getTzList()
}
},
adminFilterMethod(query, item) {
return item.unionname.indexOf(query) > -1;
},
unitFilterMethod(query, item) {
return item.unitname.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 dwdoAdd(dbtid) {
const jdhid = this.pageForm.jdhid
this.dwFormData.jdhid = jdhid
this.dwFormData.dbtid = dbtid
const {data} = await $.get(loc() + "/finddw", {jdhid, dbtid})
if (data) {
this.dwData = data.data
this.dwFormData.dwValue = data.value.map(v => {
return v.dwid
})
}
this.dwDialogVisible = 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)
this.fghSubLoading = false
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.fghDialogVisible = false
this.pageData()
await this.adminPageData()
} else {
this.notifyWarning(resp.msg)
}
},
//添加单位
async dodw() {
this.dwSubLoading = true
const data = clone(this.dwFormData)
data.dwValue = JSON.stringify(data.dwValue)
const resp = await $.post(loc() + "/dwdoAdd", data)
this.dwSubLoading = false
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.dwDialogVisible = false
this.pageData()
await this.unitPageData()
} else {
this.notifyWarning(resp.msg)
}
},
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)
if (resp.code === 0) {
this.adminTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
//该代表团下的组成单位
async unitPageData() {
const resp = await $.post(loc() + "/unitPageData", this.adminPageForm)
if (resp.code === 0) {
this.unitTableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
//获取团长副团长
async getTzList() {
const resp = await $.get(loc() + '/getTzList', this.adminPageForm)
if (resp.code === 0) {
this.TzTableData = resp.data
} else {
this.notifyWarning(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)
if (resp.code === 0) {
this.getTzList()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(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)
},
openDw(row) {
const {dbtname} = row
const dbtid = row.id
this.setzcfghdbtname = dbtname
this.dwdoAdd(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 getUnits(this.dbPageForm.unionid)
}
},
async created() {
this.jdhList = await getAllMeeting()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
this.pageData()
}
await this.getUnits()
this.unionList = await getUnions(null)
await this.undertakeUnitTree()
}
})
</script>
<!--#
}
#-->