billHistory.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="content flex flex_column">
  3. <view class="p-header" @click="jumpPage('/pages/statistics/chooseShelf?customerSn='+(targetSn?targetSn:''))">
  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" v-if="status=='loading'"/>
  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:undefined
  44. }
  45. },
  46. onLoad() {
  47. uni.$on('chooseShelfOk',(data)=>{
  48. this.pageNo=1;
  49. this.targetSn = data.customerSn
  50. this.curCustomerName=data.customerName
  51. this.getList();
  52. })
  53. },
  54. onReady() {
  55. setTimeout(()=>{
  56. this.getList();
  57. },500)
  58. },
  59. methods:{
  60. jumpPage(url){
  61. uni.navigateTo({
  62. url
  63. })
  64. },
  65. getList(){
  66. let params = {targetSn:this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
  67. this.status = 'loading';
  68. queryPage(params).then(res => {
  69. if (res.status == 200) {
  70. if (this.pageNo > 1) {
  71. this.billList = this.billList.concat(res.data.list || []);
  72. } else {
  73. this.billList = res.data.list || [];
  74. }
  75. this.totalNum = res.data.count || 0;
  76. } else {
  77. this.billList = [];
  78. this.totalNum = 0;
  79. this.noDataText = res.message;
  80. }
  81. this.status = 'loadmore';
  82. });
  83. }
  84. },
  85. onReachBottom() {
  86. if (this.billList.length < this.totalNum) {
  87. this.pageNo += 1;
  88. this.getList();
  89. }else{
  90. this.status = 'nomore'
  91. }
  92. },
  93. onUnload(){
  94. uni.$off('chooseShelfOk')
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .content {
  100. height: 100vh;
  101. width: 100%;
  102. .p-header {
  103. background-color: #fff;
  104. text-align: center;
  105. padding-bottom: 20rpx;
  106. }
  107. .p-content{
  108. flex-grow: 1;
  109. padding:20rpx;
  110. .list{
  111. width: 100%;
  112. background: #ffffff;
  113. padding:30rpx 20rpx;
  114. border-radius: 20rpx;
  115. box-sizing: border-box;
  116. margin-bottom: 20rpx;
  117. .list_t{
  118. margin-bottom: 20rpx;
  119. view{
  120. &:first-child{
  121. width: calc(100% - 200rpx);
  122. }
  123. &:last-child{
  124. color:$uni-color-warning;
  125. }
  126. }
  127. }
  128. .list_b{
  129. color:$uni-text-color-grey;
  130. font-size: $uni-font-size-sm;
  131. font-weight: 500;
  132. }
  133. }
  134. }
  135. }
  136. </style>