From 76469344314338a4771a676a3475155cac2621da Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 28 Nov 2023 10:11:24 -0300 Subject: [PATCH] Add csv download feature and add descriptors --- src/composables/useNotify.js | 9 +- src/i18n/en/index.js | 4 + src/i18n/es/index.js | 4 + .../InvoiceOut/InvoiceOutNegativeBases.vue | 87 +++++++++---------- src/pages/Supplier/Card/SupplierSummary.vue | 2 +- src/services/invoiceOut.service.js | 4 + src/stores/invoiceOutGlobal.js | 21 +++++ 7 files changed, 83 insertions(+), 48 deletions(-) diff --git a/src/composables/useNotify.js b/src/composables/useNotify.js index 30bb70b28..2f0e1c257 100644 --- a/src/composables/useNotify.js +++ b/src/composables/useNotify.js @@ -2,10 +2,17 @@ import { Notify } from 'quasar'; import { i18n } from 'src/boot/i18n'; export default function useNotify() { - const notify = (message, type) => { + const notify = (message, type, icon) => { + const defaultIcons = { + warning: 'warning', + negative: 'error', + positive: 'check', + }; + Notify.create({ message: i18n.global.t(message), type: type, + icon: icon ? icon : defaultIcons[type], }); }; diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 1314666c8..0f87f8e5e 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -37,6 +37,7 @@ export default { basicData: 'Basic data', }, noSelectedRows: `You don't have any line selected`, + downloadCSVSuccess: 'CSV downloaded successfully', }, errors: { statusUnauthorized: 'Access denied', @@ -422,6 +423,9 @@ export default { hasToInvoice: 'Has to Invoice', verifiedData: 'Verified Data', comercial: 'Comercial', + errors: { + downloadCsvFailed: 'CSV download failed', + }, }, }, shelving: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index dcd7c3ca8..59c76fc21 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -37,6 +37,7 @@ export default { basicData: 'Datos básicos', }, noSelectedRows: `No tienes ninguna línea seleccionada`, + downloadCSVSuccess: 'Descarga de CSV exitosa', }, errors: { statusUnauthorized: 'Acceso denegado', @@ -424,6 +425,9 @@ export default { hasToInvoice: 'Facturar', verifiedData: 'Datos comprobados', comercial: 'Comercial', + errors: { + downloadCsvFailed: 'Error al descargar CSV', + }, }, }, shelving: { diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index 7fcaaa0c0..8c0692286 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -1,21 +1,26 @@