feat: refs #7134 #7124 handle columns

This commit is contained in:
Javier Segarra 2024-11-20 14:28:41 +01:00
parent 7325be2366
commit 78e70f2b69
1 changed files with 49 additions and 49 deletions

View File

@ -6,9 +6,8 @@ import { useAcl } from 'src/composables/useAcl';
import axios from 'axios'; import axios from 'axios';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { getSupplierRisk } from 'src/composables/getRisk'; import { getSupplierRisk } from 'src/composables/getRisk';
import RightMenu from 'src/components/common/RightMenu.vue';
import { toCurrency, toDate, toDateHourMin } from 'src/filters'; import { dashIfEmpty, toCurrency, toDate, toDateHourMin } from 'src/filters';
import { useState } from 'composables/useState'; import { useState } from 'composables/useState';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { usePrintService } from 'composables/usePrintService'; import { usePrintService } from 'composables/usePrintService';
@ -74,40 +73,41 @@ const companyFilterColumn = {
}; };
const columns = computed(() => [ const columns = computed(() => [
// {
// align: 'left',
// name: 'payed',
// label: t('Date'),
// format: ({ payed }) => toDate(payed),
// cardVisible: true,
// },
{ {
align: 'left', align: 'left',
name: 'payed', name: 'dated',
label: t('Date'),
format: ({ payed }) => toDate(payed),
cardVisible: true,
},
{
align: 'left',
name: 'created',
label: t('Creation date'), label: t('Creation date'),
format: ({ created }) => toDateHourMin(created), format: ({ dated }) => toDateHourMin(dated),
cardVisible: true, cardVisible: true,
}, },
// {
// align: 'left',
// label: t('Employee'),
// columnField: {
// component: 'userLink',
// attrs: ({ row }) => {
// return {
// workerId: row.workerFk,
// name: row.userName,
// };
// },
// },
// cardVisible: true,
// },
{ {
align: 'left', align: 'left',
label: t('Employee'), name: 'sref',
columnField: {
component: 'userLink',
attrs: ({ row }) => {
return {
workerId: row.workerFk,
name: row.userName,
};
},
},
cardVisible: true,
},
{
align: 'left',
name: 'description',
label: t('Reference'), label: t('Reference'),
isTitle: true, isTitle: true,
class: 'extend', class: 'extend',
format: ({ sref }) => dashIfEmpty(sref),
}, },
{ {
align: 'left', align: 'left',
@ -117,23 +117,23 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'debit', name: 'invoiceEuros',
label: t('Debit'), label: t('Debit'),
format: ({ debit }) => debit && toCurrency(debit), format: ({ invoiceEuros }) => invoiceEuros && toCurrency(invoiceEuros),
isId: true, isId: true,
}, },
{ {
align: 'left', align: 'left',
name: 'credit', name: 'paymentEuros',
label: t('Havings'), label: t('Havings'),
format: ({ credit }) => credit && toCurrency(credit), format: ({ paymentEuros }) => paymentEuros && toCurrency(paymentEuros),
cardVisible: true, cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
name: 'balance', name: 'euroBalance',
label: t('Balance'), label: t('Balance'),
format: ({ balance }) => toCurrency(balance), format: ({ euroBalance }) => toCurrency(euroBalance),
cardVisible: true, cardVisible: true,
}, },
{ {
@ -146,23 +146,23 @@ const columns = computed(() => [
align: 'left', align: 'left',
name: 'tableActions', name: 'tableActions',
actions: [ actions: [
{ // {
title: t('globals.downloadPdf'), // title: t('globals.downloadPdf'),
icon: 'cloud_download', // icon: 'cloud_download',
show: (row) => row.isInvoice, // show: (row) => row.isInvoice,
action: (row) => showBalancePdf(row), // action: (row) => showBalancePdf(row),
}, // },
{ // {
title: t('Send compensation'), // title: t('Send compensation'),
icon: 'outgoing_mail', // icon: 'outgoing_mail',
show: (row) => !!row.isCompensation, // show: (row) => !!row.isCompensation,
action: ({ id }) => // action: ({ id }) =>
openConfirmationModal( // openConfirmationModal(
t('Send compensation'), // t('Send compensation'),
t('Do you want to report compensation to the supplier by mail?'), // t('Do you want to report compensation to the supplier by mail?'),
() => sendEmail(`Receipts/${id}/balance-compensation-email`) // () => sendEmail(`Receipts/${id}/balance-compensation-email`)
), // ),
}, // },
], ],
}, },
]); ]);