index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <z-paging ref="paging" bgColor="#F7F7F7" safe-area-inset-bottom paging-class="paging-btm-shadow" scroll-with-animation>
  3. <template #top>
  4. <ut-navbar title="库房详情" :fixed="false" border :breadcrumb="`库房管理 > 库房详情`"></ut-navbar>
  5. </template>
  6. <template>
  7. <view class="pd-24">
  8. <view class="startline-title">库房信息</view>
  9. </view>
  10. <view class="pd-24 bg-#fff mb-10">
  11. <view class="f-s-30 pd2-16-0 info-border-bottom">
  12. <span class="c-#666">库房类型:</span>
  13. <span class="c-#333 f-w-600">{{ selectDictLabel(pt_warehouse_type, form?.type) || '-' }}</span>
  14. </view>
  15. <view class="f-s-30 pd2-16-0 info-border-bottom">
  16. <span class="c-#666">库房名称:</span>
  17. <span class="c-#333 f-w-600">{{ form?.warehouseName || '-' }}</span>
  18. </view>
  19. <view v-if="form?.sn" class="f-s-30 pd2-16-0 info-border-bottom">
  20. <span class="c-#666">库房编号:</span>
  21. <span class="c-#333 f-w-600">{{ form?.sn }}</span>
  22. </view>
  23. <view class="f-s-30 pd2-16-0 info-border-bottom">
  24. <span class="c-#666">负责人:</span>
  25. <span class="c-#333 f-w-600">{{ form?.contactName || '-' }}</span>
  26. </view>
  27. <view class="f-s-30 pd2-16-0 info-border-bottom">
  28. <span class="c-#666">联系电话:</span>
  29. <span class="c-#333 f-w-600">{{ form?.tel || '-' }}</span>
  30. </view>
  31. <view class="f-s-30 pd2-16-0 info-border-bottom">
  32. <span class="c-#666">所在位置:</span>
  33. <span class="c-#333 f-w-600">{{ form?.address || '-' }}</span>
  34. </view>
  35. <view class="f-s-30 pd2-16-0 info-border-bottom">
  36. <span class="c-#666">面积:</span>
  37. <span class="c-#333 f-w-600">{{ form?.area || '-' }} 平方米</span>
  38. </view>
  39. <view v-if="form?.storageCondition" class="f-s-30 pd2-16-0 info-border-bottom">
  40. <span class="c-#666">库房条件:</span>
  41. <span class="c-#333 f-w-600">{{ form?.storageCondition }}</span>
  42. </view>
  43. <view v-if="form?.remark" class="f-s-30 pd2-16-0 info-border-bottom">
  44. <span class="c-#666">备注:</span>
  45. <span class="c-#333 f-w-600">{{ form?.remark }}</span>
  46. </view>
  47. </view>
  48. <view class="pd-24">
  49. <view class="startline-title">货位信息</view>
  50. </view>
  51. <view class="pd-24 bg-#fff mb-10">
  52. <view class="f-s-28 c-#666 mb-10"
  53. >货位数量:<span class="c-#333 f-w-600">{{ form?.shelves?.length || 0 }}</span></view
  54. >
  55. <template v-if="form?.shelves?.length">
  56. <view>
  57. <view v-for="(item, index) in form.shelves" :key="index" class="plot-item pd-24 mb-20">
  58. <view class="d-flex mb-16">
  59. <view class="f-s-32 f-w-5 c-#333 flex1 mr-10">{{ item?.shelvesName || '-' }}</view>
  60. <view v-if="item?.sn" class="f-s-24 c-#333">编号:{{ item?.sn }}</view>
  61. </view>
  62. <view class="f-s-28 c-#666" v-if="item?.remark">
  63. <span class="">备注:</span>
  64. <span class="c-#333 f-w-5">{{ item?.remark }}</span>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <template v-else>
  70. <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx">暂无货位信息</ut-empty>
  71. </template>
  72. </view>
  73. </template>
  74. <template #empty>
  75. <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx">暂无库房详情</ut-empty>
  76. </template>
  77. <template #bottom>
  78. <view class="pd-24 d-flex a-c">
  79. <up-button type="primary" @click="clickEdit">修改</up-button>
  80. </view>
  81. </template>
  82. </z-paging>
  83. </template>
  84. <script setup lang="ts">
  85. import { useClientRequest } from '@/utils/request';
  86. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  87. const { pt_warehouse_type } = toRefs<any>(proxy?.useDict('pt_warehouse_type'));
  88. const paging = ref<any>(null);
  89. const form = ref<any>({});
  90. const did = ref('');
  91. // 获取详情(仓库信息)
  92. const getDetailById = async (id: string) => {
  93. if (!id) return;
  94. const res = await useClientRequest.get(`/plt-api/app/warehouse/getInfoById/${id}`);
  95. if (res && res.code === 200) {
  96. form.value = res.data || {};
  97. }
  98. };
  99. const onRefresh = () => {
  100. getDetailById(did.value);
  101. paging.value?.complete();
  102. };
  103. const clickEdit = () => {
  104. uni.$on('storage-room-detail-refresh', () => {
  105. getDetailById(did.value);
  106. uni.$off('storage-room-detail-refresh');
  107. });
  108. uni.$u.route({
  109. type: 'navigateTo',
  110. url: '/plant/storage/storage-room/edit/index',
  111. params: {
  112. id: did.value,
  113. },
  114. });
  115. };
  116. // 页面入参解析并加载
  117. onLoad((options: any) => {
  118. did.value = options?.id || '';
  119. getDetailById(did.value);
  120. });
  121. </script>
  122. <style lang="scss" scoped>
  123. .z-paging-wrap {
  124. position: absolute;
  125. right: 0;
  126. top: 0;
  127. bottom: 0;
  128. left: 0;
  129. }
  130. .plot-item {
  131. border: 1rpx solid rgba($u-primary, 0.4);
  132. border-radius: 10rpx;
  133. }
  134. </style>