feat: refs #8115 add new filter options
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
d66dda0b2e
commit
c74f589b2c
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref} from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
@ -16,6 +16,11 @@ defineProps({
|
||||||
|
|
||||||
const sectors = ref([]);
|
const sectors = ref([]);
|
||||||
const emit = defineEmits(['search']);
|
const emit = defineEmits(['search']);
|
||||||
|
|
||||||
|
const updateParams = () => {
|
||||||
|
emit('search');
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -26,7 +31,11 @@ const emit = defineEmits(['search']);
|
||||||
@on-fetch="(data) => (sectors = data)"
|
@on-fetch="(data) => (sectors = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel :data-key="dataKey" :search-button="true" @search="emit('search')">
|
<VnFilterPanel
|
||||||
|
:data-key="dataKey"
|
||||||
|
:search-button="true"
|
||||||
|
@search="updateParams"
|
||||||
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
@ -36,9 +45,56 @@ const emit = defineEmits(['search']);
|
||||||
<template #body="{ params }">
|
<template #body="{ params }">
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput :label="t('params.code')" v-model="params.code" filled />
|
<VnInput
|
||||||
|
:label="t('params.block')"
|
||||||
|
v-model="params.block"
|
||||||
|
filled
|
||||||
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<div class="row q-gutter-sm">
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.streetFrom')"
|
||||||
|
v-model.number="params.streetFrom"
|
||||||
|
type="number"
|
||||||
|
filled
|
||||||
|
class="col"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.streetTo')"
|
||||||
|
v-model.number="params.streetTo"
|
||||||
|
type="number"
|
||||||
|
filled
|
||||||
|
class="col"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<div class="row q-gutter-sm">
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.numberFrom')"
|
||||||
|
v-model="params.numberFrom"
|
||||||
|
type="number"
|
||||||
|
filled
|
||||||
|
class="col"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.numberTo')"
|
||||||
|
v-model="params.numberTo"
|
||||||
|
type="number"
|
||||||
|
filled
|
||||||
|
class="col"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -64,9 +120,19 @@ en:
|
||||||
code: Code
|
code: Code
|
||||||
sectorFk: Sector
|
sectorFk: Sector
|
||||||
search: General Search
|
search: General Search
|
||||||
|
block: Block
|
||||||
|
streetFrom: Street (From)
|
||||||
|
streetTo: Street (To)
|
||||||
|
numberFrom: Number (From)
|
||||||
|
numeroTo: Number (To)
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
code: Código
|
code: Código
|
||||||
search: Búsqueda general
|
search: Búsqueda general
|
||||||
|
sectorFk: Sector
|
||||||
</i18n>
|
block: Bloque
|
||||||
|
streetFrom: Calle (Desde)
|
||||||
|
streetTo: Calle (Hasta)
|
||||||
|
numberFrom: Número (Desde)
|
||||||
|
numberTo: Número (Hasta)
|
||||||
|
</i18n>
|
|
@ -24,10 +24,6 @@ const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||||
onMounted(() => (stateStore.rightDrawer = true));
|
onMounted(() => (stateStore.rightDrawer = true));
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
const filter = {
|
|
||||||
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -42,7 +38,7 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'sector',
|
name: 'sector',
|
||||||
label: t('parking.sector'),
|
label: t('parking.sector'),
|
||||||
format: (val) => val.sector.description ?? '',
|
format: (val) => val.sector_description ?? '',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
|
@ -79,10 +75,10 @@ function openPdf(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadPdf() {
|
function downloadPdf() {
|
||||||
if (selectedRows.value.size === 0) return;
|
if (selectedRows.value.length === 0) return;
|
||||||
const selectedCardsArray = Array.from(selectedRows.value.values());
|
const selectedCardsArray = selectedRows.value;
|
||||||
|
|
||||||
if (selectedRows.value.size === 1) {
|
if (selectedRows.value.length === 1) {
|
||||||
const [parking] = selectedCardsArray;
|
const [parking] = selectedCardsArray;
|
||||||
openPdf(parking.id);
|
openPdf(parking.id);
|
||||||
} else {
|
} else {
|
||||||
|
@ -102,46 +98,38 @@ function downloadPdf() {
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
prefix="parking"
|
prefix="parking"
|
||||||
|
:columns="columns"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Parkings',
|
url: 'Parkings/filter',
|
||||||
order: ['code'],
|
order: ['code'],
|
||||||
userFilter: filter,
|
|
||||||
exprBuilder,
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
<ParkingFilter data-key="ParkingList" />
|
<ParkingFilter data-key="ParkingList" />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
|
<QBtn
|
||||||
|
color="primary"
|
||||||
|
icon-right="cloud_download"
|
||||||
|
@click="downloadPdf()"
|
||||||
|
:disable="!hasSelectedCards"
|
||||||
|
data-cy="ParkingDownloadPdfBtn"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('globals.downloadPdf') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
is-editable="false"
|
is-editable="false"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:use-model="true"
|
|
||||||
redirect="shelving/parking"
|
redirect="shelving/parking"
|
||||||
default-mode="table"
|
|
||||||
v-model:selected="selectedRows"
|
v-model:selected="selectedRows"
|
||||||
:table="{
|
:table="{
|
||||||
'row-key': 'id',
|
'row-key': 'id',
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #actions="{ row }">
|
|
||||||
<QBtn
|
|
||||||
:label="t('components.smartCard.openSummary')"
|
|
||||||
@click.stop="viewSummary(row.id, ParkingSummary)"
|
|
||||||
color="primary"
|
|
||||||
/>
|
|
||||||
<QBtn
|
|
||||||
:label="t('globals.downloadPdf')"
|
|
||||||
@click.stop="openPdf(row.id)"
|
|
||||||
color="primary"
|
|
||||||
class="q-ml-sm"
|
|
||||||
icon-right="cloud_download"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
</VnSection>
|
</VnSection>
|
||||||
|
|
Loading…
Reference in New Issue