arrearsReport.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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
  8. :loading="loading"
  9. :tableTh="tableTh"
  10. :tableData="tableData"
  11. @pageChange="pageChange"
  12. />
  13. </view>
  14. </view>
  15. <view class="total">
  16. <view>
  17. 欠费次数
  18. <text>{{ totalData.oweCount || 0 }}</text>次,欠费金额
  19. <text>{{ totalData.amtOwe || 0 }}</text>元
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import TableRanking from '@/components/tableRanking.vue';
  26. export default {
  27. components: {
  28. TableRanking
  29. },
  30. props: {
  31. tableTh: {
  32. type: Array,
  33. default: () => {
  34. return [
  35. { field: '车牌号', key: 'vehicleNo', width: 100 },
  36. { field: '车主姓名', key: 'name', width: 100 },
  37. { field: '联系方式', key: 'mobile', width: 100 },
  38. { field: '欠费次数(次)', width: 80, key: 'oweCount' },
  39. { field: '欠费金额(元)', width: 80, key: 'amtOwe' }
  40. ];
  41. }
  42. }
  43. },
  44. data() {
  45. return {
  46. loading: false,
  47. totalData: {},
  48. tableData: {
  49. current: 1,
  50. total: 0,
  51. list: []
  52. },
  53. currentDate: [],
  54. beginTime: undefined,
  55. endTime: undefined
  56. };
  57. },
  58. methods: {
  59. tabClick(item) {
  60. this.tabCurName = item.value;
  61. this.tableData.current = 1;
  62. this.getArreasReportTotal();
  63. this.getArreasReportList();
  64. },
  65. getData(data) {
  66. if (data.length) {
  67. this.beginTime = data[0];
  68. this.endTime = data[1];
  69. }
  70. this.currentDate = data;
  71. this.tableData.current = 1;
  72. this.getArreasReportTotal();
  73. this.getArreasReportList();
  74. },
  75. getArreasReportTotal() {
  76. uni.$u.api.statisticalReportApi
  77. .getArrearsReportTotalApi({
  78. beginTime: this.beginTime,
  79. endTime: this.endTime
  80. })
  81. .then((res) => {
  82. if (res.code === 200) {
  83. this.totalData = res.data;
  84. }
  85. });
  86. },
  87. getArreasReportList() {
  88. this.loading = true;
  89. uni.$u.api.statisticalReportApi
  90. .getArrearsReportListApi({
  91. beginTime: this.beginTime,
  92. endTime: this.endTime,
  93. pageNum: this.tableData.current,
  94. pageSize: 10
  95. })
  96. .then((res) => {
  97. if (res.code === 200) {
  98. this.tableData.list = res.rows;
  99. this.tableData.total = res.total;
  100. }
  101. this.loading = false;
  102. });
  103. },
  104. pageChange(cur) {
  105. this.tableData.current = cur;
  106. this.getArreasReportList();
  107. }
  108. }
  109. };
  110. </script>
  111. <style lang="scss" scoped>
  112. @import './../../styles/report.scss';
  113. .tab {
  114. margin-bottom: 10px;
  115. }
  116. </style>