StudentDetailPage.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div>
  3. <DefaultHeaderPage title="Detalhe do Aluno" />
  4. <div class="q-pa-md">
  5. <div v-if="loading" class="flex flex-center q-pa-xl">
  6. <q-spinner color="primary" size="50px" />
  7. </div>
  8. <div v-else-if="student" class="column q-gutter-md" style="max-width: 600px">
  9. <q-card flat bordered style="border-radius: 12px">
  10. <q-card-section>
  11. <div class="text-subtitle2 text-grey-6 q-mb-xs">Nome do Aluno</div>
  12. <div class="text-h6 text-dark">{{ student.name }}</div>
  13. </q-card-section>
  14. <q-separator inset />
  15. <q-card-section>
  16. <div class="text-subtitle2 text-grey-6 q-mb-xs">Contato / Unidade</div>
  17. <div class="text-body1 text-dark">{{ student.phone ?? "—" }}</div>
  18. <div class="text-caption text-grey-6">
  19. {{ student.unit?.fantasy_name ?? "—" }}
  20. </div>
  21. </q-card-section>
  22. <q-separator inset />
  23. <q-card-section>
  24. <div class="text-subtitle2 text-grey-6 q-mb-xs">Protocolo do Contrato</div>
  25. <div class="text-body1 text-dark">
  26. {{ student.protocol ?? "—" }}
  27. </div>
  28. </q-card-section>
  29. </q-card>
  30. <div>
  31. <q-btn
  32. flat
  33. color="primary"
  34. icon="mdi-arrow-left"
  35. label="Voltar"
  36. @click="$router.back()"
  37. />
  38. </div>
  39. </div>
  40. <div v-else class="text-grey-6 q-pa-md">Aluno não encontrado.</div>
  41. </div>
  42. </div>
  43. </template>
  44. <script setup>
  45. import { ref, onMounted } from "vue";
  46. import { useRoute } from "vue-router";
  47. import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
  48. import { getFranchisorStudentDetail } from "src/api/student";
  49. const route = useRoute();
  50. const loading = ref(true);
  51. const student = ref(null);
  52. onMounted(async () => {
  53. try {
  54. student.value = await getFranchisorStudentDetail(route.params.id);
  55. } catch {
  56. // silent
  57. } finally {
  58. loading.value = false;
  59. }
  60. });
  61. </script>