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