revenueRanking.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!-- 路段/停车场营收排行 -->
  2. <template>
  3. <view class="ranking">
  4. <TableRanking :loading="loading" :title="title" :tableTh="tableTh" :tableData="tableData" @pageChange="pageChange"/>
  5. </view>
  6. </template>
  7. <script>
  8. import TableRanking from '@/components/tableRanking.vue'
  9. export default {
  10. components: {
  11. TableRanking
  12. },
  13. props: {
  14. title: {
  15. type: String,
  16. default: ''
  17. },
  18. tableTh: {
  19. type: Array,
  20. default: () => [
  21. { width: 100, field: '路段编号', key: 'roadNo' },
  22. { width: 100, field: '路段名称', key: 'roadName' },
  23. { width: 100, field: '收益(元)', key: 'amt' }
  24. ]
  25. }
  26. },
  27. data() {
  28. return {
  29. tableData: {
  30. current: 1,
  31. total: 0,
  32. list: []
  33. },
  34. reportType: '',
  35. queryDate: '',
  36. loading: false
  37. }
  38. },
  39. methods: {
  40. getData({ reportType, queryDate }) {
  41. this.reportType = reportType
  42. this.queryDate = queryDate
  43. this.tableData.current = 1
  44. this.getList()
  45. },
  46. getList() {
  47. this.loading = true
  48. uni.$u.api.operationalAnalysisApi.getParkingLotRevenueDataApi({
  49. pageNum: this.tableData.current,
  50. pageSize: 10,
  51. reportType: this.reportType,
  52. queryDate: this.queryDate
  53. }).then(res => {
  54. console.log(res)
  55. if (res.code === 200) {
  56. this.tableData.list = res.rows
  57. this.tableData.total = res.total
  58. }
  59. this.loading = false
  60. }).catch(() => {
  61. this.loading = false
  62. })
  63. },
  64. pageChange(current) {
  65. this.tableData.current = current
  66. this.getList()
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .ranking-title {
  73. text-align: center;
  74. margin-bottom: 10px;
  75. }
  76. </style>