0
0
Fork 0

Merge pull request 'bugfix/SupplierConsumptionDateRanges' (!312) from hyervoni/salix-front-mindshore:bugfix/SupplierConsumptionDateRanges into dev

Reviewed-on: verdnatura/salix-front#312
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Javier Segarra 2024-04-22 12:48:00 +00:00
commit 036dcaadd2
1 changed files with 5 additions and 18 deletions

View File

@ -1,6 +1,6 @@
<script setup>
import { useRoute } from 'vue-router';
import { computed, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
@ -33,20 +33,8 @@ const arrayData = useArrayData('SupplierConsumption', {
const store = arrayData.store;
const dateRanges = computed(() => {
const ranges = {
from: null,
to: null,
};
if (route.query && route.query.params) {
const params = JSON.parse(route.query.params);
if (params.from && params.to) {
ranges.from = params.from;
ranges.to = params.to;
}
}
return ranges;
const { from, to } = arrayData.store?.userParams || {};
return { from, to };
});
const reportParams = computed(() => ({
@ -117,7 +105,7 @@ onMounted(async () => {
<template>
<Teleport to="#st-actions" v-if="stateStore.isSubToolbarShown()">
<QBtn
:disabled="!dateRanges.from && !dateRanges.to"
:disabled="!dateRanges.from || !dateRanges.to || !rows.length"
color="primary"
icon-right="picture_as_pdf"
no-caps
@ -129,7 +117,7 @@ onMounted(async () => {
</QTooltip>
</QBtn>
<QBtn
:disabled="!dateRanges.from && !dateRanges.to"
:disabled="!dateRanges.from || !dateRanges.to || !rows.length"
color="primary"
icon-right="email"
no-caps
@ -140,7 +128,6 @@ onMounted(async () => {
</QTooltip>
</QBtn>
</Teleport>
<QPage class="column items-center q-pa-md">
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8">