From 13504be081107a284f807419d0167676319de82e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 2 Feb 2024 09:32:59 +0100 Subject: [PATCH 1/5] refs #5888 feat: change layout --- .../Customer/Card/CustomerFiscalData.vue | 137 ++--------------- .../Supplier/Card/SupplierFiscalData.vue | 141 ++---------------- 2 files changed, 30 insertions(+), 248 deletions(-) diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue index 0edcc3c07..bf877f145 100644 --- a/src/pages/Customer/Card/CustomerFiscalData.vue +++ b/src/pages/Customer/Card/CustomerFiscalData.vue @@ -8,29 +8,22 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; -import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; -import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnLocation from 'src/components/common/VnLocation.vue'; const { t } = useI18n(); const route = useRoute(); -const townsFetchDataRef = ref(null); -const postcodeFetchDataRef = ref(null); const typesTaxes = ref([]); const typesTransactions = ref([]); -const citiesLocationOptions = ref([]); -const provincesLocationOptions = ref([]); -const countriesOptions = ref([]); const postcodesOptions = ref([]); -const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formData) => { - await postcodeFetchDataRef.value.fetch(); - await townsFetchDataRef.value.fetch(); - formData.postcode = code; - formData.provinceFk = provinceFk; - formData.city = citiesLocationOptions.value.find((town) => town.id === townFk).name; - formData.countryFk = countryFk; -}; +function handleLocation(data, location) { + const { town, code, provinceFk, countryFk } = location ?? {}; + data.postcode = code; + data.city = town; + data.provinceFk = provinceFk; + data.countryFk = countryFk; +}