shelfList.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="moreShelfPart flex flex_column">
  3. <view class="moreShelfPart-search">
  4. <u-search
  5. placeholder="请输入货架名称搜索"
  6. v-model="shelfName"
  7. :show-action="isGobleSearch"
  8. @input="change"
  9. @focus="isGobleSearch=true"
  10. @blur="isGobleSearch=false"
  11. @custom="getShelfList"
  12. @search="getShelfList"
  13. @clear="clearSearch"
  14. :action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': '#57a3f3', 'border-radius': '6upx', 'padding': '12upx 0'}">
  15. </u-search>
  16. </view>
  17. <view class="moreShelfPart-body">
  18. <view class="nav-right">
  19. <view
  20. class="nav-right-item"
  21. v-for="(item, index) in shelfList"
  22. :key="item.id"
  23. @click="viewDetail(item)"
  24. >
  25. <view class="item-info">
  26. <view class="item-name">
  27. <text>{{item.shelfName}}</text>
  28. </view>
  29. <view class="item-detail">
  30. <view>
  31. 累计扫描VIN数量:
  32. <text class="item-detail-text">{{item.totalProfitLossQty}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view v-if="shelfList&&shelfList.length==0">
  38. <u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="100"></u-empty>
  39. </view>
  40. <view style="padding: 20upx;" v-if="shelfList.length">
  41. <u-loadmore :status="status" />
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import { selectShelfStockCheck, stockCheckDeleteBySn } from '@/api/stockCheck'
  49. import { clzConfirm } from '@/libs/tools'
  50. export default {
  51. data() {
  52. return {
  53. shelfName: '',
  54. isGobleSearch: false,
  55. shelfList: [],
  56. noDataText: '暂无货架',
  57. status: 'loading',
  58. tempData: null,
  59. }
  60. },
  61. onShow() {
  62. this.getShelfList()
  63. },
  64. methods: {
  65. clearSearch(){
  66. this.shelfName = ''
  67. this.shelfList = []
  68. this.getShelfList()
  69. },
  70. change(v){
  71. if(v==''){
  72. this.clearSearch()
  73. }
  74. },
  75. // 获取数字货架列表
  76. getShelfList(){
  77. const _this = this
  78. _this.status = 'loading'
  79. selectShelfStockCheck().then(res => {
  80. uni.hideLoading()
  81. if(res.status==200){
  82. let list = res.data.filter(item => item.shelfName.indexOf(this.shelfName)>=0)
  83. if (list && list.length){
  84. _this.status = 'nomore'
  85. _this.shelfList = list
  86. } else {
  87. _this.shelfList = []
  88. _this.status = 'nomore'
  89. _this.noDataText = '没有查询到相关货架'
  90. }
  91. }else{
  92. _this.status = 'loadmore'
  93. _this.shelfList = []
  94. _this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
  95. }
  96. })
  97. },
  98. viewDetail(item){
  99. uni.navigateTo({
  100. url:"/pages/vinAnalyse/shelfAnalyse?data="+encodeURIComponent(JSON.stringify(item))
  101. })
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="less">
  107. .moreShelfPart{
  108. width: 100%;
  109. height: 100vh;
  110. background-color: #f8f8f8;
  111. .moreShelfPart-search{
  112. padding: 20rpx;
  113. }
  114. .moreShelfPart-body{
  115. flex-grow: 1;
  116. }
  117. .nav-right{
  118. padding: 0 30upx;
  119. height: calc(100vh - 110rpx);
  120. box-sizing: border-box;
  121. overflow: auto;
  122. .nav-right-item{
  123. padding:20upx;
  124. border: 2rpx solid #f5f5f5;
  125. border-radius: 15upx;
  126. margin-bottom: 20upx;
  127. box-shadow: 3rpx 3rpx 8rpx #eee;
  128. background-color: #ffff;
  129. &:active{
  130. background: #f8f8f8;
  131. }
  132. .item-info{
  133. .item-name{
  134. font-size: 30upx;
  135. display: flex;
  136. align-items: center;
  137. }
  138. .item-detail{
  139. margin-top: 15rpx;
  140. display: flex;
  141. align-items: center;
  142. justify-content: space-between;
  143. color: #9DA8B5;
  144. font-size: 26upx;
  145. .item-detail-text{
  146. font-size: 26upx;
  147. color: #333;
  148. }
  149. }
  150. }
  151. .button-box{
  152. display: flex;
  153. margin-top: 20upx;
  154. button{
  155. margin: 0 10upx;
  156. }
  157. > text{
  158. font-size: 24upx;
  159. color: #00aaff;
  160. }
  161. }
  162. }
  163. }
  164. }
  165. </style>