checkRecord.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="sockQuery flex flex_column">
  3. <swiper class="list-box">
  4. <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;">
  5. <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
  6. <view
  7. class="list-item flex align_center justify_between"
  8. v-for="item in list"
  9. :key="item.id"
  10. @click="detail(item)"
  11. >
  12. <view>
  13. <view class="vin-text">
  14. <text>{{item.checkFinishDate}}</text>
  15. </view>
  16. <view class="time-text">
  17. {{item.checkFinishPersonName}}
  18. <view>{{item.stockCheckNo}}</view>
  19. </view>
  20. </view>
  21. <view>
  22. ¥{{item.totalProfitLossCost}}
  23. </view>
  24. </view>
  25. <view style="padding: 20upx;">
  26. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  27. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  28. </view>
  29. </scroll-view>
  30. </swiper-item>
  31. </swiper>
  32. </view>
  33. </template>
  34. <script>
  35. import { stockCheckQueryPage } from '@/api/stockCheck'
  36. export default {
  37. data() {
  38. return {
  39. status: 'loading',
  40. noDataText: '暂无记录',
  41. pageNo: 1,
  42. pageSize: 20,
  43. total: 0,
  44. list: []
  45. }
  46. },
  47. onLoad() {
  48. this.getList()
  49. },
  50. methods: {
  51. pageInit(){
  52. this.total = 0
  53. this.pageNo = 1
  54. this.list = []
  55. this.getList()
  56. },
  57. detail(item){
  58. uni.navigateTo({
  59. url: '/pages/stockCheck/submitStockCheck?stockCheckSn='+item.stockCheckSn+'&type=view'
  60. })
  61. },
  62. // 查询列表
  63. getList (pageNo) {
  64. let _this = this
  65. if (pageNo) {
  66. this.pageNo = pageNo
  67. }
  68. // 状态条件
  69. let params = {
  70. pageNo: this.pageNo,
  71. pageSize: this.pageSize,
  72. checkState: 'FINISH'
  73. }
  74. this.status = "loading"
  75. stockCheckQueryPage(params).then(res => {
  76. if (res.code == 200 || res.status == 204 || res.status == 200) {
  77. if(_this.pageNo>1){
  78. _this.list = _this.list.concat(res.data.list || [])
  79. }else{
  80. _this.list = res.data.list || []
  81. }
  82. _this.total = res.data.count || 0
  83. } else {
  84. _this.list = []
  85. _this.total = 0
  86. _this.noDataText = res.message
  87. }
  88. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  89. })
  90. },
  91. // scroll-view到底部加载更多
  92. onreachBottom() {
  93. if(this.list.length < this.total){
  94. this.pageNo += 1
  95. this.getList()
  96. }else{
  97. this.status = "nomore"
  98. }
  99. },
  100. }
  101. }
  102. </script>
  103. <style lang="less">
  104. .sockQuery{
  105. width: 100%;
  106. height: 100vh;
  107. background: #f8f8f8;
  108. .search-box{
  109. padding: 20rpx 30rpx;
  110. }
  111. .list-box{
  112. flex-grow: 1;
  113. overflow: auto;
  114. }
  115. .list-item{
  116. margin: 20rpx 30rpx;
  117. border:2rpx solid #f8f8f8;
  118. box-shadow: 2rpx 2rpx 6rpx #eee;
  119. border-radius: 20rpx;
  120. padding: 20rpx 15rpx;
  121. background: #ffffff;
  122. > view{
  123. padding: 0 10rpx;
  124. &:first-child{
  125. flex-grow: 1;
  126. width: 70%;
  127. }
  128. &:last-child{
  129. text-align: right;
  130. font-weight: bold;
  131. font-size: 34upx;
  132. width: 30%;
  133. }
  134. }
  135. .time-text{
  136. margin-top: 10upx;
  137. font-size: 24upx;
  138. color: #999;
  139. text{
  140. color: #333;
  141. }
  142. }
  143. }
  144. }
  145. </style>