arrearsReport.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.oweCount || 0 }}</text>次,欠费金额<text>{{ totalData.amtOwe || 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: '车牌号', key: 'vehicleNo', width: 100 },
  30. { field: '车主姓名', key: 'name', width: 100 },
  31. { field: '联系方式', key: 'mobile', width: 100 },
  32. { field: '欠费次数(次)', width: 80, key: 'oweCount' },
  33. { field: '欠费金额(元)', width: 80, key: 'amtOwe' }
  34. ]
  35. }
  36. }
  37. },
  38. data() {
  39. return {
  40. loading: false,
  41. totalData: {},
  42. tableData: {
  43. current: 1,
  44. total: 0,
  45. list: []
  46. },
  47. currentDate: [],
  48. beginTime: undefined,
  49. endTime: undefined
  50. }
  51. },
  52. methods: {
  53. getData(data) {
  54. if (data.length) {
  55. this.beginTime = data[0]
  56. this.endTime = data[1]
  57. }
  58. this.currentDate = data
  59. this.tableData.current = 1
  60. this.getArreasReportTotal()
  61. this.getArreasReportList()
  62. },
  63. getArreasReportTotal() {
  64. uni.$u.api.statisticalReportApi.getArrearsReportTotalApi({
  65. beginTime: this.beginTime,
  66. endTime: this.endTime
  67. }).then(res => {
  68. if (res.code === 200) {
  69. this.totalData = res.data
  70. }
  71. })
  72. },
  73. getArreasReportList() {
  74. this.loading = true
  75. uni.$u.api.statisticalReportApi.getArrearsReportListApi({
  76. beginTime: this.beginTime,
  77. endTime: this.endTime,
  78. pageNum: this.tableData.current,
  79. pageSize: 10
  80. }).then(res => {
  81. if (res.code === 200) {
  82. this.tableData.list = res.rows
  83. this.tableData.total = res.total
  84. }
  85. this.loading = false
  86. })
  87. },
  88. pageChange(cur) {
  89. this.tableData.current = cur
  90. this.getArreasReportList()
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. @import './report.scss';
  97. </style>