Blame view

src/views/report/reportPayFeeDetailList.vue 18.3 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
95629508   wuxw   继续开发报表功能
2
3
4
5
6
7
8
9
10
11
12
13
    <div class="report-pay-fee-detail-container animated fadeInRight">
      <!-- 查询条件 -->
      <el-card class="search-card">
        <div slot="header" class="flex justify-between">
          <span>{{ $t('reportPayFeeDetail.search.title') }}</span>
          <el-button type="text" style="float: right; padding: 3px 0" @click="_moreCondition()">
            {{ reportPayFeeDetailInfo.moreCondition ? $t('reportPayFeeDetail.hide') : $t('reportPayFeeDetail.more') }}
          </el-button>
        </div>
  
        <el-row :gutter="20">
          <el-col :span="4">
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
14
15
16
            <el-date-picker v-model="reportPayFeeDetailInfo.conditions.startTime" type="datetime"
              value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('reportPayFeeDetail.search.startTime')"
              style="width: 100%" />
95629508   wuxw   继续开发报表功能
17
18
19
          </el-col>
  
          <el-col :span="4">
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
20
21
22
            <el-date-picker v-model="reportPayFeeDetailInfo.conditions.endTime" type="datetime"
              value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('reportPayFeeDetail.search.endTime')"
              style="width: 100%" @change="validateDate" />
95629508   wuxw   继续开发报表功能
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
          </el-col>
  
          <el-col :span="4">
            <el-select v-model="reportPayFeeDetailInfo.conditions.primeRate"
              :placeholder="$t('reportPayFeeDetail.search.paymentMethod')" style="width: 100%" clearable>
              <el-option v-for="(item, index) in reportPayFeeDetailInfo.primeRates" :key="index" :label="item.name"
                :value="item.statusCd" />
            </el-select>
          </el-col>
  
          <el-col :span="4">
            <el-select v-model="reportPayFeeDetailInfo.conditions.state"
              :placeholder="$t('reportPayFeeDetail.search.feeStatus')" style="width: 100%" clearable>
              <el-option v-for="(item, index) in reportPayFeeDetailInfo.states" :key="index" :label="item.name"
                :value="item.statusCd" />
            </el-select>
          </el-col>
  
          <el-col :span="4">
            <el-input v-model="reportPayFeeDetailInfo.conditions.payerObjName"
              :placeholder="$t('reportPayFeeDetail.search.roomOrCarNum')" clearable />
          </el-col>
  
          <el-col :span="4">
            <el-button type="primary" @click="_queryMethod()">
              {{ $t('common.search') }}
            </el-button>
            <el-button @click="_resetMethod()">
              <i class="el-icon-refresh"></i>
              {{ $t('common.reset') }}
            </el-button>
          </el-col>
        </el-row>
  
        <!-- 更多查询条件 -->
        <el-row v-show="reportPayFeeDetailInfo.moreCondition" :gutter="20" style="margin-top: 20px">
          <el-col :span="4">
            <el-select v-model="reportPayFeeDetailInfo.conditions.feeTypeCd"
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
61
62
              :placeholder="$t('reportPayFeeDetail.search.feeType')" style="width: 100%" clearable
              @change="_selectConfig">
95629508   wuxw   继续开发报表功能
63
64
65
66
67
68
69
70
71
72
73
74
75
76
              <el-option v-for="(item, index) in reportPayFeeDetailInfo.feeTypeCds" :key="index" :label="item.name"
                :value="item.statusCd" />
            </el-select>
          </el-col>
  
          <el-col :span="4">
            <el-select v-model="reportPayFeeDetailInfo.conditions.configId"
              :placeholder="$t('reportPayFeeDetail.search.feeItem')" style="width: 100%" clearable>
              <el-option v-for="(item, index) in reportPayFeeDetailInfo.feeConfigDtos" :key="index" :label="item.feeName"
                :value="item.configId" />
            </el-select>
          </el-col>
  
          <el-col :span="4">
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
77
78
79
            <el-date-picker v-model="reportPayFeeDetailInfo.conditions.feeStartTime" type="datetime"
              value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('reportPayFeeDetail.search.feeStartTime')"
              style="width: 100%" />
