parkingReallyIncome.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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" :padding="'0'" :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. beginTime: this.beginTime,
  86. endTime: this.endTime
  87. }).then(res => {
  88. if (res.code === 200) {
  89. this.tableData.list = res.rows
  90. this.tableData.total = res.total
  91. }
  92. this.loading = false
  93. })
  94. },
  95. getTotal() {
  96. uni.$u.api.statisticalReportApi.getParkingReallyIncomeTotalApi({
  97. beginTime: this.beginTime,
  98. endTime: this.endTime
  99. }).then(res => {
  100. if (res.code === 200) {
  101. const { realAmount, vehicleCount } = res.data
  102. this.totalData.realAmount = realAmount
  103. this.totalData.vehicleCount = vehicleCount
  104. }
  105. })
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. @import './report.scss';
  112. </style>