first commit
This commit is contained in:
@@ -0,0 +1,143 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-table__footer-wrapper td{
|
||||
color: orangered!important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<el-row class="header navbar bg-white shadow">
|
||||
<div class="tool-button mt5">
|
||||
<el-select v-model="pageForm.hdid" @change="hdChange" style="width: 100%">
|
||||
<el-option v-for="i in hdOptions" :label="i.name" :value="i._id" :key="i._id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" show-summary>
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="unionname" label="院级工会"></el-table-column>
|
||||
<el-table-column prop="ybmnum" label="报名人数" sortable>
|
||||
<template slot-scope="{row}">
|
||||
<span class="text-primary pointer" @click="bmNumClick(row.ybm)">
|
||||
{{row.ybmnum}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="signnum" label="参加人数" sortable>
|
||||
<template slot-scope="{row}">
|
||||
<span class="text-primary pointer" @click="signNumClick(row.sign)">
|
||||
{{row.signnum}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-dialog title="详情" :visible.sync="detailVisible">
|
||||
<el-table :data="bmTableData.length===0?signTableData:bmTableData" height="450px">
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="loginname" label="工号"></el-table-column>
|
||||
<el-table-column prop="username" label="姓名"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="birthday" label="生日"></el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
let vue = new Vue({
|
||||
el:'#app',
|
||||
data(){
|
||||
return{
|
||||
tableData:[],
|
||||
bmTableData:[],
|
||||
signTableData:[],
|
||||
unionOptions:[],
|
||||
hdOptions:[],
|
||||
pageForm:{
|
||||
hdid:'',
|
||||
pageNumber:1,
|
||||
pageSize:10,
|
||||
totalCount:0
|
||||
},
|
||||
detailVisible:false
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
async getAllUnion(){
|
||||
const {data} = await GET('/platform/jsz/cxtj/union/getAllUnion',{})
|
||||
this.unionOptions = data
|
||||
this.pageForm.totalCount = this.unionOptions.length
|
||||
},
|
||||
async getUnionNumData(){
|
||||
if(this.hdOptions.length>0){
|
||||
const {data:{ybmlist,signlist}} = await POST('/platform/jsz/cxtj/union/pageData',this.pageForm,true)
|
||||
let signlist2 = QC(signlist,[],'loginname')
|
||||
this.compileData(ybmlist,signlist2)
|
||||
}
|
||||
},
|
||||
async getAllHd(){
|
||||
const {data} = await GET('/jsz/common/getAllHd',{})
|
||||
this.hdOptions = data
|
||||
if(this.hdOptions.length>0){
|
||||
this.pageForm.hdid = this.hdOptions[0]._id
|
||||
}
|
||||
},
|
||||
compileData(ybmlist,signlist){
|
||||
console.log(ybmlist)
|
||||
console.log(signlist)
|
||||
this.tableData= []
|
||||
for(let gh of this.unionOptions){
|
||||
let o = {}
|
||||
o.unionname = gh.unionname
|
||||
const s = ybmlist.filter(o=>{return o.unionid === gh.id})
|
||||
o.ybmnum = s.length
|
||||
o.ybm = s
|
||||
const b = signlist.filter(o=>{return o.unionid === gh.id})
|
||||
o.sign = b
|
||||
o.signnum = b.length
|
||||
this.tableData.push(o)
|
||||
}
|
||||
},
|
||||
hdChange(hdid){
|
||||
this.pageForm.hdid = hdid
|
||||
this.getUnionNumData()
|
||||
},
|
||||
bmNumClick(data){
|
||||
this.signTableData = []
|
||||
this.bmTableData = data
|
||||
this.detailVisible = true
|
||||
},
|
||||
signNumClick(data){
|
||||
console.log(data)
|
||||
this.bmTableData = []
|
||||
this.signTableData = data
|
||||
this.detailVisible = true
|
||||
},
|
||||
groupBy (array, name) {
|
||||
const groups = {}
|
||||
array.forEach(function (o) {
|
||||
const group = JSON.stringify(o[name])
|
||||
groups[group] = groups[group] || []
|
||||
groups[group].push(o)
|
||||
})
|
||||
return Object.keys(groups).map(function (group) {
|
||||
return groups[group]
|
||||
})
|
||||
}
|
||||
},
|
||||
async created(){
|
||||
this.getAllUnion()
|
||||
await this.getAllHd()
|
||||
await this.getUnionNumData()
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user