parkingReallyIncome.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!--
  2. * @Description: 统计报表 => 停车场实收统计
  3. * @Author: 空白格
  4. * @Date: 2022-08-03 13:30:32
  5. * @LastEditors: 空白格
  6. * @LastEditTime: 2022-08-03 13:30:33
  7. * @FilePath: \parking_operation\pages\statisticalReport\parkModel\components\parkingReallyIncome.vue
  8. * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
  9. -->
  10. <template>
  11. <view class="container">
  12. <view class="table">
  13. <!-- <view class="table-date" v-if="currentDate">{{ currentDate.join(' 至 ') }}</view> -->
  14. <view class="table-box">
  15. <TableRanking :loading="loading" :tableTh="tableTh" :tableData="tableData"
  16. @pageChange="pageChange" />
  17. </view>
  18. </view>
  19. <view class="total">
  20. <view>
  21. 停车数量<text>{{ totalData.vehicleCount || 0 }}</text>辆,实收金额<text>{{ totalData.realAmount || 0 }}</text>元
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import TableRanking from '@/components/tableRanking.vue'
  28. export default {
  29. components: {
  30. TableRanking
  31. },
  32. props: {
  33. tableTh: {
  34. type: Array,
  35. default: () => {
  36. return [{
  37. field: '停车场名称',
  38. width: 120,
  39. key: 'parkingName'
  40. },
  41. {
  42. field: '停车数量(次)',
  43. width: 120,
  44. key: 'vehicleCount'
  45. },
  46. {
  47. field: '实收金额(元)',
  48. width: 80,
  49. key: 'realAmount'
  50. }
  51. ]
  52. }
  53. }
  54. },
  55. data() {
  56. return {
  57. loading: false,
  58. tableData: {
  59. current: 1,
  60. total: 0,
  61. list: []
  62. },
  63. totalData: {},
  64. currentDate: [],
  65. beginTime: undefined,
  66. endTime: undefined
  67. }
  68. },
  69. methods: {
  70. getData(data) {
  71. if (data.length) {
  72. this.beginTime = data[0]
  73. this.endTime = data[1]
  74. }
  75. this.currentDate = data
  76. this.tableData.current = 1
  77. this.getList();
  78. this.getTotal();
  79. },
  80. getList() {
  81. this.loading = true
  82. uni.$u.api.statisticalReportApi.getParkingReallyIncomeApi({
  83. pageNum: this.tableData.current,
  84. pageSize: 10,
  85. sortField: 'realAmount',
  86. sortOrder: 'desc',
  87. beginTime: this.beginTime,
  88. endTime: this.endTime
  89. }).then(res => {
  90. if (res.code === 200) {
  91. this.tableData.list = res.rows
  92. this.tableData.total = res.total
  93. }
  94. this.loading = false
  95. })
  96. },
  97. getTotal() {
  98. uni.$u.api.statisticalReportApi.getParkingReallyIncomeTotalApi({
  99. beginTime: this.beginTime,
  100. endTime: this.endTime
  101. }).then(res => {
  102. if (res.code === 200) {
  103. const { realAmount, vehicleCount } = res.data
  104. this.totalData.realAmount = realAmount
  105. this.totalData.vehicleCount = vehicleCount
  106. }
  107. })
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. @import './../../styles/report.scss';
  114. </style>