allot.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <!-- 调拨 -->
  3. <view class="main-wrap">
  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">
  11. {{ item.code }}
  12. </view>
  13. <view class="s2">
  14. {{ item.name }}
  15. </view>
  16. </view>
  17. <view class="main">
  18. <view class="row">
  19. <view class="row-item">
  20. <text class="t1">物品名称</text>
  21. <text class="t2">{{ item.categoryName }}</text>
  22. </view>
  23. <view class="row-item">
  24. <text class="t1">批次号</text>
  25. <text class="t2">{{ item.batchNo }}</text>
  26. </view>
  27. </view>
  28. <view class="row">
  29. <view class="row-item w100">
  30. <text class="t1">包装编码</text>
  31. <text class="t2">{{ item.packageNo }}</text>
  32. </view>
  33. </view>
  34. <view class="row">
  35. <view class="row-item">
  36. <text class="t1">包装数量</text>
  37. <text class="t2">{{ item.packingQuantity }}</text>
  38. </view>
  39. <view class="row-item">
  40. <text class="t1">包装单位</text>
  41. <text class="t2">{{ item.packingUnit }}</text>
  42. </view>
  43. </view>
  44. <view class="row">
  45. <view class="row-item">
  46. <text class="t1">计量数量</text>
  47. <text class="t2">{{ item.measureQuantity }}</text>
  48. </view>
  49. <view class="row-item">
  50. <text class="t1">计量单位</text>
  51. <text class="t2">{{ item.measureUnit }}</text>
  52. </view>
  53. </view>
  54. <view class="row">
  55. <view class="row-item">
  56. <text class="t1">重量</text>
  57. <text class="t2">{{ item.weight }}</text>
  58. </view>
  59. <view class="row-item">
  60. <text class="t1">重量单位</text>
  61. <text class="t2">{{ item.weightUnit }}</text>
  62. </view>
  63. </view>
  64. <view class="row">
  65. <view class="row-item w100">
  66. <text class="t1">调出区域</text>
  67. <text class="t2">{{ warehouseLabel(item) }}</text>
  68. </view>
  69. </view>
  70. <view class="row">
  71. <view class="row-item w100">
  72. <text class="t1">调入区域</text>
  73. <text class="t2">{{ targetWarehouseLabel(item) }}</text>
  74. </view>
  75. </view>
  76. <view class="row">
  77. <view class="row-item w100">
  78. <text class="t1">创建时间</text>
  79. <text class="t2">{{ item.createTime }}</text>
  80. </view>
  81. </view>
  82. <!-- <view class="ckmx" @click="goDetails(item)"> 查看明细 </view> -->
  83. </view>
  84. </view>
  85. </view>
  86. <u-loadmore :status="status" fontSize="32" iconSize="36" style="margin: 20rpx 0" />
  87. </scroll-view>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. import { getAllotDetails } from '@/api/warehouseManagement'
  93. export default {
  94. props: ['categoryCode', 'categoryId', 'dimension'],
  95. data() {
  96. return {
  97. page: 1,
  98. size: 10,
  99. isEnd: true,
  100. listData: [],
  101. status: 'loading',
  102. searchValue: '',
  103. timerId: null
  104. }
  105. },
  106. created() {
  107. this.getData()
  108. },
  109. methods: {
  110. inputChange() {
  111. // 清除timer对应的延时器
  112. clearTimeout(this.timerId)
  113. // 重新启动一个延时器,并把timerId赋值给this.timer
  114. this.timerId = setTimeout(() => {
  115. // 如果500毫秒内,没有触发新的输入事件,则为搜索关键词赋值
  116. this.search()
  117. }, 500)
  118. },
  119. warehouseLabel(row) {
  120. if (row.warehouseName && row.areaName && row.goodsShelfName && row.goodsAllocationName) {
  121. return row.warehouseName + '/' + row.areaName + '/' + row.goodsShelfName + '/' + row.goodsAllocationName
  122. } else if (row.warehouseName && row.areaName && row.goodsShelfName) {
  123. return row.warehouseName + '/' + row.areaName + '/' + row.goodsShelfName
  124. } else if (row.warehouseName && row.areaName) {
  125. return row.warehouseName + '/' + row.areaName
  126. } else {
  127. return row.warehouseName
  128. }
  129. },
  130. targetWarehouseLabel(row) {
  131. if (row.targetWarehouseName && row.targetAreaName && row.targetGoodsShelfName && row.targetGoodsAllocationName) {
  132. return row.targetWarehouseName + '/' + row.targetAreaName + '/' + row.targetGoodsShelfName + '/' + row.targetGoodsAllocationName
  133. } else if (row.targetWarehouseName && row.targetAreaName && row.targetGoodsShelfName) {
  134. return row.targetWarehouseName + '/' + row.targetAreaName + '/' + row.targetGoodsShelfName
  135. } else if (row.targetWarehouseName && row.targetAreaName) {
  136. return row.targetWarehouseName + '/' + row.targetAreaName
  137. } else {
  138. return row.targetWarehouseName
  139. }
  140. },
  141. // 触底
  142. lower() {
  143. console.log('触底')
  144. if (this.isEnd) {
  145. return
  146. }
  147. this.getMoreLists()
  148. },
  149. getData() {
  150. uni.showLoading({
  151. title: '加载中'
  152. })
  153. let par = {
  154. pageNum: this.page,
  155. size: this.size,
  156. keyWord: this.searchValue,
  157. categoryId: this.categoryId
  158. }
  159. getAllotDetails(par)
  160. .then(res => {
  161. this.listData = this.listData.concat(res.list)
  162. let length = res.count
  163. if (this.listData.length < length) {
  164. this.isEnd = false
  165. } else {
  166. this.isEnd = true
  167. this.status = 'nomore'
  168. }
  169. })
  170. .finally(() => {
  171. uni.hideLoading()
  172. })
  173. },
  174. getMoreLists() {
  175. this.page++
  176. this.getData()
  177. },
  178. search() {
  179. this.page = 1
  180. this.listData = []
  181. this.status = 'loading'
  182. this.getData()
  183. },
  184. goDetails(item) {
  185. let par = {
  186. bizNum: item.dialNumber,
  187. batchNum: this.batchNum,
  188. type: '调拨'
  189. }
  190. par = this.URLSearchParams(par)
  191. uni.navigateTo({
  192. url: '/pages/warehouse/inventory/order/order?' + par
  193. })
  194. }
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .main-wrap {
  200. height: 100%;
  201. display: flex;
  202. flex-direction: column;
  203. overflow: hidden;
  204. }
  205. .scroll_box {
  206. flex: 1;
  207. overflow: hidden;
  208. }
  209. .scroll-Y {
  210. //height: calc(100% - 112rpx);
  211. height: 100%;
  212. background-color: #fafafa;
  213. }
  214. .order-list {
  215. .item {
  216. background-color: #fff;
  217. margin-bottom: 30rpx;
  218. margin-bottom: 30rpx;
  219. .title {
  220. display: flex;
  221. padding: 20rpx;
  222. justify-content: space-between;
  223. align-items: center;
  224. border-bottom: 1px solid #dedede;
  225. .s1 {
  226. color: #333333;
  227. font-size: 28rpx;
  228. font-weight: bold;
  229. }
  230. .s2 {
  231. font-size: 28rpx;
  232. font-weight: bold;
  233. color: #333333;
  234. }
  235. }
  236. .main {
  237. padding: 0 30rpx;
  238. .row {
  239. display: flex;
  240. align-items: center;
  241. justify-content: space-between;
  242. padding: 20rpx 0;
  243. border-bottom: 1px dashed #dedede;
  244. .row-item {
  245. .t1 {
  246. font-weight: bold;
  247. font-size: 28rpx;
  248. color: #333333;
  249. margin-right: 20rpx;
  250. }
  251. .t2 {
  252. font-size: 28rpx;
  253. color: #333333;
  254. }
  255. }
  256. }
  257. .ckmx {
  258. color: #70b603;
  259. font-size: 28rpx;
  260. font-weight: bold;
  261. padding: 20rpx;
  262. display: flex;
  263. justify-content: flex-end;
  264. }
  265. }
  266. }
  267. }
  268. </style>