add new filter by days
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-07-11 19:56:37 +02:00
parent 3a2b27484a
commit 73049f7282
1 changed files with 27 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import { toDate } from 'src/filters/index';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import EntryBuysTableDialog from './EntryBuysTableDialog.vue'; import EntryBuysTableDialog from './EntryBuysTableDialog.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnInput from 'src/components/common/VnInput.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
@ -34,6 +35,10 @@ const columns = computed(() => [
isTitle: false, isTitle: false,
create: true, create: true,
cardVisible: true, cardVisible: true,
component: 'date',
columnField: {
component: null,
},
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
}, },
{ {
@ -43,6 +48,10 @@ const columns = computed(() => [
isTitle: false, isTitle: false,
create: true, create: true,
cardVisible: false, cardVisible: false,
component: 'date',
columnField: {
component: null,
},
format: ({ landed }) => toDate(landed), format: ({ landed }) => toDate(landed),
}, },
{ {
@ -75,6 +84,7 @@ const printBuys = (rowId) => {
}, },
}); });
}; };
const DEFAULT_INTERVAL_DAYS = 3;
</script> </script>
<template> <template>
<VnSearchbar <VnSearchbar
@ -93,14 +103,30 @@ const printBuys = (rowId) => {
:columns="columns" :columns="columns"
default-mode="card" default-mode="card"
auto-load auto-load
:right-search="true"
:filter="{ days: DEFAULT_INTERVAL_DAYS }"
> >
<template #moreFilterPanel="{ params }">
<VnInput
:label="t('params.scopeDays')"
v-model="params.days"
class="q-px-xs q-pb-xs q-pt-none fit"
dense
filled
outlined
></VnInput>
</template>
</VnTable> </VnTable>
</div> </div>
</QPage> </QPage>
</template> </template>
<i18n> <i18n>
en:
params:
scopeDays: Days onward
es: es:
Search entries: Buscar entradas params:
scopeDays: Días adelante
You can search by entry reference: Puedes buscar por referencia de la entrada You can search by entry reference: Puedes buscar por referencia de la entrada
</i18n> </i18n>