95629508   wuxw   继续开发报表功能
80
81
82
          </el-col>
  
          <el-col :span="4">
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
83
84
85
            <el-date-picker v-model="reportPayFeeDetailInfo.conditions.feeEndTime" type="datetime"
              value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('reportPayFeeDetail.search.feeEndTime')"
              style="width: 100%" />
95629508   wuxw   继续开发报表功能
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
          </el-col>
        </el-row>
  
        <el-row v-show="reportPayFeeDetailInfo.moreCondition && reportPayFeeDetailInfo.communitys.length > 1" :gutter="20"
          style="margin-top: 20px">
          <el-col :span="4">
            <el-select v-model="reportPayFeeDetailInfo.conditions.communityId"
              :placeholder="$t('reportPayFeeDetail.search.community')" style="width: 100%" clearable
              @change="_changCommunity">
              <el-option v-for="(item, index) in reportPayFeeDetailInfo.communitys" :key="index" :label="item.name"
                :value="item.communityId" />
            </el-select>
          </el-col>
        </el-row>
      </el-card>
  
      <!-- 缴费明细表 -->
      <el-card class="table-card">
        <div slot="header" class="flex justify-between">
          <div>
            <span>{{ $t('reportPayFeeDetail.table.title') }}</span>
            <el-tooltip effect="dark" :content="$t('reportPayFeeDetail.table.tooltip')" placement="top">
              <i class="el-icon-info" style="margin-left: 10px; cursor: pointer"></i>
            </el-tooltip>
          </div>
          <el-button type="primary" size="small" style="float: right" @click="_exportFee">
            {{ $t('common.export') }}
          </el-button>
        </div>
  
        <el-table :data="reportPayFeeDetailInfo.fees" border style="width: 100%" v-loading="loading">
          <el-table-column prop="oId" :label="$t('reportPayFeeDetail.table.orderNum')" align="center" />
          <el-table-column :label="$t('reportPayFeeDetail.table.roomOwner')" align="center" width="120">
            <template slot-scope="scope">
              <div>{{ scope.row.payerObjName }}/{{ scope.row.ownerName }}</div>
            </template>
          </el-table-column>
          <el-table-column :label="$t('reportPayFeeDetail.table.feeTypeItem')" align="center">
            <template slot-scope="scope">
              {{ scope.row.feeTypeCdName }}>{{ scope.row.feeName }}
            </template>
          </el-table-column>
          <el-table-column prop="stateName" :label="$t('reportPayFeeDetail.table.feeStatus')" align="center" />
          <el-table-column prop="primeRate" :label="$t('reportPayFeeDetail.table.paymentMethod')" align="center" />
          <el-table-column :label="$t('reportPayFeeDetail.table.paymentPeriod')" align="center" width="150">
            <template slot-scope="scope">
              <div>{{ dateFormat(scope.row.startTime) }}</div>
              <div>~</div>
              <div>{{ dateFormat(scope.row.endTime) }}</div>
            </template>
          </el-table-column>
          <el-table-column prop="createTime" :label="$t('reportPayFeeDetail.table.paymentTime')" align="center" />
          <el-table-column prop="cashierName" :label="$t('reportPayFeeDetail.table.cashier')" align="center" />
          <el-table-column :label="$t('reportPayFeeDetail.table.payableAmount')" align="center">
            <template slot-scope="scope">
              {{ scope.row.payableAmount }}/{{ scope.row.receivableAmount }}
            </template>
          </el-table-column>
          <el-table-column prop="receivedAmount" :label="$t('reportPayFeeDetail.table.receivedAmount')" align="center" />
          <el-table-column prop="withholdAmount" :label="$t('reportPayFeeDetail.table.withholdAmount')" align="center" />
          <el-table-column :label="$t('reportPayFeeDetail.table.preferentialAmount')" align="center">
            <template slot-scope="scope">
              {{ scope.row.preferentialAmount }}/{{ scope.row.deductionAmount }}
            </template>
          </el-table-column>
          <el-table-column prop="giftAmount" :label="$t('reportPayFeeDetail.table.giftAmount')" align="center" />
          <el-table-column prop="lateFee" :label="$t('reportPayFeeDetail.table.lateFee')" align="center" />
          <el-table-column prop="builtUpArea" :label="$t('reportPayFeeDetail.table.area')" align="center" />
          <el-table-column prop="psName" :label="$t('reportPayFeeDetail.table.parkingSpace')" align="center" />
