0
0
Fork 0

Se hace correccion solicitada en issuecomment-39495

This commit is contained in:
carlosfonseca 2024-01-22 06:53:47 -05:00
parent 533435c7ba
commit 2400eca1e3
1 changed files with 15 additions and 16 deletions

View File

@ -1,7 +1,7 @@
<script setup>
import { onBeforeMount, reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';
@ -16,20 +16,9 @@ import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCus
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const formInitialData = reactive({
isDefaultAddress: false,
nickname: null,
street: null,
postalCode: null,
city: null,
provinceFk: null,
agencyModeFk: null,
phone: null,
mobile: null,
incotermsFk: null,
customsAgentFk: null,
});
const formInitialData = reactive({ isDefaultAddress: false });
const townsFetchDataRef = ref(null);
const postcodeFetchDataRef = ref(null);
@ -63,19 +52,28 @@ const getCustomsAgents = async () => {
const refreshData = () => {
getCustomsAgents();
};
const toCustomerConsignees = () => {
router.push({
name: 'CustomerConsignees',
params: {
id: route.params.id,
},
});
};
</script>
<template>
<FetchData
ref="postcodeFetchDataRef"
@on-fetch="(data) => (postcodesOptions = data)"
auto-load
ref="postcodeFetchDataRef"
url="Postcodes/location"
/>
<FetchData
ref="townsFetchDataRef"
@on-fetch="(data) => (citiesLocationOptions = data)"
auto-load
ref="townsFetchDataRef"
url="Towns/location"
/>
<FetchData
@ -94,6 +92,7 @@ const refreshData = () => {
:form-initial-data="formInitialData"
:observe-form-changes="false"
:url-create="urlCreate"
@on-data-saved="toCustomerConsignees()"
model="client"
>
<template #form="{ data, validate }">