perf: refs #7134 #7134 fix filter panel

This commit is contained in:
Javier Segarra 2024-12-05 09:10:55 +01:00
parent a5f41871ae
commit 4fc3e1fabb
1 changed files with 53 additions and 26 deletions

View File

@ -44,6 +44,7 @@ const filter = computed(() => {
return {
supplierId: route.params.id,
companyId: companyId.value ?? companyUser.value,
isBooked: false,
};
});
@ -138,33 +139,10 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'isConciliate',
name: 'isBooked',
label: t('Conciliated'),
cardVisible: true,
},
{
align: 'left',
name: 'tableActions',
actions: [
// {
// title: t('globals.downloadPdf'),
// icon: 'cloud_download',
// show: (row) => row.isInvoice,
// action: (row) => showBalancePdf(row),
// },
// {
// title: t('Send compensation'),
// icon: 'outgoing_mail',
// show: (row) => !!row.isCompensation,
// action: ({ id }) =>
// openConfirmationModal(
// t('Send compensation'),
// t('Do you want to report compensation to the supplier by mail?'),
// () => sendEmail(`Receipts/${id}/balance-compensation-email`)
// ),
// },
],
},
]);
onBeforeMount(() => {
@ -223,7 +201,7 @@ function round(value) {
</script>
<template>
<!-- <VnSubToolbar class="q-mb-md">
<VnSubToolbar class="q-mb-md">
<template #st-data>
<div class="column justify-center q-px-md q-py-sm">
<span class="text-bold">{{ t('Total by company') }}</span>
@ -244,7 +222,7 @@ function round(value) {
/>
</div>
</template>
</VnSubToolbar> -->
</VnSubToolbar>
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<SupplierBalanceFilter data-key="SupplierBalance" />
</QDrawer>
@ -258,9 +236,58 @@ function round(value) {
:right-search="false"
:is-editable="false"
:column-search="false"
@on-fetch="onFetch"
:disable-option="{ card: true }"
:footer="true"
auto-load
>
<template #column-balance="{ rowIndex }">
{{ toCurrency(balances[rowIndex]?.balance) }}
</template>
<template #column-description="{ row }">
<div class="link" v-if="row.isInvoice">
{{ t('bill', { ref: row.description }) }}
<InvoiceOutDescriptorProxy :id="row.description" />
</div>
<span v-else class="q-pa-xs dotted rounded-borders" :title="row.description">
{{ row.description }}
</span>
<QPopupEdit
v-model="row.description"
v-slot="scope"
@save="
(value) =>
value != row.description &&
axios.patch(`Receipts/${row.id}`, { description: value })
"
auto-save
>
<VnInput
v-model="scope.value"
:disable="
!hasAny([{ model: 'Receipt', props: '*', accessType: 'WRITE' }])
"
@keypress.enter="scope.set"
autofocus
/>
</QPopupEdit>
</template>
<template #column-footer-invoiceEuros>
<span>
{{ round(tableRef.footer.invoiceEuros) }}
</span>
</template>
<template #column-footer-paymentEuros>
<span>
{{ round(tableRef.footer.paymentEuros) }}
</span>
</template>
<template #column-footer-euroBalance>
<span>
{{ round(tableRef.footer.euroBalance) }}
</span>
</template>
</VnTable>
<QPageSticky :offset="[18, 18]" style="z-index: 2">
<QBtn