putStorage.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <!-- 入库 -->
  3. <view class="main-wrap" :class="{ info: isInfo }">
  4. <uni-search-bar
  5. class="uni-search-bar"
  6. @confirm="search"
  7. v-model="searchValue"
  8. @input="search"
  9. cancelButton="none"
  10. placeholder="搜索关键字"
  11. >
  12. </uni-search-bar>
  13. <scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
  14. <view class="order-list">
  15. <view class="item" v-for="(item, index) in listData" :key="index">
  16. <view class="title">
  17. <view class="s1"> 入库单号 {{ item.bizNum }} </view>
  18. <view class="s2">
  19. {{ dict.bizScene[item.bizScene] }}
  20. </view>
  21. </view>
  22. <view class="main">
  23. <!-- <view class="row">
  24. <view class="row-item">
  25. <text class="t1">货位</text>
  26. <text class="t2">{{ item.warehouseName }}-{{ item.areaName }}-{{item.shelfCode}}—{{item.cargoSpaceCode}}</text>
  27. </view>
  28. </view> -->
  29. <view class="row">
  30. <view class="row-item">
  31. <text class="t1">入库数量</text>
  32. <text class="t2"
  33. >{{ item.measurementUnit }}{{ item.unit }}</text
  34. >
  35. </view>
  36. <view class="row-item">
  37. <text class="t1">包装数量</text>
  38. <text class="t2"
  39. >{{ item.outInNum }}{{ item.minPackUnit }}</text
  40. >
  41. </view>
  42. </view>
  43. <view class="row">
  44. <view class="row-item">
  45. <text class="t1">操作人</text>
  46. <text class="t2">{{ item.createUsername }}</text>
  47. </view>
  48. <view class="row-item">
  49. <text class="t1">审核人</text>
  50. <text class="t2">{{ item.verifyName }}</text>
  51. </view>
  52. </view>
  53. <view class="row">
  54. <view class="row-item">
  55. <text class="t1">入库时间</text>
  56. <text class="t2">{{ item.verifyTime }}</text>
  57. </view>
  58. </view>
  59. <view class="ckmx" @click="goDetails(item)"> 查看明细 </view>
  60. </view>
  61. </view>
  62. </view>
  63. <u-loadmore :status="status" style="margin: 20rpx 0" />
  64. </scroll-view>
  65. </view>
  66. </template>
  67. <script>
  68. import { post } from '@/utils/api.js'
  69. let [page, size, isEnd] = [1, 10, true]
  70. export default {
  71. props: ['batchNum', 'inventoryCode', 'isInfo'],
  72. data () {
  73. return {
  74. listData: [],
  75. status: 'loading',
  76. searchValue: '',
  77. dict: {
  78. bizScene: {
  79. 1: '生产入库',
  80. 2: '采购入库',
  81. 3: '赠送入库',
  82. 4: '借用入库',
  83. 5: '退还入库',
  84. 6: '其他入库'
  85. }
  86. }
  87. }
  88. },
  89. created () {
  90. this.getData()
  91. },
  92. methods: {
  93. // 触底
  94. lower () {
  95. console.log('触底')
  96. if (isEnd) {
  97. return
  98. }
  99. this.getMoreLists()
  100. },
  101. getData () {
  102. let par = {
  103. page,
  104. size,
  105. batchNum: this.batchNum,
  106. bizStatus: 1,
  107. inventoryCode: this.inventoryCode
  108. }
  109. if (this.searchValue !== '') {
  110. par.key = this.searchValue
  111. }
  112. par = this.URLSearchParams(par)
  113. post(
  114. this.apiUrl + '/InventoryBook/select/getInWarehouseDetail?' + par
  115. ).then(res => {
  116. if (res.success) {
  117. this.listData = [...this.listData, ...res.data.records]
  118. let pages = res.data.pages
  119. if (page < pages) {
  120. isEnd = false
  121. } else {
  122. isEnd = true
  123. this.status = 'nomore'
  124. }
  125. }
  126. })
  127. },
  128. getMoreLists () {
  129. page++
  130. this.getData()
  131. },
  132. search () {
  133. this.page = 1
  134. this.listData = []
  135. this.status = 'loading'
  136. this.getData()
  137. },
  138. goDetails (item) {
  139. let par = {
  140. bizNum: item.bizNum,
  141. batchNum: this.batchNum,
  142. type: '入库'
  143. }
  144. par = this.URLSearchParams(par)
  145. uni.navigateTo({
  146. url: '/pages/warehouse/inventory/order/order?' + par
  147. })
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .main-wrap {
  154. height: calc(100% - 170rpx);
  155. &.info {
  156. height: calc(100% - 236rpx);
  157. }
  158. }
  159. .scroll-Y {
  160. height: calc(100vh - 112rpx);
  161. //height: 100%;
  162. background-color: #fafafa;
  163. }
  164. .order-list {
  165. .item {
  166. background-color: #fff;
  167. margin-bottom: 30rpx;
  168. margin-bottom: 30rpx;
  169. .title {
  170. display: flex;
  171. padding: 20rpx;
  172. justify-content: space-between;
  173. align-items: center;
  174. border-bottom: 1px solid #dedede;
  175. .s1 {
  176. color: #333333;
  177. font-size: 28rpx;
  178. font-weight: bold;
  179. }
  180. .s2 {
  181. font-size: 28rpx;
  182. font-weight: bold;
  183. color: #333333;
  184. }
  185. }
  186. .main {
  187. padding: 0 30rpx;
  188. .row {
  189. display: flex;
  190. align-items: center;
  191. justify-content: space-between;
  192. padding: 20rpx 0;
  193. border-bottom: 1px dashed #dedede;
  194. .row-item {
  195. .t1 {
  196. font-weight: bold;
  197. font-size: 28rpx;
  198. color: #333333;
  199. margin-right: 20rpx;
  200. }
  201. .t2 {
  202. font-size: 28rpx;
  203. color: #333333;
  204. }
  205. }
  206. }
  207. .ckmx {
  208. color: #70b603;
  209. font-size: 28rpx;
  210. font-weight: bold;
  211. padding: 20rpx;
  212. display: flex;
  213. justify-content: flex-end;
  214. }
  215. }
  216. }
  217. }
  218. </style>