新增-妇代会

This commit is contained in:
=
2026-02-26 09:37:51 +08:00
parent 3d07a36d6d
commit 4408f423df
23 changed files with 3480 additions and 4 deletions
@@ -238,6 +238,24 @@ const getGdhDbt = async (jdhId) => {
return data
}
/**
* 获取妇代会
* @returns {Promise<*>}
*/
const getFdh = async (open = true) => {
const {data} = await $.get("/platform/vi/common/getFdh", {open})
return data
}
/**
* 获取妇代会代表团
* @returns {Promise<*>}
*/
const getFdhDbt = async (jdhId) => {
const {data} = await $.get("/platform/fdh/common/getDbt", {jdhId})
return data
}
/**
* 根据id查用户
* @returns {Promise<*>}
@@ -3,6 +3,30 @@ const basicForm = {
<el-dialog :visible.sync="dialogVisible" title="基础设置">
<div style="overflow-y: auto">
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="150px">
<el-row>
<el-col :span="12">
<el-form-item label="是否沿用之前活动" prop="use">
<el-radio-group v-model="use" size="medium">
<el-radio-button :label="true" border>沿用</el-radio-button>
<el-radio-button :label="false" border>不沿用</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="往期活动" prop="historicalQsv">
<el-select v-model="historicalQsv" placeholder="请选择往期活动"
:disabled="!use"
style="width: 100%" @change="historicalQsvChange">
<el-option
v-for="item in historicalQsvList"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="类型" prop="category">
<el-radio-group v-model="formData.category" size="small">
<el-radio v-for="item in dict.type.ACTIVITY_QSV_CATEGORY" :label="item.value"
@@ -201,6 +225,9 @@ const basicForm = {
},
data() {
return {
use: false,
historicalQsvList: [],
historicalQsv: '',
dialogVisible: false,
formData: {
category: ''
@@ -217,6 +244,19 @@ const basicForm = {
}
},
methods: {
async getHistoricalQsvList() {
const resp = await $.post('/platform/qsv/activity/getHistoricalQsvList', {})
return resp.data
},
async historicalQsvChange(val) {
const resp = await $.get('/platform/qsv/activity/findOne', {id: val})
if (resp.code === 0) {
this.formData = resp.data
this.formData.activityId = resp.data.id
this.formData.id = ''
console.log(this.formData.activityId)
}
},
onOpen(id) {
this.dialogVisible = true
this.getActivityGroup()
@@ -250,5 +290,8 @@ const basicForm = {
}
})
}
}
},
async created() {
this.historicalQsvList = await this.getHistoricalQsvList()
},
}
@@ -0,0 +1,564 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-select v-model="pageForm.fdh_id" filterable placeholder="请选择教代会" @change="jdhChange">
<el-option
v-for="item in fdhList"
:key="item.id"
:label="item.fdhAllName"
: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 style="padding: 0 10px">
<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 style="width: 200px" 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" v-if="node.level!=2">
<el-select style="width: 200px" 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
style="width: 200px" 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-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">
<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-table :data="tableData" row-key="id" @selection-change="handleSelectionChange"
ref="multipleTable" height="584">
<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>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</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="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="identity" label="代表类型">
<el-radio v-model="formData.identity" label="1" border>正式代表</el-radio>
<el-radio v-model="formData.identity" label="2" border>列席代表</el-radio>
<el-radio v-model="formData.identity" label="3" border>特邀代表</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.fdhid">
<el-option :label="item.fdhAllName" :value="item.id" v-for="item in fdhList"></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>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue')
},
data() {
return {
loading: false,
xldTableData: [],
xldFormData: {
userid: ""
},
xldUserList: [],
node: {
level: 1
},
label: "代表列表",
selection: [],
unionList: [],
unitList: {},
dbList: [],
delegations: [],
checkData: {
id: ""
},
treeData: [],
fdhList: [],
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: 'mobile', label: '联系方式'},
{prop: 'dbt_name', label: '代表团', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', 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']}],
identity: [{required: true, message: '请选择代表类型', trigger: ['change', 'blur']}]
},
}
},
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(loc() + '/fpXldToDbt', {
user: this.xldTableData,
fdhid: this.xldFormData.fdhid
})
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.fdhid === '') {
this.$message.info('请先选择妇代会!')
return
}
if (key !== '') {
this.loading = true;
const {data} = await $.get(loc() + '/queryXldUser', {
query: key,
fdhid: this.xldFormData.fdhid
})
this.xldUserList = data
this.loading = false;
}
},
async xldJdhChange(jdhid) {
this.delegations = await getDbt(jdhid)
},
async openSetXld() {
if (this.fdhList && this.fdhList.length > 0) {
this.xldFormData.fdhid = this.fdhList[0].id
}
this.$set(this.xldFormData, "userid", "")
this.xldUserList = []
this.xldTableData = []
this.xldDialogVisible = true
},
doExcel() {
if (this.pageForm.fdh_id) {
const current_fdh = this.fdhList.find(v => v.id === this.pageForm.fdh_id)
location.href = '/platform/womanCongress/delegate/doExcel?fdhId=' + this.pageForm.fdh_id + '&dbtId=' + this.checkData.id + '&fdhAllName=' + current_fdh.fdhAllName
}
},
/*点击多选框*/
handleSelectionChange(val) {
this.selection = val
},
/*删除多个*/
doDeleteUserList() {
this.$confirm('确定要移除勾选的代表吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDeleteUserList", {
userData: JSON.stringify(this.selection),
fdh_id: this.pageForm.fdh_id
})
if(resp.code===0){
this.$message.success(resp.msg)
this.$refs.multipleTable.clearSelection();
this.pageData()
}else{
this.$message.warning(resp.msg)
}
}
}
});
},
/*删除一个*/
delUser(row) {
const data = {
userId: row.userId,
dbt_id: row.dbt_id,
fdh_id: row.fdh_id,
identity: row.identity
}
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.$message.success(resp.msg)
this.pageData()
}else{
this.$message.warning(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),
fdh_id: this.pageForm.fdh_id,
dbt_id: this.formData.dbt_id,
identity: this.formData.identity
})
loading.close()
if(resp.code===0){
this.pageData()
this.addDialogVisible = false
}else{
this.$message.warning(resp.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", {
fdh_id: this.pageForm.fdh_id,
dbt_id: this.formData.dbt_id
})
this.dbList = data
},
/*查询代表团*/
async undertakeUnitTree() {
const {data} = await $.get("/platform/womanCongress/delegation/undertakeUnionTree", {fdh_id: this.pageForm.fdh_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 getFdhDbt(this.pageForm.fdh_id)
},
/*点击届次*/
async jdhChange(id) {
this.pageForm.dbt_id = ''
this.delegations = await getFdhDbt(id)
await this.undertakeUnitTree()
this.pageData();
},
async getUnitList() {
this.unitList = await getUnits(this.pageForm.unionId)
},
},
async created() {
this.fdhList = await getFdh()
if (this.fdhList.length > 0) {
this.pageForm.fdh_id = this.fdhList[0].id
this.delegations = await getFdhDbt(this.fdhList[0].id)
}
this.pageData();
this.unionList = await getUnions()
this.getUnitList()
await this.undertakeUnitTree()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,579 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-select v-model="pageForm.fdh_id" filterable placeholder="请选择妇代会代会" @change="fdhChange">
<el-option
v-for="item in fdhList"
:key="item.id"
:label="item.fdhAllName"
:value="item.id">
</el-option>
</el-select>
</div>
<el-tree class="v-tree" :data="treeData" :props="defaultProps"
default-expand-all :filter-node-method="filterNode" 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" style="padding:0 10px">
<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">
<el-table :data="tableData" row-key="id" height="638"
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">
</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>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
<div v-if="node.level==2" style="padding:0 10px">
<el-card shadow="never" v-if="['two','three'].includes(activeName)">
<el-row type="flex" justify="end">
<el-button type="primary" v-if="activeName==='two'" @click="unionOpenAdd()">设置组成基层工会</el-button>
<el-button type="primary" v-if="activeName==='three'" @click="openUserTz()">设置团长/副团长</el-button>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="代表" name="one">
<el-table highlight-current-row :data="dbTableData" size="small"
style="width: 100%;"
height="719">
<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>
</el-tab-pane>
<el-tab-pane label="设置组成基层工会" name="two">
<el-table highlight-current-row :data="unionTableData" size="small"
height="629"
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-tab-pane>
<el-tab-pane label="设置团长/副团长" name="three">
<el-table :data="tzTableData" size="mini" height="629">
<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-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</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="fdhAllName" label="所属教代会">
<el-input v-model="formData.fdhAllName" 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="fdhAllName" label="届次">
<el-input v-model="userFormData.fdhAllName" 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>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue')
},
data() {
return {
pageForm: {
fdh_id: ""
},
leaderInfo: {},
userList: [],
userFormData: {},
unionData: [],
unionFormData: {
unionValue: []
},
unionTableData: [],
unionDialogVisible: false,
userDialogVisible: false,
addDialogVisible: false,
unionSubLoading: false,
treeData: [],
dbTableData: [],
tzTableData: [],
checkData: {},
activeName: 'one',
label: "",
fdhList: [],
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: 'found_time', label: '创建时间', 所属教代会: true}
],
rules: {
dbt_id: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}]
},
}
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.dbt_name.indexOf(value) !== -1
return false
},
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()
}
},
fdhChange() {
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,
fdh_id: this.pageForm.fdh_id
})
if (resp.code === 0) {
this.getTzList()
} else {
this.$message.warning(resp.msg)
}
}
}
});
},
async undertakeUnitTree() {
const {data} = await $.get(loc() + "/undertakeUnionTree", {fdh_id: this.pageForm.fdh_id})
this.treeData = [data]
this.pageData()
},
openAddDbt() {
const fdhFind = this.fdhList.find(v => v.id = this.pageForm.fdh_id)
this.$set(this.formData, "fdhAllName", fdhFind.fdhAllName)
this.getDbtList()
this.addDialogVisible = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
async getDbtList() {
const resp = await $.post(loc() + "/getDbtFind", {fdh_id: this.pageForm.fdh_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),
fdh_id: this.pageForm.fdh_id
})
loading.close()
if (resp.code === 0) {
await this.undertakeUnitTree()
this.pageData()
this.addDialogVisible = false
this.delegations = await getFdhDbt(this.pageForm.fdh_id)
} else {
this.$message.warning(resp.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, fdh_id: this.pageForm.fdh_id})
if (resp.code === 0) {
this.undertakeUnitTree()
this.pageData()
this.delegations = await getFdhDbt(this.pageForm.fdh_id)
} else {
this.$message.warning(resp.msg)
}
}
}
});
},
async unionOpenAdd() {
const {data} = await $.get(loc() + "/unionOpenAddList", {
fdh_id: this.pageForm.fdh_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),
fdh_id: this.pageForm.fdh_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", {
fdh_id: this.pageForm.fdh_id,
dbt_id: this.checkData.id
})
this.unionTableData = resp
},
unionFilterMethod(query, item) {
return item.unionname.indexOf(query) > -1;
},
async getDbTableData() {
const resp = await $.post(loc() + "/getDbTableData", {
fdh_id: this.pageForm.fdh_id,
dbt_id: this.checkData.id
})
this.dbTableData = resp
},
async openUserTz() {
this.userFormData = {}
this.leaderInfo = {
mobile: '',
unitname: '',
sf: '2'
}
const aa = this.fdhList.find(v => v.id == this.pageForm.fdh_id)
this.$set(this.userFormData, 'fdhAllName', aa.fdhAllName)
const data = await $.get(loc() + "/queryUser", {
dbt_id: this.checkData.id,
fdh_id: this.pageForm.fdh_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.fdh_id = this.pageForm.fdh_id
const resp = await $.post(loc() + "/doAddTz", this.userFormData)
if (resp.code === 0) {
this.$message.success(resp.msg)
this.getTzList()
} else {
this.$message.warning(resp.msg)
}
this.userList = []
this.userFormData.userid = ''
this.userDialogVisible = false
},
async getTzList() {
const resp = await $.get(loc() + '/getTzList', {
dbt_id: this.checkData.id,
fdh_id: this.pageForm.fdh_id
})
if (resp.code === 0) {
this.tzTableData = resp.data
} else {
this.$message.warning(resp.msg)
}
},
},
async created() {
this.fdhList = await getFdh()
if (this.fdhList.length > 0) {
this.pageForm.fdh_id = this.fdhList[0].id
this.delegations = await getFdhDbt(this.fdhList[0].id)
}
this.pageData()
this.undertakeUnitTree()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,428 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 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 v-if="node.level==3"
style="font-size: 14px" :title="data.name" class="v-node">
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
<i class="fa fa-circle-o" v-else></i>
&nbsp; {{ data.name }}
</div>
</div>
</el-tree>
</template>
<template>
<div style="padding: 0 10px">
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.fdh_id" filterable clearable
placeholder="届次">
<el-option
v-for="item in fdhList"
:label="item.fdhAllName"
: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" class="mt10">
<template v-if="checkData.childrens&&checkData.childrens.length>0">
</template>
<template v-else="">
<table-tool :label="label" :app="this">
<template #func>
<el-button type="primary" size="medium" @click="openAdd"
v-if="node.level==2">
添加人员
</el-button>
</template>
</table-tool>
<el-table :data="tableData" row-key="id" height="584">
<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>
</template>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</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="fdhAllName" label="届次">
<el-input v-model="formData.fdhAllName" 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==='fdhwyh1'">
<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: "妇代会机构设置",
fdhList: [],
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: 'fdh_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,
fdh_id: row.fdh_id,
organization_id: row.organization_id,
user_id: row.user_id
})
if(resp.code===0){
this.$message.success(resp.msg)
this.pageData()
}else{
this.$message.warning(resp.msg)
}
},
async loadTree() {
this.treeLoading = true
const data = await $.get("/platform/womanCongress/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.$message.warning(resp.msg)
}
},
async openAdd() {
const aa = this.fdhList.find(v => v.id = this.pageForm.fdh_id)
this.$set(this.formData, 'fdhAllName', aa.fdhAllName)
this.$set(this.formData, 'status', 1)
this.$set(this.formData, 'fdh_id', this.pageForm.fdh_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", {
fdh_id: this.pageForm.fdh_id,
organization_id: this.checkData.id,
key: key
})
this.userList = data.list
}
},
async created() {
this.fdhList = await getFdh()
if (this.fdhList.length > 0) {
this.$set(this.pageForm, "fdh_id", this.fdhList[0].id)
}
this.loadTree()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,304 @@
<!--#
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.fdhJs" 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.fdhCs" 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" @click="openAdd">新建届次
</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=='fdhJs'">
{{row.fdhJs}}
</template>
<template scope="{row}" v-else-if="column.prop=='fdhCs'">
{{row.fdhCs}}
</template>
<template scope="{row}" v-else-if="column.prop=='fdhAllName'">
{{row.fdhAllName}}妇代会
</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="fdhJs" label="妇代会届数">
<el-select v-model="formData.fdhJs" 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="fdhCs" label="妇代会次数">
<el-select v-model="formData.fdhCs" @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.fdhCs=='一' || formData.fdhCs==''"
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: {
fdhJs: ""
},
jsList: [],
tableColumns: [
{prop: 'year', label: '年份', sortable: true},
{prop: 'fdhJs', label: '妇代会届数', sortable: true},
{prop: 'fdhCs', label: '次数', sortable: true},
{prop: 'fdhAllName', 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']}],
fdhJs: [{required: true, message: '请输入教代会届数', trigger: ['blur', 'change']}],
fdhCs: [{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, "fdhJs", row.fdhJs)
this.$set(this.formData, "fdhCs", row.fdhCs)
this.$set(this.formData, "startState", row.startState)
this.addDialogVisible = true
},
async doEdit() {
const fdhAllName = this.formData.fdhJs + this.formData.fdhCs
this.$set(this.formData, "fdhAllName", fdhAllName)
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.fdhCs !== '一') {
this.$confirm('确定不延用上一次教代会的组织及人员数据吗?这将导致此次教代会的组织及人员都将为空必须重新组建!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
await this.getAdd()
}
}
})
} else {
await this.getAdd()
}
}
})
},
async getAdd() {
const fdhAllName = this.formData.fdhJs + this.formData.fdhCs
this.$set(this.formData, "fdhAllName", fdhAllName)
this.formData.isExtend = this.isExtend
console.log(this.formData)
const resp = await $.post(loc() + "/doAdd", this.formData)
if(resp.code===0){
this.pageData()
this.addDialogVisible = false
}else{
this.$message.warning(resp.msg)
}
},
openAdd() {
this.$set(this.formData, 'fdhCs', "")
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>
<!--#
}
#-->