170 lines
6.7 KiB
HTML
170 lines
6.7 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
<style>
|
|
.el-table-container {
|
|
padding-top: 0;
|
|
}
|
|
</style>
|
|
|
|
<div id="app" v-cloak>
|
|
|
|
<guava ref="guava">
|
|
<template>
|
|
<el-card shadow="never">
|
|
<el-row type="flex" justify="center">
|
|
<el-select v-model="meetingId" placeholder="请选择教代会" @change="corpsPageData()"
|
|
filterable style="width: 100%">
|
|
<el-option
|
|
v-for="item in meetingOptions"
|
|
:label="item.jdhallname"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
</el-row>
|
|
</el-card>
|
|
|
|
|
|
<el-table class="mt20" :data="corpsTableData" show-summary :summary-method="getSummaries">
|
|
<el-table-column align="center" header-align="center" label="序号" type="index"></el-table-column>
|
|
<el-table-column label="代表团名称" prop="dbtname" align="center" header-align="center">
|
|
<template scope="{row}">
|
|
<el-link type="primary" @click="findProposal(row)">{{ row.dbtname }}</el-link>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="提案总数" prop="total"
|
|
sortable></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="立案数" prop="determine"
|
|
sortable></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="意见建议" prop="opinion"
|
|
sortable></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="不予立案" prop="notGive"
|
|
sortable></el-table-column>
|
|
<el-table-column align="center" header-align="center" label="立案率" prop="caseRate" sortable>
|
|
<template scope="{row}">{{row.caseRate}}%</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" header-align="center" label="撤案率" prop="withdrawRate" sortable>
|
|
<template scope="{row}">{{row.withdrawRate}}%</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<el-dialog :title="dialogTitle" :visible.sync="delegationVisible" width="70%">
|
|
|
|
<proposal-table :loading="tableLoading" :page="pageForm" :data="tableData"
|
|
@order="pageOrder" @view="openView">
|
|
</proposal-table>
|
|
|
|
<!--#include("/layouts/pagination.html"){}#-->
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<template #view>
|
|
<proposal-info ref="info"></proposal-info>
|
|
</template>
|
|
</guava>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
meetingId: '',
|
|
dialogTitle: '',
|
|
delegationVisible: false,
|
|
meetingOptions: [],
|
|
corpsTableData: [],
|
|
pageForm: {}
|
|
}
|
|
},
|
|
components: {
|
|
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
|
'proposal-info': httpVueLoader('/components/proposal/ProposalInfo.vue'),
|
|
'proposal-table': httpVueLoader('/components/proposal/ProposalTable.vue'),
|
|
},
|
|
methods: {
|
|
findProposal(row) {
|
|
this.pageForm.delegationId = row.id
|
|
this.pageData()
|
|
this.dialogTitle = row.dbtname + '所属提案'
|
|
this.delegationVisible = true
|
|
},
|
|
openView(row) {
|
|
this.$refs.guava.view()
|
|
this.$refs.info.openView(row.id)
|
|
this.delegationVisible = false
|
|
},
|
|
getSummaries(param) {
|
|
const {columns, data} = param;
|
|
const sums = [];
|
|
|
|
columns.forEach((column, index) => {
|
|
if (index === 0) {
|
|
sums[index] = this.corpsTableData.length + 1;
|
|
return;
|
|
} else if (index === 1) {
|
|
sums[index] = '合计';
|
|
return;
|
|
}
|
|
const values = data.map(item => Number(item[column.property]));
|
|
|
|
if (!values.every(value => isNaN(value))) {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
const value = Number(curr);
|
|
if (!isNaN(value)) {
|
|
return prev + curr;
|
|
} else {
|
|
return prev;
|
|
}
|
|
}, 0);
|
|
|
|
|
|
if (index === 6) {
|
|
let a = ((sums[3] + sums[4]) / sums[2]) * 100
|
|
sums[index] = isNaN(a) ? 0 + ' %' : (a).toFixed(1) + ' %';
|
|
}
|
|
|
|
if (index === 7) {
|
|
let b = (sums[5] / sums[2]) * 100
|
|
sums[index] = isNaN(b) ? 0 + ' %' : (b).toFixed(1) + ' %';
|
|
}
|
|
} else {
|
|
sums[index] += 'NaN';
|
|
}
|
|
});
|
|
return sums;
|
|
},
|
|
async corpsPageData() {
|
|
sublime.showLoadingbar();
|
|
this.tableLoading = true
|
|
|
|
const resp = await $.post(loc() + "/corpsPageData", {meetingId: this.meetingId})
|
|
const {data, msg} = resp
|
|
|
|
sublime.closeLoadingbar();
|
|
this.tableLoading = false
|
|
if(resp.code===0){
|
|
data.forEach(v => {
|
|
v.caseRate = ((v.determine + v.opinion) / v.total) * 100
|
|
v.withdrawRate = (v.notGive / v.total) * 100
|
|
v.caseRate = isNaN(v.caseRate) ? 0 : v.caseRate.toFixed(1)
|
|
v.withdrawRate = isNaN(v.withdrawRate) ? 0 : v.withdrawRate.toFixed(1)
|
|
})
|
|
this.corpsTableData = data;
|
|
}else{
|
|
this.notifyWarning(resp.msg)
|
|
}
|
|
}
|
|
},
|
|
async created() {
|
|
this.meetingOptions = await proposal.getAllMeeting()
|
|
this.meetingId = this.meetingOptions.length ? this.meetingOptions[0].id : ''
|
|
await this.corpsPageData();
|
|
}
|
|
})
|
|
</script>
|
|
<!--#
|
|
}
|
|
#--> |