General.vue 2.9 KB

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