DataMonthReceivedStatistics.vue
8.2 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<template>
<div class="margin-top">
<el-row>
<el-col :span="3" class="padding-r-0">
<el-card class="border-radius">
<div class="treeview attendance-staff" style="height: 650px;">
<ul class="list-group text-center border-radius">
<li v-for="(item, index) in dataMonthReceivedStatisticsInfo.feeTypeCds" :key="index"
class="list-group-item node-orgTree"
:class="{ 'vc-node-selected': dataMonthReceivedStatisticsInfo.feeTypeCd === item.statusCd }"
@click="switchMonthReceivedStatisticsFeeTypeCd(item.statusCd)">
{{ item.name }}
</li>
</ul>
</div>
</el-card>
</el-col>
<el-col :span="21">
<el-row>
<el-col :span="4">
<el-select v-model="dataMonthReceivedStatisticsInfo.floorId" :placeholder="$t('dataReport.selectBuilding')"
clearable style="width: 100%">
<el-option v-for="(item, index) in dataMonthReceivedStatisticsInfo.floors" :key="index"
:label="item.floorNum" :value="item.floorId" />
</el-select>
</el-col>
<el-col :span="4">
<el-date-picker v-model="dataMonthReceivedStatisticsInfo.feeStartDate" type="date"
:placeholder="$t('dataReport.feeStartDate')" style="width: 100%" />
</el-col>
<el-col :span="4">
<el-date-picker v-model="dataMonthReceivedStatisticsInfo.feeEndDate" type="date"
:placeholder="$t('dataReport.feeEndDate')" style="width: 100%" />
</el-col>
<el-col :span="4">
<el-button type="primary" size="small" @click="_qureyDataMonthReceivedStatistics">
<i class="el-icon-search"></i>
{{ $t('dataReport.search') }}
</el-button>
</el-col>
<el-col :span="8" class="text-right">
<el-button type="primary" size="small" @click="_exportReportMonthReceivedFeeExcel">
<i class="el-icon-download"></i>
<span>{{ $t('dataReport.export') }}</span>
</el-button>
</el-col>
</el-row>
<div class="margin-top">
<el-table :data="dataMonthReceivedStatisticsInfo.fees" border style="width: 100%">
<el-table-column prop="objName" :label="$t('dataReport.room')" align="center" />
<el-table-column :label="$t('dataReport.owner')" align="center">
<template slot-scope="scope">
{{ scope.row.ownerName }}({{ scope.row.link }})
</template>
</el-table-column>
<el-table-column prop="receivedAmount" :label="$t('dataReport.receivedAmount')" align="center">
<template slot-scope="scope">
{{ scope.row.receivedAmount || 0 }}
</template>
</el-table-column>
<el-table-column prop="feeName" :label="$t('dataReport.feeName')" align="center" />
<el-table-column prop="curYearMonth" :label="$t('dataReport.receivedPeriod')" align="center" />
<el-table-column prop="cashierName" :label="$t('dataReport.cashier')" align="center" />
<el-table-column prop="createTime" :label="$t('dataReport.paymentTime')" align="center" />
</el-table>
<el-row class="margin-top">
<el-col :span="8">
<span>{{ $t('dataReport.totalReceived') }}:</span>
<span>{{ dataMonthReceivedStatisticsInfo.feeAmount }}</span>
</el-col>
<el-col :span="16" class="text-right">
<el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
:total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
@current-change="handleCurrentChange" />
</el-col>
</el-row>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import { getDict } from '@/api/community/communityApi'
import { queryMonthReceivedDetail, exportData, queryFloors } from '@/api/report/dataReportApi'
export default {
name: 'DataMonthReceivedStatistics',
data() {
return {
dataMonthReceivedStatisticsInfo: {
fees: [],
feeTypeCds: [],
floors: [],
floorId: '',
feeStartDate: '',
feeEndDate: '',
feeTypeCd: '',
feeAmount: '0'
},
startDate: '',
endDate: '',
communityId: '',
page: {
current: 1,
size: 10,
total: 0
}
}
},
created() {
this._initMethod()
},
methods: {
open(param){
this.startDate = param.startDate
this.endDate = param.endDate
this.communityId = param.communityId
this._loadMonthReceivedFloors()
},
async _initMethod() {
try {
const data = await getDict('pay_fee_config', 'fee_type_cd_show')
this.dataMonthReceivedStatisticsInfo.feeTypeCds = data
this.dataMonthReceivedStatisticsInfo.feeTypeCd = data[0].statusCd
this.dataMonthReceivedStatisticsInfo.feeStartDate = this.startDate
this.dataMonthReceivedStatisticsInfo.feeEndDate = this.endDate
} catch (error) {
console.error('Failed to load dictionary:', error)
}
},
async _loadMonthReceivedFloors() {
try {
const params = {
page: 1,
row: 100,
communityId: this.communityId
}
const { apiFloorDataVoList } = await queryFloors(params)
this.dataMonthReceivedStatisticsInfo.floors = apiFloorDataVoList
} catch (error) {
console.error('Failed to load floors:', error)
}
},
async _loadDataMonthReceivedStatisticsData() {
try {
const params = {
page: this.page.current,
row: this.page.size,
communityId: this.communityId,
feeStartDate: this.dataMonthReceivedStatisticsInfo.feeStartDate,
feeEndDate: this.dataMonthReceivedStatisticsInfo.feeEndDate,
feeTypeCd: this.dataMonthReceivedStatisticsInfo.feeTypeCd,
floorId: this.dataMonthReceivedStatisticsInfo.floorId
}
const { data, records, sumTotal } = await queryMonthReceivedDetail(params)
this.dataMonthReceivedStatisticsInfo.fees = data
this.page.total = records
this.dataMonthReceivedStatisticsInfo.feeAmount = sumTotal
} catch (error) {
console.error('Failed to load data:', error)
}
},
async _exportReportMonthReceivedFeeExcel() {
try {
const params = {
communityId: this.communityId,
feeStartDate: this.dataMonthReceivedStatisticsInfo.feeStartDate,
feeEndDate: this.dataMonthReceivedStatisticsInfo.feeEndDate,
feeTypeCd: this.dataMonthReceivedStatisticsInfo.feeTypeCd,
floorId: this.dataMonthReceivedStatisticsInfo.floorId,
pagePath: 'dataMonthReceivedStatistics'
}
const res = await exportData(params)
this.$message.success(res.msg)
if (res.code === 0) {
this.$router.push('/pages/property/downloadTempFile?tab=下载中心')
}
} catch (error) {
console.error('Export failed:', error)
}
},
_qureyDataMonthReceivedStatistics() {
this.page.current = 1
this._loadDataMonthReceivedStatisticsData()
},
switchMonthReceivedStatisticsFeeTypeCd(_feeTypeCd) {
this.dataMonthReceivedStatisticsInfo.feeTypeCd = _feeTypeCd
this._loadDataMonthReceivedStatisticsData()
},
handleSizeChange(val) {
this.page.size = val
this._loadDataMonthReceivedStatisticsData()
},
handleCurrentChange(val) {
this.page.current = val
this._loadDataMonthReceivedStatisticsData()
}
}
}
</script>
<style scoped>
.margin-top {
margin-top: 20px;
}
.text-right {
text-align: right;
}
.padding-r-0 {
padding-right: 0;
}
.border-radius {
border-radius: 4px;
}
.list-group {
list-style: none;
padding: 0;
margin: 0;
}
.list-group-item {
padding: 10px;
cursor: pointer;
border-bottom: 1px solid #eee;
}
.list-group-item:hover {
background-color: #f5f5f5;
}
.vc-node-selected {
background-color: #409EFF;
color: white;
}
.treeview {
overflow-y: auto;
}
</style>