forked from verdnatura/salix-front
fix: #6943 CustomerAddressCreate
This commit is contained in:
parent
514d54b222
commit
940fe5c2b9
|
@ -18,8 +18,6 @@ const router = useRouter();
|
||||||
|
|
||||||
const formInitialData = reactive({ isDefaultAddress: false });
|
const formInitialData = reactive({ isDefaultAddress: false });
|
||||||
|
|
||||||
const urlCreate = ref('');
|
|
||||||
|
|
||||||
const agencyModes = ref([]);
|
const agencyModes = ref([]);
|
||||||
const incoterms = ref([]);
|
const incoterms = ref([]);
|
||||||
const customsAgents = ref([]);
|
const customsAgents = ref([]);
|
||||||
|
@ -40,13 +38,18 @@ function handleLocation(data, location) {
|
||||||
data.countryFk = countryFk;
|
data.countryFk = countryFk;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAgentCreated(requestResponse, data) {
|
function onAgentCreated({ id, fiscalName }, data) {
|
||||||
customsAgents.value.push(requestResponse);
|
customsAgents.value.push({ id, fiscalName });
|
||||||
data.customsAgentFk = requestResponse.id;
|
data.customsAgentFk = id;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
@on-fetch="(data) => (customsAgents = data)"
|
||||||
|
auto-load
|
||||||
|
url="CustomsAgents"
|
||||||
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
@on-fetch="(data) => (agencyModes = data)"
|
@on-fetch="(data) => (agencyModes = data)"
|
||||||
auto-load
|
auto-load
|
||||||
|
@ -57,7 +60,7 @@ function onAgentCreated(requestResponse, data) {
|
||||||
<FormModel
|
<FormModel
|
||||||
:form-initial-data="formInitialData"
|
:form-initial-data="formInitialData"
|
||||||
:observe-form-changes="false"
|
:observe-form-changes="false"
|
||||||
:url-create="urlCreate"
|
:url-create="`Clients/${route.params.id}/createAddress`"
|
||||||
@on-data-saved="toCustomerAddress()"
|
@on-data-saved="toCustomerAddress()"
|
||||||
model="client"
|
model="client"
|
||||||
>
|
>
|
||||||
|
@ -141,7 +144,7 @@ function onAgentCreated(requestResponse, data) {
|
||||||
<template #form>
|
<template #form>
|
||||||
<CustomerNewCustomsAgent
|
<CustomerNewCustomsAgent
|
||||||
@on-data-saved="
|
@on-data-saved="
|
||||||
(_, requestResponse) =>
|
(requestResponse, _) =>
|
||||||
onAgentCreated(requestResponse, data)
|
onAgentCreated(requestResponse, data)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue