From fe1d9e93a33d2027f7922402bedd50ce3c0ea843 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 17 Dec 2024 06:27:03 +0100 Subject: [PATCH] refactor: refs #8201 added onMounted to stablish the value to show icons --- src/pages/Claim/Card/ClaimDevelopment.vue | 14 +------------- src/pages/Customer/Card/CustomerDescriptor.vue | 12 +++++++++--- src/pages/Department/Card/DepartmentBasicData.vue | 2 +- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/pages/Claim/Card/ClaimDevelopment.vue b/src/pages/Claim/Card/ClaimDevelopment.vue index e288d8614..d17c6b4e6 100644 --- a/src/pages/Claim/Card/ClaimDevelopment.vue +++ b/src/pages/Claim/Card/ClaimDevelopment.vue @@ -164,19 +164,7 @@ const columns = computed(() => [ :autofocus="col.tabIndex == 1" input-debounce="0" hide-selected - > - - + /> -import { ref, computed } from 'vue'; +import { ref, computed, onMounted } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; @@ -14,7 +14,13 @@ import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue'; import { useState } from 'src/composables/useState'; const state = useState(); -const customer = computed(() => state.get('customer')); +const customer = ref(); + +onMounted(async () => { + console.log('state.get(customer): ', state.get('customer')); + customer.value = state.get('customer'); + if (customer.value) customer.value.webAccess = data.value?.account?.isActive; +}); const $props = defineProps({ id: { @@ -38,7 +44,6 @@ const entityId = computed(() => { const data = ref(useCardDescription()); const setData = (entity) => { data.value = useCardDescription(entity?.name, entity?.id); - if (customer.value) customer.value.webAccess = data.value?.account?.isActive; }; const debtWarning = computed(() => { return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary'; @@ -94,6 +99,7 @@ const debtWarning = computed(() => { />