Merge branch 'Hotfix-ZoneEventsExclusion' of https://gitea.verdnatura.es/verdnatura/salix-front into Hotfix-ZoneEventsExclusion
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Jon Elias 2024-11-28 07:21:04 +01:00
commit b2e99230b3
1 changed files with 18 additions and 20 deletions

View File

@ -43,16 +43,17 @@ const columns = computed(() => [
{
align: 'left',
name: 'ref',
label: t('invoiceOutList.tableVisibleColumns.ref'),
label: t('globals.reference'),
isTitle: true,
component: 'select',
attrs: {
url: MODEL,
optionLabel: 'ref',
optionValue: 'id',
optionValue: 'ref',
},
columnField: {
component: null,
columnField: { component: null },
columnFilter: {
inWhere: true,
},
},
{
@ -147,25 +148,22 @@ function openPdf(id) {
}
function downloadPdf() {
if (selectedRows.value.size === 0) return;
const selectedCardsArray = Array.from(selectedRows.value.values());
if (selectedRows.value.size === 0) return;
const selectedCardsArray = Array.from(selectedRows.value.values());
if (selectedRows.value.size === 1) {
const [invoiceOut] = selectedCardsArray;
openPdf(invoiceOut.id);
} else {
const invoiceOutIdsArray = selectedCardsArray.map(
(invoiceOut) => invoiceOut.id
);
const invoiceOutIds = invoiceOutIdsArray.join(',');
if (selectedRows.value.size === 1) {
const [invoiceOut] = selectedCardsArray;
openPdf(invoiceOut.id);
} else {
const invoiceOutIdsArray = selectedCardsArray.map((invoiceOut) => invoiceOut.id);
const invoiceOutIds = invoiceOutIdsArray.join(',');
const params = {
ids: invoiceOutIds,
};
openReport(`${MODEL}/downloadZip`, params);
}
const params = {
ids: invoiceOutIds,
};
openReport(`${MODEL}/downloadZip`, params);
}
}
watchEffect(selectedRows);