fix address map
This commit is contained in:
parent
3c75ba975e
commit
73f4b3b97a
4 changed files with 20 additions and 26 deletions
|
|
@ -10,7 +10,6 @@
|
|||
/>
|
||||
</template>
|
||||
<div class="status-cards">
|
||||
<template v-if="isNew || editMode">
|
||||
<template v-if="isNew || editMode">
|
||||
<ClientInformationForm
|
||||
ref="clientInfoRef"
|
||||
|
|
@ -160,7 +159,7 @@
|
|||
|
||||
<!-- Edit Confirmation Dialog -->
|
||||
<Dialog
|
||||
v-model:visible="showEditConfirmDialog"
|
||||
:visible="showEditConfirmDialog"
|
||||
header="Confirm Edit"
|
||||
:modal="true"
|
||||
:closable="false"
|
||||
|
|
@ -318,10 +317,10 @@ const fullAddress = computed(() => {
|
|||
|
||||
// Get contacts linked to the selected address
|
||||
const contactsForAddress = computed(() => {
|
||||
if (!selectedAddressData.value?.customLinkedContacts || !props.clientData?.contacts) return [];
|
||||
return selectedAddressData.value.customLinkedContacts
|
||||
.map((link) => props.clientData.contacts.find((c) => c.name === link.contact))
|
||||
.filter(Boolean);
|
||||
console.log("DEBUG: props.clientData:", props.clientData);
|
||||
console.log("DEBUG: Calculating contacts for address:", props.selectedAddress);
|
||||
if (!selectedAddressData.value?.customLinkedContacts && !props.clientData?.contacts) return [];
|
||||
return props.clientData.contacts
|
||||
});
|
||||
|
||||
// Selected contact index for display
|
||||
|
|
|
|||
|
|
@ -121,11 +121,11 @@ const getClient = async (name) => {
|
|||
selectedAddressObject.value?.customLatitude
|
||||
) {
|
||||
geocode.value = {
|
||||
longitude: selectedAddressObject.value.customLongitude,
|
||||
latitude: selectedAddressObject.value.customLatitude,
|
||||
longitude: selectedAddressObject.value.customLongitude || selectedAddressObject.value.longitude,
|
||||
latitude: selectedAddressObject.value.customLatitude || selectedAddressObject.value.latitude,
|
||||
};
|
||||
} else if (selectedAddress.value) {
|
||||
geocode.value = await Api.getGeocode(selectedAddress.value);
|
||||
// geocode.value = await Api.getGeocode(selectedAddress.value);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching client data in Client.vue: ", error.message || error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue