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,791 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" clearable
v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 80px;">
<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 mt5">
<el-select v-model="pageForm.gdh_id" filterable placeholder="请选择教代会"
@change="jdhChange">
<el-option
v-for="item in gdhList"
:key="item.id"
:label="item.gdhAllName"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.unionId" filterable clearable @change="getUnitList"
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 mt5">
<el-select v-model="pageForm.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 mt5">
<el-select v-model="pageForm.dbt_id" filterable clearable placeholder="请选择代表团">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbt_name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.dbsf" clearable placeholder="请选择代表身份">
<el-option v-for="i in representativeRoleOptions" :label="i.label"
:key="i.value"
:value="i.value"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<table-tool label="代表列表" :app="this">
<template #func>
<el-button @click="doDeleteUserList" plain size="small" type="danger"
icon="el-icon-delete"> 批量删除
</el-button>
<el-button @click="openAdd" size="small" icon="ti-plus" type="success"
plain>
添加代表
</el-button>
<el-button @click="openSetXld" icon="el-icon-sort" size="small" plain
type="warning">代表调整
</el-button>
<!--<el-button size="small" type="primary" plain @click="doExcel"><i
class="el-icon-s-promotion"></i> 导出Excel
</el-button>-->
</template>
</table-tool>
<el-table :data="tableData" row-key="id" @selection-change="handleSelectionChange"
ref="multipleTable">
<el-table-column type="selection" width="55"
reserve-selection></el-table-column>
<el-table-column
type="index" label="序号" header-align="center" align="center"
width="100">
</el-table-column>
<el-table-column
align="center"
show-overflow-tooltip
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
</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-row>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member ref="memberInfo" :id="userId" view></member>
</template>
</guava>
<!-- <tree-layout>
<template #tree>
<div style="padding: 15px;">
<el-select v-model="pageForm.gdh_id" filterable placeholder="请选择教代会" @change="jdhChange">
<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>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" clearable
v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 80px;">
<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 mt5" v-if="node.level!=2">
<el-select v-model="pageForm.unionId" filterable clearable @change="getUnitList"
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 mt5" v-if="node.level!=2">
<el-select v-model="pageForm.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 mt5" v-if="node.level!=2">
<el-select v-model="pageForm.dbt_id" filterable clearable placeholder="请选择代表团">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbt_name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd"><i class="ti-plus"></i> 添加代表</el-button>
</div>
<div class="pull-right offscreen-right mt5 mr10">
<el-button @click="openSetXld"><i class="el-icon-sort" style="transform: rotate(90deg);"></i>代表调整
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10 d">
<table-tool :label="label" :app="this">
<template #func>
<el-button @click="doDeleteUserList" plain size="small" type="primary"
v-if="selection.length>0"><i class="el-icon-delete"></i>批量删除
</el-button>
<el-button size="small" type="primary" plain @click="doExcel"><i
class="el-icon-s-promotion"></i> 导出Excel
</el-button>
</template>
</table-tool>
<el-row class="el-table-container">
<el-table :data="tableData" row-key="id" @selection-change="handleSelectionChange"
ref="multipleTable">
<el-table-column type="selection" width="55" reserve-selection></el-table-column>
<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">
</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>
&lt;!&ndash;#include("/layouts/pagination.html"){}#&ndash;&gt;
</el-card>
</template>
</tree-layout>-->
<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="dbt_id" label="代表团名称">
<el-select v-model="formData.dbt_id" filterable clearable placeholder="请选择代表团"
@change="getUserDbChange"
style="width: 100%;">
<el-option
v-for="item in delegations"
:key="item.id"
:label="item.dbt_name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="userId" label="工代会代表">
<el-select v-model="formData.userId" filterable clearable multiple
placeholder="请选择工代会代表"
style="width: 100%;">
<el-option
v-for="item in dbList"
:key="item.id"
:label="item.username+'('+item.loginname+')'+item.unionname+'('+item.unitname+')'"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item prop="roleId" label="代表类型">
<el-radio v-model="formData.roleId" :label="i.value" border v-for="i in representativeRoleOptions">{{i.label}}</el-radio>
</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-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 :loading="loading" :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 {
modifyDialogVisible: false,
representativeInfo: {},
representativeRoleOptions: [],
loading: false,
xldTableData: [],
xldFormData: {
userid: ""
},
xldUserList: [],
node: {
level: 1
},
label: "代表列表",
selection: [],
unionList: [],
unitList: {},
dbList: [],
delegations: [],
checkData: {
id: ""
},
treeData: [],
gdhList: [],
singleTableData: [],
pageForm: {
jdh_id: "",
unitId: "",
unionId: "",
searchName: "u.username",
},
defaultProps: {
children: 'childrens',
label: 'dbtname',
disabled: 'disabled'
},
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别', sortable: true},
{prop: 'age', label: '年龄', sortable: true},
{prop: 'mobile', label: '联系方式'},
{prop: 'dbt_name', label: '代表团', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'gdhAllName', label: '届次', sortable: true},
{prop: 'roleName', label: '代表身份', sortable: true},
],
addDialogVisible: false,
xldDialogVisible: false,
rules: {
dbt_id: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}],
userId: [{required: true, message: '请选择代表', trigger: ['change', 'blur']}],
roleId: [{required: true, message: '请选择代表类型', trigger: ['change', 'blur']}]
},
userId: null,
}
},
methods: {
openView(row) {
const {userId} = row
this.userId = userId
this.$refs.memberInfo.getUserInfo()
this.$refs.guava.view()
},
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.doSearch()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
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.doSearch()
}
})
},
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 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(loc() + '/fpXldToDbt', {
user: this.xldTableData,
gdhid: this.xldFormData.gdhid
})
if (data.code === 0) {
this.$message.success(data.msg)
this.xldTableData = []
this.pageData()
}
},
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 remotexldMethod(key) {
if (this.xldFormData.gdhid === '') {
this.$message.info('请先选择工代会!')
return
}
if (key !== '') {
this.loading = true;
const {data} = await $.get(loc() + '/queryXldUser', {
query: key,
gdhid: this.xldFormData.gdhid
})
this.xldUserList = data
this.loading = false;
}
},
async xldJdhChange(jdhid) {
this.delegations = await getDbt(jdhid)
},
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
},
doExcel() {
if (this.pageForm.gdh_id) {
const current_gdh = this.gdhList.find(v => v.id === this.pageForm.gdh_id)
location.href = '/platform/workersCongress/delegate/doExcel?gdhId=' + this.pageForm.gdh_id + '&dbtId=' + this.checkData.id + '&gdhAllName=' + current_gdh.gdhAllName
}
},
/*点击多选框*/
handleSelectionChange(val) {
this.selection = val
},
/*删除多个*/
doDeleteUserList() {
if (this.selection.length === 0) {
this.$notify.warning({title: '警告', message: "请在左侧勾选需要删除的代表"});
return
}
this.$confirm('确定要移除勾选的代表吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDeleteUserList", {
userData: JSON.stringify(this.selection),
gdh_id: this.pageForm.gdh_id
})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.$refs.multipleTable.clearSelection();
this.pageData()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
/*删除一个*/
delUser(row) {
const data = {
userId: row.userId,
roleId: row.roleId,
dbt_id: row.dbt_id,
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(loc() + "/userDoDelete", data)
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.pageData()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
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(loc() + '/doAdd', {
userData: JSON.stringify(this.formData.userId),
gdh_id: this.pageForm.gdh_id,
dbt_id: this.formData.dbt_id,
roleId: this.formData.roleId
})
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.addDialogVisible = false
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
openAdd() {
if (this.node.level == 2) {
this.delegations = this.delegations.filter(v => v.id == this.checkData.id)
this.formData.dbt_id = this.delegations[0].id
this.getUserDbChange()
}
this.addDialogVisible = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
async getUserDbChange() {
const {data} = await $.get(loc() + "/getUserDbChange", {
gdh_id: this.pageForm.gdh_id,
dbt_id: this.formData.dbt_id
})
this.dbList = data
},
/*查询代表团*/
async undertakeUnitTree() {
const {data} = await $.get("/platform/workersCongress/delegation/undertakeUnionTree", {gdh_id: this.pageForm.gdh_id})
this.treeData = [data]
},
/*点击左侧代表团触发*/
async handleNodeClick(data, node) {
this.$set(this.pageForm, "dbt_id", "")
this.node = node
this.checkData = data
this.label = "代表列表"
if (node.level == 2) {
this.label = data.dbt_name + "代表"
this.$set(this.pageForm, "dbt_id", data.id)
await this.getUnitList()
}
this.pageData();
this.delegations = await getGdhDbt(this.pageForm.gdh_id)
},
/*点击届次*/
async jdhChange(id) {
this.pageForm.dbt_id = ''
this.delegations = await getGdhDbt(id)
await this.undertakeUnitTree()
this.pageData();
},
async getUnitList() {
this.unitList = await getUnit(this.pageForm.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)
}
this.pageData();
this.unionList = await getUnion()
this.getUnitList()
await this.undertakeUnitTree()
await this.getRepresentativeRoleOptions()
}
})
</script>
<!--#
}
#-->
@@ -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>
<!--#
}
#-->
@@ -0,0 +1,363 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<tree-layout style="height: calc(100vh - 50px)">
<template #tree>
<div style="padding: 20px;border-right: 2px solid rgb(240,240,240);padding-bottom: 20px">
<el-input
placeholder="输入关键字进行查找"
v-model="filterText">
</el-input>
</div>
<el-tree class="filter-tree" :data="treeData" :props="defaultProps"
default-expand-all ref="tree"
highlight-current accordion @node-click="handleNodeClick" :filter-node-method="filterNode">
<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.name }}
</div>
<div v-if="node.level==2" style="font-size: 14px" class="v-node">
<i class="el-icon-s-help" v-if="checkData.name==data.name"></i>
<i class="el-icon-help" v-else></i>
&emsp;{{ data.name }}
</div>
</div>
</el-tree>
</template>
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.gdh_id" filterable clearable
placeholder="届次">
<el-option
v-for="item in gdhList"
:label="item.gdhAllName"
:key="item.id"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" clearable
v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 80px;">
<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 mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card shadow="never">
<table-tool :label="label" :app="this">
<template #func>
<el-button type="primary" plain size="medium" icon="el-icon-edit" @click="openAdd"
v-if="node.level==2">
添加人员
</el-button>
</template>
</table-tool>
<el-row class="el-table-container">
<el-table :data="tableData" row-key="id">
<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"
show-overflow-tooltip>
<template scope="{row}" v-if="column.prop=='status'">
<span class="text-primary" v-if="row.role_name">{{row.role_name}}</span>
<template v-else>
<span class="text-primary" v-if="row.status==1">委员</span>
<span class="text-primary" v-if="row.status==2">副主任</span>
<span class="text-primary" v-if="row.status==3">主任</span>
</template>
</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="delUser(row.id)">删除
</el-dropdown-item>
<el-dropdown-item v-if="row.status!==3"
@click.native="updateStatus(row,3)"
class="text-primary">设置主任
</el-dropdown-item>
<el-dropdown-item v-if="row.status!==2"
@click.native="updateStatus(row,2)"
class="text-primary">设置副主任
</el-dropdown-item>
<el-dropdown-item v-if="row.status!==1"
@click.native="updateStatus(row,1)"
class="text-primary">设置委员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</tree-layout>
</template>
</guava>
<el-dialog title="添加人员" :visible.sync="addDialogVisible" width="40%" :close-on-click-modal="false">
<el-form label-width="100px" :model="formData" ref="addUserForm">
<el-form-item prop="gdhAllName" label="届次">
<el-input v-model="formData.gdhAllName" disabled></el-input>
</el-form-item>
<el-form-item prop="organization_name" label="机构名称">
<el-input v-model="formData.organization_name" disabled></el-input>
</el-form-item>
<el-form-item prop="user_id" label="工号或姓名"
:rules="[{required:true,message:'请输入工号和姓名',trigger: ['blur', 'change']}]">
<el-select
@change="userChange"
style="width: 100%"
v-model="formData.user_id"
value-key="id"
filterable
remote
reserve-keyword
placeholder="请输入工号或者姓名"
:remote-method="queryNotWyhUser">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+'-'+item.loginname+'-'+item.unionname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="mobile" label="联系方式">
<el-input v-model="formData.mobile" readonly></el-input>
</el-form-item>
<el-form-item prop="unitname" label="所属单位">
<el-input v-model="formData.unitname" readonly></el-input>
</el-form-item>
<el-form-item label="身份" prop="status" v-if="checkData.code==='gdhwyh1'">
<el-radio-group v-model="formData.status">
<el-radio-button label="1">委&emsp;员</el-radio-button>
<el-radio-button label="2">副主席</el-radio-button>
<el-radio-button label="3">常务副主席</el-radio-button>
<el-radio-button label="4">主&emsp;席</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="身份" prop="status" v-else>
<el-radio-group v-model="formData.status">
<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 slot="footer" class="dialog-footer">
<el-button type="primary" @click="doAdd" v-loading="addLoading">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
addLoading: false,
label: "工代会机构设置",
gdhList: [],
userList: [],
node: {
level: 1
},
checkData: {
id: ""
},
addDialogVisible: false,
checkData: {},
treeData: [],
filterText: '',
treeLoading: false,
defaultProps: {
children: 'childrens',
label: 'name',
},
pageForm: {
searchName: "u.username"
},
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
{prop: 'sex', label: '性别', sortable: true},
{prop: 'mobile', label: '手机', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'gdh_name', label: '届次', sortable: true},
{prop: 'organization_name', label: '所属机构', sortable: true},
{prop: 'status', label: '身份', sortable: true},
],
}
},
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
'guava': httpVueLoader('/components/plugins/Guava.vue'),
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
},
methods: {
async updateStatus(row, status) {
const resp = await $.get(loc() + "/updateStatus", {
status: status,
gdh_id: row.gdh_id,
organization_id: row.organization_id,
user_id: row.user_id
})
requestLaterFun(resp, () => {
this.pageData()
this.$notify.success({title: '成功', message: resp.msg});
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
}, () => {
})
},
async loadTree() {
this.treeLoading = true
const data = await $.get("/platform/workersCongress/Organization/getTreeData")
this.treeData = [data]
this.treeLoading = false
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
async handleNodeClick(data, node) {
this.node = node
this.checkData = data
this.pageForm.organization_id = data.id
this.pageData()
this.label = data.name
},
userChange() {
const aa = this.userList.find(v => v.id == this.formData.user_id)
this.$set(this.formData, "mobile", aa.mobile)
this.$set(this.formData, "unitname", aa.unitname)
},
async doAdd() {
const valid = await this.$refs.addUserForm.validate()
if (!valid) return
this.addLoading = true
const resp = await $.get(loc() + "/doAdd", this.formData)
this.addLoading = false
if (resp.code === 0) {
this.pageData()
this.addDialogVisible = false
this.formData = {}
} else {
this.notifyWarning(resp.msg)
}
},
async openAdd() {
console.log(this.checkData)
const aa = this.gdhList.find(v => v.id = this.pageForm.gdh_id)
this.$set(this.formData, 'gdhAllName', aa.gdhAllName)
this.$set(this.formData, 'status', 1)
this.$set(this.formData, 'gdh_id', this.pageForm.gdh_id)
this.$set(this.formData, 'organization_id', this.checkData.id)
this.$set(this.formData, 'organization_name', this.checkData.name)
this.$set(this.formData, 'organization_code', this.checkData.code)
this.addDialogVisible = true
},
async delUser(id) {
this.$confirm('您确定要删除此用户吗!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/delUser", {id: id})
this.pageData()
}
}
})
},
async queryNotWyhUser(key) {
const data = await $.get(loc() + "/getUserList", {
gdh_id: this.pageForm.gdh_id,
organization_id: this.checkData.id,
key: key
})
this.userList = data.list
}
},
async created() {
this.gdhList = await getOpenGdh()
if (this.gdhList.length > 0) {
this.$set(this.pageForm, "gdh_id", this.gdhList[0].id)
}
this.loadTree()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,307 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年份:</div>
<el-date-picker
clearable
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
placeholder="选择年份">
</el-date-picker>
</div>
<div class="search-item">
<div class="search-item-label">届数:</div>
<el-select v-model="pageForm.gdhJs" placeholder="请选择届数" clearable style="width: 100%">
<el-option
v-for="item in jsList"
:key="item.id"
:label="item.name"
:value="item.name">
</el-option>
</el-select>
</div>
<div class="search-item">
<div class="search-item-label">次数:</div>
<el-select v-model="pageForm.gdhCs" placeholder="请选择次数" clearable style="width: 100%">
<el-option
v-for="item in csOptions"
:key="item.id"
:label="item.name"
:value="item.name">
</el-option>
</el-select>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="届次列表" :app="this">
<template #func>
<el-button size="small" type="primary" plain @click="openAdd"><i
class="el-icon-s-promotion"></i> 新建届次
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
<template scope="{row}" v-if="column.prop=='startState'">
<el-switch active-color="#13ce66"
inactive-color="#ff4949"
:value="row.startState"
@change="startStateChange(row.startState,row.id)">
</el-switch>
</template>
<template scope="{row}" v-else-if="column.prop=='gdhJs'">
{{row.gdhJs}}
</template>
<template scope="{row}" v-else-if="column.prop=='gdhCs'">
{{row.gdhCs}}
</template>
<template scope="{row}" v-else-if="column.prop=='gdhAllName'">
{{row.gdhAllName}}工代会
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template scope="{row}">
<el-button size="mini" type="primary" @click="openEdit(row)">
编辑
</el-button>
<el-button size="mini" type="danger"
@click="doDelete(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</guava>
<el-dialog
title="新建届次"
:visible.sync="addDialogVisible"
width="45%">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="120px">
<el-form-item prop="year" label="工代会年份">
<el-date-picker style="width:100%;" :clearable="false"
v-model="formData.year"
value-format="yyyy"
formData="yyyy"
type="year"
placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-form-item prop="gdhJs" label="工代会届数">
<el-select v-model="formData.gdhJs" filterable placeholder="请选择届数" style="width:100%;">
<el-option v-for="i in jsList" :label="i.name" :key="i.id" :value="i.name"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="gdhCs" label="工代会次数">
<el-select v-model="formData.gdhCs" @change="csChange" filterable placeholder="请选择次数"
style="width:100%;">
<el-option v-for="item in csOptions" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="isExtend" class="is-required" label="" label-width="30px" style="margin-top: 20px;">
<el-checkbox v-model="isExtend"
:disabled="formData.gdhCs=='一' || formData.gdhCs==''"
style="font-size: 14px;color: #ff6a00;width: 100%">
<span style="text-overflow: clip;white-space: normal;">
延用上一次工代会的组织机构及代表信息,包含【女教职工委员会;经费审查委员会;工会委员会;人事(劳动)争议调解委员会;代表团;工代会代表】。
</span>
</el-checkbox>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="!formData.id?doAdd():doEdit()">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
addDialogVisible: false,
isExtend: false,
pageForm: {
gdhJs: ""
},
jsList: [],
tableColumns: [
{prop: 'year', label: '年份'},
{prop: 'gdhJs', label: '工代会届数'},
{prop: 'gdhCs', label: '次数'},
{prop: 'gdhAllName', label: '全称'},
{prop: 'startState', label: '开启状态'},
{prop: 'startTime', label: '创建时间'}
],
csOptions: [
{id: "六", name: "六次"},
{id: "五", name: "五次"},
{id: "四", name: "四次"},
{id: "三", name: "三次"},
{id: "二", name: "二次"},
{id: "一", name: "一次"}].reverse(),
rules: {
year: [{required: true, message: '请选择教代会年份', trigger: ['blur', 'change']}],
gdhJs: [{required: true, message: '请输入教代会届数', trigger: ['blur', 'change']}],
gdhCs: [{required: true, message: '请输入教代会次数', trigger: ['blur', 'change']}]
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
},
methods: {
openEdit(row) {
this.$set(this.formData, "id", row.id)
this.$set(this.formData, "year", row.year + "")
this.$set(this.formData, "gdhJs", row.gdhJs)
this.$set(this.formData, "gdhCs", row.gdhCs)
this.$set(this.formData, "startState", row.startState)
this.addDialogVisible = true
},
async doEdit() {
const gdhAllName = this.formData.gdhJs + this.formData.gdhCs
this.$set(this.formData, "gdhAllName", gdhAllName)
this.$set(this.formData, "isExtend", this.isExtend)
const resp = await $.post(loc() + "/doEdit", this.formData)
this.pageData()
this.addDialogVisible = false
},
async doDelete(id) {
this.$confirm('您确定要删除此届工代会吗!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id: id})
this.pageData()
}
}
})
},
startStateChange(startState, id) {
const state = startState ? "关闭" : "开启";
this.$confirm('您确定要' + state + '工代会吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/startStateChange", {startState: startState, id: id})
this.pageData()
}
}
})
},
csChange(val) {
if (val === '一') {
this.$set(this, 'isExtend', false)
}
},
doAdd() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
if (!this.isExtend && this.formData.gdhCs !== '一') {
this.$confirm('确定不延用上一次教代会的组织及人员数据吗?这将导致此次教代会的组织及人员都将为空必须重新组建!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
await this.getAdd()
}
}
})
} else {
await this.getAdd()
}
}
})
},
async getAdd() {
const gdhAllName = this.formData.gdhJs + this.formData.gdhCs
this.$set(this.formData, "gdhAllName", gdhAllName)
this.formData.isExtend = this.isExtend
console.log(this.formData)
const resp = await $.post(loc() + "/doAdd", this.formData)
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.pageData()
this.addDialogVisible = false
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
openAdd() {
this.$set(this.formData, 'gdhCs', "")
this.$set(this.formData, 'year', new Date().getFullYear() + "")
this.addDialogVisible = true
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields()
}
},
async created() {
this.jsList = await getJc()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,359 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form .el-select {
width: 100% !important;
}
.wp-upload .wp-upload-button-select-file {
margin: 0 !important;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select placeholder="请选择工代会" v-model="pageForm.teacherMeetId" filterable style="width:180px;">
<el-option v-for="item in teacherMeets" :label="item.gdhAllName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select v-model="pageForm.unionId" @change="unionChange" filterable clearable
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="pageForm.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="doSearch"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button size="medium" type="primary" @click="doAuditMany" icon="el-icon-check">批量通过</el-button>
</div>
<div class="pull-right offscreen-right mr25">
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="medium">
<el-radio-button label="all">全部</el-radio-button>
<el-radio-button label="true">已审查</el-radio-button>
<el-radio-button label="false">待审查</el-radio-button>
</el-radio-group>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" @selection-change="(val)=>{selections = val}" @sort-change='pageOrder'
:row-key="(row)=>row.id">
<el-table-column type="selection" reserve-selection width="55"></el-table-column>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="姓名" prop="userName" width="80" align="center"></el-table-column>
<el-table-column label="工号" prop="loginName" align="center"></el-table-column>
<el-table-column label="性别" prop="sex" width="50" align="center"></el-table-column>
<el-table-column label="民族" prop="nation" align="center"></el-table-column>
<el-table-column label="政治面貌" prop="politicalOutlook" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="学历" prop="education" align="center"></el-table-column>
<el-table-column label="专业技术职称" prop="technicalTitle" align="center"></el-table-column>
<el-table-column label="年龄" prop="age" align="center" width="50"></el-table-column>
<el-table-column label="教学科研及双肩挑人员" prop="twoWork" align="center">
<template scope="{row}">
<el-checkbox v-model="row.twoWork"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="教代会代表" prop="isJdh" align="center">
<template scope="{row}">
<el-checkbox v-model="row.isJdh"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="工代会代表" prop="isGdh" align="center">
<template scope="{row}">
<el-checkbox v-model="row.isGdh"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="备注" prop="bz" show-overflow-tooltip></el-table-column>
<el-table-column label="分工会" prop="unionname" show-overflow-tooltip></el-table-column>
<el-table-column sortable label="状态" prop="stateName"></el-table-column>
<el-table-column label="操作" width="250" align="center" v-if="pageForm.isAudit!=='true'">
<template slot-scope="{row}">
<el-button size="mini" v-if="row.stateCode===100" @click="openEdit(row)"
type="primary">编辑
</el-button>
<el-button size="mini" v-if="row.stateCode===100" @click="doAudit(row.id,true)"
type="success">通过
</el-button>
<el-button size="mini" v-if="row.stateCode===100" @click="doAudit(row.id,false)"
type="danger">拒绝
</el-button>
<!-- <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:'view',data:row}">-->
<!-- 查看-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item v-if="row.stateCode===100"-->
<!-- :command="{type:'doAudit',id:row.id,result:true}">-->
<!-- 通过-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item v-if="row.stateCode===100"-->
<!-- :command="{type:'doAudit',id:row.id,result:false}">-->
<!-- 拒绝-->
<!-- </el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<db-info :active="'1'" ref="delegateInfo"></db-info>
</template>
</guava>
<el-dialog title="编辑" :visible.sync="editDialogVisible" :close-on-click-modal="false">
<el-form :model="formData" ref="form" :rules="rules" label-width="160px">
<el-row>
<el-col :span="12">
<el-form-item prop="userName" label="姓名">
<el-input v-model="formData.userName" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="loginName" label="工号">
<el-input v-model="formData.loginName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item prop="sex" label="性别">
<el-input v-model="formData.sex" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="age" label="年龄">
<el-input v-model="formData.age"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item prop="nation" label="民族">
<el-select filterable v-model="formData.nation">
<el-option v-for="n in nation" :key="n" :value="n" :label="n"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="education" label="学历">
<dict-select v-model="formData.education" code="Education"></dict-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item prop="politicalOutlook" label="政治面貌">
<el-input maxlength="20" v-model="formData.politicalOutlook"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="administrativeTitle" label="行政职务">
<el-input v-model="formData.administrativeTitle"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="technicalTitle" label="专业技术职务">
<el-select v-model="formData.technicalTitle" placeholder="请选择专业技术职务">
<el-option-group
v-for="group in technicalTitleOptions"
:key="group.label"
:label="group.label">
<el-option
v-for="item in group.options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-option-group>
</el-select>
</el-form-item>
<el-form-item prop="twoWork" label="教学科研及双肩挑人员">
<el-checkbox v-model="formData.twoWork"></el-checkbox>
</el-form-item>
<el-form-item prop="isJdh" label="教代会代表">
<el-checkbox v-model="formData.isJdh"></el-checkbox>
</el-form-item>
<el-form-item prop="isGdh" label="工代会代表">
<el-checkbox v-model="formData.isGdh"></el-checkbox>
</el-form-item>
<el-form-item prop="bz" label="备注">
<el-input v-model="formData.bz"></el-input>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="editDialogVisible=false">取消</el-button>
<el-button type="primary" @click="doEdit">确定</el-button>
</el-row>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
data() {
return {
teacherMeets: [],
tableData: [],
unionList: [],
unitList: [],
pageForm: {
isAudit: false
},
selections: [],
editDialogVisible: false,
rules: {
nation: [{required: true, message: '请选择民族', trigger: ['change', 'blur']}],
age: [{required: true, message: '请输入年龄', trigger: ['change', 'blur']}],
education: [{required: true, message: '请选择学历', trigger: ['change', 'blur']}],
politicalOutlook: [{required: true, message: '请输入政治面貌', trigger: ['change', 'blur']}],
administrativeTitle: [{required: true, message: '请输入行政职务', trigger: ['change', 'blur']}],
technicalTitle: [{required: true, message: '请选择专业技术职务', trigger: ['change', 'blur']}]
},
technicalTitleOptions: []
}
},
methods: {
openEdit(row) {
this.editDialogVisible = true
this.formData = row
console.log(row)
},
async doEdit() {
const valid = await this.$refs['form'].validate()
if (!valid) return
const resp = await $.post(loc() + '/doEditTeacher', this.formData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.editDialogVisible = false
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
},
dropdownCommand(command) {
const {type, id, result} = command
switch (type) {
case 'view': {
this.$refs.guava.view()
this.$refs.delegateInfo.openView('00mtsco13mgitql1pdblo7v5li')
break
}
case 'doAudit': {
this.doAudit([id], result)
break
}
}
},
async doAudit(id, result) {
let ids = [].concat(id)
console.log(ids)
const resp = await $.post('/platform/teacherMeet/delegate/audit/doAudit', {ids, result})
if (resp.code === 0) {
this.$notify.success(resp.msg)
this.doSearch()
} else {
this.$notify.error(resp.msg)
}
},
doAuditMany() {
if (this.selections.length === 0) {
this.$notify.warning('请先勾选需要批量审核的数据')
return
}
const ids = this.selections.map(v => v.id)
this.doAudit(ids, true)
this.selections = []
},
async unionChange(val) {
this.$set(this.pageForm, 'unitId', null)
this.unitList = await getUnit(val)
},
async getTechnicalTitleOptions() {
const resp = await $.get('/platform/teacherMeet/push/getTechnicalTitleOptions')
if (resp.code === 0) {
this.technicalTitleOptions = resp.data
}
}
},
async created() {
await this.getTechnicalTitleOptions()
this.teacherMeets = await getOpenGdh()
if (this.teacherMeets.length > 0) {
this.pageForm.teacherMeetId = this.teacherMeets[0].id
}
this.unionList = await getUnion()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,390 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form .el-select {
width: 100% !important;
}
.wp-upload .wp-upload-button-select-file {
margin: 0 !important;
}
.el-transfer {
display: flex;
align-items: center;
}
.el-transfer-panel {
flex: 2.5;
}
.el-transfer__buttons {
flex: 1;
text-align: center;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select placeholder="请选择工代会" v-model="pageForm.teacherMeetId" filterable style="width:180px;">
<el-option v-for="item in teacherMeets" :label="item.gdhAllName" :value="item.id"
:key="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="btn-group tool-button pull-right offscreen-right">
<el-button type="primary" size="medium" icon="el-icon-plus" @click="openPreselectionDialog">预选
</el-button>
<el-button type="primary" size="medium" icon="el-icon-plus" @click="doConfirmMany">批量上报</el-button>
<el-button type="primary" size="medium" icon="el-icon-download" @click="doExport">导出</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData" @sort-change='pageOrder' @selection-change="(val)=>{tableSelections=val}"
ref="multipleTable">
<el-table-column
:selectable="(row)=>{return row.stateCode===0}"
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column sortable label="姓名" prop="userName" header-align="center"
align="center"></el-table-column>
<el-table-column label="工号" prop="loginName" header-align="center" align="center"></el-table-column>
<el-table-column sortable label="性别" prop="sex" header-align="center"
align="center">
<template scope="{row}">
<el-select v-model="row.sex" v-if="row.stateCode===0">
<el-option value="男">男</el-option>
<el-option value="女">女</el-option>
</el-select>
<span v-else>{{row.sex}}</span>
</template>
</el-table-column>
<el-table-column label="民族" prop="nation" header-align="center" align="center" width="100">
<template scope="{row}">
<el-select filterable v-model="row.nation" v-if="row.stateCode===0">
<el-option v-for="n in nation" :key="n" :value="n" :label="n"></el-option>
</el-select>
<span v-else>{{row.nation}}</span>
</template>
</el-table-column>
<el-table-column label="政治面貌" prop="politicalOutlook" header-align="center"
align="center" show-overflow-tooltip>
<template scope="{row}">
<el-input maxlength="20" v-model="row.politicalOutlook" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.politicalOutlook}}</span>
</template>
</el-table-column>
<el-table-column label="学历" prop="education" header-align="center" align="center"
width="150px"
show-overflow-tooltip>
<template scope="{row}">
<dict-select v-model="row.education" code="Education"
v-if="row.stateCode===0"></dict-select>
<span v-else>{{row.education}}</span>
</template>
</el-table-column>
<el-table-column label="行政职务" prop="administrativeTitle" header-align="center" align="center"
width="100">
<template scope="{row}">
<el-input v-model="row.administrativeTitle" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.administrativeTitle}}</span>
</template>
</el-table-column>
<el-table-column label="专业技术职务" prop="technicalTitle" header-align="center" align="center"
width="200" show-overflow-tooltip>
<template scope="{row}">
<el-select v-model="row.technicalTitle" placeholder="请选择专业技术职务" v-if="row.stateCode===0">
<el-option-group
v-for="group in technicalTitleOptions"
:key="group.label"
:label="group.label">
<el-option
v-for="item in group.options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-option-group>
</el-select>
<!-- <dict-select v-model="row.technicalTitle" code="technical_position"-->
<!-- v-if="row.stateCode===0"></dict-select>-->
<!-- <el-input v-model="row.technicalTitle" v-if="row.stateCode===0"></el-input>-->
<span v-else>{{row.technicalTitle}}</span>
</template>
</el-table-column>
<el-table-column label="年龄<=40" prop="age" header-align="center" align="center" width="80px">
<template scope="{row}">
<el-input v-model="row.age" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.age}}</span>
</template>
</el-table-column>
<el-table-column label="教学科研及双肩挑人员" prop="twoWork" header-align="center" align="center">
<template scope="{row}">
<el-checkbox v-model="row.twoWork"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="教代会代表" prop="isJdh" header-align="center"
align="center">
<template scope="{row}">
<el-checkbox v-model="row.isJdh"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="工代会代表" prop="isGdh" header-align="center" align="center">
<template scope="{row}">
<el-checkbox v-model="row.isGdh"
:style="{'pointer-events':row.stateCode===0?'auto':'none'}"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="备注" prop="bz" header-align="center" align="center"
width="100">
<template scope="{row}">
<el-input v-model="row.bz" v-if="row.stateCode===0"></el-input>
<span v-else>{{row.bz}}</span>
</template>
</el-table-column>
<el-table-column sortable label="状态" prop="dbzt" header-align="center" align="center">
<template scope="{row}">
{{row.stateName}}
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center" fixed="right">
<template slot-scope="{row}">
<el-button v-if="row.stateCode===0" size="mini" @click="doConfirm(row)" type="primary">上报
</el-button>
<el-button v-if="row.stateCode===100" size="mini" @click="doRevoke(row)" type="warning">撤回
</el-button>
<el-button v-if="row.stateCode===0" size="mini" @click="doDelete(row)" type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</guava>
<el-dialog
title="添加人员"
:visible.sync="dialogVisible"
width="45%"
:close-on-click-modal="false"
>
<el-transfer
@right-check-change="rightCheckChange"
@change="rightChange"
ref="transfer"
:titles="['可报人员名单', '当前选择']"
filterable
:props="{key: 'id',label: 'name'}"
:filter-method="filterMethod"
:right-default-checked="rightChecked"
v-model="userValue"
:data="userData">
</el-transfer>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addPreselectionDb">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
searchName: "u.username",
teacherMeetId: null
},
userValue: [],
userData: [],
rightChecked: [],
dialogVisible: false,
teacherMeets: [],
tableData: [],
tableSelections: [],
technicalTitleOptions: []
}
},
methods: {
async doConfirmMany() {
if (this.tableSelections.length === 0) {
this.$notify.warning('请先勾选需要上报的代表!')
return
}
const keys = ['sex', 'nation', 'politicalOutlook', 'education', 'administrativeTitle', 'technicalTitle',
'age']
const flag = this.tableSelections.some(row => {
if (keys.some(v => row[v] === '' || row[v] == null)) {
this.$notify.warning('推选代表的信息不完整,请完善!')
return true
}
if (!row.isJdh && !row.isGdh) {
this.$notify.warning('请确认是教代会还是工代会代表!')
return true
}
return false
})
if (flag) {
return
}
const resp = await $.post(loc() + '/doCofirmMany', {data: JSON.stringify(this.tableSelections)})
this.doSearch()
this.$notify.success(resp.msg)
},
async doConfirm(row) {
const keys = ['sex', 'nation', 'politicalOutlook', 'education', 'administrativeTitle', 'technicalTitle',
'age']
if (keys.some(v => row[v] === '' || row[v] == null)) {
this.$notify.warning('推选代表的信息不完整,请完善!')
return
}
if (!row.isJdh && !row.isGdh) {
this.$notify.warning('请确认是教代会还是工代会代表!')
return;
}
const resp = await $.post(loc() + '/doUpdate', row)
this.doSearch()
this.$notify.success(resp.msg)
},
async doRevoke(row) {
const resp = await $.post(loc() + '/doRevoke', {id: row.id})
this.doSearch()
this.$notify.success(resp.msg)
},
async doDelete(row) {
const resp = await $.post(loc() + '/doDelete', {id: row.id})
this.doSearch()
this.$notify.success(resp.msg)
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
rightCheckChange(v, v2) {
this.rightChecked = v
},
filterMethod(query, item) {
return item.name.indexOf(query) > -1;
},
async openPreselectionDialog() {
this.userValue = []
this.userData = []
const {data} = await $.get(loc() + "/getUnionUser", {teacherMeetId: this.pageForm.teacherMeetId})
data.userData.forEach(v => {
this.userData.push({id: v.id, name: v.username + "-" + v.loginname})
})
/* data.userValue.forEach(v => {
this.userValue.push(v.userId)
})*/
this.dialogVisible = true
},
async addPreselectionDb() {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.get(loc() + "/addPreselectionDb", {
userValue: JSON.stringify(this.userValue),
teacherMeetId: this.pageForm.teacherMeetId
})
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.dialogVisible = false
}, (data, msg) => {
})
},
async pageData() {
const {data} = await $.get(loc() + '/pageData', this.pageForm)
data.forEach(v => {
v.jdhdb = v.dbzt === 2
})
this.tableData = data
},
rightChange(v) {
},
doExport() {
if (!this.pageForm.teacherMeetId) {
this.$notify({
title: '警告',
message: '请选择工代会',
type: 'warning'
});
return
}
location.href = '/platform/jdh/db/dbyl/doExport?jdhid=' + this.pageForm.teacherMeetId
},
async getTechnicalTitleOptions() {
const resp = await $.get(loc() + '/getTechnicalTitleOptions')
if (resp.code === 0) {
this.technicalTitleOptions = resp.data
}
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue'),
},
async created() {
await this.getTechnicalTitleOptions()
// this.teacherMeets = await teacherMeet.getOpenJdh()
this.teacherMeets = await getOpenGdh()
if (this.teacherMeets && this.teacherMeets.length > 0) this.$set(this.pageForm, "teacherMeetId", this.teacherMeets[0].id)
this.pageData()
}
})
</script>
<!--#
}
#-->