fix: customer insurance grade
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Javier Segarra 2025-04-07 12:25:16 +02:00
parent 4f821c86c1
commit e8a3dc05dd
1 changed files with 27 additions and 19 deletions

View File

@ -3,7 +3,13 @@ import { computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { toCurrency, toPercentage, toDate, dashOrCurrency } from 'src/filters';
import {
toCurrency,
toPercentage,
toDate,
dashOrCurrency,
dashIfEmpty,
} from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
@ -84,31 +90,29 @@ const sumRisk = ({ clientRisks }) => {
<VnLv :label="t('customer.summary.customerId')" :value="entity.id" />
<VnLv :label="t('globals.name')" :value="entity.name" />
<VnLv :label="t('customer.summary.contact')" :value="entity.contact" />
<VnLv :label="t('customer.extendedList.tableVisibleColumns.phone')">
<template #value>
<VnLv :value="entity.phone">
<template #label>
{{ t('customer.extendedList.tableVisibleColumns.phone') }}
<VnLinkPhone :phone-number="entity.phone" />
</template>
</VnLv>
<VnLv :label="t('customer.summary.mobile')">
<template #value>
<VnLv :value="entity.mobile">
<template #label>
{{ t('customer.summary.mobile') }}
<VnLinkPhone :phone-number="entity.mobile" />
<VnLinkPhone
sip
say-simple
:phone-number="entity.mobile"
:channel="entity.country?.saySimpleCountry?.channel"
class="q-ml-xs"
/>
</template>
</VnLv>
<VnLv
:label="t('globals.params.email')"
:value="entity.email"
class="ellipsis"
copy
>
<template #value>
<VnLinkMail :email="entity.email" />
</template>
</VnLv>
<VnLv :value="entity.email" copy
><template #label>
{{ t('globals.params.email') }}
<VnLinkMail email="entity.email"></VnLinkMail> </template
></VnLv>
<VnLv :label="t('globals.department')">
<template #value>
<span class="link" v-text="entity.department?.name" />
@ -289,10 +293,14 @@ const sumRisk = ({ clientRisks }) => {
<VnLv
v-if="entity.creditInsurance"
:label="t('customer.summary.securedCredit')"
:value="toCurrency(entity.creditInsurance)"
:info="t('customer.summary.securedCreditInfo')"
/>
>
<template #value>
{{ toCurrency(entity.creditInsurance) }}({{
dashIfEmpty(entity.classifications[0]?.insurances[0]?.grade)
}})
</template></VnLv
>
<VnLv
:label="t('customer.summary.balance')"
:value="toCurrency(sumRisk(entity)) || toCurrency(0)"