putStorage.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <!-- 入库 -->
  3. <view class="main-wrap" :class="{ info: isInfo }">
  4. <uni-search-bar class="uni-search-bar" @confirm="search" v-model="searchValue" @input="inputChange" cancelButton="none" placeholder="搜索关键字"></uni-search-bar>
  5. <view class="scroll_box">
  6. <scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
  7. <view v-if="listData.length > 0" class="order-list">
  8. <view class="item" v-for="(item, index) in listData" :key="index">
  9. <view class="title">
  10. <view class="s1">入库单号 {{ item.bizNo }}</view>
  11. <view class="s2">
  12. {{ dict.bizScene[item.bizScene] }}
  13. </view>
  14. </view>
  15. <view class="main">
  16. <!-- <view class="row">
  17. <view class="row-item">
  18. <text class="t1">货位</text>
  19. <text class="t2">{{ item.warehouseName }}-{{ item.areaName }}-{{item.shelfCode}}—{{item.cargoSpaceCode}}</text>
  20. </view>
  21. </view> -->
  22. <view class="row">
  23. <view class="row-item">
  24. <text class="t1">入库数量</text>
  25. <text class="t2">{{ item.measureQuantity }}{{ item.measureUnit }}</text>
  26. </view>
  27. <view class="row-item">
  28. <text class="t1">包装数量</text>
  29. <text class="t2">{{ item.packingQuantity }}{{ item.packingUnit }}</text>
  30. </view>
  31. </view>
  32. <view class="row">
  33. <view class="row-item">
  34. <text class="t1">操作人</text>
  35. <text class="t2"></text>
  36. </view>
  37. <view class="row-item">
  38. <text class="t1">审核人</text>
  39. <text class="t2">{{ item.verifyName }}</text>
  40. </view>
  41. </view>
  42. <view class="row">
  43. <view class="row-item">
  44. <text class="t1">入库时间</text>
  45. <text class="t2">{{ item.createTime }}</text>
  46. </view>
  47. </view>
  48. <!-- <view class="ckmx" @click="goDetails(item)">查看明细</view> -->
  49. </view>
  50. </view>
  51. </view>
  52. <view v-else class="no_data">暂无数据</view>
  53. <!-- <u-loadmore fontSize="32" iconSize="36" :status="status" style="margin: 20rpx 0" /> -->
  54. </scroll-view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import { outInRecordsPage } from '@/api/warehouseManagement'
  60. export default {
  61. props: ['categoryId'],
  62. data() {
  63. return {
  64. page: 1,
  65. size: 20,
  66. isEnd: true,
  67. listData: [],
  68. status: 'loading',
  69. searchValue: '',
  70. timerId: '',
  71. dict: {
  72. bizScene: {
  73. 1: '生产入库',
  74. 2: '采购入库',
  75. 3: '归还入库',
  76. 4: '领料退货入库',
  77. 6: '销售退货入库',
  78. 7: '销售受托入库',
  79. 8: '半成品入库',
  80. 9: '外协入库',
  81. 10: '委外入库',
  82. 11: '委外退货入库',
  83. 12: '委外入库(非采购)',
  84. 13: '受托入库',
  85. 14: '项目入库',
  86. 15: '调拨入库',
  87. 99: '其他入库'
  88. }
  89. }
  90. }
  91. },
  92. created() {
  93. this.getData()
  94. },
  95. methods: {
  96. // 触底
  97. lower() {
  98. console.log('触底')
  99. if (this.isEnd) {
  100. return
  101. }
  102. this.getMoreLists()
  103. },
  104. inputChange() {
  105. // 清除timer对应的延时器
  106. clearTimeout(this.timerId)
  107. // 重新启动一个延时器,并把timerId赋值给this.timer
  108. this.timerId = setTimeout(() => {
  109. // 如果500毫秒内,没有触发新的输入事件,则为搜索关键词赋值
  110. this.search()
  111. }, 500)
  112. },
  113. getData() {
  114. let par = {
  115. pageNum: this.page,
  116. size: this.size,
  117. type: 1,
  118. categoryId: this.categoryId
  119. }
  120. if (this.searchValue !== '') {
  121. par.keyWord = this.searchValue
  122. }
  123. uni.showLoading({
  124. title: '加载中'
  125. })
  126. // par = this.URLSearchParams(par)
  127. outInRecordsPage(par)
  128. .then(res => {
  129. console.log('res----', res)
  130. this.listData = [...this.listData, ...res.list]
  131. let pages = res.count
  132. if (this.listData.length < pages) {
  133. this.isEnd = false
  134. this.status = 'loading'
  135. } else {
  136. this.isEnd = true
  137. this.status = 'nomore'
  138. }
  139. })
  140. .finally(() => {
  141. uni.hideLoading()
  142. })
  143. },
  144. getMoreLists() {
  145. this.page++
  146. this.getData()
  147. },
  148. search() {
  149. this.page = 1
  150. this.listData = []
  151. this.status = 'loading'
  152. this.getData()
  153. },
  154. goDetails(item) {
  155. let par = {
  156. bizNo: item.id,
  157. type: '入库'
  158. }
  159. par = this.URLSearchParams(par)
  160. uni.navigateTo({
  161. url: '/pages/warehouse/inventory/order/outInStorageDetail?' + par
  162. })
  163. }
  164. }
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .main-wrap {
  169. height: 100%;
  170. display: flex;
  171. flex-direction: column;
  172. overflow: hidden;
  173. }
  174. .scroll_box {
  175. flex: 1;
  176. overflow: hidden;
  177. }
  178. .scroll-Y {
  179. height: 100%;
  180. background-color: #fafafa;
  181. }
  182. .no_data {
  183. height: 100%;
  184. display: flex;
  185. justify-content: center;
  186. align-items: center;
  187. }
  188. .order-list {
  189. .item {
  190. background-color: #fff;
  191. margin-bottom: 30rpx;
  192. margin-bottom: 30rpx;
  193. .title {
  194. display: flex;
  195. padding: 20rpx;
  196. justify-content: space-between;
  197. align-items: center;
  198. border-bottom: 1px solid #dedede;
  199. .s1 {
  200. color: #333333;
  201. font-size: 28rpx;
  202. font-weight: bold;
  203. }
  204. .s2 {
  205. font-size: 28rpx;
  206. font-weight: bold;
  207. color: #333333;
  208. }
  209. }
  210. .main {
  211. padding: 0 30rpx;
  212. .row {
  213. display: flex;
  214. align-items: center;
  215. justify-content: space-between;
  216. padding: 20rpx 0;
  217. border-bottom: 1px dashed #dedede;
  218. .row-item {
  219. .t1 {
  220. font-weight: bold;
  221. font-size: 28rpx;
  222. color: #333333;
  223. margin-right: 20rpx;
  224. }
  225. .t2 {
  226. font-size: 28rpx;
  227. color: #333333;
  228. }
  229. }
  230. }
  231. .ckmx {
  232. color: #70b603;
  233. font-size: 28rpx;
  234. font-weight: bold;
  235. padding: 20rpx;
  236. display: flex;
  237. justify-content: flex-end;
  238. }
  239. }
  240. }
  241. }
  242. </style>