General.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <LayoutContainer>
  3. <UiLoadingPanel v-if="pending" />
  4. <UiForm
  5. v-else
  6. :model="Parameters"
  7. :entity="parameters"
  8. >
  9. <v-row>
  10. <v-col cols="6">
  11. <UiInputDatePicker
  12. v-if="organizationProfile.isSchool"
  13. v-model="parameters.financialDate"
  14. field="financialDate"
  15. label="start_date_of_financial_season"
  16. class="my-2"
  17. />
  18. <UiInputDatePicker
  19. v-if="organizationProfile.isSchool"
  20. v-model="parameters.startCourseDate"
  21. field="startCourseDate"
  22. label="start_date_of_courses"
  23. class="my-2"
  24. />
  25. <UiInputCheckbox
  26. v-model="parameters.showAdherentList"
  27. field="showAdherentList"
  28. label="show_adherents_list_and_their_coordinates"
  29. />
  30. <UiInputAutocompleteWithEnum
  31. v-model="parameters.timezone"
  32. enum-name="timezone"
  33. field="timezone"
  34. />
  35. </v-col>
  36. <v-col cols="6">
  37. <UiInputDatePicker
  38. v-if="organizationProfile.isSchool"
  39. v-model="parameters.musicalDate"
  40. field="musicalDate"
  41. label="start_date_of_activity_season"
  42. class="my-2"
  43. />
  44. <UiInputDatePicker
  45. v-if="organizationProfile.isSchool"
  46. v-model="parameters.endCourseDate"
  47. field="endCourseDate"
  48. label="end_date_of_courses"
  49. class="my-2"
  50. />
  51. <UiInputCheckbox
  52. v-if="organizationProfile.isSchool && organizationProfile.isAssociation"
  53. v-model="parameters.studentsAreAdherents"
  54. field="studentsAreAdherents"
  55. label="students_are_also_association_members"
  56. />
  57. <!-- TODO: reprendre l'UiInput -->
  58. <UiInputImage
  59. v-model="parameters['qrCode_id']"
  60. field="qrCode_id"
  61. label="licenceQrCode"
  62. />
  63. </v-col>
  64. </v-row>
  65. </UiForm>
  66. </LayoutContainer>
  67. </template>
  68. <script setup lang="ts">
  69. import Parameters from "~/models/Organization/Parameters";
  70. import {useEntityFetch} from "~/composables/data/useEntityFetch";
  71. import {useOrganizationProfileStore} from "~/stores/organizationProfile";
  72. import {AsyncData} from "#app";
  73. const { fetch } = useEntityFetch()
  74. const organizationProfile = useOrganizationProfileStore()
  75. if (organizationProfile.parametersId === null) {
  76. throw new Error('Missing organization parameters id')
  77. }
  78. const { data: parameters, pending } = fetch(Parameters, organizationProfile.parametersId) as AsyncData<Parameters, Parameters | true>
  79. </script>
  80. <style scoped lang="scss">
  81. </style>