checkRecord.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. shelfSn: ''
  46. }
  47. },
  48. onLoad(opts) {
  49. this.shelfSn = opts.shelfSn
  50. this.getList()
  51. },
  52. methods: {
  53. pageInit(){
  54. this.total = 0
  55. this.pageNo = 1
  56. this.list = []
  57. this.getList()
  58. },
  59. detail(item){
  60. uni.navigateTo({
  61. url: '/pages/stockCheck/submitStockCheck?stockCheckSn='+item.stockCheckSn+'&type=view'
  62. })
  63. },
  64. // 查询列表
  65. getList (pageNo) {
  66. let _this = this
  67. if (pageNo) {
  68. this.pageNo = pageNo
  69. }
  70. // 状态条件
  71. let params = {
  72. pageNo: this.pageNo,
  73. pageSize: this.pageSize,
  74. checkState: 'FINISH',
  75. shelfSn: this.shelfSn
  76. }
  77. this.status = "loading"
  78. stockCheckQueryPage(params).then(res => {
  79. if (res.code == 200 || res.status == 204 || res.status == 200) {
  80. if(_this.pageNo>1){
  81. _this.list = _this.list.concat(res.data.list || [])
  82. }else{
  83. _this.list = res.data.list || []
  84. }
  85. _this.total = res.data.count || 0
  86. } else {
  87. _this.list = []
  88. _this.total = 0
  89. _this.noDataText = res.message
  90. }
  91. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  92. })
  93. },
  94. // scroll-view到底部加载更多
  95. onreachBottom() {
  96. if(this.list.length < this.total){
  97. this.pageNo += 1
  98. this.getList()
  99. }else{
  100. this.status = "nomore"
  101. }
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="less">
  107. .sockQuery{
  108. width: 100%;
  109. height: 100vh;
  110. background: #f8f8f8;
  111. .search-box{
  112. padding: 20rpx 30rpx;
  113. }
  114. .list-box{
  115. flex-grow: 1;
  116. overflow: auto;
  117. }
  118. .list-item{
  119. margin: 20rpx 30rpx;
  120. border:2rpx solid #f8f8f8;
  121. box-shadow: 2rpx 2rpx 6rpx #eee;
  122. border-radius: 20rpx;
  123. padding: 20rpx 15rpx;
  124. background: #ffffff;
  125. > view{
  126. padding: 0 10rpx;
  127. &:first-child{
  128. flex-grow: 1;
  129. width: 70%;
  130. }
  131. &:last-child{
  132. text-align: right;
  133. font-weight: bold;
  134. font-size: 34upx;
  135. width: 30%;
  136. }
  137. }
  138. .time-text{
  139. margin-top: 10upx;
  140. font-size: 24upx;
  141. color: #999;
  142. text{
  143. color: #333;
  144. }
  145. }
  146. }
  147. }
  148. </style>