batch-info-popup.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <root-portal>
  3. <up-popup :show="show" closeable round="0" @close="close">
  4. <view>
  5. <view class="pd-24">
  6. <view class="f-s-34 f-w-5 c-#333">查看批次信息</view>
  7. <view class="f-s-24 c-#999">若下列溯源信息有误,请前往相应位置修改。</view>
  8. </view>
  9. <scroll-view scroll-y style="max-height: 70vh;">
  10. <view class="pd3-0-24-24">
  11. <batch-info v-if="info" :info="info"></batch-info>
  12. </view>
  13. </scroll-view>
  14. </view>
  15. </up-popup>
  16. </root-portal>
  17. </template>
  18. <script lang="ts" setup>
  19. import { useClientRequest } from '@/utils/request';
  20. import batchInfo from './batch-info.vue';
  21. const props = defineProps({
  22. show: {
  23. type: Boolean,
  24. default: false,
  25. },
  26. packId: {
  27. type: String,
  28. default: '',
  29. },
  30. title: {
  31. type: String,
  32. default: '系统提示',
  33. },
  34. showTitle: {
  35. type: Boolean,
  36. default: true,
  37. },
  38. tabs: {
  39. type: Array,
  40. default: () => [],
  41. },
  42. mode: {
  43. type: String,
  44. }
  45. })
  46. const emit = defineEmits<{
  47. // 关闭事件
  48. (e: 'close'): void;
  49. // 更新 show 状态
  50. (e: 'update:show', value: boolean): void;
  51. }>();
  52. const close = () => {
  53. emit('update:show', false);
  54. emit('close');
  55. };
  56. const info = ref<any>(null);
  57. // 获取批次信息接口
  58. const getBatchInfo = async () => {
  59. const res = await useClientRequest.get(`/plt-api/app/packTask/getPackTraceSimpleInfo/${props?.packId}`);
  60. console.log(res);
  61. info.value = res?.data;
  62. }
  63. onMounted(() => {
  64. getBatchInfo()
  65. })
  66. </script>