billHistory.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="content flex flex_column">
  3. <view class="p-header" @click="jumpPage('/pages/statistics/chooseShelf')">
  4. <text>{{ curCustomerName || '全部客户' }}</text>
  5. <u-icon name="arrow-right"></u-icon>
  6. </view>
  7. <view class="p-content" v-if="billList && billList.length>0">
  8. <view class="list" @click="jumpPage('/pages/sales/billHistoryDetail?billId='+item.verifySn)" v-for="(item,i) in billList" :key="i">
  9. <view class="list_t u-flex u-row-between">
  10. <view class="u-line-1">{{item.customer.customerName}}</view>
  11. <view>¥{{item.settleAmount}}</view>
  12. </view>
  13. <view class="list_b u-flex u-row-between" >
  14. <view>{{item.createDate}}</view>
  15. <view class="u-flex" v-if="item.billStatus != 'UNSETTLE'">
  16. <view>已付款</view>
  17. <u-icon name="yifukuan" custom-prefix="iscm-icon" size="40" :color="wordColor"></u-icon>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view v-if="billList&&billList.length==0">
  23. <u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="50"></u-empty>
  24. </view>
  25. <view style="padding: 20upx;" v-else>
  26. <u-loadmore :status="status" />
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { queryPage } from '@/api/verify.js';
  32. export default {
  33. data(){
  34. return {
  35. wordColor:this.$config('infoColor'),
  36. curCustomerName:'',
  37. pageNo: 1,
  38. pageSize: 10,
  39. totalNum: 0,
  40. status: 'loadmore',
  41. noDataText: '暂无数据',
  42. billList:[],
  43. targetSn:null
  44. }
  45. },
  46. onLoad() {
  47. uni.$on('chooseShelfOk',(info)=>{
  48. if(info){
  49. this.pageNo=1;
  50. this.targetSn = info.targetSn
  51. this.curCustomerName=info.customerName
  52. }
  53. })
  54. this.getList();
  55. },
  56. methods:{
  57. jumpPage(url){
  58. uni.navigateTo({
  59. url
  60. })
  61. },
  62. getList(){
  63. const _this = this;
  64. let params = {targetSn:this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
  65. this.status = 'loading';
  66. queryPage(params).then(res => {
  67. if (res.status == 200) {
  68. if (this.pageNo > 1) {
  69. this.billList = this.billList.concat(res.data.list || []);
  70. } else {
  71. this.billList = res.data.list || [];
  72. }
  73. this.totalNum = res.data.count || 0;
  74. } else {
  75. this.billList = [];
  76. this.totalNum = 0;
  77. this.noDataText = res.message;
  78. }
  79. this.status = 'loadmore';
  80. });
  81. }
  82. },
  83. onReachBottom() {
  84. if (this.billList.length < this.totalNum) {
  85. this.pageNo += 1;
  86. this.getList();
  87. }
  88. },
  89. onUnload(){
  90. uni.$off('chooseShelfOk')
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .content {
  96. height: 100vh;
  97. width: 100%;
  98. .p-header {
  99. background-color: #fff;
  100. text-align: center;
  101. padding-bottom: 20rpx;
  102. }
  103. .p-content{
  104. flex-grow: 1;
  105. padding:20rpx;
  106. .list{
  107. width: 100%;
  108. background: #ffffff;
  109. padding:30rpx 20rpx;
  110. border-radius: 20rpx;
  111. box-sizing: border-box;
  112. margin-bottom: 20rpx;
  113. .list_t{
  114. margin-bottom: 20rpx;
  115. view{
  116. &:first-child{
  117. width: calc(100% - 200rpx);
  118. }
  119. &:last-child{
  120. color:$uni-color-warning;
  121. }
  122. }
  123. }
  124. .list_b{
  125. color:$uni-text-color-grey;
  126. font-size: $uni-font-size-sm;
  127. font-weight: 500;
  128. }
  129. }
  130. }
  131. }
  132. </style>