organization.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <UiFormEdition :model="Organization" class="inner-container">
  3. <template #default="{ entity: organization }">
  4. <div v-if="organization">
  5. <LayoutCommonSection>
  6. <v-row>
  7. <v-col cols="12">
  8. <h4 class="mb-8">{{ $t('general_informations') }}</h4>
  9. <UiInputText
  10. v-model="organization.name"
  11. field="name"
  12. :rules="getAsserts('name')"
  13. />
  14. <UiInputAutocompleteEnum
  15. v-model="organization.legalStatus"
  16. enum-name="organization_legal"
  17. field="legalStatus"
  18. />
  19. <UiInputAutocompleteEnum
  20. v-model="organization.principalType"
  21. enum-name="organization_principal_type_short_list"
  22. field="principalType"
  23. />
  24. <UiInputTreeSelectTypeOfPractices
  25. v-model="organization.typeOfPractices"
  26. label="type_of_practices"
  27. />
  28. <UiInputTextArea
  29. v-model="organization.description"
  30. field="description"
  31. />
  32. <UiInputImage
  33. v-model="organization.logo"
  34. field="logo"
  35. label="organization_logo"
  36. :width="120"
  37. :cropping-enabled="true"
  38. />
  39. </v-col>
  40. </v-row>
  41. </LayoutCommonSection>
  42. <LayoutCommonSection>
  43. <v-row>
  44. <v-col cols="12">
  45. <h4 class="mb-8">{{ $t('coordinate') }}</h4>
  46. <UiInputText
  47. v-model="organization.email"
  48. field="email"
  49. :rules="getAsserts('email')"
  50. />
  51. <UiInputPhone v-model="organization.tel" field="tel" />
  52. </v-col>
  53. </v-row>
  54. </LayoutCommonSection>
  55. <LayoutCommonSection>
  56. <v-row>
  57. <v-col cols="12">
  58. <h4 class="mb-8">{{ $t('postal_address') }}</h4>
  59. <UiInputText
  60. v-model="organization.streetAddress"
  61. field="streetAddress"
  62. />
  63. <UiInputText
  64. v-model="organization.streetAddressSecond"
  65. field="streetAddressSecond"
  66. />
  67. <UiInputText
  68. v-model="organization.streetAddressThird"
  69. field="streetAddressThird"
  70. />
  71. <UiInputText
  72. v-model="organization.postalCode"
  73. field="postalCode"
  74. />
  75. <UiInputText
  76. v-model="organization.addressCity"
  77. field="addressCity"
  78. />
  79. <UiInputAutocompleteApiResources
  80. v-model="organization.addressCountry"
  81. field="addressCountry"
  82. :model="Country"
  83. list-value="id"
  84. list-label="name"
  85. />
  86. <client-only>
  87. <UiMapLeaflet
  88. v-model:latitude="organization.latitude"
  89. v-model:longitude="organization.longitude"
  90. :street-address="organization.streetAddress"
  91. :street-address-second="organization.streetAddressSecond"
  92. :street-address-third="organization.streetAddressThird"
  93. :postal-code="organization.postalCode"
  94. :address-city="organization.addressCity"
  95. :address-country-id="organization.addressCountry"
  96. :search-button="true"
  97. ></UiMapLeaflet>
  98. </client-only>
  99. </v-col>
  100. </v-row>
  101. </LayoutCommonSection>
  102. <LayoutCommonSection>
  103. <v-row>
  104. <v-col cols="12">
  105. <h4 class="mb-8">{{ $t('communication_params') }}</h4>
  106. <UiInputText v-model="organization.facebook" field="facebook" :rules="getAsserts('facebook')" />
  107. <UiInputText v-model="organization.twitter" field="twitter" :rules="getAsserts('twitter')" />
  108. <UiInputText v-model="organization.youtube" field="youtube" :rules="getAsserts('youtube')" />
  109. <UiInputText v-model="organization.instagram" field="instagram" :rules="getAsserts('instagram')" />
  110. <UiInputCheckbox
  111. v-model="organization.portailVisibility"
  112. field="portailVisibility"
  113. />
  114. </v-col>
  115. </v-row>
  116. </LayoutCommonSection>
  117. </div>
  118. </template>
  119. </UiFormEdition>
  120. </template>
  121. <script setup lang="ts">
  122. import Organization from '~/models/Freemium/Organization'
  123. import { getAssertUtils } from '~/services/asserts/getAssertUtils'
  124. import Country from '~/models/Core/Country'
  125. definePageMeta({
  126. name: 'freemium_organization_page',
  127. })
  128. onUnmounted(() => {
  129. useRepo(Organization).flush()
  130. useRepo(Country).flush()
  131. })
  132. const getAsserts = (key) => getAssertUtils(Organization.getAsserts(), key)
  133. </script>
  134. <style scoped lang="scss">
  135. .inner-container {
  136. max-width: 1200px;
  137. }
  138. </style>