general_parameters.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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>