fleetBill.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //车队账单
  2. <template>
  3. <view class="center">
  4. <view class="list_css" v-for="(item,index) in dataList">
  5. <view class="list_css_item_top">
  6. <view class="list_css_left">{{index}}{{item.orderNo}}</view>
  7. <view class="list_css_right">{{item.payeeName}} 承运</view>
  8. </view>
  9. <view class="list_css_item_middle">
  10. <view class="list_css_left">{{item.paymentType}} {{item.amountMoney}}</view>
  11. <view class="list_css_right">账号尾号 {{item.bankNo}}</view>
  12. </view>
  13. <view class="list_css_item_lower">
  14. <view class="list_css_left">{{item.paymentDate}}</view>
  15. </view>
  16. <u-divider></u-divider>
  17. </view>
  18. <view>
  19. <u-loadmore :status="loadStatus" />
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. mapState
  26. } from 'vuex';
  27. export default {
  28. data() {
  29. return {
  30. //分页
  31. currentPage: 1,
  32. pageSize: 10,
  33. dataList: [],
  34. loadStatus: "",
  35. isLoadMore: false
  36. }
  37. },
  38. onLoad() {
  39. this.getList()
  40. },
  41. onShow() {},
  42. //下拉刷新
  43. onPullDownRefresh() {
  44. this.currentPage = 1
  45. this.isLoadMore = false
  46. this.loadStatus = 'loading'
  47. this.getList()
  48. setTimeout(function() {
  49. uni.stopPullDownRefresh();
  50. }, 1000);
  51. },
  52. onReachBottom() { //上拉触底函数
  53. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  54. this.isLoadMore = true
  55. this.currentPage += 1
  56. this.getList()
  57. }
  58. },
  59. computed: {
  60. ...mapState(['hasLogin', 'userInfo']),
  61. },
  62. methods: {
  63. getList() {
  64. uni.showLoading({
  65. title: '加载中',
  66. mask: true
  67. })
  68. this.$request.baseRequest('get', '/hyFreightSettlementInfo/selectFleetCaptainBill', {
  69. carCaptainCommonId: this.userInfo.id,
  70. pageSize: this.pageSize,
  71. currentPage: this.currentPage
  72. }).then(res => {
  73. if (res.code == 200) {
  74. if (res.data.records.length > 0) {
  75. this.isLoadMore = false
  76. this.loadStatus = 'loadmore'
  77. } else {
  78. this.isLoadMore = true
  79. this.loadStatus = 'nomore'
  80. }
  81. if (this.currentPage == 1) {
  82. this.dataList = res.data.records
  83. if (res.data.records.length < 10) {
  84. this.loadStatus = 'nomore'
  85. }
  86. } else {
  87. this.dataList = this.dataList.concat(res.data.records)
  88. }
  89. if (this.dataList.length > 0) {
  90. for (let i = 0; i < this.dataList.length; i++) {
  91. if (this.dataList[i].bankCard) {
  92. this.dataList[i].bankNo = this.dataList[i].bankCard.substr(this.dataList[i]
  93. .bankCard.length - 4)
  94. }
  95. }
  96. }
  97. uni.hideLoading()
  98. } else {
  99. uni.hideLoading()
  100. uni.$u.toast(res.message);
  101. }
  102. })
  103. .catch(res => {
  104. uni.hideLoading()
  105. uni.$u.toast(res.message);
  106. });
  107. },
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .center {
  113. padding: 20rpx 30rpx;
  114. }
  115. .list_css {
  116. margin-top: 20rpx;
  117. .list_css_item_middle,
  118. .list_css_item_top,
  119. .list_css_item_lower {
  120. display: flex;
  121. margin-bottom: 20rpx;
  122. }
  123. .list_css_right,
  124. .list_css_left {
  125. width: 50%;
  126. }
  127. .list_css_right {
  128. text-align: right;
  129. }
  130. }
  131. </style>