putStorage.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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 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. <u-loadmore fontSize="32" iconSize="36" :status="status" style="margin: 20rpx 0" />
  53. </scroll-view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import { outInRecordsPage } from '@/api/warehouseManagement'
  59. export default {
  60. props: ['categoryId'],
  61. data() {
  62. return {
  63. page: 1,
  64. size: 20,
  65. isEnd: true,
  66. listData: [],
  67. status: 'loading',
  68. searchValue: '',
  69. timerId: '',
  70. dict: {
  71. bizScene: {
  72. 1: '生产入库',
  73. 2: '采购入库',
  74. 3: '归还入库',
  75. 4: '领料退货入库',
  76. 6: '销售退货入库',
  77. 7: '销售受托入库',
  78. 8: '半成品入库',
  79. 9: '外协入库',
  80. 10: '委外入库',
  81. 11: '委外退货入库',
  82. 12: '委外入库(非采购)',
  83. 13: '受托入库',
  84. 14: '项目入库',
  85. 15: '调拨入库',
  86. 99: '其他入库'
  87. }
  88. }
  89. }
  90. },
  91. created() {
  92. this.getData()
  93. },
  94. methods: {
  95. // 触底
  96. lower() {
  97. console.log('触底')
  98. if (this.isEnd) {
  99. return
  100. }
  101. this.getMoreLists()
  102. },
  103. inputChange() {
  104. // 清除timer对应的延时器
  105. clearTimeout(this.timerId)
  106. // 重新启动一个延时器,并把timerId赋值给this.timer
  107. this.timerId = setTimeout(() => {
  108. // 如果500毫秒内,没有触发新的输入事件,则为搜索关键词赋值
  109. this.search()
  110. }, 500)
  111. },
  112. getData() {
  113. let par = {
  114. pageNum: this.page,
  115. size: this.size,
  116. type: 1,
  117. categoryId: this.categoryId
  118. }
  119. if (this.searchValue !== '') {
  120. par.keyWord = this.searchValue
  121. }
  122. // par = this.URLSearchParams(par)
  123. outInRecordsPage(par).then(res => {
  124. console.log('res----', res)
  125. this.listData = [...this.listData, ...res.list]
  126. let pages = res.count
  127. if (this.listData.length < pages) {
  128. this.isEnd = false
  129. this.status = 'loading'
  130. } else {
  131. this.isEnd = true
  132. this.status = 'nomore'
  133. }
  134. })
  135. },
  136. getMoreLists() {
  137. this.page++
  138. this.getData()
  139. },
  140. search() {
  141. this.page = 1
  142. this.listData = []
  143. this.status = 'loading'
  144. this.getData()
  145. },
  146. goDetails(item) {
  147. let par = {
  148. bizNo: item.id,
  149. type: '入库'
  150. }
  151. par = this.URLSearchParams(par)
  152. uni.navigateTo({
  153. url: '/pages/warehouse/inventory/order/outInStorageDetail?' + par
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .main-wrap {
  161. height: calc(100% - 176rpx);
  162. &.info {
  163. height: calc(100% - 236rpx);
  164. }
  165. }
  166. .scroll-Y {
  167. height: calc(100vh - 322rpx);
  168. }
  169. .order-list {
  170. .item {
  171. background-color: #fff;
  172. margin-bottom: 30rpx;
  173. margin-bottom: 30rpx;
  174. .title {
  175. display: flex;
  176. padding: 20rpx;
  177. justify-content: space-between;
  178. align-items: center;
  179. border-bottom: 1px solid #dedede;
  180. .s1 {
  181. color: #333333;
  182. font-size: 28rpx;
  183. font-weight: bold;
  184. }
  185. .s2 {
  186. font-size: 28rpx;
  187. font-weight: bold;
  188. color: #333333;
  189. }
  190. }
  191. .main {
  192. padding: 0 30rpx;
  193. .row {
  194. display: flex;
  195. align-items: center;
  196. justify-content: space-between;
  197. padding: 20rpx 0;
  198. border-bottom: 1px dashed #dedede;
  199. .row-item {
  200. .t1 {
  201. font-weight: bold;
  202. font-size: 28rpx;
  203. color: #333333;
  204. margin-right: 20rpx;
  205. }
  206. .t2 {
  207. font-size: 28rpx;
  208. color: #333333;
  209. }
  210. }
  211. }
  212. .ckmx {
  213. color: #70b603;
  214. font-size: 28rpx;
  215. font-weight: bold;
  216. padding: 20rpx;
  217. display: flex;
  218. justify-content: flex-end;
  219. }
  220. }
  221. }
  222. }
  223. </style>