239 lines
9.5 KiB
HTML
239 lines
9.5 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
<div id="app" v-cloak>
|
|
<guava>
|
|
<el-card shadow="never">
|
|
<div class="btn-group tool-button">
|
|
<el-select placeholder="捐款项目" v-model="pageForm.contributionName"
|
|
style="width: 100%;"
|
|
clearable="true"
|
|
filterable="true">
|
|
<el-option v-for="item in contributionOption" :label="item.contributionName"
|
|
:value="item.contributionName"></el-option>
|
|
</el-select>
|
|
</div>
|
|
<div class="btn-group tool-button">
|
|
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
|
|
clearable="true"
|
|
@change="flushUnits" @clear="flushUnits"
|
|
|
|
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
|
|
|
|
filterable="true">
|
|
<el-option v-for="item in unions" :label="item.unionname"
|
|
:value="item.id"></el-option>
|
|
</el-select>
|
|
</div>
|
|
|
|
<div class="btn-group tool-button">
|
|
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
|
|
clearable="true"
|
|
filterable="true">
|
|
<el-option v-for="item in units" :label="item.name"
|
|
:value="item.id"></el-option>
|
|
</el-select>
|
|
</div>
|
|
<div class="btn-group tool-button">
|
|
<el-select placeholder="捐款方式" v-model="pageForm.payMode" style="width: 100%;"
|
|
clearable="true"
|
|
filterable="true">
|
|
<el-option label="微信" value="WeChat"></el-option>
|
|
<el-option label="支付宝" value="Alipay"></el-option>
|
|
</el-select>
|
|
</div>
|
|
<div class="btn-group tool-button">
|
|
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
|
</div>
|
|
<div class="pull-right offscreen-right">
|
|
<el-button type="primary" icon="el-icon-search" @click="doExport">导出</el-button>
|
|
</div>
|
|
</el-card>
|
|
|
|
|
|
<el-card shadow="never" class="mt20">
|
|
<table-tool label="捐款列表" :app="this">
|
|
|
|
</table-tool>
|
|
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
|
:size="tableSize"
|
|
show-summary :summary-method="getSummaries">
|
|
<el-table-column align="center" header-align="center" label="序号" width="120px">
|
|
<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"
|
|
v-for="column in tableColumns"
|
|
show-overflow-tooltip
|
|
:label="column.label"
|
|
:prop="column.prop"
|
|
sortable
|
|
>
|
|
<template v-if="column.prop=='payMode'" scope="{row}">
|
|
{{row.payMode==='WeChat'?'微信':'支付宝'}}
|
|
</template>
|
|
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="200">
|
|
<template slot-scope="{row}">
|
|
<el-button size="mini" type="primary"
|
|
@click="openView(row)">
|
|
查看
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<!--#include("/layouts/pagination.html"){}#-->
|
|
</el-card>
|
|
</guava>
|
|
|
|
<el-dialog
|
|
title="捐款详情"
|
|
:visible.sync="viewDialogVisible"
|
|
width="50%"
|
|
:close-on-click-modal="false">
|
|
|
|
<el-descriptions class="margin-top" title="" :column="3" border>
|
|
<el-descriptions-item label="捐款项目">
|
|
{{viewData.contributionName}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="捐款人工号">
|
|
{{viewData.loginname}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="姓名">
|
|
{{viewData.username}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="联系方式">
|
|
{{viewData.mobile}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="所属工会">
|
|
{{viewData.unionname}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="所属单位">
|
|
{{viewData.unitname}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="善款金额">
|
|
{{viewData.money}}元
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="捐款方式">
|
|
{{viewData.payMode==='WeChat'?'微信':'支付宝'}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="捐款时间">
|
|
{{viewData.contributionTime}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="捐款凭证">
|
|
<file-upload :files="viewData.contributionFiles" :view="true">
|
|
</file-upload>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="viewDialogVisible = false">关 闭</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
viewData: {},
|
|
viewDialogVisible: false,
|
|
contributionOption: [],
|
|
unions: [],
|
|
units: [],
|
|
pageForm: {
|
|
contributionName: '',
|
|
unionId: '',
|
|
unitId: '',
|
|
payMode: ''
|
|
},
|
|
tableColumns: [
|
|
{prop: 'contributionName', label: '捐款项目'},
|
|
{prop: 'loginname', label: '捐款人工号'},
|
|
{prop: 'username', label: '姓名'},
|
|
{prop: 'mobile', label: '联系方式'},
|
|
{prop: 'unionname', label: '所属工会'},
|
|
{prop: 'unitname', label: '所属单位'},
|
|
{prop: 'money', label: '善款金额'},
|
|
{prop: 'payMode', label: '捐款方式'},
|
|
{prop: 'contributionTime', label: '捐款时间'},
|
|
],
|
|
}
|
|
},
|
|
methods: {
|
|
openView(row) {
|
|
const rowc = clone(row)
|
|
rowc.contributionFiles = JSON.parse(rowc.contributionFiles)
|
|
this.viewData = rowc
|
|
this.viewDialogVisible = true
|
|
},
|
|
doExport() {
|
|
const {unionId, unitId, payMode, contributionName} = this.pageForm
|
|
window.location.href = loc() + "/doExport?unionId=" + unionId + "&unitId=" + unitId + "&payMode=" + payMode + "&contributionName=" + contributionName
|
|
},
|
|
async flushUnits() {
|
|
this.$set(this.pageForm, "unitId", "")
|
|
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
|
this.units = await getUnits(this.pageForm.unionId)
|
|
} else {
|
|
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
|
}
|
|
},
|
|
async getContribution() {
|
|
const data = await $.get("/platform/contribution/list/getContribution")
|
|
return data
|
|
},
|
|
getSummaries(param) {
|
|
const {columns, data} = param;
|
|
const sums = [];
|
|
columns.forEach((column, index) => {
|
|
if (index === 0) {
|
|
sums[index] = '总额';
|
|
return;
|
|
}
|
|
if (index !== 7) {
|
|
sums[index] = null;
|
|
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 Math.floor((prev + curr) * 100) / 100;
|
|
} else {
|
|
return prev;
|
|
}
|
|
}, 0);
|
|
sums[index] += ' 元';
|
|
} else {
|
|
sums[index] = null;
|
|
}
|
|
});
|
|
|
|
return sums;
|
|
}
|
|
},
|
|
async created() {
|
|
this.unions = await getUnions(null)
|
|
this.contributionOption = await this.getContribution()
|
|
this.flushUnits()
|
|
this.pageData()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
|
|
<!--#
|
|
}
|
|
#-->
|