General.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. <div
  58. v-if="organizationProfile.isCMFCentralService"
  59. class="d-flex flex-column"
  60. >
  61. <span class="mb-1">{{ $t('qrCode')}} </span>
  62. <UiInputImage
  63. v-model="parameters.qrCode"
  64. field="qrCode"
  65. label="licenceQrCode"
  66. :width="120"
  67. />
  68. </div>
  69. </v-col>
  70. </v-row>
  71. </UiForm>
  72. </LayoutContainer>
  73. </template>
  74. <script setup lang="ts">
  75. import Parameters from "~/models/Organization/Parameters";
  76. import {useEntityFetch} from "~/composables/data/useEntityFetch";
  77. import {useOrganizationProfileStore} from "~/stores/organizationProfile";
  78. import {AsyncData} from "#app";
  79. const { fetch } = useEntityFetch()
  80. const organizationProfile = useOrganizationProfileStore()
  81. if (organizationProfile.parametersId === null) {
  82. throw new Error('Missing organization parameters id')
  83. }
  84. const { data: parameters, pending } = fetch(Parameters, organizationProfile.parametersId) as AsyncData<Parameters, Parameters | true>
  85. </script>