feat: refs #7119 add vehicle parameters and improve filter functionality
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2025-01-24 10:46:44 +01:00
parent 55ab885ef9
commit 2e4610847d
8 changed files with 38 additions and 7 deletions

View File

@ -114,7 +114,7 @@ async function clearFilters() {
arrayData.resetPagination();
// Filtrar los params no removibles
const removableFilters = Object.keys(userParams.value).filter((param) =>
$props.unremovableParams.includes(param)
$props.unremovableParams.includes(param),
);
const newParams = {};
// Conservar solo los params que no son removibles
@ -162,13 +162,13 @@ const formatTags = (tags) => {
const tags = computed(() => {
const filteredTags = tagsList.value.filter(
(tag) => !($props.customTags || []).includes(tag.label)
(tag) => !($props.customTags || []).includes(tag.label),
);
return formatTags(filteredTags);
});
const customTags = computed(() =>
tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.label))
tagsList.value.filter((tag) => ($props.customTags || []).includes(tag.label)),
);
async function remove(key) {
@ -188,10 +188,13 @@ function formatValue(value) {
const getLocale = (label) => {
const param = label.split('.').at(-1);
const globalLocale = `globals.params.${param}`;
const moduleName = route.meta.moduleName;
const moduleLocale = `${moduleName.toLowerCase()}.${param}`;
if (te(globalLocale)) return t(globalLocale);
else if (te(t(`params.${param}`)));
else if (te(moduleLocale)) return t(moduleLocale);
else {
const camelCaseModuleName = route.meta.moduleName.charAt(0).toLowerCase() + route.meta.moduleName.slice(1);
const camelCaseModuleName =
moduleName.charAt(0).toLowerCase() + moduleName.slice(1);
return t(`${camelCaseModuleName}.params.${param}`);
}
};

View File

@ -326,6 +326,7 @@ globals:
maxTemperature: Max
minTemperature: Min
params:
description: Description
clientFk: Client id
salesPersonFk: Sales person
warehouseFk: Warehouse
@ -348,6 +349,7 @@ globals:
correctingFk: Rectificative
daysOnward: Days onward
countryFk: Country
countryCodeFk: Country
companyFk: Company
changePass: Change password
setPass: Set password

View File

@ -330,6 +330,7 @@ globals:
maxTemperature: Máx
minTemperature: Mín
params:
description: Descripción
clientFk: Id cliente
salesPersonFk: Comercial
warehouseFk: Almacén
@ -350,6 +351,7 @@ globals:
daysOnward: Días adelante
packing: ITP
countryFk: País
countryCodeFk: País
companyFk: Empresa
changePass: Cambiar contraseña
setPass: Establecer contraseña

View File

@ -6,6 +6,8 @@ import VnLv from 'src/components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
import VehicleFilter from '../VehicleFilter.js';
import { downloadFile } from 'src/composables/downloadFile';
import { dashIfEmpty } from 'src/filters';
const props = defineProps({ id: { type: [Number, String], default: 0 } });
@ -74,7 +76,22 @@ const links = {
<VnLv
:label="$t('vehicle.leasing')"
:value="entity.bankPolicy?.ref"
/>
>
<template #value>
<span v-text="dashIfEmpty(entity.bankPolicy?.name)" />
<QBtn
v-if="entity.bankPolicy?.dmsFk"
class="q-ml-xs"
color="primary"
flat
dense
icon="cloud_download"
@click="downloadFile(entity.bankPolicy?.dmsFk)"
>
<QTooltip>{{ $t('globals.download') }}</QTooltip>
</QBtn>
</template>
</VnLv>
<VnLv :label="$t('globals.amount')" :value="entity.import" />
</QList>
<QList dense>

View File

@ -57,7 +57,7 @@ export default {
{
relation: 'bankPolicy',
scope: {
fields: ['id', 'ref'],
fields: ['id', 'ref', 'dmsFk'],
},
},
{

View File

@ -15,3 +15,6 @@ vehicle:
searchbar:
label: Search Vehicle
info: Search by id or number plate
params:
vehicleTypeFk: Type
vehicleStateFk: State

View File

@ -15,3 +15,6 @@ vehicle:
searchbar:
label: Buscar Vehículo
info: Buscar por id o matrícula
params:
vehicleTypeFk: Tipo
vehicleStateFk: Estado

View File

@ -109,6 +109,7 @@ export default {
meta: {
title: 'vehicleList',
icon: 'directions_car',
moduleName: 'Vehicle',
},
component: () =>
import('src/pages/Route/Vehicle/VehicleList.vue'),