new.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <LayoutContainer>
  3. <div>
  4. <h2>{{ $t('create_a_new_residence_area') }}</h2>
  5. <UiFormCreation
  6. :model="ResidenceArea"
  7. :go-back-route="goBackRoute"
  8. >
  9. <template v-slot="{ entity }">
  10. <v-container :fluid="true" class="container">
  11. <v-row>
  12. <v-col cols="12" sm="6">
  13. <UiInputText
  14. v-model="entity.label"
  15. field="label"
  16. type="string"
  17. :rules="rules()"
  18. />
  19. </v-col>
  20. </v-row>
  21. </v-container>
  22. </template>
  23. </UiFormCreation>
  24. </div>
  25. </LayoutContainer>
  26. </template>
  27. <script setup lang="ts">
  28. import ResidenceArea from '~/models/Billing/ResidenceArea'
  29. import { useI18n } from 'vue-i18n'
  30. const i18n = useI18n()
  31. const goBackRoute = { path: `/parameters`, query: { tab: 'residenceAreas' } }
  32. const rules = () => [
  33. (label: string | null) =>
  34. (label !== null && label.length > 0) || i18n.t('please_enter_a_value'),
  35. ]
  36. </script>