From a3afe790b942e0154cf6b1fc720156d223a62716 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 12 Sep 2024 12:00:07 +0200 Subject: [PATCH 01/10] fix: CustomerGreuges --- src/pages/Customer/Card/CustomerGreuges.vue | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue index 1c78392e7..1d8b8585f 100644 --- a/src/pages/Customer/Card/CustomerGreuges.vue +++ b/src/pages/Customer/Card/CustomerGreuges.vue @@ -5,10 +5,10 @@ import { useRoute } from 'vue-router'; import { toCurrency } from 'src/filters'; import { toDateTimeFormat } from 'src/filters/date'; import VnTable from 'components/VnTable/VnTable.vue'; - +import FetchData from 'components/FetchData.vue'; +const entityId = computed(() => route.params.id); const { t } = useI18n(); const route = useRoute(); -const rows = ref([]); const totalAmount = ref(); const tableRef = ref(); const filter = computed(() => { @@ -28,7 +28,7 @@ const filter = computed(() => { }, ], where: { - clientFk: route.params.id, + clientFk: entityId, }, }; }); @@ -84,14 +84,14 @@ const columns = computed(() => [ create: true, }, ]); - -const setRows = (data) => { - rows.value = data; - totalAmount.value = data.reduce((acc, { amount = 0 }) => acc + amount, 0); -};