billHistory.vue 3.4 KB

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