From 21731f304712983e19b4d3bc7cd5b6f071059502 Mon Sep 17 00:00:00 2001 From: Joel Crespo Date: Wed, 22 Nov 2023 09:37:58 -0300 Subject: [PATCH] fix boolean values in grid --- .../InvoiceOut/InvoiceOutNegativeBases.vue | 104 ++++++++++++++++-- 1 file changed, 93 insertions(+), 11 deletions(-) diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index cbed6c1f0..e4b8f4f89 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'; import CustomerDescriptor from 'src/pages/Customer/Card/CustomerDescriptor.vue'; */ import invoiceOutService from 'src/services/InvoiceOut.service'; import { toCurrency } from 'src/filters'; -import { exportFile } from 'quasar'; +import { QBadge, QCheckbox, exportFile } from 'quasar'; const rows = ref([]); const { t } = useI18n(); @@ -31,6 +31,53 @@ const filter = ref({ comercial: null, }); +const tableColumnComponents = { + company: { + component: 'span', + props: {}, + }, + country: { + component: 'span', + props: {}, + }, + clientId: { + component: 'a', + props: { href: '#' }, + }, + client: { + component: 'span', + props: {}, + }, + amount: { + component: 'span', + props: {}, + }, + base: { + component: 'span', + props: {}, + }, + ticketId: { + component: 'span', + props: {}, + }, + active: { + component: 'span', + props: { type: 'boolean' }, + }, + hasToInvoice: { + component: 'span', + props: { type: 'boolean' }, + }, + verifiedData: { + component: 'span', + props: { type: 'boolean' }, + }, + comercial: { + component: 'a', + props: { href: '#' }, + }, +}; + const columns = ref([ { label: 'company', @@ -135,17 +182,23 @@ const exportTable = () => { }; const search = async () => { + const and = []; + Object.keys(filter.value).forEach((key) => { + if (filter.value[key]) { + and.push({ + [key]: filter.value[key], + }); + } + }); + const params = { ...payload.value, filter: { limit: 20, - where: { - ...filter.value, - }, + where: { and }, }, }; - console.log(params); - rows.value = await invoiceOutService.getNegativeBases(payload.value); + rows.value = await invoiceOutService.getNegativeBases(params); }; const refresh = () => { @@ -153,6 +206,19 @@ const refresh = () => { from: new Date('2001-01-01'), to: new Date('2001-01-31'), }; + filter.value = { + company: null, + country: null, + clientId: null, + client: null, + amount: null, + base: null, + ticketId: null, + active: null, + hasToInvoice: null, + verifiedData: null, + comercial: null, + }; search(); }; @@ -178,7 +244,7 @@ onMounted(async () => { v-model="payload.from" type="date" mask="date" - class="q-mr-sm q" + class="q-mr-md q" :label="t('invoiceOut.negativeBases.from')" /> { - +