first commit
This commit is contained in:
@@ -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 v-model="pageForm.jdhid" @change="jdhChange" placeholder="请选择教代会">
|
||||
<el-option
|
||||
v-for="item in openJdhList"
|
||||
:key="item.id"
|
||||
:label="item.jdhallname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select clearable v-model="pageForm.union_id" filterable placeholder="请选择工会">
|
||||
<el-option
|
||||
v-for="item in unionOptions"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" :row-style="showRow">
|
||||
<el-table-column type="index" label="序号" align="center" width="80"></el-table-column>
|
||||
<el-table-column prop="dbtname" align="center" label="代表团名称"></el-table-column>
|
||||
<el-table-column sortable prop="ghzrs" align="center" label="代表团总人数(人)"></el-table-column>
|
||||
<el-table-column sortable prop="fps" align="center" label="名额分配数(人)"></el-table-column>
|
||||
<el-table-column sortable prop="dbzrs" align="center" label="代表人数"></el-table-column>
|
||||
<el-table-column sortable prop="dbrsb" align="center" label="代表占比"></el-table-column>
|
||||
<el-table-column prop="lxty" align="center" label="列席/特邀代表">
|
||||
</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 title="修改名额分配数" :visible.sync="fpsDialogVisible" width="30%">
|
||||
<el-form :model="formData" ref="mefpsForm" :rules="mefpsRules" label-width="100px">
|
||||
<el-form-item prop="unionname" label="院级工会">
|
||||
<el-input disabled
|
||||
v-model="formData.unionname">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="ghzrs" label="总人数">
|
||||
<el-input disabled
|
||||
v-model="formData.ghzrs">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="fps" label="名额分配数">
|
||||
<el-input placeholder="请输入名额分配数"
|
||||
v-model="formData.fps">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="fpsDialogVisible=false">取 消</el-button>
|
||||
<el-button type="primary" @click="doFp">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="列席/特邀代表" :visible.sync="dbDialogVisible">
|
||||
<el-alert show-icon :closable="false" type="info" title="不占代表团名额"></el-alert>
|
||||
<el-row>
|
||||
<div class="btn-group tool-button">
|
||||
<el-select
|
||||
size="mini"
|
||||
style="width: 300px"
|
||||
v-model="lxtydbFormData.userid"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="queryNolxtyDb"
|
||||
placeholder="请输入工号或姓名关键字">
|
||||
<el-option
|
||||
v-for="item in lxtyUserList"
|
||||
:key="item.id"
|
||||
:label="item.loginname+' '+item.username+' '+item.dwname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-dropdown placement="bottom">
|
||||
<el-button type="primary" size="mini">
|
||||
设置身份<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 sortable prop="loginname" label="工号"></el-table-column>
|
||||
<el-table-column sortable prop="username" label="姓名"></el-table-column>
|
||||
<el-table-column sortable prop="dbunitname" label="单位"></el-table-column>
|
||||
<el-table-column prop="mobile" label="电话"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="rolename" label="身份"></el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="danger" icon="el-icon-delete" @click="delLxtyDb(row)"></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(null)
|
||||
this.openJdhList = await proposal.getOpenMeeting()
|
||||
if (this.openJdhList.length > 0) {
|
||||
this.pageForm.jdhid = this.openJdhList[0].id
|
||||
this.data()
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user