first commit

This commit is contained in:
2026-09-09 09:14:28 +08:00
commit 5343198112
5199 changed files with 1052895 additions and 0 deletions
@@ -0,0 +1,425 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入关键字查询" style="width: 250px;" v-model="pageForm.zlname">
</el-input>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择工作资料类型" v-model="pageForm.zllx">
<el-option
:key="item.id"
:label="item.lxname"
:value="item.id"
v-for="item in filelxList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openAdd" size="medium" type="primary"><i class="ti-plus"></i> 新建筹备文件</el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="资料名称" prop="zlname">
</el-table-column>
<el-table-column label="所属教代会" prop="jdhallname" sortable>
</el-table-column>
<el-table-column label="资料类型" prop="lxname" sortable>
</el-table-column>
<el-table-column label="上传人" prop="username" sortable>
</el-table-column>
<el-table-column label="上传时间" prop="time" sortable>
</el-table-column>
<el-table-column label="是否通过" prop="ispass" sortable>
<template slot-scope="scope">
<i class="fa fa-circle text-danger ml5" v-if="scope.row.ispass === 0"> 未通过</i>
<i class="fa fa-circle text-success ml5" v-if="scope.row.ispass === 1"> 通过</i>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'preview',data:scope.row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{type:'Edit',data:scope.row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'Delete',data:scope.row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="pageForm.pageNumber"
:page-size="pageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</guava>
<el-dialog :visible.sync="addDialogVisible" title="新建筹备文件">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="上传人">
<el-input readonly value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
<el-form-item label="所属教代会" prop="jdhid">
<el-select placeholder="选择教代会" style="width: 100%" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="资料名称" prop="zlname">
<el-input placeholder="请填写工作资料名称" v-model="formData.zlname"></el-input>
</el-form-item>
<el-form-item label="资料类型" prop="zllx">
<el-select placeholder="选择资料类型" style="width: 100%" v-model="formData.zllx">
<el-option
:key="item.id"
:label="item.lxname"
:value="item.id"
v-for="item in filelxList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否通过" prop="ispass">
<template>
<el-switch
active-color="#13ce66"
inactive-color="#ff4949"
v-model="formData.ispass">
</el-switch>
</template>
</el-form-item>
<el-form-item label="附件上传" prop="files">
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
</el-form>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="editDialogVisible" title="编辑筹备文件">
<el-form :model="formData" :rules="rules" label-width="100px" ref="editForm">
<el-form-item label="上传人">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
<el-form-item label="所属教代会" prop="jdhid">
<el-select placeholder="选择教代会" style="width: 100%" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhjs+'届'+item.jdhcs+'次教代会'"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="资料名称" prop="zlname">
<el-input placeholder="请填写工作资料名称" v-model="formData.zlname"></el-input>
</el-form-item>
<el-form-item label="资料类型" prop="zllx">
<el-select placeholder="选择资料类型" style="width: 100%" v-model="formData.zllx">
<el-option
:key="item.id"
:label="item.lxname"
:value="item.id"
v-for="item in filelxList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否通过" prop="ispass">
<template>
<el-switch
active-color="#13ce66"
inactive-color="#ff4949"
v-model="formData.ispass">
</el-switch>
</template>
</el-form-item>
<el-form-item label="附件上传" prop="files">
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="viewDialogVisible" title="阅览筹备文件">
<el-form label-suffix="" label-width="100px">
<vi-title title="基本信息"></vi-title>
<el-row>
<el-col :span="12">
<el-form-item label="上传人">
{{formData.username}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="教代会">
{{formData.jdhallname}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资料名称" prop="zlname">
{{formData.zlname}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资料类型" prop="zllx">
{{formData.lxname}}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="是否通过" prop="ispass">
{{formData.ispass?'通过':'不通过'}}
</el-form-item>
<vi-title title="附件"></vi-title>
<el-form-item label="附&emsp;&emsp;件" prop="files">
<file-upload :files.sync="formData.files" view></file-upload>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="viewDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: "#app",
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
},
data() {
return {
addDialogVisible: false,
editDialogVisible: false,
viewDialogVisible: false,
tableData: [],
jdhList: [],
filelxList: [],
fileList: [],
pageForm: {
zlname: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
formData: {},
rules: {
jdhid: [{required: true, message: '请填写所属教代会', trigger: ['blur', 'change']}],
zlname: [{required: true, message: '请填写所属教代会', trigger: ['blur', 'change']}],
zllx: [{required: true, message: '请填写资料类型', trigger: ['blur', 'change']}],
},
delFiles: []
}
},
methods: {
openView(row) {
const formData = clone(row)
formData.files = JSON.parse(formData.files || "[]")
this.formData = formData
this.viewDialogVisible = true
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'preview') {
this.openView(data)
} else if (type == 'Edit') {
this.openEdit(data)
} else if (type == 'Delete') {
this.doDelete(data.id, data.filepath)
}
},
handleChange: function (file, filelist) {
this.fileList = filelist;
},
handleRemove(file, filelist) {
if (file.status === 'success') {
this.fileList = filelist;
this.delFiles.push({fileid: file.id, filepath: file.url})
}
},
onDeleteFile(file) {
if (file.status === 2) {
console.log(file)
this.delFiles.push({fileid: file.fileDes.id, filepath: file.fileDes.filepath})
}
},
doDelete(id, filepath) {
this.$confirm('确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
$.post(base + '/platform/jdh/cb/cbwj/doDelete', {id: id, filepath: filepath}).then(res => {
if (res.code === 0) {
this.doSearch()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
doEdit() {
this.$refs['editForm'].validate(async (valid) => {
if (valid) {
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files)
const resp = await $.post(loc() + '/doEdit', formData)
AssertResponseMessage({
app: this,
response: resp,
success: () => {
this.editDialogVisible = false
this.pageData()
},
final: () => {
loading.close()
}
})
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop
this.pageForm.pageOrderBy = column.order
this.pageData()
},
pageNumberChange(val) {
this.pageForm.pageNumber = val;
this.pageData()
},
pageSizeChange(val) {
this.pageForm.pageSize = val;
this.pageData()
},
pageData() {
sublime.showLoadingbar()
$.post(base + '/platform/jdh/cb/cbwj/pageData', this.pageForm).then(res => {
sublime.closeLoadingbar()
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
openEdit(obj) {
if (this.$refs["editForm"])
this.$refs["editForm"].resetFields()
const formData = clone(obj)
formData.files = JSON.parse(formData.files || "[]")
this.formData = formData
this.editDialogVisible = true
},
openAdd() {
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields()
this.formData = {files: []}
this.addDialogVisible = true
},
doAdd() {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
this.$refs['addForm'].validate(async valid => {
if (valid) {
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files)
const resp = await $.post(loc() + '/doAdd', formData)
AssertResponseMessage({
app: this,
response: resp,
success: () => {
this.addDialogVisible = false
this.pageData()
},
final: () => {
loading.close()
}
})
}
})
}
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
this.filelxList = await getGzzllx()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,484 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-loading-spinner {
font-size: 30px !important;
}
.el-checkbox__label {
padding-left: 20px;
}
.el-checkbox__input {
position: absolute;
/*line-height: unset!important;*/
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-date-picker
:clearable="false"
formData="yyyy"
placeholder="选择年份"
type="year"
v-model="pageForm.searchYear"
value-format="yyyy">
</el-date-picker>
</div>
<div class="btn-group tool-button">
<el-select clearable placeholder="请选择届数" v-model="pageForm.jdhjs">
<el-option
:key="item.id"
:label="item.name"
:value="item.code"
v-for="item in jsOptions">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable placeholder="请选择次数" v-model="pageForm.jdhcs">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in csOptions">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openAdd" size="medium" type="primary"><i class="ti-plus"></i> 新建届次</el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="教代会年份" prop="jdhnf"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="教代会届数" prop="jdhjs"
sortable>
<template slot-scope="scope">
第{{scope.row.jdhjs}}届
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="次数" prop="jdhcs"
sortable>
<template slot-scope="scope">
第{{scope.row.jdhcs}}次
</template>
</el-table-column>
<el-table-column label="描述" prop="jdhms"></el-table-column>
<el-table-column :formatter="dateFormat" label="创建时间" prop="jdhkqsj"></el-table-column>
<el-table-column label="开启状态" prop="jdhkqzt">
<template slot-scope="scope">
<el-switch :value="scope.row.jdhkqzt===1"
@change="jdhztChange(scope.row.jdhkqzt,scope.row.id)"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button :disabled="scope.row.jdhkqzt===0" @click="openEdit(scope)" size="mini"
type="primary">
编辑
</el-button>
<el-button :disabled="scope.row.jdhkqzt===0" @click="doDelete(scope.row.id)" size="mini"
type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="pageForm.pageNumber"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
layout="total, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</guava>
<el-dialog
:visible.sync="addDialogVisible"
title="新建届次"
width="45%">
<el-form :model="formData" :rules="rules" label-width="120px" ref="addForm">
<el-form-item label="教代会年份" prop="jdhnf">
<el-date-picker :clearable="false" formData="yyyy"
placeholder="选择年"
style="width:100%;"
type="year"
v-model="formData.jdhnf"
value-format="yyyy">
</el-date-picker>
</el-form-item>
<el-form-item label="教代会届数" prop="jdhjs">
<el-select filterable placeholder="请选择届数" style="width:100%;" v-model="formData.jdhjs">
<el-option :key="i.id" :label="i.name" :value="i.code" v-for="i in jsList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="教代会次数" prop="jdhcs">
<el-select @change="csChange" filterable placeholder="请选择次数" style="width:100%;"
v-model="formData.jdhcs">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in csOptions"></el-option>
</el-select>
</el-form-item>
<el-form-item label="教代会描述" prop="jdhms">
<el-input :rows="2"
placeholder="请输入教代会描述"
type="textarea"
v-model="formData.jdhms">
</el-input>
</el-form-item>
<el-form-item class="is-required" label="" label-width="30px" prop="sfjc" style="margin-top: 20px;">
<el-checkbox :disabled="formData.jdhcs=='一' || formData.jdhcs==''"
style="font-size: 14px;color: #ff6a00;width: 100%"
v-model="formData.isExtend">
<span style="text-overflow: clip;white-space: normal;">
延用上一次教代会的组织机构及代表信息,包含【筹备领导小组;资格审查小组;主席团;执行委员会;专门委员会;代表团;教代会代表】。
</span>
</el-checkbox>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog
:close-on-click-modal="false"
:visible.sync="editDialogVisible"
custom-class="ViewDialogClass"
title="编辑教代会信息"
width="45%">
<el-form :model="formData" :rules="rules" label-width="120px" ref="editForm">
<el-form-item label="教代会年份" prop="jdhnf">
<div class="block">
<el-date-picker formData="yyyy"
placeholder="选择年"
style="width:250px;"
type="year"
v-model="formData.jdhnf"
value-format="yyyy">
</el-date-picker>
</div>
</el-form-item>
<el-form-item label="教代会届数" prop="jdhjs">
<el-select filterable placeholder="请选择届数" style="width:100%;" v-model="formData.jdhjs">
<el-option :key="i.id" :label="i.name" :value="i.code" v-for="i in jsList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="教代会次数" prop="jdhcs">
<el-select filterable placeholder="请选择次数" style="width:100%;" v-model="formData.jdhcs">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in csOptions"></el-option>
</el-select>
</el-form-item>
<el-form-item label="教代会描述" prop="jdhms">
<el-input :rows="2"
auto-complete="off"
placeholder="请输入教代会主题描述"
style="width:450px;"
type="textarea"
v-model="formData.jdhms">
</el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const rules = {
jdhnf: [
{required: true, message: '请选择教代会年份', trigger: ['blur', 'change']}
],
jdhjs: [
{required: true, message: '请输入教代会届数', trigger: ['blur', 'change']}
],
jdhcs: [
{required: true, message: '请输入教代会次数', trigger: ['blur', 'change']}
]
}
let vue = new Vue({
el: "#app",
data() {
return {
addDialogVisible: false,
editDialogVisible: false,
tableData: [],
pageForm: {
searchYear: '',
jdhjs: '',
jdhcs: '',
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: '',
pageOrderBy: ''
},
formData: {
jdhid: "",
jdhnf: "",
jdhjs: "",
jdhcs: "",
jdhms: "",
jdhkqzt: "",
sfjc: "",
isExtend: false
},
rules: rules,
jsList: [],
cslist: ['一', '二', '三', '四', '五'],
jsOptions: [],
csOptions: [
{id: "一", name: "一次"},
{id: "二", name: "二次"},
{id: "三", name: "三次"},
{id: "四", name: "四次"},
{id: "五", name: "五次"},
{id: "六", name: "六次"}
]
}
},
methods: {
dateFormat(row, column) {
let date = row[column.property];
if (date) {
return moment(date).format("YYYY-MM-DD")
}
},
doDelete(id) {
this.$confirm('删除此次教代会将会删除该教代会下面所有的数据(包括提案数据)', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((res) => {
const loading = this.$loading({
lock: true,
text: '删除中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
$.post(base + '/platform/jdh/cb/jcgl/doDelete', {id: id}).then(res => {
if (res.code === 0) {
setTimeout(() => {
loading.spinner = 'el-icon-circle-check'
loading.text = '删除成功'
setTimeout(() => {
loading.close()
this.doSearch()
}, 1000)
}, 1000)
} else {
setTimeout(() => {
loading.spinner = 'el-icon-circle-close'
loading.text = '删除失败'
setTimeout(() => {
loading.close()
this.doSearch()
}, 1000)
}, 1000)
}
})
}).catch(() => {
})
},
jsChange(val) {
$.post(base + "/platform/jdh/cb/jcgl/getcs", {jdhjs: val}).then(res => {
if (res.code == 0) {
this.cslist = res.data;
} else {
this.$message.error(res.msg)
}
})
},
csChange(val) {
if (val === '一') {
this.$set(this.formData, 'isExtend', false)
}
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop
this.pageForm.pageOrderBy = column.order
this.pageData()
},
pageNumberChange(val) {
this.pageForm.pageNumber = val
this.pageData()
},
pageData() {
sublime.showLoadingbar()
$.post(base + "/platform/jdh/cb/jcgl/pageData", this.pageForm).then(res => {
sublime.closeLoadingbar()
if (res.code == 0) {
this.tableData = res.data.list;
this.pageForm.totalCount = res.data.totalCount;
} else {
this.$message.error(res.msg)
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
openAdd() {
this.formData = {
jdhid: "",
jdhnf: (new Date()).getFullYear() + '',
jdhjs: "",
jdhcs: "",
jdhms: "",
jdhkqzt: "",
sfjc: "",
isExtend: false
},
this.addDialogVisible = true
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields()
},
doAdd() {
if (!this.formData.isExtend && this.formData.jdhcs !== '一') {
this.$confirm('确定不延用上一次教代会的组织及人员数据吗?这将导致此次教代会的组织及人员都将为空必须重新组建!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$refs["addForm"].validate(valid => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '提交中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
$.post(base + '/platform/jdh/cb/jcgl/doAdd', this.formData).then(res => {
if (res.code === 0) {
setTimeout(() => {
loading.close()
this.$message.success(res.msg)
this.doSearch()
this.addDialogVisible = false
}, 1500)
} else {
loading.close()
this.$message.error(res.msg)
}
})
}
})
}).catch(() => {
})
} else {
this.$refs["addForm"].validate(valid => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '提交中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
$.post(base + "/platform/jdh/cb/jcgl/doAdd", this.formData).then(res => {
if (res.code == 0) {
setTimeout(() => {
loading.close()
this.$message.success(res.msg)
this.doSearch()
this.addDialogVisible = false
}, 1500)
} else {
loading.close()
this.$message.error(res.msg)
}
})
}
})
}
},
openEdit(scope) {
this.formData = JSON.parse(JSON.stringify(scope.row))
this.editDialogVisible = true
},
doEdit() {
this.$refs["editForm"].validate(valid => {
if (valid) {
$.post(base + "/platform/jdh/cb/jcgl/editDo", this.formData).then(res => {
if (res.code == 0) {
this.$message.success(res.msg)
this.doSearch()
this.editDialogVisible = false
} else {
this.$message.error(res.msg)
}
})
}
})
},
jdhztChange(status, id) {
let cz = status === 1 ? '关闭' : '开启'
this.$confirm('此操作将' + cz + '此次教代会!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
$.post(base + "/platform/jdh/cb/jcgl/jdhztChange", {id: id, status: status}).then(res => {
if (res.code == 0) {
this.doSearch()
}
})
}).catch(() => {
})
}
},
async created() {
this.pageData()
this.jsList = await getJc()
this.jsOptions = await getJc()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,331 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-select @change="jdhChange" placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in openJdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择工会" v-model="pageForm.union_id">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionOptions">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" :row-style="showRow">
<el-table-column align="center" label="序号" type="index" width="80"></el-table-column>
<el-table-column align="center" label="代表团名称" prop="dbtname"></el-table-column>
<el-table-column align="center" label="代表团总人数(人)" prop="ghzrs" sortable></el-table-column>
<el-table-column align="center" label="名额分配数(人)" prop="fps" sortable></el-table-column>
<el-table-column align="center" label="代表人数" prop="dbzrs" sortable></el-table-column>
<el-table-column align="center" label="代表占比" prop="dbrsb" sortable></el-table-column>
<el-table-column align="center" label="列席/特邀代表" prop="lxty">
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'editFps',data:scope.row}">
修改分配数
</el-dropdown-item>
<el-dropdown-item :command="{type:'openDb',data:scope.row}">
查看列席/特邀代表
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-card>
</guava>
<el-dialog :visible.sync="fpsDialogVisible" title="修改名额分配数" width="30%">
<el-form :model="formData" :rules="mefpsRules" label-width="100px" ref="mefpsForm">
<el-form-item label="院级工会" prop="unionname">
<el-input disabled
v-model="formData.unionname">
</el-input>
</el-form-item>
<el-form-item label="总人数" prop="ghzrs">
<el-input disabled
v-model="formData.ghzrs">
</el-input>
</el-form-item>
<el-form-item label="名额分配数" prop="fps">
<el-input placeholder="请输入名额分配数"
v-model="formData.fps">
</el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="fpsDialogVisible=false">取 消</el-button>
<el-button @click="doFp" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="dbDialogVisible" title="列席/特邀代表">
<el-alert :closable="false" show-icon title="不占代表团名额" type="info"></el-alert>
<el-row>
<div class="btn-group tool-button">
<el-select
:remote-method="queryNolxtyDb"
filterable
placeholder="请输入工号或姓名关键字"
remote
size="mini"
style="width: 300px"
v-model="lxtydbFormData.userid">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in lxtyUserList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-dropdown placement="bottom">
<el-button size="mini" type="primary">
设置身份<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="doAddLxtyDb(2)">列席代表
</el-dropdown-item>
<el-dropdown-item @click.native="doAddLxtyDb(1)">特邀代表
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button type="primary" size="mini" @click="doAddLxtyDb">-->
<!-- 添加-->
<!-- </el-button>-->
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="lxtydbTableData" height="450px">
<el-table-column label="工号" prop="loginname" sortable></el-table-column>
<el-table-column label="姓名" prop="username" sortable></el-table-column>
<el-table-column label="单位" prop="dbunitname" sortable></el-table-column>
<el-table-column label="电话" prop="mobile"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份" prop="rolename"></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="{row}">
<el-button @click="delLxtyDb(row)" icon="el-icon-delete" size="mini" type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
jdhid: '',
pageOrderName: '',
pageOrderBy: ''
},
unionOptions: [],
openJdhList: [],
tableData: [],
fpsDialogVisible: false,
mefpsRules: {
fps: [{required: true, message: '请输入', trigger: ['change', 'blur']}]
},
formData: {
dbtid: '',
fps: ''
},
dbDialogVisible: false,
lxtydbTableData: [],
lxtyUserList: [],
lxtydbFormData: {
dbtid: '',
userid: ''
}
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'editFps') {
this.editFps(data)
} else if (type == 'openDb') {
this.openDb(data)
}
},
doSearch() {
this.tabKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.data()
},
jdhChange(jdhid) {
this.pageForm.jdhid = jdhid
this.data()
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop
this.pageForm.pageOrderBy = column.order
this.data()
},
data() {
sublime.showLoadingbar()
$.post(base + '/platform/jdh/cb/mefp/data', this.pageForm).then(res => {
console.log(res.data)
sublime.closeLoadingbar()
if (res.code === 0) {
this.tableData = res.data
for (let o of this.tableData) {
if (o.fps == null) {
o.fps = Math.round(o.ghzrs * 0.1)
}
o.dbrsb = o.dbzrs != 0 ? ((o.dbzrs / o.ghzrs) * 100).toFixed(2) + '%' : 0 + '%'
}
}
})
},
editFps(obj) {
// this.formData.dbtid = obj.id
this.formData.fghid = obj.id
this.formData.ghzrs = obj.ghzrs
this.formData.unionname = obj.unionname
if (obj.fps == null) {
this.formData.fps = Math.round(obj.ghzrs * 0.1)
} else {
this.formData.fps = obj.fps
}
this.fpsDialogVisible = true
},
doFp() {
this.$refs['mefpsForm'].validate(valid => {
if (valid) {
if (parseInt(this.formData.fps) > this.formData.ghzrs) {
this.$message.info('名额分配数不得大于分工会总人数')
return
}
this.formData.jdhid = this.pageForm.jdhid
$.post(base + '/platform/jdh/cb/mefp/doMefp', this.formData).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.fpsDialogVisible = false
this.data()
}
})
}
})
},
openDb(row) {
this.lxtydbFormData = {
fghid: row.id,
userid: ''
}
this.lxtyUserList = []
this.dbDialogVisible = true
this.lxtyPageData(row.id)
},
lxtyPageData(fghid) {
$.get('/platform/jdh/cb/mefp/lxtydbPgaeData', {fghid: fghid, jdhid: this.pageForm.jdhid}).then(res => {
if (res.code === 0) {
this.lxtydbTableData = res.data
}
})
},
queryNolxtyDb(keyword) {
if (keyword !== '') {
$.get('/platform/jdh/cb/mefp/queryNolxtyDb', {
keyword: keyword,
jdhid: this.pageForm.jdhid,
fghid: this.lxtydbFormData.fghid
}).then(res => {
if (res.code === 0) {
this.lxtyUserList = res.data
}
})
} else {
this.lxtyUserList = []
this.lxtydbFormData.userid = ''
}
},
doAddLxtyDb(val) {
if (this.lxtydbFormData.userid === '') {
this.$message.info('请先查询并选择用户后再添加!')
return
}
let o = this.lxtyUserList.find(u => {
return u.id === this.lxtydbFormData.userid
})
let u = JSON.parse(JSON.stringify(o))
u.jdhid = this.pageForm.jdhid
u.dbtid = this.lxtydbFormData.dbtid
u.dbid = u.id
u.id = undefined
u.lx = val
$.post('/platform/jdh/cb/mefp/doAddLxTyDb', u).then(res => {
if (res.code === 0) {
this.lxtydbFormData.userid = ''
this.lxtyUserList = []
this.$message.success(res.msg)
this.lxtyPageData(this.lxtydbFormData.dbtid)
this.data()
}
})
},
delLxtyDb(row) {
$.post('/platform/jdh/cb/mefp/delLxtyDb', {dbid: row.dbid, jdhid: row.jdhid}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.lxtyPageData(this.lxtydbFormData.dbtid)
this.data()
}
})
},
showRow({row}) {
if (row.dbzrs == 0 || (((row.dbzrs / row.ghzrs) * 100).toFixed(2)) < 10) {
return {color: 'red'}
}
}
},
async created() {
this.unionOptions = await getUnions()
this.openJdhList = await getOpenJdh()
if (this.openJdhList.length > 0) {
this.pageForm.jdhid = this.openJdhList[0].id
this.data()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,107 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.header > div, .header > div .el-select {
width: 100%;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-select @change="jdhChange" placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in openJdhList">
</el-option>
</el-select>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" show-summary>
<el-table-column label="序号" type="index" width="80"></el-table-column>
<el-table-column label="代表团名称" prop="dbtname"></el-table-column>
<el-table-column label="院级工会总人数(人)" prop="ghzrs" sortable></el-table-column>
<!-- <el-table-column sortable prop="fps" label="名额分配数(人)" ></el-table-column>-->
<el-table-column label="代表人数" prop="dbzrs" sortable></el-table-column>
<el-table-column label="列席/特邀代表人数" prop="lxty" sortable></el-table-column>
<!-- <el-table-column sortable prop="ty" label="特邀代表人数"></el-table-column>-->
<!-- <el-table-column sortable prop="dbrsb" label="代表占全体人数比"></el-table-column>-->
</el-table>
</el-card>
</guava>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
jdhid: '',
pageOrderName: '',
pageOrderBy: ''
},
openJdhList: [],
tableData: [],
fpsDialogVisible: false,
mefpsRules: {
fps: [{required: true, message: '请输入', trigger: ['change', 'blur']}]
},
formData: {
dbtid: '',
fps: ''
},
dbDialogVisible: false
}
},
methods: {
jdhChange(jdhid) {
this.pageForm.jdhid = jdhid
this.data()
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop
this.pageForm.pageOrderBy = column.order
this.pageData()
},
data() {
sublime.showLoadingbar()
$.post(base + '/platform/jdh/cb/mefp/data', this.pageForm).then(res => {
sublime.closeLoadingbar()
if (res.code === 0) {
this.tableData = res.data
for (let o of this.tableData) {
if (o.fps == null) {
o.fps = Math.round(o.dbtzrs * 0.1)
}
o.dbrsb = ((o.dbzrs / o.dbtzrs) * 100).toFixed(2) + '%'
}
}
})
},
openDb() {
this.dbDialogVisible = true
}
},
async created() {
this.openJdhList = await getAllJdh()
if (this.openJdhList.length > 0) {
this.pageForm.jdhid = this.openJdhList[0].id
this.data()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,203 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.header > div, .header > div .el-select {
width: 100%;
}
.flex {
padding: 30px;
display: flex;
}
.flex > div {
width: 33.3%;
text-align: left;
padding: 0 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-select @change="jdhChange" placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in JdhList">
</el-option>
</el-select>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-tabs @tab-click="tabClick" class="m20" v-model="tabindex">
<el-tab-pane label="教代会" name="1">
<div class="flex">
<div>年份&nbsp;&nbsp;{{jdhData.jdhxx.jdhnf}}</div>
<div>届数&nbsp;&nbsp;{{jdhData.jdhxx.jdhjs}}</div>
<div>次数&nbsp;&nbsp;{{jdhData.jdhxx.jdhcs}}</div>
</div>
<div class="flex">
<div>创建时间&nbsp;&nbsp;{{jdhData.jdhxx.jdhkqsj}}</div>
<div>状态&nbsp;&nbsp;{{jdhData.jdhxx.jdhkqsj===1?'开启':'关闭'}}</div>
<div>描述&nbsp;&nbsp;{{jdhData.jdhxx.jdhms}}</div>
</div>
<el-divider></el-divider>
<div class="flex">
<div>筹备领导小组人数&nbsp;&nbsp;{{jdhData.cbldxz}}</div>
<div>主席团人数&nbsp;&nbsp;{{jdhData.zxt}}</div>
<div>资格审查小组人数&nbsp;&nbsp;{{jdhData.zgscxz}}</div>
</div>
<div class="flex">
<div>执行委员会人数&nbsp;&nbsp;{{jdhData.zxwyh}}</div>
<div>代表数&nbsp;&nbsp;{{jdhData.db}}</div>
<div>代表团数&nbsp;&nbsp;{{jdhData.dbt}}</div>
</div>
<div class="flex">
<div>专门委员会数&nbsp;&nbsp;{{jdhData.zmwyh}}</div>
</div>
</el-tab-pane>
<el-tab-pane label="筹备领导小组" name="2">
<my-tab :data="tableData" :pf="pageForm" name="2"/>
</el-tab-pane>
<el-tab-pane label="资格审查小组" name="3">
<my-tab :data="tableData" :pf="pageForm" name="3"/>
</el-tab-pane>
<el-tab-pane label="主席团" name="4">
<my-tab :data="tableData" :pf="pageForm" name="4"/>
</el-tab-pane>
<el-tab-pane label="执行委员会" name="5">
<my-tab :data="tableData" :pf="pageForm" name="5"/>
</el-tab-pane>
<el-tab-pane label="专门委员会" name="6">
<el-table :data="tableData">
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="委员会名称" prop="wyhname"></el-table-column>
<el-table-column label="主任及联系方式" prop="zrmobile"></el-table-column>
<el-table-column label="工作职责" prop="gzzz" show-overflow-tooltip width="400"></el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="代表团" name="7">
<el-table :data="tableData">
<el-table-column label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="代表团名称" prop="dbtname"></el-table-column>
<el-table-column label="创建时间" prop="cjsj"></el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="代表" name="8">
<my-tab :data="tableData" :pf="pageForm" name="8"/>
</el-tab-pane>
</el-tabs>
<el-row class="el-pagination-container" v-show="tabindex>1">
<el-pagination
:current-page="pageForm.pageNumber"
:page-size="pageForm.pageSize"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
layout="total, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</guava>
</div>
<script>
let vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
jdhid: '',
pageNumber: 1,
pageSize: 10,
totalCount: 0
},
JdhList: [],
tableData: [],
jdhData: {
jdhxx: {}
},
tabindex: '1',
}
},
components: {
'my-tab': httpVueLoader('/components/jdh/mytab.vue')
},
methods: {
jdhChange(id) {
this.pageForm.jdhid = id
this.pageForm.pageNumber = 1
this.tabClick()
},
tabClick(val) {
this.pageForm.pageNumber = 1
this.getData()
},
async getData() {
let res = null
const index = parseInt(this.tabindex)
switch (index) {
case 1:
res = await POST('/platform/jdh/cxtj/sjzl/data', this.pageForm, true)
this.jdhData = res.data
break
case 2:
res = await POST('/platform/jdh/zzjg/cbldxz/pageData', this.pageForm, true)
break
case 3:
res = await POST('/platform/jdh/zzjg/zgscxz/pageData', this.pageForm, true)
break
case 4:
res = await POST('/platform/jdh/zzjg/zxt/pageData', this.pageForm, true)
break
case 5:
res = await POST('/platform/jdh/zzjg/zxwyh/pageData', this.pageForm, true)
break
case 6:
res = await POST('/platform/jdh/zzjg/zmwyh/pageData', this.pageForm, true)
break
case 7:
res = await POST('/platform/jdh/zzjg/dbt/pageData', this.pageForm, true)
break
case 8:
res = await POST('/platform/jdh/db/dbyl/pageData', this.pageForm, true)
break
}
if (this.tabindex !== 1) {
this.pageForm.totalCount = res.data.totalCount
this.tableData = res.data.list
}
},
pageNumberChange(val) {
this.pageForm.pageNumber = val
this.getData()
}
},
async created() {
this.JdhList = await getAllJdh()
if (this.JdhList.length > 0) {
this.pageForm.jdhid = this.JdhList[0].id
this.tabClick()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,226 @@
<!--#
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 placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 filterable placeholder="请选择教代会" style="width:180px;" v-model="pageForm.teacherMeetId">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in teacherMeets"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select @change="unionChange" clearable filterable placeholder="请选择工会"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择单位" v-model="pageForm.unitId">
<el-option
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="doAuditMany" icon="el-icon-check" size="medium" type="primary">批量通过</el-button>
</div>
<div class="pull-right offscreen-right mr25">
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.isAudit">
<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 class="mt20" shadow="never">
<el-table :data="tableData" :row-key="(row)=>row.id" @selection-change="(val)=>{selections = val}"
@sort-change='pageOrder'>
<el-table-column reserve-selection type="selection" width="55"></el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" label="姓名" prop="userName" width="80"></el-table-column>
<el-table-column align="center" label="工号" prop="loginName"></el-table-column>
<el-table-column align="center" label="性别" prop="sex" width="50"></el-table-column>
<el-table-column align="center" label="民族" prop="nation"></el-table-column>
<el-table-column align="center" label="政治面貌" prop="politicalOutlook"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" label="学历" prop="education"></el-table-column>
<el-table-column align="center" label="技术职称" prop="technicalTitle"></el-table-column>
<el-table-column align="center" label="年龄" prop="age" width="50"></el-table-column>
<el-table-column align="center" label="教学科研及双肩挑人员" prop="twoWork">
<template scope="{row}">
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
v-model="row.twoWork"></el-checkbox>
</template>
</el-table-column>
<el-table-column align="center" label="教代会代表" prop="isJdh">
<template scope="{row}">
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
v-model="row.isJdh"></el-checkbox>
</template>
</el-table-column>
<el-table-column align="center" label="工代会代表" prop="isGdh">
<template scope="{row}">
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
v-model="row.isGdh"></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 label="状态" prop="stateName" sortable></el-table-column>
<el-table-column align="center" label="操作" v-if="pageForm.isAudit!=='true'" width="150">
<template slot-scope="{row}">
<el-button @click="doAudit(row.id,true)" size="mini" type="success"
v-if="row.stateCode===100">通过
</el-button>
<el-button @click="doAudit(row.id,false)" size="mini" type="danger"
v-if="row.stateCode===100">拒绝
</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>
</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: []
}
},
methods: {
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 created() {
this.teacherMeets = await teacherMeet.getOpenJdh()
if (this.teacherMeets.length > 0) {
this.pageForm.teacherMeetId = this.teacherMeets[0].id
}
this.unionList = await getUnion()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,609 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form .el-select {
width: 100%;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 @change="jdhChange" clearable filterable placeholder="请选择教代会"
v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in allTeacherMeets">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select @change="delegationChange" clearable filterable placeholder="请选择代表团"
v-model="pageForm.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select
@change="unitList = allUnitList.filter(v => pageForm.unionid?v.unionid === pageForm.unionid:true)"
clearable filterable placeholder="请选择工会"
v-model="pageForm.unionid">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择单位" v-model="pageForm.unitid">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable placeholder="请选择代表身份" v-model="pageForm.dbsf">
<el-option label="正式代表" value="正式代表"></el-option>
<el-option label="列席代表" value="列席代表"></el-option>
<el-option label="特邀代表" value="特邀代表"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<el-row class="mt20">
<div class="btn-group tool-button">
<el-button @click="doDeleteMany" icon="el-icon-delete" size="medium" type="danger">批量删除
</el-button>
</div>
<div class="btn-group tool-button">
<el-button @click="openAddDb" icon="el-icon-plus" size="medium" type="success">新增代表
</el-button>
</div>
<div class="btn-group tool-button">
<el-button @click="openSetXld" size="medium" type="warning">
<i class="el-icon-sort" style="transform: rotate(90deg);"></i>
代表调整
</el-button>
</div>
<div class="btn-group tool-button">
<el-button @click="dofpdbt" size="medium" type="warning">
一键分配代表团
</el-button>
</div>
</el-row>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @selection-change="handleSelectionChange" @sort-change='pageOrder'
row-key="id">
<el-table-column reserve-selection type="selection" width="55"></el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" label="工号" prop="loginname"></el-table-column>
<el-table-column align="center" label="姓名" prop="username" sortable></el-table-column>
<el-table-column align="center" label="性别" prop="sex" sortable></el-table-column>
<el-table-column align="center" label="联系方式" prop="mobile"></el-table-column>
<el-table-column align="center" label="代表团" prop="dbtname" show-overflow-tooltip
sortable></el-table-column>
<el-table-column align="center" label="所属工会" prop="dbfghname" show-overflow-tooltip
sortable></el-table-column>
<el-table-column align="center" label="所属单位" prop="dbunitname" show-overflow-tooltip sortable>
<template scope="scope">
{{scope.row.dbunitname}}({{scope.row.dbunitid}})
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="届次" prop="jdhallname"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="代表身份"
prop="rolename"></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100">
<template slot-scope="{row}">
<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 :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>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<db-info :active="'1'" ref="DbInfo"></db-info>
</template>
<el-dialog :visible.sync="dbAddDialogVisible" @close="formData.role=''" title="新增教代会代表">
<el-form :model="formData" :rules="rules" label-width="80px" ref="AddForm">
<el-form-item label="届次" prop="jdhid">
<el-select @change="jdhChange" filterable placeholder="代表所属教代会" v-model="formData.jdhid">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in allTeacherMeets"></el-option>
</el-select>
</el-form-item>
<el-form-item label="代表团" prop="dbtid">
<el-select @change="dbtChange" filterable v-model="formData.dbtid">
<el-option :key="i.id" :label="i.dbtname" :value="i.id"
v-for="i in delegations"></el-option>
</el-select>
</el-form-item>
<el-form-item label="代表类型" prop="role">
<el-select v-model="formData.role">
<el-option :key="i.value" :label="i.label" :value="i.value"
v-for="i in representativeRoleOptions"></el-option>
</el-select>
</el-form-item>
<el-form-item label="用户" prop="user">
<el-select
:remote-method="queryNotDbUser"
@change="$refs.secondedSelect.$children[1].clear()"
filterable
multiple
placeholder="请输入工号或者姓名"
ref="secondedSelect"
remote
reserve-keyword
v-model="formData.user"
value-key="id">
<el-option
:key="item.id"
:label="item.username+'-'+item.loginname+'-'+item.dwname"
:value="item"
v-for="item in notDbUserList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="dbAddDialogVisible = false">取 消</el-button>
<el-button @click="doAddDb" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="xldDialogVisible" title="代表名单调整">
<el-select @change="xldJdhChange" v-model="xldFormData.jdhid">
<el-option :label="item.jdhallname" :value="item.id" v-for="item in allTeacherMeets"></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 :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="dwname"></el-table-column>
<el-table-column label="代表团">
<template slot-scope="scope">
<el-select clearable filterable v-model="scope.row.dbtid">
<el-option :label="d.dbtname" :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 :visible.sync="modifyDialogVisible" title="编辑教代会代表" width="50%">
<el-form :model="formData" :rules="formRules" label-width="80px" ref="form">
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="username">
<el-input :value="representativeInfo.username" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工号" prop="loginname">
<el-input :value="representativeInfo.loginname" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="届次" prop="jdhid">
<el-select @change="jdhChange" filterable placeholder="届次"
v-model="representativeInfo.jdhid">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in allTeacherMeets"></el-option>
</el-select>
</el-form-item>
<el-form-item label="代表团" prop="dbtid">
<el-select filterable v-model="representativeInfo.dbtid">
<el-option :key="i.id" :label="i.dbtname" :value="i.id"
v-for="i in delegationList"></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 label="代表类型" prop="roleid">
<el-select v-model="representativeInfo.roleid">
<el-option :key="i.value" :label="i.label" :value="i.value"
v-for="i in representativeRoleOptions"></el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="modifyDialogVisible = false">取 消</el-button>
<el-button @click="modifying" type="primary">确 定</el-button>
</span>
</el-dialog>
</guava>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unionList: [],
allUnitList: [],
unitList: [],
delegations: [],
allTeacherMeets: [],
tableData: [],
pageForm: {
jdhid: '',
dbtid: '',
unitid: '',
dbsf: '',
searchName: 'u.username',
},
selection: [],
dbAddDialogVisible: false,
formData: {
user: []
},
rules: {},
notDbUserList: [],
xldDialogVisible: false,
xldFormData: {
jdhid: '',
userid: ''
},
xldUserList: [],
xldTableData: [],
xldDbtList: [],
uid: '',
formRules: {
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
modifyDialogVisible: false,
representativeRoleOptions: [],
representativeInfo: {},
modifyUnitList: [],
/*new*/
allTeacherMeets: [],
delegationList: [],
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue?v=1.0.0')
},
methods: {
dofpdbt() {
this.$confirm('确定要给当前教代会代表分配代表团吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await $.post(loc() + '/dofpdbt', {jdhid: this.pageForm.jdhid})
this.$message.success("成功")
this.doSearch()
}).catch(() => {
});
},
/*代表团变化 工会列表也变化*/
async delegationChange(val) {
this.pageForm.unionid = ''
this.pageForm.unitid = ''
this.unionList = await getUnions(val)
},
async modifying() {
const response = await $.post(loc() + '/modifyRepresentativeInfo', this.representativeInfo)
AssertResponseMessage({
response,
success: () => {
this.modifyDialogVisible = false
this.pageData()
}
})
},
async modify(row) {
const resp = await $.get(loc() + '/representativeInfo/' + row.id)
AssertResponseMessage2({
response: resp,
success: ({data}) => {
this.modifyUnitList = this.allUnitList;
this.representativeInfo = data
this.modifyDialogVisible = true
},
})
this.delegationList = await getDbt(row.jdhid)
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data)
} else if (type === 'doDelete') {
this.doDelete(data)
} else if (type === 'modify') {
this.modify(data)
}
},
openView(row) {
const {dbid} = row
this.$refs.DbInfo.openView(dbid)
this.$refs.guava.view()
},
async jdhChange(val) {
this.delegations = await getDbt(val)
},
handleSelectionChange(val) {
this.selection = val
},
doDelete(obj) {
this.$confirm('此操作将删除用户' + obj.username + '的正式代表身份!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let data = []
data.push({id: obj.id, dbid: obj.dbid, jdhid: obj.jdhid})
$.post(base + '/platform/jdh/db/dbgl/doDelete', {data: data}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
}).catch(() => {
})
},
doDeleteMany() {
if (this.selection.length === 0) {
this.$message.info('请先选择')
return
}
this.$confirm('此操作将删除选中用户的正式代表身份!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let data = []
for (let obj of this.selection) {
data.push({id: obj.id, dbid: obj.dbid, jdhid: obj.jdhid})
}
$.post(base + '/platform/jdh/db/dbgl/doDelete', {data: data}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
}).catch(() => {
})
},
queryNotDbUser(key) {
if (this.formData.dbtid === '') {
this.$message.info('请先选择代表团')
return
}
let data = this.formData
data.keyword = key
$.post(base + '/platform/jdh/db/scmd/queryNotDbUser', data).then(res => {
if (res.code === 0) {
this.notDbUserList = QC(this.formData.user, res.data.list, 'id')
}
})
},
dbtChange() {
this.formData.user = []
this.notDbUserList = []
},
async openAddDb() {
if (this.allTeacherMeets) {
this.formData.jdhid = this.allTeacherMeets[0].id
this.delegations = await getDbt(this.allTeacherMeets[0].id)
}
this.formData.dbtid = this.pageForm.dbtid
this.formData.user = []
this.notDbUserList = []
this.dbAddDialogVisible = true
},
async doAddDb() {
const data = await $.post("/platform/jdh/db/dbgl/doAdd", this.formData)
this.$message.success(data.msg)
/*this.delegations = await getDbt(this.formData.jdhid)*/
/* this.$set(this.pageForm, "jdhid", this.formData.jdhid)
await this.jdhChange()*/
this.pageData()
this.dbAddDialogVisible = false
},
async openSetXld() {
if (this.allTeacherMeets) {
this.xldFormData.jdhid = this.allTeacherMeets[0].id
// this.xldDbtList = await getDbtList(this.allTeacherMeets[0].id)
this.delegations = await getDbt(this.allTeacherMeets[0].id)
}
this.xldFormData.userid = ''
this.xldUserList = []
this.xldTableData = []
this.xldDialogVisible = true
},
remotexldMethod(key) {
if (this.xldFormData.jdhid === '') {
this.$message.info('请先选择教代会!')
return
}
if (key !== '') {
$.get(base + '/platform/jdh/db/dbgl/queryXldUser', {
query: key,
jdhid: this.xldFormData.jdhid
}).then(res => {
if (res.code === 0) {
this.xldUserList = res.data.list
}
})
}
},
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 xldJdhChange(jdhid) {
// this.xldDbtList = await getDbtList(jdhid)
this.delegations = await getDbt(jdhid)
},
doSetxlddbt() {
let flag = true
for (let o of this.xldTableData) {
if (!('dbtid' in o)) {
flag = false
break
}
}
if (!flag) {
this.$message.info('请先选择要分配的代表团!')
return
}
$.post(base + '/platform/jdh/db/dbgl/fpXldToDbt', {
user: this.xldTableData,
jdhid: this.xldFormData.jdhid
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.xldTableData = []
this.pageData()
}
})
},
async getRepresentativeRoleOptions() {
const {code, data} = await $.get(loc() + '/representativeRoleOptions')
if (!code) {
this.representativeRoleOptions = data
}
}
},
async created() {
this.allTeacherMeets = await getAllJdh()
if (this.allTeacherMeets && this.allTeacherMeets.length > 0) {
const lastTeacherMeeting = this.allTeacherMeets[0].id
this.pageForm.jdhid = lastTeacherMeeting
this.delegations = await getDbt(lastTeacherMeeting)
this.delegationList = await getDbt(lastTeacherMeeting)
this.unionList = await getUnion()
this.allUnitList = await getUnit()
this.unitList = clone(this.allUnitList)
this.pageData()
}
await this.getRepresentativeRoleOptions()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,239 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form .el-select {
width: 100%;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 @change="jdhChange" clearable filterable placeholder="请选择届次"
v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select @change="delegationChange" clearable filterable placeholder="请选择代表团"
v-model="pageForm.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select
@change="unitList = allUnitList.filter(v => pageForm.unionid?v.unionid === pageForm.unionid:true)"
clearable filterable placeholder="请选择工会"
v-model="pageForm.unionid">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择单位" v-model="pageForm.unitid">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable placeholder="请选择代表身份" v-model="pageForm.dbsf">
<el-option label="正式代表" value="正式代表"></el-option>
<el-option label="列席代表" value="列席代表"></el-option>
<el-option label="特邀代表" value="特邀代表"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<el-row class="mt5 mb5">
<template
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('tamange')}">
<div class="btn-group tool-button">
<el-button @click="exportList" icon="el-icon-download" size="medium">导出Excel</el-button>
<el-button @click="downloadCommand({id:pageForm.jdhid})" icon="el-icon-download">
导出名单
</el-button>
<!-- <el-dropdown @command="downloadCommand">-->
<!-- <el-button icon="el-icon-download">导出名单 <i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
<!-- </el-button>-->
<!-- <el-dropdown-menu slot="dropdown">-->
<!-- <el-dropdown-item v-for="item in jdhList" :command="{id:item.id}">{{item.jdhallname}}-->
<!-- </el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
</div>
</template>
</el-row>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="工号"
prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" label="姓名" prop="username"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="性别" prop="sex"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="联系方式"
prop="mobile"></el-table-column>
<el-table-column align="center" header-align="center" label="代表团" prop="dbtname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="所属工会" prop="dbunitname"
show-overflow-tooltip sortable>
<template scope="scope">
{{scope.row.unionname}}({{scope.row.unioncode}})
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="所属单位" prop="dbunitname"
show-overflow-tooltip
sortable>
<template scope="scope">
{{scope.row.dbunitname}}({{scope.row.dbunitid}})
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="届次" prop="jdhallname"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="代表身份"
prop="rolename"></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
</transition>
<template #view>
<db-info :active="'1'" ref="DbInfo"></db-info>
</template>
</guava>
</div>
<script>
let vue = new Vue({
el: '#app',
data() {
return {
tabShow: true,
dbtList: [],
jdhList: [],
unitList: [],
allUnitList: [],
unionList: [],
tableData: [],
delegations: [],
pageForm: {
...getPageForm(),
jdhid: '',
unitid: '',
searchName: 'u.username',
dbtid: '',
dbsf: ''
},
dbModal: false,
uid: ''
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
async delegationChange(val) {
this.pageForm.unionid = ''
this.pageForm.unitid = ''
this.unionList = await getUnions(val)
},
exportList() {
if (!this.pageForm.jdhid) {
this.$notify({
title: '警告',
message: '请选择教代会',
type: 'warning'
});
return
}
location.href = '/platform/jdh/db/dbyl/exportList?jdhid=' + this.pageForm.jdhid + '&dbtid=' + this.pageForm.dbtid
},
downloadCommand(command) {
const {id} = command
location.href = '/platform/jdh/db/dbyl/downloadDbList?jdh_id=' + id
},
openView(row) {
const {dbid} = row
this.$refs.DbInfo.openView(dbid)
this.$refs.guava.view()
},
async jdhChange(val) {
this.delegations = await getDbt(val)
},
handleSelectionChange(val) {
this.selection = val
},
...pageSomeThing
},
async created() {
this.jdhList = await getAllJdh()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
this.pageData()
}
this.unionList = await getUnion();
this.allUnitList = await getUnit();
this.unitList = clone(this.allUnitList);
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,245 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
input[type="file"] {
display: none
}
.el-input-number input {
text-align: left !important;
}
.el-loading-mask {
z-index: 30000 !important;
}
</style>
<div id="app" style="padding: 20px 40px" v-cloak>
<el-card class="box-card">
<div class="clearfix" slot="header">
<span style="color: #409EFF;font-size: 18px">预选代表填报</span>
</div>
<div>
<el-form label-width="100px">
<el-form-item class="view-header" label="填写申请信息&emsp;" label-width="135px">
</el-form-item>
</el-form>
<el-form :model="formData" :rules="formRules" label-position="right" label-suffix="" label-width="120px"
ref="form">
<el-row gutter="60">
<el-col :span="12">
<el-form-item label="姓名" prop="manager_name">
<el-input disabled type="text" v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工号" prop="apply_time">
<el-input disabled type="text" v-model="formData.loginname"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="60">
<el-col :span="12">
<el-form-item label="联系方式" prop="mobile">
<el-input maxlength="30" type="text"
v-model="formData.mobile"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="申请届次" prop="jdhid">
<el-select @change="jdhChange" clearable filterable placeholder="请选择教代会"
v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="代表团" prop="dbtid">
<el-select clearable filterable placeholder="请选择代表团" v-model="formData.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="60">
<el-col :span="12">
<el-form-item label="填报时间" prop="apply_time">
<el-input disabled type="text" v-model="formData.apply_time"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="民族" prop="nation">
<el-input maxlength="30" type="text"
v-model="formData.nation"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="60">
<el-col :span="12">
<el-form-item label="职称" prop="jobTitle">
<el-input maxlength="30" type="text"
v-model="formData.jobTitle"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务" prop="position">
<el-input maxlength="30" type="text"
v-model="formData.position"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">近几年奖惩情况</span>
</el-divider>
<el-form-item class="is-required" label="" prop="vita">
<div id="vita"></div>
</el-form-item>
<el-form-item label="附&emsp;&emsp;件" prop="files">
<file-upload :files.sync="formData.files" card></file-upload>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="doAdd()" type="primary">确 定</el-button>
</div>
</div>
</el-card>
</div>
<script>
let E = window.wangEditor
let vita = null
const vue = new Vue({
el: '#app',
data() {
let validAc = (rule, value, callback) => {
if (!this.formData.vita || !dd3s.html2txt(this.formData.vita)) {
callback(new Error('请填写近几年奖惩情况'));
} else {
callback();
}
};
return {
jdhList: [],
delegations: [],
userIsExist: "",
dbtList: [],
formData: {},
formRules: {
jdhid: [{required: true, message: '必填', trigger: ['blur', 'change']}],
dbtid: [{required: true, message: '必填', trigger: ['blur', 'change']}],
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
vita: [{validator: validAc, trigger: ['blur', 'change']}],
}
}
},
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
},
methods: {
doAdd() {
this.$refs["form"].validate(async (valid) => {
const flag = await this.getdb()
console.log(flag)
if (!flag) {
this.$notify({
title: '警告',
message: '您已填报,请勿重复提交!',
type: 'warning'
});
return
}
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(loc() + "/doAdd", {
jdh_db: JSON.stringify(this.formData),
user: JSON.stringify(this.formData)
})
closeLoadingFunc(loading, resp, async () => {
window.location.href = '/platform/jdh/db/preselection'
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
async jdhChange(val) {
this.formData.dbtid = ''
this.delegations = await getDbt(val)
},
async getdb() {
const jdhid = this.formData.jdhid
const {code, data} = await $.post(base + '/platform/jdh/db/preselection/getdb', {jdhid})
return code ? false : data == 0
},
flush() {
this.formData = {
jdhid: '',
dbtid: '',
files: [],
id: '${@shiro.getPrincipalProperty("id")}',
username: '${@shiro.getPrincipalProperty("username")}',
apply_time: moment().format('YYYY-MM-DD'),
loginname: '${@shiro.getPrincipalProperty("loginname")}',
nation: '${@shiro.getPrincipalProperty("nation")}',
jobTitle: '${@shiro.getPrincipalProperty("jobTitle")}',
position: '${@shiro.getPrincipalProperty("position")}',
mobile: '${@shiro.getPrincipalProperty("mobile")}',
}
this.$nextTick(() => {
$("#vita").html("")
vita = new E("#vita")
vita.config.onchange = (html) => {
this.formData.vita = html
}
vita.create()
vita.txt.html('${@shiro.getPrincipalProperty("vita")}')
})
},
},
async created() {
this.jdhList = await getOpenJdh()
if (this.jdhList.length > 0) {
this.formData.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
}
this.flush()
// console.log()
// if(!await this.getdb()){
// alert(1)
// }
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,364 @@
<!--#
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 placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 filterable placeholder="请选择教代会" style="width:180px;" v-model="pageForm.teacherMeetId">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in teacherMeets"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="btn-group tool-button pull-right offscreen-right">
<el-button @click="openPreselectionDialog" icon="el-icon-plus" size="medium" type="primary">预选
</el-button>
<el-button @click="doConfirmMany" icon="el-icon-plus" size="medium" type="primary">批量上报</el-button>
<el-button @click="doExport" icon="el-icon-download" size="medium" type="primary">导出</el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @selection-change="(val)=>{tableSelections=val}" @sort-change='pageOrder'
ref="multipleTable">
<el-table-column
:selectable="(row)=>{return row.stateCode===0}"
type="selection"
width="55">
</el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="姓名" prop="userName"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="工号" prop="loginName"></el-table-column>
<el-table-column align="center" header-align="center" label="性别" prop="sex"
sortable>
<template scope="{row}">
<el-select v-if="row.stateCode===0" v-model="row.sex">
<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 align="center" header-align="center" label="民族" prop="nation" width="100">
<template scope="{row}">
<el-select filterable v-if="row.stateCode===0" v-model="row.nation">
<el-option :key="n" :label="n" :value="n" v-for="n in nation"></el-option>
</el-select>
<span v-else>{{row.stateCode}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="政治面貌"
prop="politicalOutlook" show-overflow-tooltip>
<template scope="{row}">
<el-input maxlength="20" v-if="row.stateCode===0" v-model="row.politicalOutlook"></el-input>
<span v-else>{{row.politicalOutlook}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="学历" prop="education"
show-overflow-tooltip
width="150px">
<template scope="{row}">
<dict-select code="Education" v-if="row.stateCode===0"
v-model="row.education"></dict-select>
<span v-else>{{row.education}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="行政职务" prop="administrativeTitle"
width="100">
<template scope="{row}">
<el-input v-if="row.stateCode===0" v-model="row.administrativeTitle"></el-input>
<span v-else>{{row.administrativeTitle}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="技术职务" prop="technicalTitle"
width="100">
<template scope="{row}">
<el-input v-if="row.stateCode===0" v-model="row.technicalTitle"></el-input>
<span v-else>{{row.technicalTitle}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="年龄<=40" prop="age" width="80px">
<template scope="{row}">
<el-input v-if="row.stateCode===0" v-model="row.age"></el-input>
<span v-else>{{row.age}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="教学科研及双肩挑人员" prop="twoWork">
<template scope="{row}">
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
v-model="row.twoWork"></el-checkbox>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="教代会代表"
prop="isJdh">
<template scope="{row}">
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
v-model="row.isJdh"></el-checkbox>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="工代会代表" prop="isGdh">
<template scope="{row}">
<el-checkbox :style="{'pointer-events':row.stateCode===0?'auto':'none'}"
v-model="row.isGdh"></el-checkbox>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="备注" prop="bz"
width="100">
<template scope="{row}">
<el-input v-if="row.stateCode===0" v-model="row.bz"></el-input>
<span v-else>{{row.bz}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="状态" prop="dbzt" sortable>
<template scope="{row}">
{{row.stateName}}
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="200">
<template slot-scope="{row}">
<el-button @click="doConfirm(row)" size="mini" type="primary" v-if="row.stateCode===0">上报
</el-button>
<el-button @click="doRevoke(row)" size="mini" type="warning" v-if="row.stateCode===100">撤回
</el-button>
<el-button @click="doDelete(row)" size="mini" type="danger" v-if="row.stateCode===0">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</guava>
<el-dialog
:close-on-click-modal="false"
:visible.sync="dialogVisible"
title="添加人员"
width="45%"
>
<el-transfer
:data="userData"
:filter-method="filterMethod"
:props="{key: 'id',label: 'name'}"
:right-default-checked="rightChecked"
:titles="['可报人员名单', '当前选择']"
@change="rightChange"
@right-check-change="rightCheckChange"
filterable
ref="transfer"
v-model="userValue">
</el-transfer>
<span class="dialog-footer" slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button @click="addPreselectionDb" type="primary">确 定</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: []
}
},
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
},
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue'),
},
async created() {
this.teacherMeets = await teacherMeet.getOpenJdh()
if (this.teacherMeets && this.teacherMeets.length > 0) this.$set(this.pageForm, "teacherMeetId", this.teacherMeets[0].id)
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,251 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 @change="jdhChange" clearable filterable placeholder="请选择教代会"
v-model="pageForm.jdhid">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in jdhList"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select @change="getChange" clearable filterable placeholder="请选择工会"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择单位" v-model="pageForm.unitId">
<el-option
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="pageFormUrl='/platform/jdh/db/qrmd/pageData';doSearch();"
icon="el-icon-search" type="primary"></el-button>
</div>
<!-- <div class="btn-group tool-button">-->
<!-- <el-button size="medium" class="text-primary" @click="pageFormUrl='/platform/jdh/db/qrmd/pageData';doSearch();">待确认</el-button>-->
<!-- </div>-->
<!-- <div class="btn-group tool-button">-->
<!-- <el-button size="medium" class="text-success" @click="confirmPageData">已确认</el-button>-->
<!-- </div>-->
<div class="pull-right offscreen-right">
<el-button @click="doConfirmMany" icon="el-icon-check" size="medium">批量审核</el-button>
</div>
<div class="pull-right offscreen-right mr25">
<el-radio-group @change="radioChange" size="medium" v-model="pageFormUrl">
<el-radio-button label="/platform/jdh/db/dbyl/pageData">已确认</el-radio-button>
<el-radio-button label="/platform/jdh/db/qrmd/pageData">待确认</el-radio-button>
</el-radio-group>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @selection-change="handleSelectionChange" @sort-change='pageOrder'
row-key="id">
<el-table-column reserve-selection type="selection"
v-if="pageFormUrl=='/platform/jdh/db/qrmd/pageData'"
width="55"></el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username" sortable></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="联系方式" prop="mobile"></el-table-column>
<el-table-column label="所属工会" prop="dbfghname" show-overflow-tooltip sortable>
<template scope="scope">
{{scope.row.dbfghname}}
</template>
</el-table-column>
<el-table-column label="所属单位" prop="dbunitname" show-overflow-tooltip sortable>
<template scope="scope">
{{scope.row.dbunitname}}({{scope.row.dbunitid}})
</template>
</el-table-column>
<el-table-column label="上报状态" prop="dbzt" sortable>
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.dbzt===1">待校工会确认</span>
<span class="text-success" v-if="scope.row.dbzt===2">校工会已确认</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="{row}">
<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 :command="{type:'doConfirm',data:row}"
v-if="pageFormUrl=='/platform/jdh/db/qrmd/pageData'">
确认
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
</transition>
<template #view>
<db-info :active="'1'" ref="DbInfo"></db-info>
</template>
</guava>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
jdhList: [],
unionList: [],
unitList: [],
dbShow: false,
tabShow: true,
uid: '',
pageForm: {
//...getPageForm(),
jdhid: '',
unionId: '',
unitId: '',
searchName: 'u.username',
searchType: 0
},
tableData: [],
selection: [],
dbtList: [],
pageFormUrl: '/platform/jdh/db/qrmd/pageData'
}
},
methods: {
radioChange(val) {
this.pageFormUrl = val
this.pageData(val)
},
confirmPageData() {
this.pageForm.searchType = 1
this.pageFormUrl = '/platform/jdh/db/dbyl/pageData'
this.pageData(this.pageFormUrl)
},
openView(row) {
const {dbid} = row
this.$refs.DbInfo.openView(dbid)
this.$refs.guava.view()
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'doConfirm') {
this.doConfirm(data.id)
}
},
async jdhChange(jdhid) {
this.pageForm.dbtid = ''
this.dbtList = await getDbtList(jdhid)
},
async getChange(unionId) {
this.pageForm.unitId = ''
this.unitList = await getUnit(unionId)
},
handleSelectionChange(val) {
console.log(val)
this.selection = val
},
doConfirm(id) {
const ids = []
ids.push(id)
$.post(base + '/platform/jdh/db/qrmd/doConfirm', {ids: [id]}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
},
doConfirmMany() {
if (this.pageFormUrl === '/platform/jdh/db/dbyl/pageData') {
this.$message.info('请切换到待确认名单列表')
return
}
if (this.selection.length === 0) {
this.$message.info('请先选择')
return
}
let ids = []
for (let o of this.selection) {
ids.push(o.id)
}
$.post(base + '/platform/jdh/db/qrmd/doConfirm', {ids: ids}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
},
//...pageSomeThing
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
async created() {
this.unionList = await getUnion()
this.jdhList = await getOpenJdh()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.pageData()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,467 @@
<!--#
layout("/layouts/platform.html"){
#-->
<link href="${base!}/assets/platform/plugins/wp-upload-vue/css/wpupload.css" rel="stylesheet">
<link href="${base!}/assets/platform/plugins/wp-upload-vue/font/iconfont.css" rel="stylesheet">
<script src="${base!}/assets/platform/plugins/wp-upload-vue/font/iconfont.js" type="text/javascript"></script>
<script src="${base!}/assets/platform/plugins/wp-upload-vue/js/wpupload.js" type="text/javascript"></script>
<style>
.el-form .el-select {
width: 100% !important;
}
.wp-upload .wp-upload-button-select-file {
margin: 0 !important;
}
</style>
<div :style="{padding:(tabShow?'0':'10px')}" id="app" v-cloak>
<guava ref="guava">
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<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 filterable placeholder="请选择教代会" style="width:180px;" v-model="pageForm.jdhid">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in searchJdhList"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openExport" size="medium"><i class="el-icon-upload2"></i> 导入</el-button>
<el-button @click="openAdd" size="medium"><i class="ti-plus"></i> 添加</el-button>
</div>
</el-card>
<el-dialog :visible.sync="addDialogVisible" title="上传名单">
<el-form :model="formData" :rules="rules" label-width="80px" ref="AddForm">
<el-form-item label="教代会" prop="jdhid">
<el-select @change="jdhChange" filterable placeholder="代表所属教代会" style="width:180px;"
v-model="formData.jdhid">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in searchJdhList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="代表团" prop="dbtid">
<el-select @change="dbtChange" filterable v-model="formData.dbtid">
<el-option :key="i.id" :label="i.dbtname" :value="i.id"
v-for="i in dbtList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="代表类型" prop="role">
<el-select v-model="formData.role">
<el-option :key="i.value" :label="i.label" :value="i.value"
v-for="i in representativeRoleOptions"></el-option>
</el-select>
</el-form-item>
<el-form-item label="人员" prop="user">
<el-select
:remote-method="queryNotDbUser"
filterable
multiple
placeholder="请输入工号或者姓名"
remote
reserve-keyword
v-model="formData.user"
value-key="id">
<el-option
:key="item.id"
:label="item.username+'-'+item.loginname+'-'+item.dwname"
:value="item"
v-for="item in notDbUserList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username" sortable></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="联系方式" prop="mobile"></el-table-column>
<el-table-column label="所属单位" prop="dbunitname" show-overflow-tooltip
sortable>
<template scope="{row}">
{{isDisPlayCode?''+row.dbunitid+'':null}}{{row.dbunitname}}
</template>
</el-table-column>
<el-table-column label="代表身份" prop="rolename"></el-table-column>
<el-table-column label="代表团" prop="dbtname" show-overflow-tooltip>
<template scope="{row}">
{{isDisPlayCode?''+row.delegationCode+'':null}}{{row.dbtname}}
</template>
</el-table-column>
<el-table-column label="状态" prop="dbzt" sortable>
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.dbzt===1">待校工会确认</span>
<span class="text-success" v-if="scope.row.dbzt===2">校工会已确认</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="{row}">
<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 :command="{type:'delete',data:row}" v-if="row.dbzt===1">
撤回
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
</transition>
<template #view>
<db-info :active="'1'" ref="DbInfo"></db-info>
</template>
<transition name="el-zoom-in-center">
<div v-show="exportShow">
<el-card>
<div @click="tabShow=true;exportShow=false" class="text-primary pointer" style="font-size: 20px;">
<i class="el-icon-arrow-left"></i>
返回
</div>
<el-select placeholder="请选择教代会" style="width: 50%" v-model="exportjdhid">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in jdhList"></el-option>
</el-select>
<div style="padding: 10px 0">
<wp-upload
:allow-files="['xls','xlsx']"
:max-file-number="1"
:upload-auto="false"
@on-select="selectFile"
ref="upload"></wp-upload>
</div>
<el-button @click="downLoadTemp" size="medium" type="primary">模板下载</el-button>
<el-button @click="readExcel" size="medium" type="primary">读取数据</el-button>
<el-button @click="doSubmitExcel" size="medium" type="primary">提交</el-button>
<el-table :data="scexcelTable" max-height="500px">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="单位" prop="dwname" show-overflow-tooltip></el-table-column>
<el-table-column label="代表团" prop="dbtname" show-overflow-tooltip></el-table-column>
<el-table-column label="代表类型" prop="role" show-overflow-tooltip></el-table-column>
<el-table-column label="校验结果" prop="isok">
<template slot-scope="{row}">
<i class="el-icon-circle-check text-success" v-if="row.isok"></i>
<i class="el-icon-circle-close text-danger" v-else></i>
</template>
</el-table-column>
<el-table-column label="提示" prop="info" show-overflow-tooltip width="250">
<template slot-scope="{row}">
<span :style="{color:(row.isok?'':'red')}">{{row.info}}</span>
</template>
</el-table-column>
<el-table-column label="操作" show-overflow-tooltip width="100">
<template slot-scope="{$index}">
<el-button @click="scexcelTable.splice($index,1)" circle icon="el-icon-delete"
size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</transition>
</guava>
</div>
<script>
let vue = new Vue({
el: '#app',
data() {
return {
representativeRoleOptions: [],
scexcelTable: [],
exportShow: false,
dbShow: false,
tabShow: true,
addDialogVisible: false,
rules: {},
formData: {
jdhid: '',
dbtid: '',
user: []
},
jdhList: [],
dbtList: [],
notDbUserList: [],
pageForm: {
...getPageForm(),
jdhid: '',
unitid: '',
searchName: 'u.username',
},
searchJdhList: [],
tableData: [],
dbModal: false,
uid: '',
exportjdhid: '',
readingjdhid: ''
}
},
methods: {
async getRepresentativeRoleOptions() {
const {code, data} = await $.get('/platform/jdh/db/dbgl/representativeRoleOptions')
if (!code) {
this.representativeRoleOptions = data
}
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
openExport() {
this.tabShow = false
this.exportShow = true
},
selectFile() {
},
downLoadTemp() {
window.location.href = '/platform/basics/downloadTemplate?filePath=jdh/dbImportTemplate.xls&fileName=代表导入模板.xlsx';
},
readExcel() {
if (this.$refs.upload.fileShowArray.length === 0) {
this.$notify.warning('请先上传文件')
return
}
if (this.exportjdhid === '') {
this.$notify.warning('请选择教代会进行数据对比')
return
}
const loading = this.$loading({
lock: true,
text: '读取文件中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.readingjdhid = this.exportjdhid
let fd = new FormData()
fd.append("jdhid", this.exportjdhid)
fd.append("file", this.$refs.upload.fileShowArray[0].file)
$.ajax({
url: base + '/platform/jdh/db/scmd/readScmdExecl',
type: "post",
data: fd,
processData: false,
contentType: false
}).then(({data}) => {
setTimeout(() => {
loading.close()
this.scexcelTable = data
}, 1000)
}).error(() => {
loading.close()
this.$message.error('系统异常')
})
},
async doSubmitExcel() {
if (this.exportjdhid === '') {
this.$notify.warning('请先选择教代会!')
return
}
if (this.exportjdhid !== this.readingjdhid) {
this.$notify.warning('提交的教代会和数据校验的教代会届次不同!')
return
}
if (this.scexcelTable.length === 0) {
this.$notify.warning('没有数据!')
return
}
const obj = this.scexcelTable.some(o => {
return !o.isok
})
if (obj) {
this.$notify.error('请先处理错误数据!')
return
}
const loading = this.$loading({
lock: true,
text: '提交中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const {data} = await POST('/platform/jdh/db/scmd/doAddExcel', {
data: JSON.stringify(this.scexcelTable),
jdhid: this.exportjdhid
})
loading.text = '提交成功'
loading.spinner = 'el-icon-circle-check'
setTimeout(() => {
loading.close()
this.scexcelTable = []
this.exportjdhid = ''
this.exportShow = false
this.tabShow = true
this.doSearch()
}, 1000)
},
openView(row) {
const {dbid} = row
this.$refs.DbInfo.openView(dbid)
this.$refs.guava.view()
},
openAdd() {
this.formData = {
jdhid: '',
dbtid: '',
user: []
}
if (this.jdhList.length > 0) {
this.formData.jdhid = this.jdhList[0].id
this.getDbtList(this.formData.jdhid)
}
this.notDbUserList = []
this.addDialogVisible = true
},
getJdhList() {
$.post(base + '/platform/jdh/db/scmd/getJdhList', {jdhkqzt: 1}).then(res => {
if (res.code === 0) {
this.jdhList = res.data.filter(f => {
return f.jdhkqzt === 1
})
this.searchJdhList = res.data
if (this.searchJdhList.length > 0) {
this.pageForm.jdhid = this.searchJdhList[0].id
this.pageData()
}
}
})
},
getDbtList(jdhid) {
$.post(base + '/platform/jdh/db/scmd/getDbtList', {jdhid: jdhid}).then(res => {
if (res.code === 0) {
this.dbtList = res.data
if ("${@shiro.hasRole('sysadmin')}" !== 'true') {
this.formData.dbtid = this.dbtList[0].id
}
}
})
},
jdhChange(jdhid) {
this.formData.dbtid = ''
this.dbtList = []
this.formData.user = []
this.notDbUserList = []
this.getDbtList(jdhid)
},
dbtChange() {
this.formData.user = []
this.notDbUserList = []
},
queryNotDbUser(key) {
if (this.formData.dbtid === '') {
this.$message.info('请先选择代表团')
return
}
let data = this.formData
data.keyword = key
$.post(base + '/platform/jdh/db/scmd/queryNotDbUser', data).then(res => {
if (res.code === 0) {
//this.notDbUserList = res.data.list
this.notDbUserList = QC(this.formData.user, res.data.list, 'id')
//this.notDbUserList = QC(this.notDbUserList,res.data.list,'id')
}
})
},
doAdd() {
$.post(base + '/platform/jdh/db/scmd/doAdd', this.formData).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.doSearch()
}
})
},
doDelete(id) {
this.$confirm('撤回后将删除这条记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/db/scmd/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.doSearch()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
...pageSomeThing
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
async created() {
this.getRepresentativeRoleOptions()
this.getJdhList()
this.searchJdhList = await getOpenJdh()
if (this.searchJdhList.length > 0) {
this.pageForm.jdhid = this.searchJdhList[0].id
this.pageData()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,438 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input placeholder="请输入关键字查询" style="width: 250px;" v-model="pageForm.zlname">
</el-input>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button" v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<el-select clearable filterable placeholder="请选择工会" v-model="pageForm.union_id">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionOptions">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择工作资料类型" v-model="pageForm.zllx">
<el-option
:key="item.id"
:label="item.lxname"
:value="item.id"
v-for="item in filelxList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openAdd" size="medium" type="primary"><i class="ti-plus"></i> 新建工作资料</el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="资料名称" prop="zlname">
</el-table-column>
<el-table-column label="所属教代会" prop="jdhallname" sortable>
</el-table-column>
<el-table-column label="资料类型" prop="lxname" sortable>
</el-table-column>
<el-table-column label="上传人" prop="username" sortable>
</el-table-column>
<el-table-column label="工会" prop="unionname" sortable>
</el-table-column>
<el-table-column label="上传时间" prop="time" sortable>
</el-table-column>
<el-table-column label="是否通过" prop="ispass" sortable>
<template slot-scope="scope">
<i class="fa fa-circle text-danger ml5" v-if="scope.row.ispass === 0"> 未通过</i>
<i class="fa fa-circle text-success ml5" v-if="scope.row.ispass === 1"> 通过</i>
</template>
</el-table-column>
<el-table-column label="操作" prop="userOnline" width="100px">
<template slot-scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}">
预览
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:scope.row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="pageForm.pageNumber"
:page-size="pageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</guava>
<el-dialog :visible.sync="addDialogVisible" title="新建工作资料">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="上传人">
<el-input readonly value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
<el-form-item label="所属教代会" prop="jdhid">
<el-select placeholder="选择教代会" style="width: 100%" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="资料名称" prop="zlname">
<el-input placeholder="请填写工作资料名称" v-model="formData.zlname"></el-input>
</el-form-item>
<el-form-item label="资料类型" prop="zllx">
<el-select placeholder="选择资料类型" style="width: 100%" v-model="formData.zllx">
<el-option
:key="item.id"
:label="item.lxname"
:value="item.id"
v-for="item in filelxList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否通过" prop="ispass">
<template>
<el-switch
active-color="#13ce66"
inactive-color="#ff4949"
v-model="formData.ispass">
</el-switch>
</template>
</el-form-item>
<el-form-item label="附件上传" prop="files">
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
</el-form>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="editDialogVisible" title="编辑筹备文件">
<el-form :model="formData" :rules="rules" label-width="100px" ref="editForm">
<el-form-item label="上传人">
<el-input readonly v-model="formData.username"></el-input>
</el-form-item>
<el-form-item label="所属教代会" prop="jdhid">
<el-select placeholder="选择教代会" style="width: 100%" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhjs+'届'+item.jdhcs+'次教代会'"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="资料名称" prop="zlname">
<el-input placeholder="请填写工作资料名称" v-model="formData.zlname"></el-input>
</el-form-item>
<el-form-item label="资料类型" prop="zllx">
<el-select placeholder="选择资料类型" style="width: 100%" v-model="formData.zllx">
<el-option
:key="item.id"
:label="item.lxname"
:value="item.id"
v-for="item in filelxList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否通过" prop="ispass">
<template>
<el-switch
active-color="#13ce66"
inactive-color="#ff4949"
v-model="formData.ispass">
</el-switch>
</template>
</el-form-item>
<el-form-item label="附件上传" prop="files">
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="viewDialogVisible" title="阅览筹备文件">
<el-form label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="上传人">
{{formData.username}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="教代会">
{{formData.jdhallname}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资料名称" prop="zlname">
{{formData.zlname}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资料类型" prop="zllx">
{{formData.lxname}}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="是否通过" prop="ispass">
{{formData.ispass?'通过':'不通过'}}
</el-form-item>
<el-form-item label="附&emsp;&emsp;件" prop="files">
<file-upload :files.sync="formData.files" view></file-upload>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="viewDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: "#app",
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
},
data() {
return {
addDialogVisible: false,
editDialogVisible: false,
viewDialogVisible: false,
tableData: [],
jdhList: [],
filelxList: [],
fileList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
zlname: "",
union_id: ""
},
formData: {},
rules: {
jdhid: [{required: true, message: '请填写所属教代会', trigger: ['blur', 'change']}],
zlname: [{required: true, message: '请填写所属教代会', trigger: ['blur', 'change']}],
zllx: [{required: true, message: '请填写资料类型', trigger: ['blur', 'change']}],
},
delFiles: [],
unionOptions: []
}
},
methods: {
openView(row) {
const formData = clone(row)
formData.files = JSON.parse(formData.files || "[]")
this.formData = formData
this.viewDialogVisible = true
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'edit') {
this.openEdit(data)
} else if (type == 'delete') {
this.doDelete(data.id, data.filepath)
}
},
handleChange: function (file, filelist) {
this.fileList = filelist;
},
handleRemove(file, filelist) {
if (file.status === 'success') {
this.fileList = filelist;
this.delFiles.push({fileid: file.id, filepath: file.url})
}
},
onDeleteFile(file) {
if (file.status === 2) {
console.log(file)
this.delFiles.push({fileid: file.fileDes.id, filepath: file.fileDes.filepath})
}
},
doDelete(id, filepath) {
this.$confirm('确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
$.post(base + '/platform/jdh/cb/cbwj/doDelete', {id: id, filepath: filepath}).then(res => {
if (res.code === 0) {
this.doSearch()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
doEdit() {
this.$refs['editForm'].validate(async (valid) => {
if (valid) {
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files)
const resp = await $.post('/platform/jdh/cb/cbwj/doEdit', formData)
AssertResponseMessage({
app: this,
response: resp,
success: () => {
this.editDialogVisible = false
this.pageData()
},
final: () => {
loading.close()
}
})
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop
this.pageForm.pageOrderBy = column.order
this.pageData()
},
pageNumberChange(val) {
this.pageForm.pageNumber = val;
this.pageData()
},
pageSizeChange(val) {
this.pageForm.pageSize = val;
this.pageData()
},
pageData() {
sublime.showLoadingbar()
$.post(base + '/platform/jdh/cb/cbwj/pageData', this.pageForm).then(res => {
sublime.closeLoadingbar()
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
openEdit(obj) {
if (this.$refs["editForm"])
this.$refs["editForm"].resetFields()
const formData = clone(obj)
formData.files = JSON.parse(formData.files || "[]")
this.formData = formData
this.editDialogVisible = true
},
openAdd() {
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields()
this.formData = {files: []}
this.addDialogVisible = true
},
doAdd() {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
this.$refs['addForm'].validate(async valid => {
if (valid) {
const formData = clone(this.formData)
formData.files = JSON.stringify(formData.files)
const resp = await $.post('/platform/jdh/cb/cbwj/doAdd', formData)
AssertResponseMessage({
app: this,
response: resp,
success: () => {
this.addDialogVisible = false
this.pageData()
},
final: () => {
loading.close()
}
})
}
})
}
},
async created() {
this.jdhList = await getAllJdh()
this.filelxList = await getGzzllx()
this.unionOptions = await getUnions()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.pageData()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,219 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入工作资料类型名称" style="width: 350px;"
v-model="pageForm.lxname"></el-input>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openAdd" size="medium" type="primary"><i class="ti-plus"></i> 新增工作资料类型</el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData">
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="工作资料类型编码" prop="code"></el-table-column>
<el-table-column align="center" header-align="center" label="工作资料类型名称" prop="lxname"></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="150px">
<template scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'top',data:scope.row}" v-if="scope.row.xh!==1">
上移
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:scope.row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
<el-dropdown-item :command="{type:'bottom',data:scope.row}"
v-if="scope.row.xh!==pageForm.totalCount">
下移
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="pageForm.pageNumber"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
layout="total, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</guava>
<el-dialog :visible.sync="addDialogVisible" title="新增工作资料类型" width="30%">
<el-form :model="formData" :rules="rules" ref="addForm">
<el-form-item label="类型编码" prop="code">
<el-input placeholder="请输入工作资料类型编码" v-model="formData.code"></el-input>
</el-form-item>
<el-form-item label="类型名称" prop="lxname">
<el-input placeholder="请输入工作资料类型名称" v-model="formData.lxname"></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="editDialogVisible" title="编辑工作资料类型" width="30%">
<el-form :model="formData" :rules="rules" ref="editForm">
<el-form-item label="类型编码" prop="code">
<el-input placeholder="请输入工作资料类型编码" v-model="formData.code"></el-input>
</el-form-item>
<el-form-item label="类型名称" prop="lxname">
<el-input placeholder="请输入工作资料类型名称" v-model="formData.lxname"></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
new Vue({
el: '#app',
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
lxname: ''
},
addDialogVisible: false,
editDialogVisible: false,
formData: {},
rules: {
lxname: [{required: true, message: '请输入工作资料类型名称', trigger: ['change', 'blur']}],
code: [{required: true, message: '请输入工作资料类型编码', trigger: ['change', 'blur']}]
},
tableData: []
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'top') {
this.rowChange(data, false)
} else if (type == 'edit') {
this.openEdit(data)
} else if (type == 'delete') {
this.doDelete(data.id)
} else if (type == 'bottom') {
this.rowChange(data, true)
}
},
rowChange(row, toDown) {
$.post(base + '/platform/jdh/gzzllx/xhChange', {id: row.id, xh: row.xh, toDown}).then(res => {
if (res.code === 0) {
this.doSearch()
}
})
},
openAdd() {
this.formData = {}
this.addDialogVisible = true
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields()
},
doAdd() {
this.$refs['addForm'].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/gzzllx/doAdd', this.formData).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
})
}
})
},
pageData() {
sublime.showLoadingbar()
$.post(base + '/platform/jdh/gzzllx/pageData', this.pageForm).then(res => {
sublime.closeLoadingbar()
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageNumberChange(val) {
this.pageForm.pageNumber = val
this.pageData()
},
openEdit(obj) {
this.formData = JSON.parse(JSON.stringify(obj))
this.editDialogVisible = true
},
doEdit() {
this.$refs['editForm'].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/gzzllx/doEdit', this.formData).then(res => {
if (res.code === 0) {
this.editDialogVisible = false
this.pageData()
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
})
}
})
},
doDelete(id) {
this.$confirm('此操作将删除工作资料类型,确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/gzzllx/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.doSearch()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,647 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.flex {
display: flex;
}
.flex > .el-form-item {
width: 50% !important;
}
.el-form-item .el-select {
width: 100% !important;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入名称查询" style="width: 250px;" v-model="pageForm.name"></el-input>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable placeholder="类型" style="width: 100px;" v-model="pageForm.lx">
<el-option label="会议" value="1"></el-option>
<el-option label="活动" value="2"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openAdd" size="medium" type="primary"><i class="ti-plus"></i> 新增会议及活动</el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" align="center" header-align="center" header-align="center" label="序号"
type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="会议或活动名称" prop="name"></el-table-column>
<el-table-column align="center" header-align="center" label="教代会" prop="jdhallname"></el-table-column>
<el-table-column align="center" header-align="center" label="开始时间" prop="kssj"></el-table-column>
<el-table-column align="center" header-align="center" label="结束时间" prop="jssj"></el-table-column>
<el-table-column align="center" header-align="center" label="场地" prop="cd"></el-table-column>
<el-table-column align="center" header-align="center" label="类型" prop="lx">
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.lx===1">会议</span>
<span class="text-primary" v-if="scope.row.lx===2">活动</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="状态">
<template slot-scope="{row}">
<span class="text-warning" v-if="moment().format('YYYY-MM-DD HH:mm:ss')<row.kssj">准备中</span>
<span class="text-primary"
v-if="row.kssj<moment().format('YYYY-MM-DD HH:mm:ss') && moment().format('YYYY-MM-DD HH:mm:ss')<row.jssj">进行中</span>
<span class="text-danger" v-if="moment().format('YYYY-MM-DD HH:mm:ss')>row.jssj">已结束</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="350">
<template slot-scope="{row}">
<el-button @click="openView(row.id)" size="mini">查看</el-button>
<el-button @click="openCy(row.id)" size="mini" v-if="moment().format('YYYY-MM-DD')<row.jssj">
人员设置
</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</guava>
<el-dialog :visible.sync="addDialogVisible" title="新增会议及活动">
<el-form :model="formData" :rules="rules" label-width="100px" ref="AddForm">
<el-form-item label="发布人">
<el-input value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input maxlength="30" v-model="formData.name"></el-input>
</el-form-item>
<div class="flex">
<el-form-item label="类型" prop="lx">
<el-select v-model="formData.lx">
<el-option label="会议" value="1"></el-option>
<el-option label="活动" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="教代会" prop="jdhid">
<el-select v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="时间" prop="sj">
<el-date-picker
:default-time="['12:00:00', '08:00:00']"
end-placeholder="结束日期"
start-placeholder="开始日期"
style="width: 100%"
type="datetimerange"
v-model="formData.sj"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item label="经费预算" prop="jfys">
<el-input oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请输入内容" v-model="formData.jfys">
<template slot="append"></template>
</el-input>
</el-form-item>
</div>
<el-form-item label="场地" prop="cd">
<el-input maxlength="100" placeholder="请输入场地地点" v-model="formData.cd">
</el-input>
</el-form-item>
<el-form-item label="内容" prop="nr">
<el-input maxlength="200" rows="5" type="textarea" v-model="formData.nr">
</el-input>
</el-form-item>
<el-form-item label="纪要" prop="jy">
<el-input maxlength="200" rows="5" type="textarea" v-model="formData.jy">
</el-input>
</el-form-item>
<el-form-item label="附件">
<wp-upload :upload-auto="false"
allow-files="['doc','docx']"
max-file-number="1"
ref="addwp"></wp-upload>
<div>只能上传doc、docx类型的文件</div>
</el-form-item>
<!-- <el-form-item label="附件上传">-->
<!-- <el-upload-->
<!-- name="file"-->
<!-- multiple="false"-->
<!-- :auto-upload="false"-->
<!-- limit="1"-->
<!-- action="#"-->
<!-- :on-change="handleChange"-->
<!-- :file-list="fileList">-->
<!-- <el-button size="small" type="primary">选取文件</el-button>-->
<!-- </el-upload>-->
<!-- </el-form-item>-->
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="editDialogVisible" title="编辑会议及活动">
<el-form :model="formData" :rules="rules" label-width="100px" ref="EditForm">
<el-form-item label="发布人">
<el-input v-model="formData.username"></el-input>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input maxlength="30" v-model="formData.name"></el-input>
</el-form-item>
<div class="flex">
<el-form-item label="类型" prop="lx">
<el-select v-model="formData.lx">
<el-option label="会议" value="1"></el-option>
<el-option label="活动" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="教代会" prop="jdhid">
<el-select v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="时间" prop="sj">
<el-date-picker
:default-time="['12:00:00', '08:00:00']"
end-placeholder="结束日期"
start-placeholder="开始日期"
style="width: 100%"
type="datetimerange"
v-model="formData.sj"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item label="经费预算" prop="jfys">
<el-input oninput="value=value.replace(/[^\d.]/g,'')" placeholder="请输入内容" v-model="formData.jfys">
<template slot="append"></template>
</el-input>
</el-form-item>
</div>
<el-form-item label="场地" prop="cd">
<el-input maxlength="100" placeholder="请输入场地地点" v-model="formData.cd">
</el-input>
</el-form-item>
<el-form-item label="内容" prop="nr">
<el-input maxlength="200" rows="5" type="textarea" v-model="formData.nr">
</el-input>
</el-form-item>
<el-form-item label="纪要" prop="jy">
<el-input maxlength="200" rows="5" type="textarea" v-model="formData.jy">
</el-input>
</el-form-item>
<el-form-item label="附件">
<wp-upload :file-list="fileList"
:upload-auto="false"
@on-delete="onDeleteFile"
allow-files="['doc','docx']"
max-file-number="1"
ref="editwp"></wp-upload>
<div>只能上传doc、docx类型的文件</div>
</el-form-item>
<!-- <el-form-item label="附件上传">
<el-upload
name="file"
multiple="false"
:auto-upload="false"
limit="1"
action="#"
:on-change="handleChange"
:on-remove="handleRemove"
:file-list="fileList">
<el-button size="small" type="primary">选取文件</el-button>
<div slot="tip" class="el-upload__tip">只能上传doc/docx文件</div>
</el-upload>
</el-form-item>-->
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="参与人员设置">
<el-row>
<div class="btn-group tool-button">
<div>
<el-select
:remote-method="queryUser"
filterable
placeholder="请输入工号或姓名关键字"
remote
reserve-keyword
size="mini"
style="width: 400px"
v-model="userFormData.userid"
>
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</div>
</div>
<div class="btn-group tool-button">
<el-button @click="doAddUser" icon="el-icon-circle-plus" size="mini" type="primary">添加</el-button>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="userTableData" height="350">
<el-table-column align="center" header-align="center" label="工号" prop="loginname"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="姓名" prop="username"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="性别" prop="sex" sortable></el-table-column>
<el-table-column align="center" header-align="center" label="所属单位" prop="dwname"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="手机号码" prop="mobile"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="150">
<template slot-scope="scope">
<el-button @click="doDeleteUser(scope.row.id)" icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer">
<el-button @click="userDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="viewDialogVisible" title="查看">
<el-form label-position="left" label-suffix="" style="padding: 20px 0">
<el-row gutter="20">
<vi-title title="基础信息"></vi-title>
<el-col :span="12">
<el-form-item label="教代会">
{{ viewData.data.jdhallname }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类型">
{{viewData.data.lx===1?'会议':'活动'}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开始时间">
{{viewData.data.kssj}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间">
{{viewData.data.jssj}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发布人">
{{viewData.data.username}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="经费预算">
{{viewData.data.jfys}}元
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
{{viewData.data.nr}}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="纪要">
{{viewData.data.jy}}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="参与人员">
<el-tag class="mr5" effect="light"
type="info" v-for="u in viewData.userList" v-if="viewData.userList.length>0">
{{u.username}}
</el-tag>
<td class="content" colspan="4" v-else>
<div class="text-center">暂无</div>
</td>
</el-form-item>
</el-col>
<el-col :span="24">
<vi-title title="附件"></vi-title>
<el-form-item label="附件">
<el-link @click="dd3s.preview(f.filepath,f.id)" type="primary" v-for="f in viewData.fileList"
v-if="viewData.fileList.length>0">
{{f.filename}}
</el-link>
<td class="content" colspan="4" v-else>
<div class="text-center">暂无</div>
</td>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</div>
<script>
const rules = {
name: [{required: true, message: '请填写名称', trigger: ['blur', 'change']}],
lx: [{required: true, message: '请选择类型', trigger: ['blur', 'change']}],
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
sj: [{required: true, message: '请选择时间', trigger: ['blur', 'change']}],
jfys: [{required: true, message: '请填写经费预算', trigger: ['blur', 'change']}],
cd: [{required: true, message: '请填写场地名称', trigger: ['blur', 'change']}],
nr: [{required: true, message: '请填写内容', trigger: ['blur', 'change']}],
jy: [{required: true, message: '请填写纪要', trigger: ['blur', 'change']}],
}
let vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
name: '',
lx: null
},
jdhList: [],
addDialogVisible: false,
formData: {},
rules: rules,
tableData: [],
fileList: [],
editDialogVisible: false,
delFile: [],
userDialogVisible: false,
userFormData: {},
userTableData: [],
userList: [],
viewData: {
data: {},
fileList: [],
userList: []
},
viewDialogVisible: false
}
},
methods: {
onDeleteFile(file) {
this.delFile.push({fileid: file.fileDes.id, filepath: file.fileDes.filepath})
},
openAdd() {
this.formData = {}
if (this.$refs.addwp) {
this.$refs.addwp.clean()
}
this.addDialogVisible = true
},
doAdd() {
this.$refs['AddForm'].validate(valid => {
if (valid) {
this.formData.kssj = this.formData.sj[0]
this.formData.jssj = this.formData.sj[1]
let formData = new FormData()
formData.append("data", JSON.stringify(this.formData))
// this.fileList.forEach(val=>{
// formData.append("file",val.raw)
// })
if (this.$refs.addwp.fileShowArray.length > 0) {
formData.append("file", this.$refs.addwp.fileShowArray[0].file)
}
$.ajax({
url: base + '/platform/jdh/hyjhd/doAdd',
type: "post",
data: formData,
processData: false,
contentType: false
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
pageData() {
sublime.showLoadingbar()
$.post(base + '/platform/jdh/hyjhd/pageData', this.pageForm).then(res => {
sublime.closeLoadingbar()
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageOrder(column) {
this.pageForm.pageOrderName = column.prop
this.pageForm.pageOrderBy = column.order
this.pageData()
},
pageNumberChange(val) {
this.pageForm.pageNumber = val;
this.pageData()
},
pageSizeChange(val) {
this.pageForm.pageSize = val;
this.pageData()
},
openEdit(row) {
this.editDialogVisible = true
$.get(base + '/platform/jdh/hyjhd/findOne', {id: row.id}).then(res => {
if (res.code === 0) {
this.formData = res.data.data
this.formData.sj = [res.data.data.kssj, res.data.data.jssj]
this.formData.lx = this.formData.lx.toString()
for (let f of res.data.fileList) {
f.name = f.filename
f.url = '${AppFileDomain!}' + f.filepath
}
this.fileList = res.data.fileList
this.$nextTick(() => {
this.$refs.editwp.refreshFileList()
})
}
})
},
doEdit() {
this.$refs['EditForm'].validate(valid => {
if (valid) {
this.formData.kssj = this.formData.sj[0]
this.formData.jssj = this.formData.sj[1]
let formData = new FormData()
formData.append("data", JSON.stringify(this.formData))
formData.append("delFile", JSON.stringify(this.delFile))
if (this.$refs.editwp.fileShowArray.length > 0) {
if (this.$refs.editwp.fileShowArray[0].status === 0) {
formData.append("file", this.$refs.editwp.fileShowArray[0].file)
}
}
$.ajax({
url: base + '/platform/jdh/hyjhd/doEdit',
type: "post",
data: formData,
processData: false,
contentType: false
}).then(res => {
if (res.code === 0) {
this.editDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
doDelete(id) {
this.$confirm('确认删除吗,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/hyjhd/doDelete', {id: id}).then(res => {
if (res.code === 0) {
console.log(res)
this.$message.success(res.msg)
this.pageData()
}
})
}).catch(() => {
})
},
openCy(id) {
this.userFormData.id = id
this.userData()
this.userDialogVisible = true
},
userData(id) {
$.get(base + '/platform/jdh/hyjhd/userData', {id: this.userFormData.id}).then(res => {
if (res.code === 0) {
this.userTableData = res.data
}
})
},
queryUser(query) {
if (query !== '') {
$.get(base + '/platform/jdh/hyjhd/queryUser', {
query: query,
id: this.userFormData.id
}).then(res => {
if (res.code === 0) {
this.userList = res.data
}
})
}
},
doAddUser() {
if (this.userFormData.userid === '') {
this.$message.info('请先选择用户!')
return
}
$.post(base + '/platform/jdh/hyjhd/doAddUser', this.userFormData).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.userFormData.userid = ''
this.userList = []
this.userData()
}
})
},
doDeleteUser(userid) {
$.post(base + '/platform/jdh/hyjhd/doDeleteUser', {
id: this.userFormData.id,
userid: userid
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.userFormData.userid = ''
this.userList = []
this.userData()
}
})
},
openView(id) {
this.viewDialogVisible = true
$.get(base + '/platform/jdh/hyjhd/findOne', {id: id}).then(res => {
if (res.code === 0) {
this.viewData = res.data
this.viewData.userList = []
$.get(base + '/platform/jdh/hyjhd/userData', {id: id}).then(res => {
if (res.code === 0) {
this.viewData.userList = res.data
}
})
}
})
}
},
async created() {
this.jdhList = await getOpenJdh()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.pageData()
}
}
})
</script>
<!--#
}
#-->
+161
View File
@@ -0,0 +1,161 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-select {
width: 100%;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<el-select @change="jdhChange" placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in JdhList">
</el-option>
</el-select>
</el-card>
<el-row class="mt20" type="flex">
<el-col :span="18">
<el-card shadow="never">
<vi-title title="代表结构"></vi-title>
<div :style="{height:db_box_height+'px'}" id="db_plot_box" ref="db_box"></div>
</el-card>
</el-col>
<el-col :span="6">
<el-card shadow="never" style="height: 100%">
<vi-title title="代表团"></vi-title>
<el-table :data="dbt" :height="dbtTableHeight" ref="dbtTable" show-summary>
<el-table-column label="代表团" prop="dbtname" show-overflow-tooltip>
<template scope="{row}">
{{row.delegationName}}{{isDisPlayCode?''+row.delegationCode+'':null}}
</template>
</el-table-column>
<el-table-column label="代表人数" prop="num"></el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</guava>
</div>
<script>
let dbPlot = null
let vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
jdhid: '',
},
JdhList: [],
dbt: [],
hyhdTableData: [],
dbOptions: {
xAxis: {
type: 'category',
data: [],
axisLabel: {
interval: 0
}
},
yAxis: {
type: 'value'
},
series: [{
label: {
normal: {
show: true,
position: 'top'
}
},
data: [],
type: 'bar',
showBackground: true,
itemStyle: {
//通常情况下:
normal: {
//每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
color: function (params) {
var colorList = ['#CE0000', 'rgb(42,170,227)', 'rgb(42,170,227)', 'rgb(42,170,227)', '#FFDCB9', '#FFDCB9', '#FFDCB9', '#FFDCB9', '#FFDCB9', '#FFDCB9'];
return colorList[params.dataIndex];
}
},
}
}]
},
dbtTableHeight: null,
db_box_height: null
}
},
methods: {
async jdhChange(jdhid) {
const resp_data = await $.get(base + '/platform/jdh/sjkb/getData', {jdhid})
this.dbt = resp_data.data.dbt
this.hyhdTableData = resp_data.data.hyhd
const keys = Object.keys(resp_data.data.db)
let dbData = []
keys.map(v => {
dbData.push({name: v, num: resp_data.data.db[v]})
})
if (dbPlot) {
dbPlot.destroy()
}
dbPlot = new G2Plot.Column('db_plot_box', {
data: dbData,
xField: 'name',
yField: 'num',
label: {
position: 'middle',
style: {
fill: '#FFFFFF',
opacity: 0.6,
},
},
xAxis: {
label: {
autoHide: true,
autoRotate: false,
},
},
meta: {
name: {
alias: '类别',
},
num: {
alias: '人数',
}
},
})
dbPlot.render()
}
},
mounted() {
setTimeout(() => {
this.db_box_height = (window.innerHeight - 20 - 20) - this.$refs.db_box.getBoundingClientRect().top - 20
this.dbtTableHeight = (window.innerHeight - 20 - 20) - this.$refs.dbtTable.$el.getBoundingClientRect().top
window.onresize = () => {
this.db_box_height = (window.innerHeight - 20 - 20) - this.$refs.db_box.getBoundingClientRect().top - 20
this.dbtTableHeight = (window.innerHeight - 20 - 20) - this.$refs.dbtTable.$el.getBoundingClientRect().top
}
}, 100)
},
async created() {
this.JdhList = await getAllJdh()
if (this.JdhList.length > 0) {
this.pageForm.jdhid = this.JdhList[0].id
this.jdhChange(this.pageForm.jdhid)
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,310 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.box-card {
border-radius: 16px;
padding-right: 80px;
}
.el-divider {
background-color: #409EFF;
}
.el-divider__text.is-left {
color: #409EFF;
font-weight: 600;
font-size: 15px;
}
.el-date-editor.el-input, .el-date-editor.el-input__inner, .el-select {
width: 100%;
}
.item-button {
text-align: center;
}
.item-button .el-button {
padding: 12px 100px;
}
.el-select-dropdown, .el-picker-panel, .el-loading-mask {
z-index: 99999 !important;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card>
<template #header="">
<h3 style="color:#1867b0">二级教代会申请</h3>
</template>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="会议标题" prop="meeting_name">
<el-input
clearable
maxlength="100"
placeholder="请填写会议标题"
v-model="formData.meeting_name">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有无选举事项" prop="have_elect">
<el-radio-group v-model="formData.have_elect">
<el-radio-button :label="true"></el-radio-button>
<el-radio-button :label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="届次" prop="session_id">
<el-select clearable filterable placeholder="届次" style="width: 100%"
v-model="formData.session_id">
<el-option :key="item.id" :label="item.jdhallname" :value="item.id"
v-for="item in sessionOptions">
</el-option>
</el-select>
</el-form-item>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="填表单位" prop="unit_name">
<el-input :clearable="false"
placeholder="填表单位"
readonly
v-model="formData.unit_name">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="填表日期" prop="create_time">
<el-input :clearable="false"
placeholder="填写日期"
readonly
v-model="formData.create_time">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="会议时间" prop="meeting_time">
<el-date-picker
:clearable="false"
format="yyyy-MM-dd HH:mm"
placeholder="选择会议时间"
type="datetime"
v-model="formData.meeting_time"
value-format="yyyy-MM-dd HH:mm">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上一次会议时间" prop="before_meeting_time">
<el-date-picker
:clearable="false"
format="yyyy-MM-dd HH:mm"
placeholder="选择上一次会议时间"
type="datetime"
v-model="formData.before_meeting_time"
value-format="yyyy-MM-dd HH:mm">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="正式代表人数" prop="official_delegate">
<el-input oninput="value=value.replace(/[^\d]/g,'')"
placeholder="请输入正式代表人数"
v-model="formData.official_delegate"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其中教师" prop="teacher_delegate">
<el-input oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入教师代表人数"
v-model="formData.teacher_delegate"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="列席代表人数" prop="attend_delegate">
<el-input oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入列席代表人数"
v-model="formData.attend_delegate"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其中特邀" prop="special_delegate">
<el-input oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入特邀代表人数"
v-model="formData.special_delegate"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item class="is-required" label="会议议题" prop="meeting_topic">
<div id="meetingTopicRich"></div>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input :rows="4" maxlength="500" placeholder="请输入备注" type="textarea"
v-model="formData.remark"></el-input>
</el-form-item>
<el-form-item label="附件" prop="files">
<file-upload :files.sync="formData.files" card></file-upload>
</el-form-item>
<el-form-item style="text-align: right">
<el-button @click="resetForm" type="danger">重 置
</el-button>
<el-button :loading="subLoading" @click="operation" type="primary">提 交</el-button>
</el-form-item>
</el-form>
</el-card>
</guava>
</div>
<script>
function getQueryVariable(variable) {
let query = window.location.search.substring(1);
let vars = query.split("&");
for (let i = 0; i < vars.length; i++) {
let pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return '';
}
let E = window.wangEditor
let meetingTopicRich = null
const vue = new Vue({
el: '#app',
data() {
const meetingTopicValid = (rule, value, callback) => {
if (!this.formData.meeting_topic || !dd3s.html2txt(this.formData.meeting_topic)) {
callback(new Error('请填写会议议题'));
} else {
callback();
}
};
return {
subLoading: false,
sessionOptions: [],
formData: {
meeting_name: '',
have_elect: false,
unit_name: '${@shiro.getPrincipalProperty("unit").getName()}',
create_time: moment(new Date()).format("YYYY-MM-DD"),
meeting_time: '',
before_meeting_time: '',
session_num: '',
frequency: '',
official_delegate: '',
teacher_delegate: '',
attend_delegate: '',
special_delegate: '',
meeting_topic: '',
remark: '',
files: [],
},
formRules: {
meeting_name: [{required: true, message: '请填写会议标题', trigger: ['blur', 'change']}],
session_id: [{required: true, message: '请选择届次', trigger: ['blur', 'change']}],
have_elect: [{required: true, message: '请选择有无选举事项', trigger: ['blur', 'change']}],
unit_name: [{required: true, message: '请选择填表单位', trigger: ['blur', 'change']}],
create_time: [{required: true, message: '请选择填表日期', trigger: ['blur', 'change']}],
meeting_time: [{required: true, message: '请选择会议时间', trigger: ['blur', 'change']}],
session_num: [{required: true, message: '请选择届数', trigger: ['blur', 'change']}],
frequency: [{required: true, message: '请选择次数', trigger: ['blur', 'change']}],
official_delegate: [{required: true, message: '请填写正式代表人数', trigger: ['blur', 'change']}],
meeting_topic: [{validator: meetingTopicValid, trigger: ['blur', 'change']}],
}
}
},
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue')
},
methods: {
resetForm() {
this.$refs["addForm"].resetFields();
$("#meetingTopicRich").html("")
meetingTopicRich.create()
},
async openEdit(id) {
const resp = await $.get(loc() + "/findOne", {id})
requestLaterFun(resp, (data) => {
data.files = JSON.parse(data.files)
this.formData = data
this.$nextTick(() => {
meetingTopicRich = new E('#meetingTopicRich')
meetingTopicRich.config.onchange = (html) => {
this.formData.meeting_topic = html
}
meetingTopicRich.create()
meetingTopicRich.txt.html(data.meeting_topic)
})
})
},
initPage() {
this.$nextTick(() => {
meetingTopicRich = new E('#meetingTopicRich')
meetingTopicRich.config.onchange = (html) => {
this.formData.meeting_topic = html
}
meetingTopicRich.create()
})
},
async operation() {
let method = this.formData.id ? "/doEdit" : "/doAdd"
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
this.subLoading = true
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const data = clone(this.formData)
data.files = JSON.stringify(data.files)
const resp = await $.post(loc() + method, {jdhLevel2: JSON.stringify(data)})
requestLaterFun(resp, () => {
window.location.href = '/platform/jdh/level2/reading'
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
}, () => {
loading.close()
this.subLoading = false
})
}
});
}
},
async created() {
this.sessionOptions = await getOpenJdhByDb()
let id = getQueryVariable("id")
id ? this.openEdit(id) : this.initPage()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,175 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.item-button {
text-align: center;
}
.item-button .el-button {
padding: 12px 100px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<jdh-two-search :page="pageForm" @search="doSearch"></jdh-two-search>
<jdh-two-table :loading="tableLoading" :page="pageForm" :table="tableData">
<template #column>
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
<template scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{type:'audit',data:scope.row}"
v-if="[100,300].includes(scope.row.audit_state)">
审核
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</template>
<template #pagination>
<!--#include("/layouts/pagination.html"){}#-->
</template>
</jdh-two-table>
</template>
<template #edit>
<jdh-two-info :label="title" handle ref="audit">
<template #handle>
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
ref="auditForm">
<vi-title title="审核信息"></vi-title>
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="reply_username">
<el-input disabled value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="reply_time">
<el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审核意见" prop="opinion">
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.opinion"></el-input>
</el-form-item>
<el-form-item class="item-button">
<el-button @click="doAudit(false)" style="margin-right: 20px" type="danger">退&emsp;&emsp;
</el-button>
<el-button @click="doAudit(true)" type="primary">&emsp;&emsp;</el-button>
</el-form-item>
</el-form>
</template>
</jdh-two-info>
</template>
<template #view>
<jdh-two-info ref="view"></jdh-two-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
'jdh-two-search': httpVueLoader('/components/jdh/JdhTwoSearch.vue'),
'jdh-two-table': httpVueLoader('/components/jdh/JdhTwoTable.vue?v=1.0.0'),
'jdh-two-info': httpVueLoader('/components/jdh/JdhTwoInfo.vue')
},
data() {
return {
title: '审核',
pageForm: {
searchName: "meeting_name",
isAudit: false
},
formData: {
auditTime: moment().format('YYYY-MM-DD')
},
formRules: {
opinion: [{required: true, message: '请填写审核意见', trigger: ['blur', 'change']}],
}
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'audit') {
this.openReview(data)
}
},
openView(data) {
this.$refs.guava.view()
this.$refs.view.openView(data.id)
},
openReview(data) {
this.title = data.audit_state == 100 ? "院级党委审核" : "校工会审核"
this.formData.id = data.id
this.$refs.guava.edit()
this.$refs.audit.openView(data.id)
},
doAudit(flag) {
this.$refs["auditForm"].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() + "/doAudit", {
id: this.formData.id,
opinion: this.formData.opinion,
flag: flag
})
requestLaterFun(resp, async () => {
this.pageData()
this.$refs.guava.index()
this.$notify.success({title: '成功', message: resp.msg});
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
}, () => {
loading.close()
})
}
})
}
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,130 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<jdh-two-search :audit="false" :page="pageForm" @search="doSearch"></jdh-two-search>
<div class="mt20">
<jdh-two-table :loading="tableLoading" :page="pageForm" :table="tableData">
<template #column>
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
<template scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:scope.row}"
v-if="[100].includes(scope.row.audit_state)">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}"
:loading="scope.row.delLoading">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</template>
</jdh-two-table>
</div>
</template>
<template #view>
<jdh-two-info ref="twoInfo"></jdh-two-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
'jdh-two-search': httpVueLoader('/components/jdh/JdhTwoSearch.vue'),
'jdh-two-table': httpVueLoader('/components/jdh/JdhTwoTable.vue'),
'jdh-two-info': httpVueLoader('/components/jdh/JdhTwoInfo.vue')
},
data() {
return {
viewData: {},
pageForm: {
searchName: "meeting_name",
isAudit: false,
}
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'delete') {
this.doDelete(data)
} else if (type == 'edit') {
this.openEdit(data.id)
}
},
openView(row) {
const {id} = row
this.$refs.twoInfo.openView(id)
this.$refs.guava.view()
},
async pageData() {
const {data} = await POST('/platform/jdh/level2/info/pageData', this.pageForm, true)
this.tableData = data.list
this.pageForm.totalCount = data.totalCount
},
openEdit(id) {
window.location.href = '/platform/jdh/level2/info?id=' + id
},
async doDelete(row) {
const {id} = row
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
this.$set(row, "delLoading", true)
const resp = await GET('/platform/jdh/level2/info/doDelete', {id: id})
requestLaterMsgFun(vue, resp, async () => {
this.pageData()
}, () => {
}, () => {
this.$set(row, "delLoading", false)
})
}
}
});
}
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,258 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div :style="{padding:(tabShow?'0':'10px')}" id="app" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">组员</span>
<span class="text-primary" v-if="row.sf===2">负责人</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id, row.userid, row.jdhid)">
删除
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置组员
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置负责人
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加组员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小组成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
reserve-keyword
v-model="formData.cyuser">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
visible: false,
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/cbldxz/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = res.data.list
})
}
},
doDelete(id, userid, jdhid) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/cbldxz/doDelete', {
id: id,
userid: userid,
jdhid: jdhid
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/cbldxz/doAdd', {
jdhid: this.formData.jdhid,
userids: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/cbldxz/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,520 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-select @change="jdhChange" filterable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select @change="dbtChange(pageForm.dbtid)" clearable filterable placeholder="请选择代表团"
v-model="pageForm.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable filterable placeholder="请选择工会" v-model="pageForm.union_id">
<el-option
:key="item.id"
:label="item.unionname"
:value="item.id"
v-for="item in unionOptions">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd"><i class="ti-plus"></i> 新建代表团</el-button>
</div>
</el-row>
<el-dialog :visible.sync="addDialogVisible" title="新建代表团">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="addJdhChange" placeholder="选择教代会" style="width: 100%" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="代表团名称" prop="dbtname">
<el-select filterable multiple placeholder="请选中代表团名称" style="width: 100%" v-model="formData.dbtname">
<el-option
:key="item.id"
:label="item.name"
:value="item.name"
v-for="item in dbtList">
</el-option>
</el-select>
</el-form-item>
</el-form>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-row class="el-table-container">
<el-table :data="tableData">
<el-table-column label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="代表团编码" prop="code"></el-table-column>
<el-table-column label="代表团名称" prop="dbtname"></el-table-column>
<el-table-column label="所属教代会" prop="jdhallname"></el-table-column>
<el-table-column label="创建时间" prop="cjsj"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'fgh',data:scope.row}">
设置组成分工会
</el-dropdown-item>
<el-dropdown-item :command="{type:'tz',data:scope.row}">
设置团长/副团长
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">
&emsp;&emsp;&emsp;&emsp;&emsp;
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :title="'设置'+setzcfghdbtname+'组成工会'" :visible.sync="fghDialogVisible">
<template>
<div class="btn-group tool-button mt5">
<el-select filterable size="mini" v-model="readySetFghId">
<el-option :key="i.id" :label="i.unionname" :value="i.id" v-for="i in fghList"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="fghdoAdd" icon="el-icon-circle-plus" size="mini" type="primary">
添加
</el-button>
</div>
</template>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="fghTableData" height="300" size="mini">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="分工会名称" prop="unionname" sortable></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="fghdoDelete(scope.row.id)" icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer">
<el-button @click="fghDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="TzDialogVisible" title="设置团长/副团长">
<el-row>
<div class="btn-group tool-button mt5">
<el-select
filterable
placeholder="请输入工号或姓名关键字"
size="mini"
style="width: 300px"
v-model="TzFormData.userid">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in readyTzList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-dropdown placement="bottom">
<el-button size="mini" type="primary">
设置身份<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="doAddTz(2)">&emsp;
</el-dropdown-item>
<el-dropdown-item @click.native="doAddTz(1)">副团长
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="TzTableData" height="300" size="mini">
<el-table-column label="工号" prop="loginname" sortable></el-table-column>
<el-table-column label="姓名" prop="username" sortable></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="电话" prop="mobile"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份" prop="rolename">
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.rolename==='代表团团长'">设置团长</span>
<span class="text-info" v-if="scope.row.rolename==='代表团副团长'">设置副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="delUser(scope.row)" icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer" style="margin-top: 0">
<el-button @click="TzDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="CzyDialogVisible" title="设置操作员">
<el-row>
<div class="btn-group tool-button mt5">
<el-select :remote-method="queryCzyList" filterable
placeholder="请输入工号或姓名关键字" remote reserve-keyword
size="mini" style="width: 300px" v-model="readyCzyUser">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username"
:value="item.id"
v-for="item in readyCzyList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="czydoAdd" icon="el-icon-circle-plus" size="mini" type="primary">
添加
</el-button>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="CzyTableData" height="300" size="mini">
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="单位" prop="dwname"></el-table-column>
<el-table-column label="电话" prop="mobile"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button @click="czydoDelete(scope.row.id)" icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer" style="margin-top: 0">
<el-button @click="CzyDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
let vue = new Vue({
el: '#app',
data() {
return {
setzcfghdbtname: '',
tableData: [],
pageForm: {
...getPageForm(),
dbtname: '',
jdhid: '',
union_id: ""
},
jdhList: [],
delegations: [],
dbtList: [],
addDialogVisible: false,
formData: {},
fghDialogVisible: false,
fghFormData: {},
fghList: [],
readySetFghId: '',
fghTableData: [],
TzDialogVisible: false,
TzFormData: {},
readyTzUser: [],
readyTzList: [],
TzTableData: [],
czyFormData: {},
CzyDialogVisible: false,
readyCzyUser: '',
readyCzyList: [],
CzyTableData: [],
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['change', 'blur']}],
dbtname: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}]
},
unionOptions: []
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'fgh') {
this.openFgh(data.id, data.jdhid, data.dbtname)
} else if (type == 'tz') {
this.openTz(data.id, data.jdhid)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
async dbtChange(dbtId) {
this.pageForm.union_id = ''
this.unionOptions = await getUnions(dbtId)
},
openAdd() {
this.formData = {}
if (this.jdhList.length > 0) {
this.formData.jdhid = this.jdhList[0].id
this.getDbtList(this.formData.jdhid)
}
this.addDialogVisible = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
async doAdd() {
this.$refs['addForm'].validate(async (valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(base + '/platform/jdh/zzjg/dbt/doAdd', this.formData)
closeLoadingFunc(loading, resp, async () => {
this.pageData()
this.addDialogVisible = false
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
async jdhChange(val) {
this.pageForm.dbtid = ''
this.delegations = await getDbt(val)
},
addJdhChange(val) {
this.getDbtList(val)
},
getDbtList(jdhid) {
$.post(base + '/platform/jdh/zzjg/dbt/queryKyDbtMc', {jdhid: jdhid}).then(res => {
if (res.code === 0) {
this.dbtList = res.data
}
})
},
openFgh(id, jdhid, dbtname) {
this.setzcfghdbtname = dbtname
this.fghFormData = {id, jdhid}
this.getNoSetFgh(jdhid)
this.getDbtFghData(id)
this.fghDialogVisible = true
},
//查询没有被代表团设置的组成分工会
getNoSetFgh(jdhid) {
$.post(base + '/platform/jdh/zzjg/dbt/queryNoSetFgh', {jdhid: jdhid}).then(res => {
this.fghList = res.data
})
},
//该代表团下的组成分工会
getDbtFghData(id) {
$.post(base + '/platform/jdh/zzjg/dbt/getDbtFghData', {id: id}).then(res => {
if (res.code === 0) {
this.fghTableData = res.data
}
})
},
fghdoAdd() {
if (this.readySetFghId === '') {
this.$message.info('请先选择分工会')
return
}
this.fghFormData.fghid = this.readySetFghId
$.post(base + '/platform/jdh/zzjg/dbt/fghdoAdd', this.fghFormData).then(res => {
if (res.code === 0) {
this.readySetFghId = ''
this.getNoSetFgh(this.fghFormData.jdhid)
this.getDbtFghData(this.fghFormData.id)
}
})
},
fghdoDelete(id) {
$.post(base + '/platform/jdh/zzjg/dbt/fghdoDelete', {id: id}).then(res => {
if (res.code === 0) {
this.getNoSetFgh(this.fghFormData.jdhid)
this.getDbtFghData(this.fghFormData.id)
}
})
},
//团长副团长
openTz(id, jdhid) {
this.TzFormData = {
id: id,
jdhid: jdhid
}
this.getNotTzList()
this.getTzList()
this.TzDialogVisible = true
},
//获取没被设置为团长副团长的代表
getNotTzList() {
$.get(base + '/platform/jdh/zzjg/dbt/queryUser', {id: this.TzFormData.id}).then(res => {
this.readyTzList = res.data
})
},
//获取团长副团长
getTzList() {
$.get(base + '/platform/jdh/zzjg/dbt/getTzList', {id: this.TzFormData.id}).then(res => {
this.TzTableData = res.data
})
},
delUser(obj) {
let data = {
userid: obj.id,
dbtid: this.TzFormData.id,
jdhid: this.TzFormData.jdhid,
roleid: obj.roleid
}
$.post(base + '/platform/jdh/zzjg/dbt/delUser', data).then(res => {
if (res.code === 0) {
this.getTzList()
this.getNotTzList()
}
})
},
doAddTz(num) {
this.TzFormData.num = num
$.post(base + '/platform/jdh/zzjg/dbt/doAddTz', this.TzFormData).then(res => {
if (res.code === 0) {
this.getTzList()
this.getNotTzList()
this.TzFormData.userid = ''
this.readyTzList = []
} else {
this.$message.info(res.msg)
}
})
},
//操作员
openCzy(id, jdhid) {
this.czyFormData = {id, jdhid}
this.getCzyTableData()
this.CzyDialogVisible = true
},
getCzyTableData() {
$.post(base + '/platform/jdh/zzjg/dbt/getCzyTableData', {dbtid: this.czyFormData.id}).then(res => {
if (res.code === 0) {
this.CzyTableData = res.data
}
})
},
czydoAdd() {
$.post(base + '/platform/jdh/zzjg/dbt/czydoAdd', {
userid: this.readyCzyUser,
dbtid: this.czyFormData.id,
jdhid: this.czyFormData.jdhid
}).then(res => {
if (res.code === 0) {
this.readyCzyUser = ''
this.readyCzyList = []
this.getCzyTableData()
}
})
},
czydoDelete(userid) {
$.post(base + '/platform/jdh/zzjg/dbt/czydoDelete', {
userid: userid,
dbtid: this.czyFormData.id
}).then(res => {
if (res.code === 0) {
this.getCzyTableData()
}
})
},
queryCzyList(keyword) {
$.get(base + '/platform/jdh/zzjg/dbt/getReadyCzyList', {
dbtid: this.czyFormData.id,
keyword: keyword
}).then(res => {
if (res.code === 0) {
this.readyCzyList = res.data.list
}
})
},
doDelete(id) {
$.post(base + '/platform/jdh/zzjg/dbt/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
},
...pageSomeThing
},
async created() {
this.unionOptions = await getUnions()
this.jdhList = await getOpenJdh()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
this.pageData()
}
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,781 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__nav {
background-color: #FFFFFF;
}
.dialog-footer .el-button {
padding: 12px 30px;
}
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-box .el-card__header {
padding: 5px 15px;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="app" v-cloak>
<guava>
<tree-layout style="height: calc(100vh - 70px)">
<template #tree>
<div style="padding: 15px;">
<el-select @change="jdhChange" filterable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"
accordion class="filter-tree"
default-expand-all highlight-current ref="tree">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div class="v-node" style="font-size: 16px;" v-if="node.level==1">
<i class="el-icon-office-building"></i>&nbsp;{{ data.dbtname }}
</div>
<div class="v-node" style="font-size: 14px" v-if="node.level==2">
<i class="el-icon-s-help" v-if="checkData.dbtname==data.dbtname"></i>
<i class="el-icon-help" v-else></i>
&emsp;{{ data.dbtname }}
</div>
</div>
</el-tree>
</template>
<template>
<div class="pl10 pr10" v-if="node.level==1">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择代表团" v-model="pageForm.dbtid">
<el-option
:key="item.id"
:label="item.dbtname"
:value="item.id"
v-for="item in delegations">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button @click="openAdd" type="primary"><i class="ti-plus"></i> 添加代表团</el-button>
</div>
</el-card>
<el-dialog :visible.sync="addDialogVisible" title="添加代表团" width="40%">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="addJdhChange" placeholder="选择教代会" style="width: 100%"
v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="代表团名称" prop="dbt">
<el-select filterable multiple placeholder="请选中代表团名称" style="width: 100%"
v-model="formData.dbt">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in dbtList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-card class="mt20" shadow="never">
<el-table :data="tableData">
<el-table-column label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="代表团名称"
prop="dbtname"></el-table-column>
<el-table-column align="center" header-align="center" label="代表团编码"
prop="dictcode"></el-table-column>
<el-table-column align="center" header-align="center" label="所属教代会"
prop="jdhallname"></el-table-column>
<el-table-column align="center" header-align="center" label="创建时间" prop="cjsj">
<template slot-scope="{row:{cjsj}}">
{{moment(cjsj).format('YYYY-MM-DD')}}
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'fgh',data:scope.row}">
设置组成基层工会
</el-dropdown-item>
<el-dropdown-item :command="{type:'tz',data:scope.row}">
设置团长/副团长
</el-dropdown-item>
<el-dropdown-item :command="{type:'editName',data:scope.row}">
编辑代表团名称
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
<div class="pl10 pr10" v-if="node.level==2">
<el-tabs @tab-click="handleTabClick" type="card" v-model="activeName">
<el-tab-pane label="代表" name="one">
<el-card shadow="never">
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入内容"
v-model="dbPageForm.searchKeyword">
<el-select placeholder="查询类型" slot="prepend"
style="width: 120px;"
v-model="dbPageForm.searchName">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-select @change="getUnits" clearable filterable placeholder="请选择工会"
v-model="dbPageForm.unionid">
<el-option
:label="item.unionname"
:value="item.id"
v-for="item in unionList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select clearable filterable placeholder="请选择单位"
v-model="dbPageForm.unitid">
<el-option
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-button @click="dbDoSearch" icon="el-icon-search"
type="primary"></el-button>
</div>
</el-card>
<el-table :data="dbTableData" class="mt20">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span></template>
</el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="工会" prop="unionname" sortable></el-table-column>
<el-table-column label="单位" prop="unitname" sortable></el-table-column>
<el-table-column label="代表身份" prop="rolename" sortable></el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="设置组成基层工会" name="two">
<el-card class="text-right" shadow="never">
<el-button @click="fghdoAdd(adminPageForm.dbtid)" type="primary">
{{butTitle}}
</el-button>
</el-card>
<el-table :data="adminTableData" class="mt20">
<el-table-column label="序号" width="60px">
<template scope="scope"><span>{{scope.$index+1}}</span></template>
</el-table-column>
<el-table-column label="基层工会名称" prop="unionname"></el-table-column>
<el-table-column label="操作">
<template scope="{row}">
<el-button @click="fghdoDelete(row)" circle icon="el-icon-delete" plain
size="mini"
type="danger">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="设置团长/副团长" name="three">
<el-card class="text-right" shadow="never">
<el-button @click="openUser(adminPageForm.dbtid)" type="primary">
{{butTitle}}
</el-button>
</el-card>
<el-table :data="TzTableData" class="mt20" height="300">
<el-table-column label="工号" prop="loginname" sortable></el-table-column>
<el-table-column label="姓名" prop="username" sortable></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="电话" prop="mobile"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="身份" prop="rolename">
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.rolename==='代表团团长'">团长</span>
<span class="text-info" v-if="scope.row.rolename==='代表团副团长'">副团长</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button @click="delUser(row)" circle icon="el-icon-delete" plain size="mini"
type="danger">
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template>
</tree-layout>
</guava>
<el-dialog :title="title" :visible.sync="fghDialogVisible" width="55%">
<div style="width: 100%;">
<el-transfer :data="fghData" :filter-method="adminFilterMethod"
:props="{key: 'id',label: 'unionname'}"
:titles="['剩余分工会', '代表团分工会']"
filterable
v-model="fghFormData.fghValue">
</el-transfer>
</div>
<span class="dialog-footer" slot="footer">
<el-button @click="fghDialogVisible = false">取 消</el-button>
<el-button :loading="fghSubLoading" @click="dofgh" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="设置团长副团长" width="40%">
<el-form label-width="100px">
<el-form-item label="届次" prop="jdhallname">
<el-select disabled style="width: 100%" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工号或姓名" prop="userid">
<el-select @change="userChange" filterable placeholder="请输入工号或姓名关键字"
style="width: 100%" v-model="userFormData.userid">
<el-option
:key="item.id"
:label="item.username+'('+item.loginname+')'"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式" prop="mobile">
<el-input readonly v-model="leaderInfo.mobile"></el-input>
</el-form-item>
<el-form-item label="所属单位" prop="dwname">
<el-input readonly v-model="leaderInfo.dwname"></el-input>
</el-form-item>
<el-form-item label="身份" prop="sf">
<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 class="dialog-footer" slot="footer">
<el-button :disabled="userSubLoading" @click="doAddTz" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="deleDialogVisible" title="编辑代表团名称" width="30%">
<el-form :model="editForm" label-width="100px" ref="editForm">
<el-form-item :rules="{required: true, message: '请填写代表团名称', trigger: 'blur'}" label="代表团名称" prop="dbtName"
ref="aa">
<el-input v-model="editForm.dbtName"></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="deleDialogVisible = false">取 消</el-button>
<el-button @click="deleDo" 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 {
editForm: {dbtName: ''},
deleDialogVisible: false,
node: {
level: 1
},
pageForm: {
jdhid: ""
},
title: '',
checkData: {},
activeName: 'one',
jdhList: [],
dbtList: [],
unitList: [],
unionList: [],
delegations: [],
treeData: [],
adminTableData: [],
dbTableData: [],
adminPageForm: {},
dbPageForm: {
...getPageForm(),
unitid: "",
unionid: "",
searchName: 'username',
},
TzTableData: [],
addDialogVisible: false,
fghDialogVisible: false,
fghDialog: false,
userDialogVisible: false,
fghData: [],
fghFormData: {
fghValue: []
},
leaderInfo: {
sf: '2'
},
userList: [],
userFormData: {},
fghSubLoading: false,
userSubLoading: false,
setzcfghdbtname: '',
setFghId: '',
butTitle: '设置组成基层工会',
defaultProps: {
children: 'childrens',
label: 'dbtname',
disabled: 'disabled'
},
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['change', 'blur']}],
dbt: [{required: true, message: '请选择代表团', trigger: ['change', 'blur']}]
},
deleData: {},
}
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type == 'fgh') {
this.openFgh(data)
} else if (type == 'tz') {
this.openTz(data)
} else if (type == 'delete') {
this.doDelete(data.id)
} else if (type === 'editName') {
this.editName(data)
}
},
editName(data) {
this.deleData = data
this.deleDialogVisible = true
if (this.$refs['editForm']) {
this.$refs['editForm'].resetFields()
}
},
async deleDo() {
this.$refs['editForm'].validate(async (valid) => {
if (valid) {
this.$confirm('此操作需要先在字典表中添加新的代表团名称,请确认', '提示', {
confirmButtonText: '我已添加',
cancelButtonText: '取消',
type: 'warning',
}).then(async ({value}) => {
const resp = await $.post(loc() + '/updateDelegation', {
id: this.deleData.id,
delegationName: this.editForm.dbtName
})
if (resp.code === 0) {
this.$notify.success({title: '成功', message: resp.msg});
} else {
this.$notify.error({title: '失败', message: resp.msg});
}
this.pageData()
this.deleDialogVisible = false
}).catch(() => {
this.deleDialogVisible = false
});
}
})
},
async dbData() {
this.dbPageForm.jdhid = this.pageForm.jdhid
const resp = await $.get(loc() + '/dbTableData', this.dbPageForm)
requestLaterFun(resp, () => {
this.dbTableData = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
async dbDoSearch() {
await this.dbData()
},
openAdd() {
this.formData = {}
if (this.jdhList.length > 0) {
this.formData.jdhid = this.jdhList[0].id
this.getDbtList(this.formData.jdhid)
}
this.addDialogVisible = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
addJdhChange(val) {
this.getDbtList(val)
},
async getDbtList(jdhid) {
const resp = await $.post(loc() + "/queryKyDbtMc", {jdhid: jdhid})
requestLaterFun(resp, () => {
this.dbtList = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
async doAdd() {
this.$refs['addForm'].validate(async (valid) => {
let data = clone(this.formData)
data.dbt = JSON.stringify(data.dbt)
if (valid) {
const loading = this.$loading({
lock: true,
text: '正在提交...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.post(loc() + '/doAdd', data)
closeLoadingFunc(loading, resp, async () => {
await this.undertakeUnitTree()
this.pageData()
this.addDialogVisible = false
}, (data, msg) => {
this.$message.error(msg);
})
}
})
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.undertakeUnitTree()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
fghdoDelete(row) {
const {id} = row
this.$confirm('确定要移除该分工会吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/fghdoDelete", {id: id})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.adminPageData()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
delUser(row) {
let data = {
userid: row.id,
dbtid: this.adminPageForm.dbtid,
jdhid: this.pageForm.jdhid,
roleid: row.roleid
}
this.$confirm('确定要移除该团长或副团长吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/userDoDelete", data)
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.getTzList()
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
async jdhChange(id) {
this.pageForm.dbtid = ''
this.delegations = await getDbt(id)
await this.undertakeUnitTree()
this.pageData()
},
handleNodeClick(data, node) {
this.node = node
this.checkData = data
this.dbPageForm.dbtid = data.id
this.adminPageForm.dbtid = data.id
this.adminPageForm.flag = this.activeName === 'one'
this.adminPageData()
this.getTzList()
this.dbData()
},
handleTabClick(tab) {
if (tab.name === 'one') {
this.butTitle = '设置组成基层工会'
this.adminPageForm.flag = tab.name === 'one'
this.adminPageData()
} else if (tab.name === 'two') {
this.butTitle = '设置组成基层工会'
this.adminPageForm.flag = tab.name === 'two'
this.getTzList()
} else {
this.butTitle = '设置团长/副团长'
this.adminPageForm.flag = tab.name === 'three'
this.dbData()
}
},
adminFilterMethod(query, item) {
return item.unionname.indexOf(query) > -1;
},
//查询没有被代表团设置的组成基层工会
async fghdoAdd(dbtid) {
const jdhid = this.pageForm.jdhid
this.fghFormData.jdhid = jdhid
this.fghFormData.dbtid = dbtid
const {data} = await $.get(loc() + "/findfgh", {jdhid, dbtid})
if (data) {
this.fghData = data.data
this.fghFormData.fghValue = data.value.map(v => {
return v.fghid
})
}
this.fghDialogVisible = true
},
//查询该代表团下的没有被设为团长副团长的代表
async openUser(dbtid) {
this.userFormData = {}
this.userFormData.dbtid = dbtid
this.userFormData.jdhid = this.pageForm.jdhid
const {data} = await $.get(loc() + "/queryUser", {dbtid: dbtid, jdhid: this.pageForm.jdhid})
if (data) {
this.userList = data
}
this.userDialogVisible = true
},
//添加分工会
async dofgh() {
this.fghSubLoading = true
const data = clone(this.fghFormData)
data.fghValue = JSON.stringify(data.fghValue)
const resp = await $.post(loc() + "/fghdoAdd", data)
requestLaterFun(resp, () => {
this.fghDialogVisible = false
this.pageData()
this.adminPageData()
this.$notify.success({title: '成功', message: resp.msg});
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
}, () => {
this.fghSubLoading = false
})
},
async undertakeUnitTree() {
const {data} = await $.get(loc() + "/undertakeUnionTree", {jdhid: this.pageForm.jdhid})
this.treeData = [data]
this.pageData()
},
//该代表团下的组成基层工会
async adminPageData() {
const resp = await $.post(loc() + "/adminPageData", this.adminPageForm)
requestLaterFun(resp, () => {
this.adminTableData = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
//获取团长副团长
async getTzList() {
const resp = await $.get(loc() + '/getTzList', this.adminPageForm)
requestLaterFun(resp, () => {
this.TzTableData = resp.data;
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
},
//添加团长或者副团长
doAddTz: throttle(async function () {
if (this.userFormData.userid == null) {
this.$notify({
title: '警告',
message: '请先选择团长你或副团长',
type: 'warning'
});
return
}
this.userFormData.num = this.leaderInfo.sf
const resp = await $.post(loc() + "/doAddTz", this.userFormData)
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
})
}, 2000),
openFgh(row) {
const {dbtname} = row
const dbtid = row.id
this.setzcfghdbtname = dbtname
this.fghdoAdd(dbtid)
},
userChange(val) {
const sf = this.leaderInfo.sf
this.leaderInfo = this.userList.find(v => {
if (v.id === val) {
return v
}
})
this.$set(this.leaderInfo, 'sf', sf)
},
openTz(row) {
this.leaderInfo = {
mobile: '',
dwname: '',
sf: '2'
}
const dbtid = row.id
this.openUser(dbtid)
},
async getUnits() {
this.unitList = await getUnit(this.dbPageForm.unionid)
}
},
async created() {
this.jdhList = await getOpenJdh()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
this.delegations = await getDbt(this.jdhList[0].id)
this.pageData()
}
this.getUnits()
this.unionList = await getUnion()
await this.undertakeUnitTree()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,164 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.dialog-footer .el-button {
padding: 12px 30px;
}
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-box .el-card__header {
padding: 5px 15px;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="v" style="height: 100%" v-cloak>
<tree-layout>
<template #tree>
<el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick" accordion default-expand-all
highlight-current>
<div class="custom-tree-node" slot-scope="{ node, data }">
<div class="v-node" style="font-size: 16px;" v-if="node.level==1">
<i class="el-icon-school"></i>&nbsp;{{ data.label }}
</div>
<div class="v-node" style="font-size: 14px" v-if="node.level==2">
<i class="el-icon-star-on" v-if="checkData.label==data.label"></i>
<i class="el-icon-star-off" v-else></i>&emsp;{{ data.label }}
</div>
</div>
</el-tree>
</template>
<template>
<cbldxzl-info v-show="v=='cbldxzShow'"></cbldxzl-info>
<zgscxz-info v-show="v=='zgscxzShow'"></zgscxz-info>
<zxt-info v-show="v=='zxtShow'"></zxt-info>
<zmwyh-info v-show="v=='zmwyhShow'"></zmwyh-info>
<zxwyh-info v-show="v=='zxwyhShow'"></zxwyh-info>
</template>
</tree-layout>
</div>
<script>
new Vue({
el: '#v',
mixins: [initTableMixins],
components: {
'zgscxz-info': httpVueLoader('/components/jdh/ZgscxzInfo.vue'),
'db-info': httpVueLoader('/components/jdh/dbinfo.vue'),
'zxt-info': httpVueLoader('/components/jdh/ZxtInfo.vue'),
'zmwyh-info': httpVueLoader('/components/jdh/zmwyhInfo.vue'),
'zxwyh-info': httpVueLoader('/components/jdh/zxwyhInfo.vue'),
'cbldxzl-info': httpVueLoader('/components/jdh/CbldxzInfo.vue'),
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
data() {
return {
node: {
level: 1
},
checkData: {},
jdhList: [],
v: 'cbldxzShow',
treeData: [{
label: '机构设置',
children: [
{
id: 1,
label: '筹备领导小组'
},
{
id: 2,
label: '资格领导小组',
},
{
id: 3,
label: '主席团管理',
},
{
id: 4,
label: '执行委员会',
},
{
id: 5,
label: '专门委员会',
}],
}],
defaultProps: {
children: 'children',
label: 'label',
},
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
}
},
methods: {
handleNodeClick(data, node) {
this.node = node
this.checkData = data
const id = data.id
if (id === 1) {
this.v = 'cbldxzShow'
} else if (id === 2) {
this.v = 'zgscxzShow'
} else if (id === 3) {
this.v = 'zxtShow'
} else if (id === 4) {
this.v = 'zxwyhShow'
} else if (id === 5) {
this.v = 'zmwyhShow'
}
},
},
async created() {
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,740 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.dialog-footer .el-button {
padding: 12px 30px;
}
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
}
.v-box .el-card__header {
padding: 5px 15px;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.v-tree-layout-left .v-tree {
width: 100%;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<tree-layout id="treeLayout" style="height: calc(100vh - 70px)">
<template #tree>
<div style="border-right: 2px solid rgb(240,240,240);padding: 20px;">
<el-input
placeholder="输入关键字进行查找"
v-model="filterText">
</el-input>
</div>
<el-tree :data="treeData" :expand-on-click-node="false" :filter-node-method="filterNode"
:props="defaultProps" @node-click="handleNodeClick"
accordion
class="v-tree" default-expand-all
highlight-current node-key="id"
ref="tree" v-loading="treeLoading">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div class="v-node" style="font-size: 16px;" v-if="node.level==1"><i
class="el-icon-s-home"></i>&nbsp;
{{ data.name }}
</div>
<div :title="data.name"
class="v-node" style="font-size: 15px" v-if="node.level==2">
<i class="el-icon-star-on" v-if="checkData.name==data.name"></i>
<i class="el-icon-star-off" v-else></i>
&nbsp; {{ data.name }}
</div>
<div :title="data.name"
class="v-node" style="font-size: 14px" v-if="node.level==3">
<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 :title="data.name"
class="v-node" style="font-size: 14px" v-if="node.level>3">
<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 class="pl10 pr10" v-if="node.level==1">
<div v-if="hasChildren">
<el-card shadow="never">
<!-- <div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" clearable>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询"
style="width: 100px;">
<el-option label="机构名称" value="name"></el-option>
<el-option label="机构编码" value="mechanismcode"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="pageData"></el-button>
</div>-->
<div class="pull-right offscreen-right">
<el-button @click="openAdd()" icon="el-icon-plus"
type="primary">
新建机构
</el-button>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<el-table :data="tableData" key="1" ref="table1">
<el-table-column label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" label="机构名称" prop="name"></el-table-column>
<el-table-column align="center" label="机构编码" prop="mechanismcode"></el-table-column>
<el-table-column align="center" label="备注" prop="mechanismName"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template scope="{row}">
<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:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<div v-if="!hasChildren">
<el-card shadow="never" shadow="never">
<div class="btn-group tool-button">
<el-select @change="jdhChange" filterable placeholder="请选择教代会"
v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-input clearable placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<el-option label="工号" value="us.loginname"></el-option>
<el-option label="姓名" value="us.username"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button">
<el-button @click="cyPageData" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="offscreen-right pull-right">
<el-button @click="openCy()" icon="el-icon-plus"
size="medium"
type="primary">
设置委员
</el-button>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<el-table :data="cyTableData" key="2" ref="table2">
<el-table-column label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column align="center" label="工号" prop="loginname"></el-table-column>
<el-table-column align="center" label="姓名" prop="username"></el-table-column>
<el-table-column align="center" label="性别" prop="sex"></el-table-column>
<el-table-column align="center" label="手机" prop="mobile"></el-table-column>
<el-table-column align="center" label="单位" prop="unitname" show-overflow-tooltip>
<template slot-scope="{row}">
({{row.unitcode}}){{row.unitname}}
</template>
</el-table-column>
<el-table-column align="center" label="届次" prop="jdhallname"></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">委员</span>
<span class="text-primary" v-if="row.sf===2">副主任</span>
<span class="text-primary" v-if="row.sf===3">主任</span>
</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="doDeleteCy(row)">删除
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row,3)"
class="text-primary"
v-if="row.sf!==3">设置主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row,2)"
class="text-primary"
v-if="row.sf!==2">设置副主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row,1)"
class="text-primary"
v-if="row.sf!==1">设置委员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
:current-page="cyPageForm.pageNumber"
:page-size="cyPageForm.pageSize"
:page-sizes="[5,10, 20, 30, 50]"
:total="cyPageForm.totalCount"
@current-change="cyPageNumberChange"
@size-change="cyPageSizeChange"
layout="total, sizes, prev, pager, next">
</el-pagination>
</el-row>
</el-card>
</div>
</div>
</template>
</tree-layout>
</template>
<template #edit>
<el-divider content-position="left"><span style="color: rgb(121, 187, 255)">请填写以下机构信息</span>
</el-divider>
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-row gutter="30">
<el-col :span="24">
<el-form-item label="上级机构" prop="name">
<el-input :value="checkData.name" disabled maxlength="100"
type="text"></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item prop="jdhid" label="所属教代会">
<el-select v-model="formData.jdhid" placeholder="选择教代会" @change="ssChange"
:disabled="!nodeZm"
style="width: 100%">
<el-option
v-for="item in jdhList"
:key="item.id"
:label="item.jdhallname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>-->
<el-col :span="12">
<el-form-item label="机构名称" prop="name" v-if="!nodeZm">
<el-input :disabled="formData.id!=null" maxlength="100" placeholder="请输入机构名称"
type="text"
v-model="formData.name"></el-input>
</el-form-item>
<el-form-item label="机构名称" prop="name" v-else>
<el-select :disabled="formData.id!=null" @change="wyhChange" style="width: 100%"
v-model="formData.wyh"
value-key="id">
<el-option :key="i.id" :label="i.name" :value="i" v-for="i in wyhList"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="机构代码" prop="unitcode">
<el-input maxlength="100" placeholder="请输入机构编码"
type="text"
v-model="formData.mechanismcode"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="unitcode">
<el-input :autosize="{ minRows: 4, maxRows: 8}" maxlength="100"
placeholder="请输入备注"
type="textarea"
v-model="formData.mechanismName"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display: flex;justify-content:flex-end;margin-top: 30px">
<el-button :loading="loading" @click="!formData.id?doAdd():doEdit()" type="primary">提 交
</el-button>
</div>
</template>
</guava>
<el-dialog :visible.sync="cyDialogVisible" title="设置委员" width="40%">
<el-form label-width="100px">
<el-form-item label="届次" prop="jdhallname">
<el-select disabled style="width: 100%" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="工号或姓名" prop="userid">
<el-select @change="userChange" filterable placeholder="请输入工号或姓名关键字"
style="width: 100%" v-model="cyFormData.userid">
<el-option
:key="item.userid"
:label="item.username+'('+item.loginname+')'"
:value="item.userid"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式" prop="mobile">
<el-input readonly v-model="cyFormData.mobile"></el-input>
</el-form-item>
<el-form-item label="所属单位" prop="dwname">
<el-input readonly v-model="cyFormData.dwname"></el-input>
</el-form-item>
<el-form-item label="身份" prop="sf">
<el-radio-group v-model="cyFormData.sf">
<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 class="dialog-footer" slot="footer">
<el-button :loading="cySubLoading" @click="doCy" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userList: [],
nodeZm: false,
wyhList: [],
title: '',
hasChildren: true,
TableData: [],
loading: false,
checkData: {},
jdhList: [],
treeData: [],
cyTableData: [],
cyPageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
filterText: '',
treeLoading: true,
cyDialogVisible: false,
cySubLoading: false,
defaultProps: {
children: 'child',
label: 'name',
},
cyData: [],
cyFormData: {
userid: "",
},
node: {
level: 1
},
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['change', 'blur']}],
},
tableHeight: null
}
},
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue')
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
},
methods: {
wyhChange(val) {
this.$set(this.formData, 'mechanismcode', val.code)
},
userChange(val) {
this.cyFormData = this.userList.find(v => {
if (v.userid === val) {
return v
}
})
this.$set(this.cyFormData, 'sf', '1')
},
async queryUser() {
const {data} = await $.get(loc() + "/queryUser", {jdhid: this.pageForm.jdhid, jgid: this.checkData.id})
if (data) {
this.userList = data
}
},
queryKyWyhMc(jdhid) {
if (jdhid !== '') {
$.get(loc() + '/queryKyWyhMc', {jdhid: jdhid}).then(res => {
if (res.code === 0) {
this.wyhList = res.data
}
})
}
},
adminFilterMethod(query, item) {
return item.username.indexOf(query) > -1;
},
async jdhChange(jdhid) {
await this.cyPageData()
await this.pageData()
this.queryKyWyhMc(jdhid)
},
async ssChange(jdhid) {
this.queryKyWyhMc(jdhid)
},
dropdownCommand: function (command) {
const {type, data} = command
if (type == 'view') {
} else if (type == 'edit') {
this.openEdit(data)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
filterNode(value, data, node) {
if (!value) return true;
return data.name.indexOf(value) !== -1
return false
},
async handleNodeClick(data, node) {
this.nodeZm = node.label === "专门委员会"
this.pageForm.mcid = data.mcid
this.pageForm.jgid = data.id
this.hasChildren = data.hasChildren
this.checkData = data
this.checkNode = node
this.pageForm.parentId = this.checkData.id
if (!this.hasChildren) {
await this.cyPageData()
} else {
this.pageData()
}
},
async loadTree(flush) {
this.treeLoading = true
const {
code,
data,
msg
} = await $.get("/platform/jdh/zzjg/mechanism/getJgszTreeData", {jdhid: this.pageForm.jdhid})
this.treeLoading = false
if (code == 0) {
this.treeData = data
} else {
this.$message({
message: msg,
type: 'error'
});
}
if (flush && code == 0) {
this.checkData = data[0]
this.pageData();
}
},
openAdd() {
const {id} = this.checkData
this.formData = {
parentId: id,
}
this.ssChange()
this.$refs.guava.edit()
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
doAdd() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
this.loading = true
this.formData.jdhallname
this.formData.mcid = this.formData.wyh.id
this.formData.name = this.formData.wyh.name
const resp = await $.post(loc() + "/doAdd", this.formData)
requestLaterMsgFun(this, resp, () => {
this.loadTree(false)
this.pageData();
}, null, () => {
this.loading = false
this.$refs.guava.index()
})
}
});
},
async openCy() {
this.cyFormData = {
userid: '',
mobile: '',
dwname: '',
sf: '1'
}
await this.queryUser()
this.cyDialogVisible = true
},
cyPageNumberChange(val) {
this.pageForm.pageNumber = val;
this.cyPageData();
},
cyPageSizeChange(val) {
this.pageForm.pageSize = val;
this.cyPageData();
},
async cyPageData() {
const jgid = this.pageForm.jgid
const jdhid = this.pageForm.jdhid
const data = await $.post(loc() + "/cyPageData", this.pageForm)
this.tableLoading = false
if (data.code == 0) {
this.cyTableData = data.data.list;
this.cyPageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
},
async doCy() {
this.cyDialogVisible = true
this.cySubLoading = true
if (this.cyFormData.userid === '') {
this.$message.info('请先选择用户!')
return
}
this.cyFormData.jgid = this.pageForm.jgid
this.cyFormData.jdhid = this.pageForm.jdhid
this.cyFormData.mcid = this.pageForm.mcid
const resp = await $.post(loc() + "/cydoAdd", this.cyFormData)
requestLaterFun(resp, () => {
this.cyDialogVisible = false
this.cyPageData();
this.$notify.success({title: '成功', message: resp.msg});
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
}, () => {
this.cyPageData()
this.cyFormData.userid = ''
this.userList = []
this.cyDialogVisible = false
this.cySubLoading = false
})
},
async openEdit(row) {
this.wyhList = this.queryKyWyhMc(row.jdhid)
this.formData = {
id: row.id,
wyh: row.name,
name: row.name,
jdhid: row.jdhid,
mechanismName: row.mechanismName,
mechanismcode: row.mechanismcode
}
this.$refs.guava.edit()
},
doEdit() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
this.loading = true
this.formData.mcid = this.formData.wyh.id
this.formData.name = this.formData.wyh.name
const resp = await $.post(loc() + "/doEdit", this.formData)
requestLaterMsgFun(this, resp, () => {
this.loadTree(false)
this.pageData();
}, null, () => {
this.loading = false
this.$refs.guava.index()
})
}
});
},
doDelete(id) {
this.$confirm('确定要删除该机构吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id: id})
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.pageData()
this.loadTree(true)
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
doDeleteCy(row) {
this.$confirm('确定要删除该委员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDeleteCy", row)
requestLaterFun(resp, () => {
this.$notify.success({title: '成功', message: resp.msg});
this.pageData()
this.cyPageData()
this.loadTree(true)
}, () => {
this.$notify.error({title: '失败', message: resp.msg});
})
}
}
});
},
updateSf(row, sf) {
$.post(loc() + '/updateSf',
{
userid: row.userid,
jgid: row.jgid,
sf: sf,
jdhid: row.jdhid
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.cyPageData()
this.pageData()
}
})
},
},
async created() {
this.jdhList = await getOpenJdh()
if (this.jdhList.length > 0) {
this.pageForm.jdhid = this.jdhList[0].id
}
this.loadTree(true)
},
mounted() {
// setTimeout(() => {
// this.tableHeight = window.innerHeight - 88 - this.$refs.table1.$el.getBoundingClientRect().top
// this.tableHeight = window.innerHeight - 88 - this.$refs.table2.$el.getBoundingClientRect().top
// window.onresize = () => {
// this.tableHeight = window.innerHeight - 88 - this.$refs.table1.$el.getBoundingClientRect().top
// this.tableHeight = window.innerHeight - 88 - this.$refs.table2.$el.getBoundingClientRect().top
// }
// }, 100)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,258 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div :style="{padding:(tabShow?'0':'10px')}" id="app" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">组员</span>
<span class="text-primary" v-if="row.sf===2">副组长</span>
<span class="text-primary" v-if="row.sf===3">组长</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id,row.userid,row.jdhid)">
删除
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,3)" class="text-primary"
v-if="row.sf!==3">设置组长
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置副组长
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置组员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加组员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="小组成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
reserve-keyword
v-model="formData.cyuser">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zgscxz/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = res.data.list
})
}
},
doDelete(id, userid, jdhid) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zgscxz/doDelete', {
id: id,
userid: userid,
jdhid: jdhid
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/zgscxz/doAdd', {
jdhid: this.formData.jdhid,
userids: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/zgscxz/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,444 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div id="app" v-cloak>
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-input @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.wyhname"></el-input>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><i class="ti-plus"></i> 添加委员会</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="委员会名称" prop="wyhname"></el-table-column>
<el-table-column label="主任及联系方式" prop="zrmobile"></el-table-column>
<el-table-column label="工作职责" prop="gzzz" show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="openEdit(row)">
编辑
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row)">
删除
</el-dropdown-item>
<el-dropdown-item @click.native="openEditUser(row)"
class="text-primary">成员管理
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加委员会">
<el-form :model="formData" :rules="rules" label-width="120px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会名称" prop="name">
<el-select v-model="formData.wyh" value-key="id">
<el-option :key="i.id" :label="i.name" :value="i" v-for="i in wyhList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会工作职责" prop="gzzz">
<el-input rows="5" type="textarea" v-model.trim="formData.gzzz"></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="editDialogVisible" title="编辑委员会">
<el-form :model="formData" :rules="rules" label-width="120px" ref="editForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select disabled placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会名称" prop="name">
<el-select disabled v-model="formData.wyh" value-key="i.id">
<el-option :key="i.id" :label="i.name" :value="i" v-for="i in wyhList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会工作职责" prop="gzzz">
<el-input rows="5" type="textarea" v-model.trim="formData.gzzz"></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="委员会成员设置" width="70%">
<el-row>
<div class="btn-group tool-button mt5">
<div>
<el-select
:remote-method="queryUser"
filterable
placeholder="请输入工号或姓名关键字"
remote
size="mini"
style="width: 400px"
v-model="userFormData.userid">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' ' + item.dwname"
:value="item.id"
v-for="item in userList">
</el-option>
</el-select>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="addUser2Tab " icon="el-icon-circle-plus" size="mini" type="primary">添加成员</el-button>
</div>
</el-row>
<el-row style="margin-top: 15px">
<el-table :data="userTableData" height="300">
<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="mobile"></el-table-column>
<el-table-column label="所属单位" prop="dwname"></el-table-column>
<el-table-column label="身份" prop="sf">
<template slot-scope="scope">
<span class="text-primary" v-if="scope.row.sf===1">成员</span>
<span class="text-primary" v-if="scope.row.sf===2">副主任</span>
<span class="text-primary" v-if="scope.row.sf===3">主任</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-dropdown placement="bottom">
<el-button size="mini" type="primary">
设置身份<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="updateSf(scope.row,3)" v-if="scope.row.sf!==3">主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(scope.row,2)" v-if="scope.row.sf!==2">副主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(scope.row,1)" v-if="scope.row.sf!==1">成员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button @click="doDeleteUser(scope.row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<span class="dialog-footer" slot="footer">
<el-button @click="userDialogVisible = false" type="danger">关 闭</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="viewDialogVisible" title="详情">
<table class="tabInfo">
<tr>
<td class="title">委员会名称</td>
<td class="content">{{viewData.wyhname}}</td>
</tr>
<tr>
<td class="title">所属教代会</td>
<td class="content">{{viewData.jdhallname}}</td>
</tr>
<tr>
<td class="title">主任</td>
<td class="content">
<template v-for="u in viewData.userList">
<span class="mr5" v-if="u.sf===3">{{u.username}}</span>
</template>
</td>
</tr>
<tr>
<td class="title">副主任</td>
<td class="content">
<template v-for="u in viewData.userList">
<span class="mr5" v-if="u.sf===2">{{u.username}}</span>
</template>
</td>
</tr>
<tr>
<td class="title">成员</td>
<td class="content">
<template v-for="u in viewData.userList">
<span class="mr5" v-if="u.sf===1">{{u.username}}</span>
</template>
</td>
</tr>
<tr>
<td class="title">委员会工作职责</td>
<td class="content">{{viewData.gzzz}}</td>
</tr>
</table>
</el-dialog>
</div>
<script>
const rules = {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
wyh: [{required: true, message: '请选择委员会', trigger: ['blur', 'change']}],
gzzz: [{required: true, message: '请输入委员会工作职责', trigger: ['blur', 'change']}]
}
let vue = new Vue({
el: "#app",
data() {
return {
rules: rules,
addDialogVisible: false,
editDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
wyhname: '',
union_id: ""
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {},
wyhList: [],
userList: [],
userDialogVisible: false,
userFormData: {},
userTableData: [],
viewDialogVisible: false,
viewData: {},
}
},
methods: {
queryKyWyhMc(jdhid) {
if (jdhid !== '') {
$.get(base + '/platform/jdh/zzjg/zmwyh/queryKyWyhMc', {jdhid: jdhid}).then(res => {
if (res.code === 0) {
this.wyhList = res.data
}
})
}
},
openEdit(obj) {
this.wyhList = [{id: obj.mcid, name: obj.wyhname}]
this.formData = {
id: obj.id,
wyh: {id: obj.mcid, name: obj.wyhname},
gzzz: obj.gzzz,
jdhid: obj.jdhid
}
this.editDialogVisible = true
},
doEdit() {
this.$refs["editForm"].validate(valid => {
if (valid) {
this.formData.name = this.formData.wyh.name
this.formData.mcid = this.formData.wyh.id
$.post(base + '/platform/jdh/zzjg/zmwyh/doEdit', this.formData).then(res => {
if (res.code === 0) {
this.editDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
doDelete(obj) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zmwyh/doDelete', {id: obj.id, jdhid: obj.jdhid}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange(jdhid) {
this.queryKyWyhMc(jdhid)
},
openAdd() {
this.formData = {
jdhid: this.jdhList.length > 0 ? this.jdhList[0].id : '',
name: '',
gzzz: ''
}
this.queryKyWyhMc(this.formData.jdhid)
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
this.formData.name = this.formData.wyh.name
this.formData.mcid = this.formData.wyh.id
$.post(base + '/platform/jdh/zzjg/zmwyh/doAdd', this.formData).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
//用户管理
userData(wyhid) {
$.get(base + '/platform/jdh/zzjg/zmwyh/userData', {wyhid: wyhid}).then(res => {
if (res.code === 0) {
this.userTableData = res.data
}
})
},
openEditUser(obj) {
this.userFormData = {
userid: '',
wyhid: obj.id,
jdhid: obj.jdhid,
wyhmcid: obj.mcid
}
this.userData(obj.id)
this.userDialogVisible = true
},
queryUser(query) {
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zmwyh/queryUser', {
query: query,
jdhid: this.userFormData.jdhid
}).then(res => {
//this.userList = QC(this.users,res.data.list,'id')
this.userList = res.data.list
})
}
},
addUser2Tab() {
if (this.userFormData.userid === '') {
this.$message.info('请先选择用户!')
return
}
$.post(base + '/platform/jdh/zzjg/zmwyh/doAddUser', this.userFormData).then(res => {
if (res.code === 0) {
this.userFormData.userid = ''
this.userList = []
this.userData(this.userFormData.wyhid)
}
})
},
updateSf(obj, sf) {
$.post(base + '/platform/jdh/zzjg/zmwyh/updateSf',
{
userid: obj.id,
zmwyhid: obj.zmwyhid,
sf: sf
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.userData(obj.zmwyhid)
this.pageData()
}
})
},
doDeleteUser(obj) {
obj.jdhid = this.userFormData.jdhid
$.post(base + '/platform/jdh/zzjg/zmwyh/doDeleteUser', obj).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.userData(obj.zmwyhid)
}
})
},
async openView(row) {
this.viewDialogVisible = true
const {data} = await GET('/platform/jdh/zzjg/zmwyh/userData', {wyhid: row.id})
this.$nextTick(() => {
this.viewData = row
this.viewData.userList = data
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
this.unionOptions = await getUnions()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,257 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div :style="{padding:(tabShow?'0':'10px')}" id="app" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">成员</span>
<span class="text-primary" v-if="row.sf===2">副秘书长</span>
<span class="text-primary" v-if="row.sf===3">秘书长</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id)">
删除
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置组员
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置副秘书长
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,3)" class="text-primary"
v-if="row.sf!==3">设置秘书长
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加成员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="主席团成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
v-model="formData.cyuser"
value-key="id">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zxt/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = QC(this.formData.cyuser, res.data.list, 'id')
})
}
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zxt/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/zxt/doAdd', {
jdhid: this.formData.jdhid,
user: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/zxt/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,259 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-dialog .el-select {
width: 100% !important;
}
</style>
<div id="app" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="tabShow">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<div>
<el-input @keyup.enter.native="doSearch" placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select placeholder="查询" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName">
<el-option label="工号" value="u.loginname"></el-option>
<el-option label="姓名" value="u.username"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="btn-group tool-button mt5">
<el-select clearable placeholder="请选择教代会" v-model="pageForm.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd" size="medium"><i class="ti-plus"></i> 添加成员</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" @sort-change='pageOrder'>
<el-table-column align="center" header-align="center" label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span></template>
</el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="性别" prop="sex" sortable></el-table-column>
<el-table-column label="手机" prop="mobile"></el-table-column>
<el-table-column label="单位" prop="dwname" sortable></el-table-column>
<el-table-column label="教代会" prop="jdhallname" sortable></el-table-column>
<el-table-column label="身份" prop="sf" sortable>
<template slot-scope="{row}">
<span class="text-primary" v-if="row.sf===1">成员</span>
<span class="text-primary" v-if="row.sf===2">副主任</span>
<span class="text-primary" v-if="row.sf===3">主任</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-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="openView(row)">
查看
</el-dropdown-item>
<el-dropdown-item @click.native="doDelete(row.id)">
删除
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,3)" class="text-primary"
v-if="row.sf!==3">设置主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,2)" class="text-primary"
v-if="row.sf!==2">设置副主任
</el-dropdown-item>
<el-dropdown-item @click.native="updateSf(row.id,1)" class="text-primary"
v-if="row.sf!==1">设置成员
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</el-row>
<!--#include("/layouts/pagination.html"){}#-->
<el-dialog :visible.sync="addDialogVisible" title="添加成员">
<el-form :model="formData" :rules="rules" label-width="100px" ref="addForm">
<el-form-item label="所属教代会" prop="jdhid">
<el-select @change="jdhChange" placeholder="选择教代会" v-model="formData.jdhid">
<el-option
:key="item.id"
:label="item.jdhallname"
:value="item.id"
v-for="item in jdhList">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="委员会成员" prop="cyuser">
<el-select
:remote-method="queryUser"
filterable
multiple
placeholder="请输入用户工号或姓名关键字"
remote
v-model="formData.cyuser"
value-key="id">
<el-option
:key="item.id"
:label="item.loginname+' '+item.username+' '+item.dwname"
:value="item"
v-for="item in userList">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</transition>
<db-info :active="'1'" :show="!tabShow" :uid="uid">
<template slot="title">
<div @click="tabShow=true" class="text-primary pointer" style="font-size: 20px">
<i class="el-icon-arrow-left"></i>
返回
</div>
</template>
</db-info>
</div>
<script>
let vue = new Vue({
el: "#app",
data() {
return {
tabShow: true,
rules: {
jdhid: [{required: true, message: '请选择教代会', trigger: ['blur', 'change']}],
cyuser: [{required: true, message: '请搜索并选择用户', trigger: ['blur', 'change']}]
},
addDialogVisible: false,
roleDialogVisible: false,
tableData: [],
jdhList: [],
userList: [],
pageForm: {
searchName: "u.username",
...getPageForm(),
jdhid: '',
},
roleData: {jdh_cbldxz: {}, sys_user: {}, sys_unit: {}, jdh_jdhxx: {}},
formData: {
cyuser: [],
jdhid: ''
},
dbModal: false,
uid: ''
}
},
components: {
'db-info': httpVueLoader('/components/jdh/dbinfo.vue')
},
methods: {
openView(row) {
this.tabShow = false
this.uid = row.userid
},
queryUser(query) {
if (this.formData.jdhid === '') {
this.$message.info('请先选择教代会')
return
}
if (query !== '') {
$.get(base + '/platform/jdh/zzjg/zxwyh/queryUser', {
keyword: query,
jdhid: this.formData.jdhid
}).then(res => {
this.userList = QC(this.formData.cyuser, res.data.list, 'id')
//this.userList = res.data.list
})
}
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(base + '/platform/jdh/zzjg/zxwyh/doDelete', {id: id}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
}
})
}).catch(() => {
})
},
jdhChange() {
this.userList = []
this.formData.cyuser = []
},
openAdd() {
this.formData = {cyuser: [], jdhid: this.pageForm.jdhid}
this.userList = []
this.addDialogVisible = true
},
doAdd() {
this.$refs["addForm"].validate(valid => {
if (valid) {
$.post(base + '/platform/jdh/zzjg/zxwyh/doAdd', {
jdhid: this.formData.jdhid,
user: this.formData.cyuser
}).then(res => {
if (res.code === 0) {
this.addDialogVisible = false
this.pageData()
this.$message.success(res.msg)
}
})
}
})
},
updateSf(id, sf) {
$.post(base + '/platform/jdh/zzjg/zxwyh/updateSf', {id: id, sf: sf}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
},
...pageSomeThing
},
async created() {
this.pageData()
this.jdhList = await getAllJdh()
}
})
</script>
<!--#
}
#-->