WarehouseRegionBySku.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view>
  3. <view class="list-ul">
  4. <view class="list-li" v-for="(item, index) in region_list" :key="index" @click="changeData(item)">
  5. <view class="name">{{ item.storageLocationName }}</view>
  6. <view class="other-info">
  7. <text class="label">库位编码</text>
  8. {{ item.storageLocationCode }}
  9. </view>
  10. <view class="other-info">
  11. <text class="label">所属库区</text>
  12. {{ item.areaName }}
  13. </view>
  14. </view>
  15. <u-loadmore :status="load_status" />
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. load_status: 'nomore',
  24. basicGoodsId: '',
  25. skuId: '',
  26. warehouseId: '',
  27. region_list: []
  28. };
  29. },
  30. onLoad(options) {
  31. if (options.basicGoodsId) {
  32. this.basicGoodsId = options.basicGoodsId;
  33. this.skuId = options.skuId;
  34. this.warehouseId = options.warehouseId;
  35. }
  36. this.getAreaDateBySkuId();
  37. },
  38. onPullDownRefresh() {
  39. this.getAreaDateBySkuId();
  40. },
  41. methods: {
  42. changeData(item) {
  43. // 选择返回上一页
  44. this._prePage().areaBysku = item;
  45. uni.navigateBack();
  46. },
  47. // 库位
  48. getAreaDateBySkuId() {
  49. this.$u.api
  50. .getAreaDateBySkuId({
  51. basicGoodsId: this.basicGoodsId,
  52. skuId: this.skuId,
  53. warehouseId: this.warehouseId
  54. })
  55. .then(res => {
  56. if (res.data.length) {
  57. this.region_list = res.data[0].areaDate;
  58. }
  59. });
  60. }
  61. }
  62. };
  63. </script>
  64. <style lang="scss" scoped>
  65. .list-ul {
  66. .list-li {
  67. width: 710rpx;
  68. margin: 20rpx auto;
  69. border-radius: 10rpx;
  70. background-color: #ffffff;
  71. padding: 24rpx;
  72. .name {
  73. padding-bottom: 10rpx;
  74. font-weight: bold;
  75. }
  76. .other-info {
  77. padding-top: 10rpx;
  78. font-size: 24rpx;
  79. .label {
  80. color: #879bba;
  81. margin-right: 20rpx;
  82. }
  83. }
  84. }
  85. }
  86. </style>