FeeDetailFeeObj.vue
3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<template>
<div>
<el-row :gutter="20" class="filter-wrapper">
<el-col :span="8">
<el-select v-model="payerObjType" :placeholder="$t('feeConfigDetail.selectFeeObject')" class="filter-item">
<el-option :label="$t('feeConfigDetail.house')" value="3333"></el-option>
<el-option :label="$t('feeConfigDetail.car')" value="6666"></el-option>
<el-option :label="$t('feeConfigDetail.contract')" value="7777"></el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-button type="primary" @click="loadData">{{ $t('common.search') }}</el-button>
</el-col>
</el-row>
<el-table :data="feeObjs" border style="width: 100%">
<el-table-column prop="feeId" :label="$t('feeConfigDetail.feeId')" align="center"></el-table-column>
<el-table-column :label="$t('feeConfigDetail.objectType')" align="center">
<template slot-scope="scope">
<span v-if="scope.row.payerObjType === '3333'">{{ $t('feeConfigDetail.house') }}</span>
<span v-else-if="scope.row.payerObjType === '6666'">{{ $t('feeConfigDetail.car') }}</span>
<span v-else>{{ $t('feeConfigDetail.contract') }}</span>
</template>
</el-table-column>
<el-table-column prop="payerObjName" :label="$t('feeConfigDetail.objectName')" align="center"></el-table-column>
<el-table-column prop="ownerName" :label="$t('feeConfigDetail.ownerName')" align="center"></el-table-column>
<el-table-column prop="ownerTel" :label="$t('feeConfigDetail.phone')" align="center"></el-table-column>
<el-table-column prop="createTime" :label="$t('feeConfigDetail.createTime')" align="center"></el-table-column>
</el-table>
<el-pagination class="pagination-wrapper" @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size"
layout="total, sizes, prev, pager, next, jumper" :total="pagination.total">
</el-pagination>
</div>
</template>
<script>
import { listConfigFeeObjs } from '@/api/fee/feeConfigDetailApi'
export default {
name: 'FeeDetailFeeObj',
data() {
return {
payerObjType: '',
feeObjs: [],
pagination: {
current: 1,
size: 10,
total: 0
},
configId: ''
}
},
methods: {
open(params) {
this.configId = params.configId
this.loadData()
},
switchTab(params) {
this.configId = params.configId
this.loadData()
},
async loadData() {
try {
const params = {
configId: this.configId,
payerObjType: this.payerObjType,
page: this.pagination.current,
row: this.pagination.size,
communityId: this.getCommunityId()
}
const response = await listConfigFeeObjs(params)
this.feeObjs = response.data
this.pagination.total = response.total
} catch (error) {
console.error('Failed to load fee objects:', error)
}
},
handleSizeChange(val) {
this.pagination.size = val
this.loadData()
},
handleCurrentChange(val) {
this.pagination.current = val
this.loadData()
}
}
}
</script>
<style scoped>
.filter-wrapper {
margin-bottom: 20px;
}
.filter-item {
width: 100%;
}
.pagination-wrapper {
margin-top: 20px;
text-align: right;
}
</style>