From ab549b6e6a5a3f3b61792d71f27ea2abf917e608 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 18 Dec 2023 11:57:56 -0300 Subject: [PATCH] Agregar funcionalidades al formulario y al InputSelectCreate --- src/components/CreateBankEntityForm.vue | 30 ++++++++++----- src/components/FormModel.vue | 1 + src/components/common/VnSelectCreate.vue | 8 +--- src/components/common/VnSelectFilter.vue | 19 +++------- src/pages/Worker/WorkerCreate.vue | 48 ++++++++++++------------ 5 files changed, 51 insertions(+), 55 deletions(-) diff --git a/src/components/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue index c2b711883..a20bf641a 100644 --- a/src/components/CreateBankEntityForm.vue +++ b/src/components/CreateBankEntityForm.vue @@ -7,11 +7,11 @@ import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; -const emit = defineEmits(['closeForm', 'onDataSaved']); +const emit = defineEmits(['onDataSaved']); const { t } = useI18n(); -const formData = reactive({ +const bankEntityFormData = reactive({ name: null, bic: null, countryFk: null, @@ -22,6 +22,7 @@ const countriesFilter = { fields: ['id', 'country', 'code'], }; +const closeButton = ref(null); const countriesOptions = ref([]); const loading = ref(false); @@ -29,14 +30,14 @@ const setCountriesOptions = (data) => { countriesOptions.value = data; }; -const closeForm = () => { - emit('closeForm'); -}; - const onDataSaved = (data) => { emit('onDataSaved', data); closeForm(); }; + +const closeForm = () => { + if (closeButton.value) closeButton.value.click(); +};