parkingReallyIncome.vue 2.3 KB

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