allot.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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 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">
  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. <view v-else class="no_data">暂无数据</view>
  87. <!-- <u-loadmore :status="status" fontSize="32" iconSize="36" style="margin: 20rpx 0" /> -->
  88. </scroll-view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import { getAllotDetails } from '@/api/warehouseManagement'
  94. export default {
  95. props: ['categoryCode', 'categoryId', 'dimension'],
  96. data() {
  97. return {
  98. page: 1,
  99. size: 10,
  100. isEnd: true,
  101. listData: [],
  102. status: 'loading',
  103. searchValue: '',
  104. timerId: null
  105. }
  106. },
  107. created() {
  108. this.getData()
  109. },
  110. methods: {
  111. inputChange() {
  112. // 清除timer对应的延时器
  113. clearTimeout(this.timerId)
  114. // 重新启动一个延时器,并把timerId赋值给this.timer
  115. this.timerId = setTimeout(() => {
  116. // 如果500毫秒内,没有触发新的输入事件,则为搜索关键词赋值
  117. this.search()
  118. }, 500)
  119. },
  120. warehouseLabel(row) {
  121. if (row.warehouseName && row.areaName && row.goodsShelfName && row.goodsAllocationName) {
  122. return row.warehouseName + '/' + row.areaName + '/' + row.goodsShelfName + '/' + row.goodsAllocationName
  123. } else if (row.warehouseName && row.areaName && row.goodsShelfName) {
  124. return row.warehouseName + '/' + row.areaName + '/' + row.goodsShelfName
  125. } else if (row.warehouseName && row.areaName) {
  126. return row.warehouseName + '/' + row.areaName
  127. } else {
  128. return row.warehouseName
  129. }
  130. },
  131. targetWarehouseLabel(row) {
  132. if (row.targetWarehouseName && row.targetAreaName && row.targetGoodsShelfName && row.targetGoodsAllocationName) {
  133. return row.targetWarehouseName + '/' + row.targetAreaName + '/' + row.targetGoodsShelfName + '/' + row.targetGoodsAllocationName
  134. } else if (row.targetWarehouseName && row.targetAreaName && row.targetGoodsShelfName) {
  135. return row.targetWarehouseName + '/' + row.targetAreaName + '/' + row.targetGoodsShelfName
  136. } else if (row.targetWarehouseName && row.targetAreaName) {
  137. return row.targetWarehouseName + '/' + row.targetAreaName
  138. } else {
  139. return row.targetWarehouseName
  140. }
  141. },
  142. // 触底
  143. lower() {
  144. console.log('触底')
  145. if (this.isEnd) {
  146. return
  147. }
  148. this.getMoreLists()
  149. },
  150. getData() {
  151. let par = {
  152. pageNum: this.page,
  153. size: this.size,
  154. keyWord: this.searchValue,
  155. categoryId: this.categoryId
  156. }
  157. uni.showLoading({
  158. title: '加载中'
  159. })
  160. getAllotDetails(par)
  161. .then(res => {
  162. this.listData = this.listData.concat(res.list)
  163. let length = res.count
  164. if (this.listData.length < length) {
  165. this.isEnd = false
  166. } else {
  167. this.isEnd = true
  168. this.status = 'nomore'
  169. }
  170. })
  171. .finally(() => {
  172. uni.hideLoading()
  173. })
  174. },
  175. getMoreLists() {
  176. this.page++
  177. this.getData()
  178. },
  179. search() {
  180. this.page = 1
  181. this.listData = []
  182. this.status = 'loading'
  183. this.getData()
  184. },
  185. goDetails(item) {
  186. let par = {
  187. bizNum: item.dialNumber,
  188. batchNum: this.batchNum,
  189. type: '调拨'
  190. }
  191. par = this.URLSearchParams(par)
  192. uni.navigateTo({
  193. url: '/pages/warehouse/inventory/order/order?' + par
  194. })
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. .main-wrap {
  201. height: 100%;
  202. display: flex;
  203. flex-direction: column;
  204. overflow: hidden;
  205. }
  206. .scroll_box {
  207. flex: 1;
  208. overflow: hidden;
  209. }
  210. .scroll-Y {
  211. height: 100%;
  212. background-color: #fafafa;
  213. }
  214. .no_data {
  215. height: 100%;
  216. display: flex;
  217. justify-content: center;
  218. align-items: center;
  219. }
  220. .order-list {
  221. .item {
  222. background-color: #fff;
  223. margin-bottom: 30rpx;
  224. margin-bottom: 30rpx;
  225. .title {
  226. display: flex;
  227. padding: 20rpx;
  228. justify-content: space-between;
  229. align-items: center;
  230. border-bottom: 1px solid #dedede;
  231. .s1 {
  232. color: #333333;
  233. font-size: 28rpx;
  234. font-weight: bold;
  235. }
  236. .s2 {
  237. font-size: 28rpx;
  238. font-weight: bold;
  239. color: #333333;
  240. }
  241. }
  242. .main {
  243. padding: 0 30rpx;
  244. .row {
  245. display: flex;
  246. align-items: center;
  247. justify-content: space-between;
  248. padding: 20rpx 0;
  249. border-bottom: 1px dashed #dedede;
  250. .row-item {
  251. .t1 {
  252. font-weight: bold;
  253. font-size: 28rpx;
  254. color: #333333;
  255. margin-right: 20rpx;
  256. }
  257. .t2 {
  258. font-size: 28rpx;
  259. color: #333333;
  260. }
  261. }
  262. }
  263. .ckmx {
  264. color: #70b603;
  265. font-size: 28rpx;
  266. font-weight: bold;
  267. padding: 20rpx;
  268. display: flex;
  269. justify-content: flex-end;
  270. }
  271. }
  272. }
  273. }
  274. </style>