putStorage.vue 5.7 KB

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