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(); +};