f804bf62   wuxw   报表功能测试完成
155
          <el-table-column prop="remark" :label="$t('reportPayFeeDetail.table.remark')" align="center" width="100" />
95629508   wuxw   继续开发报表功能
156
157
158
        </el-table>
  
        <!-- 统计信息 -->
f804bf62   wuxw   报表功能测试完成
159
        <el-row class="summary-row text-left">
95629508   wuxw   继续开发报表功能
160
161
162
163
164
165
166
167
168
169
170
          <el-col :span="24">
            <el-row>
              <el-col :span="2">{{ $t('reportPayFeeDetail.summary.subtotal') }}</el-col>
              <el-col :span="4">
                <div>{{ $t('reportPayFeeDetail.summary.receivable') }}: {{ reportPayFeeDetailInfo.totalReceivableAmount }}
                  {{
                    $t('reportPayFeeDetail.summary.yuan') }}</div>
                <div>{{ $t('reportPayFeeDetail.summary.received') }}: {{ reportPayFeeDetailInfo.totalReceivedAmount }} {{
                  $t('reportPayFeeDetail.summary.yuan') }}</div>
              </el-col>
              <el-col :span="4">
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
171
172
173
                <div>{{ $t('reportPayFeeDetail.summary.preferential') }}: {{
                  reportPayFeeDetailInfo.totalPreferentialAmount
                  }}
95629508   wuxw   继续开发报表功能
174
                  {{ $t('reportPayFeeDetail.summary.yuan') }}</div>
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
175
176
177
                <div>{{ $t('reportPayFeeDetail.summary.deduction') }}: {{ reportPayFeeDetailInfo.totalDeductionAmount }}
                  {{
                    $t('reportPayFeeDetail.summary.yuan') }}</div>
95629508   wuxw   继续开发报表功能
178
179
180
181
182
183
184
185
186
187
188
              </el-col>
              <el-col :span="4">
                <div>{{ $t('reportPayFeeDetail.summary.gift') }}: {{ reportPayFeeDetailInfo.totalGiftAmount }} {{
                  $t('reportPayFeeDetail.summary.yuan') }}</div>
                <div>{{ $t('reportPayFeeDetail.summary.lateFee') }}: {{ reportPayFeeDetailInfo.totalLateFee }} {{
                  $t('reportPayFeeDetail.summary.yuan') }}</div>
              </el-col>
            </el-row>
            <el-row style="margin-top: 10px">
              <el-col :span="2">{{ $t('reportPayFeeDetail.summary.total') }}</el-col>
              <el-col :span="4">
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
189
190
191
                <div>{{ $t('reportPayFeeDetail.summary.receivable') }}: {{ reportPayFeeDetailInfo.allReceivableAmount }}
                  {{
                    $t('reportPayFeeDetail.summary.yuan') }}</div>
95629508   wuxw   继续开发报表功能
192
193
194
195
                <div>{{ $t('reportPayFeeDetail.summary.received') }}: {{ reportPayFeeDetailInfo.allReceivedAmount }} {{
                  $t('reportPayFeeDetail.summary.yuan') }}</div>
              </el-col>
              <el-col :span="4">
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
196
197
                <div>{{ $t('reportPayFeeDetail.summary.preferential') }}: {{ reportPayFeeDetailInfo.allPreferentialAmount
                  }}
95629508   wuxw   继续开发报表功能
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
                  {{ $t('reportPayFeeDetail.summary.yuan') }}</div>
                <div>{{ $t('reportPayFeeDetail.summary.deduction') }}: {{ reportPayFeeDetailInfo.allDeductionAmount }} {{
                  $t('reportPayFeeDetail.summary.yuan') }}</div>
              </el-col>
              <el-col :span="4">
                <div>{{ $t('reportPayFeeDetail.summary.gift') }}: {{ reportPayFeeDetailInfo.allGiftAmount }} {{
                  $t('reportPayFeeDetail.summary.yuan') }}</div>
                <div>{{ $t('reportPayFeeDetail.summary.lateFee') }}: {{ reportPayFeeDetailInfo.allLateFee }} {{
                  $t('reportPayFeeDetail.summary.yuan') }}</div>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
  
        <!-- 说明 -->
f804bf62   wuxw   报表功能测试完成
213
        <el-row class="text-left table-desc">
