reallyReceivable.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!-- 应收实收分析 -->
  2. <template>
  3. <view class="container">
  4. <view class="tab">
  5. <u-tabs
  6. :list="tabList"
  7. lineColor="#fff"
  8. :activeStyle="{
  9. color: '#fff',
  10. fontWeight: 'bold',
  11. transform: 'scale(1.05)'
  12. }"
  13. :inactiveStyle="{
  14. color: '#000',
  15. transform: 'scale(1)'
  16. }"
  17. @click="tabClick">
  18. </u-tabs>
  19. </view>
  20. <view class="table">
  21. <view class="table-date" v-if="params.queryDate">{{ params.title }}</view>
  22. <view class="table-box">
  23. <uni-table emptyText="暂无更多数据" :loading="loading">
  24. <!-- 表头行 -->
  25. <uni-tr>
  26. <uni-th class="table-box-th" align="center" v-for="(item, index) in tableTh" :key="index"
  27. :width="item.width || ''">{{ item.field }}
  28. </uni-th>
  29. </uni-tr>
  30. <!-- 表格数据行 -->
  31. <uni-tr v-for="(item, index) in tableData.list" :key="index">
  32. <uni-td class="table-box-td" align="center" v-for="(field, fIndex) in tableTh" :key="fIndex">
  33. {{ item[field.key] }}</uni-td>
  34. </uni-tr>
  35. </uni-table>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. props: {
  43. tableTh: {
  44. type: Array,
  45. default: () => {
  46. return [{
  47. field: '时间',
  48. width: 120,
  49. key: 'statisTime'
  50. },
  51. {
  52. field: '应收金额(元)',
  53. width: 80,
  54. key: 'payAmount'
  55. },
  56. {
  57. field: '实收金额(元)',
  58. width: 80,
  59. key: 'realAmount'
  60. },
  61. {
  62. field: '逃费金额(元)',
  63. width: 80,
  64. key: 'runawayAmount'
  65. },
  66. {
  67. field: `“一分钱停车”减免`,
  68. width: 120,
  69. key: 'oneAmount'
  70. },
  71. {
  72. field: '“八折停车”减免',
  73. width: 110,
  74. key: 'eightAmount'
  75. },
  76. {
  77. field: '欠费金额(元)',
  78. width: 80,
  79. key: 'amtOwe'
  80. },
  81. {
  82. field: '退款金额(元)',
  83. width: 80,
  84. key: 'backAmount'
  85. }
  86. ]
  87. }
  88. }
  89. },
  90. data() {
  91. return {
  92. currentDate: [],
  93. tableData: {
  94. list: []
  95. },
  96. params: {
  97. reportType: 2,
  98. queryDate: '',
  99. title: ''
  100. },
  101. loading: false,
  102. tabCurName: 'road',
  103. tabList: [
  104. { name: '路段', value: 'road' },
  105. { name: '停车场', value: 'parking' }
  106. ]
  107. }
  108. },
  109. methods: {
  110. tabClick(item) {
  111. this.tabCurName = item.value
  112. if (this.tabCurName === 'road') {
  113. this.getReallyReceivableList()
  114. } else {
  115. this.getParkingReallyReceivableList()
  116. }
  117. },
  118. getData(obj) {
  119. this.params = obj
  120. this.getReallyReceivableList()
  121. },
  122. getReallyReceivableList() {
  123. this.loading = true
  124. uni.$u.api.statisticalReportApi.getReallyReceivableListApi(this.params).then(res => {
  125. if (res.code === 200) {
  126. this.tableData.list = res.data.itemList
  127. }
  128. this.loading = false
  129. })
  130. },
  131. getParkingReallyReceivableList() {
  132. this.loading = true
  133. uni.$u.api.statisticalReportApi.getParkingReallyReceivableListApi(this.params).then(res => {
  134. if (res.code === 200) {
  135. this.tableData.list = res.data.itemList
  136. }
  137. this.loading = false
  138. })
  139. }
  140. }
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. @import './report.scss';
  145. </style>