refactor: refs #6919 update data-key and state references to use 'Customer'
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-01-08 11:58:19 +01:00
parent 74dd49ffe0
commit 8c77f6fe40
3 changed files with 8 additions and 7 deletions

View File

@ -57,6 +57,7 @@ function onBeforeSave(formData, originalData) {
:url-update="`Clients/${route.params.id}`" :url-update="`Clients/${route.params.id}`"
auto-load auto-load
:mapper="onBeforeSave" :mapper="onBeforeSave"
module="Customer"
> >
<template #form="{ data, validate }"> <template #form="{ data, validate }">
<VnRow> <VnRow>

View File

@ -5,7 +5,7 @@ import CustomerFilter from '../CustomerFilter.vue';
</script> </script>
<template> <template>
<VnCard <VnCard
data-key="Client" data-key="Customer"
:custom-url="`Clients/${$route.params.id}/getCard`" :custom-url="`Clients/${$route.params.id}/getCard`"
:descriptor="CustomerDescriptor" :descriptor="CustomerDescriptor"
:filter-panel="$route.name != 'CustomerConsumption' && CustomerFilter" :filter-panel="$route.name != 'CustomerConsumption' && CustomerFilter"

View File

@ -17,7 +17,7 @@ const state = useState();
const customer = ref(); const customer = ref();
onMounted(async () => { onMounted(async () => {
customer.value = state.get('customer'); customer.value = state.get('Customer');
if (customer.value) customer.value.webAccess = data.value?.account?.isActive; if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
}); });
@ -54,7 +54,7 @@ const debtWarning = computed(() => {
module="Customer" module="Customer"
:url="`Clients/${entityId}/getCard`" :url="`Clients/${entityId}/getCard`"
:summary="$props.summary" :summary="$props.summary"
data-key="Client" data-key="Customer"
@on-fetch="setData" @on-fetch="setData"
> >
<template #menu="{ entity }"> <template #menu="{ entity }">
@ -63,7 +63,7 @@ const debtWarning = computed(() => {
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv <VnLv
:label="t('customer.summary.payMethod')" :label="t('customer.summary.payMethod')"
:value="entity.payMethod.name" :value="entity.payMethod?.name"
/> />
<VnLv <VnLv
@ -92,7 +92,7 @@ const debtWarning = computed(() => {
</VnLv> </VnLv>
<VnLv <VnLv
:label="t('customer.extendedList.tableVisibleColumns.businessTypeFk')" :label="t('customer.extendedList.tableVisibleColumns.businessTypeFk')"
:value="entity.businessType.description" :value="entity.businessType?.description"
/> />
</template> </template>
<template #icons> <template #icons>
@ -150,13 +150,13 @@ const debtWarning = computed(() => {
<br /> <br />
{{ {{
t('unpaidDated', { t('unpaidDated', {
dated: toDate(customer.unpaid.dated), dated: toDate(customer.unpaid?.dated),
}) })
}} }}
<br /> <br />
{{ {{
t('unpaidAmount', { t('unpaidAmount', {
amount: toCurrency(customer.unpaid.amount), amount: toCurrency(customer.unpaid?.amount),
}) })
}} }}
</QTooltip> </QTooltip>