95629508   wuxw   继续开发报表功能
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
          <el-col :span="18">
            <div>{{ $t('reportPayFeeDetail.explanation.preferential') }}</div>
            <div>{{ $t('reportPayFeeDetail.explanation.deduction') }}</div>
            <div>{{ $t('reportPayFeeDetail.explanation.gift') }}</div>
            <div>{{ $t('reportPayFeeDetail.explanation.lateFee') }}</div>
          </el-col>
        </el-row>
  
        <!-- 分页 -->
        <el-pagination :current-page.sync="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper" :total="reportPayFeeDetailInfo.total"
          @size-change="handleSizeChange" @current-change="handleCurrentChange" />
      </el-card>
    </div>
  </template>
  
  <script>
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
231
  import { queryPayFeeDetail, exportData, listFeeConfigs } from '@/api/report/reportPayFeeDetailApi'
95629508   wuxw   继续开发报表功能
232
233
234
235
236
  import { getDict } from '@/api/community/communityApi'
  import { getCommunityId } from '@/api/community/communityApi'
  import {
    listMyEnteredCommunitys
  } from '@/api/report/dataReportApi'
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
237
  import { dateFormat } from '@/utils/dateUtil'
95629508   wuxw   继续开发报表功能
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
  
  export default {
    name: 'ReportPayFeeDetailList',
    data() {
      return {
        loading: false,
        currentPage: 1,
        pageSize: 10,
        reportPayFeeDetailInfo: {
          fees: [],
          total: 0,
          records: 1,
          moreCondition: false,
          primeRates: [],
          feeConfigDtos: [],
          states: [],
          feeTypeCds: [],
          floors: [],
          communitys: [],
          totalReceivableAmount: 0.0,
          totalReceivedAmount: 0.0,
          allReceivableAmount: 0.0,
          allReceivedAmount: 0.0,
          totalPreferentialAmount: 0.0,
          totalDeductionAmount: 0.0,
          totalLateFee: 0.0,
          totalGiftAmount: 0.0,
          allPreferentialAmount: 0.0,
          allDeductionAmount: 0.0,
          allLateFee: 0.0,
          allGiftAmount: 0.0,
          conditions: {
            floorId: '',
            roomNum: '',
            payerObjName: '',
            configId: '',
            primeRate: '',
            state: '',
            feeTypeCd: '',
            startTime: '',
            endTime: '',
            feeStartTime: '',
            feeEndTime: '',
            communityId: ''
          }
        }
      }
    },
    created() {
      this._initMethod()
    },
    methods: {
      async _initMethod() {
        this.reportPayFeeDetailInfo.conditions.communityId = getCommunityId()
        await this._loadStaffCommunitys()
        await this._listFees(1, this.pageSize)
  
        // 获取字典数据
        try {
          this.reportPayFeeDetailInfo.primeRates = await getDict('pay_fee_detail', 'prime_rate')
          this.reportPayFeeDetailInfo.states = await getDict('pay_fee_detail', 'state')
          this.reportPayFeeDetailInfo.feeTypeCds = await getDict('pay_fee_config', 'fee_type_cd')
        } catch (error) {
          console.error('获取字典数据失败:', error)
        }
      },
  
      async _listFees(page, rows) {
        this.loading = true
        try {
16b469fe   wuxw   v1.9 优化查询费用页面 没有数...
308
        const params = {
95629508   wuxw   继续开发报表功能
309
310
311
312
313
314
315
            ...this.reportPayFeeDetailInfo.conditions,
            page,
            row: rows
          }
  
          const { data, total, records, sumTotal } = await queryPayFeeDetail(params)
  
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
316
317
318
319
320
321
322
          if (data && data.length > 0) {
            this.reportPayFeeDetailInfo.fees = data.map(item => ({
              ...item,
              lateFee: (item.lateFee * -1).toFixed(2)
            }))
          }
  
95629508   wuxw   继续开发报表功能
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
          this.reportPayFeeDetailInfo.total = total
          this.reportPayFeeDetailInfo.records = records
  
          // 处理统计信息
          this._processSummaryData(sumTotal)
        } catch (error) {
          console.error('查询缴费明细失败:', error)
          this.$message.error(this.$t('reportPayFeeDetail.fetchError'))
        } finally {
          this.loading = false
        }
      },
  
      _processSummaryData(sumTotal) {
        const fields = [
          'totalReceivableAmount', 'totalReceivedAmount', 'allReceivableAmount', 'allReceivedAmount',
          'totalPreferentialAmount', 'totalDeductionAmount', 'totalLateFee', 'totalGiftAmount',
          'allPreferentialAmount', 'allDeductionAmount', 'allLateFee', 'allGiftAmount'
        ]
  
        fields.forEach(field => {
          this.reportPayFeeDetailInfo[field] = sumTotal[field]
            ? parseFloat(sumTotal[field]).toFixed(2)
            : '0.00'
        })
      },
  
      async _loadStaffCommunitys() {
        try {
          const params = {
            _uid: '123mlkdinkldldijdhuudjdjkkd',
            page: 1,
            row: 100
          }
          const { communitys } = await listMyEnteredCommunitys(params)
          this.reportPayFeeDetailInfo.communitys = communitys
        } catch (error) {
          console.error('获取小区列表失败:', error)
        }
      },
  
      async _selectConfig() {
        try {
          const params = {
            page: 1,
            row: 50,
            communityId: this.reportPayFeeDetailInfo.conditions.communityId,
            feeTypeCd: this.reportPayFeeDetailInfo.conditions.feeTypeCd,
            isFlag: "0"
          }
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
373
          const { feeConfigs } = await listFeeConfigs(params)
95629508   wuxw   继续开发报表功能
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
          this.reportPayFeeDetailInfo.feeConfigDtos = feeConfigs
        } catch (error) {
          console.error('获取费用项失败:', error)
        }
      },
  
      _moreCondition() {
        this.reportPayFeeDetailInfo.moreCondition = !this.reportPayFeeDetailInfo.moreCondition
      },
  
      async _exportFee() {
        try {
          const params = {
            ...this.reportPayFeeDetailInfo.conditions,
            pagePath: 'reportPayFeeDetail'
          }
  
          const { code, msg } = await exportData(params)
  
          this.$message.success(msg)
          if (code === 0) {
            this.$router.push('/pages/property/downloadTempFile?tab=下载中心')
          }
        } catch (error) {
          console.error('导出失败:', error)
          this.$message.error(this.$t('reportPayFeeDetail.exportError'))
        }
      },
  
      _changCommunity() {
        this._listFees(1, this.pageSize)
      },
  
      _queryMethod() {
        this._listFees(1, this.pageSize)
      },
  
      _resetMethod() {
        this.reportPayFeeDetailInfo.conditions = {
          floorId: '',
          roomNum: '',
          payerObjName: '',
          configId: '',
          primeRate: '',
          state: '',
          feeTypeCd: '',
          startTime: '',
          endTime: '',
          feeStartTime: '',
          feeEndTime: '',
          communityId: this.reportPayFeeDetailInfo.conditions.communityId
        }
        this._listFees(1, this.pageSize)
      },
  
      validateDate() {
        if (this.reportPayFeeDetailInfo.conditions.startTime &&
          this.reportPayFeeDetailInfo.conditions.endTime &&
          new Date(this.reportPayFeeDetailInfo.conditions.startTime) >=
          new Date(this.reportPayFeeDetailInfo.conditions.endTime)) {
          this.$message.error(this.$t('reportPayFeeDetail.dateError'))
          this.reportPayFeeDetailInfo.conditions.endTime = ''
        }
      },
  
      dateFormat,
  
      handleSizeChange(val) {
        this.pageSize = val
        this._listFees(this.currentPage, val)
      },
  
      handleCurrentChange(val) {
        this.currentPage = val
        this._listFees(val, this.pageSize)
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .report-pay-fee-detail-container {
    padding: 20px;
  
    .search-card {
      margin-bottom: 20px;
    }
  
    .table-card {
      margin-bottom: 20px;
    }
  
    .summary-row {
      margin: 20px 0;
      padding: 15px;
      background-color: #f5f7fa;
      border-radius: 4px;
    }
  
    .explanation-row {
      margin: 20px 0;
      padding: 15px;
      background-color: #f5f7fa;
      border-radius: 4px;
      color: #909399;
      font-size: 14px;
    }
  
    .el-pagination {
      margin-top: 20px;
      text-align: right;
    }
d1dc7dc5   wuxw   房屋收费 查询分页问题 默认从30...
486
487
  }
  </style>