0
0
Fork 0

feat: refs #7119 update vehicle components and localization, add vehicle type selection

This commit is contained in:
Jorge Penadés 2025-01-23 10:52:50 +01:00
parent 0c59ca8e49
commit 4836b14e3e
11 changed files with 77 additions and 61 deletions

View File

@ -355,6 +355,8 @@ globals:
isVies: Vies isVies: Vies
model: Model model: Model
fuel: Fuel fuel: Fuel
active: Active
inactive: Inactive
errors: errors:
statusUnauthorized: Access denied statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred statusInternalServerError: An internal server error has ocurred

View File

@ -357,6 +357,8 @@ globals:
isVies: Vies isVies: Vies
model: Modelo model: Modelo
fuel: Combustible fuel: Combustible
active: Activo
inactive: Inactivo
errors: errors:
statusUnauthorized: Acceso denegado statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor statusInternalServerError: Ha ocurrido un error interno del servidor

View File

@ -64,6 +64,11 @@ const bankPolicies = ref([]);
:label="$t('globals.model')" :label="$t('globals.model')"
:required="true" :required="true"
/> />
<VnSelect
url="VehicleTypes"
v-model="data.vehicleTypeFk"
:label="$t('globals.type')"
/>
<VnSelect <VnSelect
url="Ppes" url="Ppes"
option-label="id" option-label="id"

View File

@ -15,7 +15,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
<VnLv :label="$t('vehicle.numberPlate')" :value="entity.numberPlate" /> <VnLv :label="$t('vehicle.numberPlate')" :value="entity.numberPlate" />
<VnLv :label="$t('vehicle.tradeMark')" :value="entity.tradeMark" /> <VnLv :label="$t('vehicle.tradeMark')" :value="entity.tradeMark" />
<VnLv :label="$t('globals.model')" :value="entity.model" /> <VnLv :label="$t('globals.model')" :value="entity.model" />
<VnLv :label="$t('vehicle.countryCode')" :value="entity.countryCodeFk" /> <VnLv :label="$t('globals.country')" :value="entity.countryCodeFk" />
</template> </template>
</CardDescriptor> </CardDescriptor>
</template> </template>

View File

@ -1,7 +0,0 @@
<script setup>
import VnNotes from 'src/components/ui/VnNotes.vue';
</script>
<template>
<VnNotes :add-note="true" url="VehicleNotes" :body="{ userFk: $route.params.id }" />
</template>

View File

@ -75,7 +75,7 @@ const links = {
</QCardSection> </QCardSection>
<VnLv :label="$t('globals.warehouse')" :value="entity.warehouse?.name" /> <VnLv :label="$t('globals.warehouse')" :value="entity.warehouse?.name" />
<VnLv :label="$t('globals.company')" :value="entity.company?.code" /> <VnLv :label="$t('globals.company')" :value="entity.company?.code" />
<VnLv :label="$t('vehicle.countryCode')" :value="entity.countryCodeFk" /> <VnLv :label="$t('globals.country')" :value="entity.countryCodeFk" />
<VnLv <VnLv
:label="$t('vehicle.isKmTruckRate')" :label="$t('vehicle.isKmTruckRate')"
:value="!!entity.isKmTruckRate" :value="!!entity.isKmTruckRate"

View File

@ -19,6 +19,7 @@ export default {
'countryCodeFk', 'countryCodeFk',
'leasing', 'leasing',
'bankPolicyFk', 'bankPolicyFk',
'vehicleTypeFk',
], ],
include: [ include: [
{ {

View File

@ -13,8 +13,14 @@ const warehouses = ref([]);
const companies = ref([]); const companies = ref([]);
const countries = ref([]); const countries = ref([]);
const vehicleStates = ref([]); const vehicleStates = ref([]);
const vehicleTypes = ref([]);
const columns = computed(() => [ const columns = computed(() => [
{
name: 'isActive',
columnFilter: false,
align: 'center',
},
{ {
name: 'id', name: 'id',
label: t('globals.id'), label: t('globals.id'),
@ -27,17 +33,6 @@ const columns = computed(() => [
name: 'description', name: 'description',
label: t('globals.description'), label: t('globals.description'),
}, },
{
name: 'companyFk',
label: t('globals.company'),
format: (row, dashIfEmpty) => dashIfEmpty(row.company),
columnFilter: {
component: 'select',
name: 'companyFk',
optionLabel: 'code',
options: companies.value,
},
},
{ {
name: 'tradeMark', name: 'tradeMark',
label: t('vehicle.tradeMark'), label: t('vehicle.tradeMark'),
@ -48,6 +43,36 @@ const columns = computed(() => [
label: t('vehicle.numberPlate'), label: t('vehicle.numberPlate'),
isTitle: true, isTitle: true,
}, },
{
name: 'vehicleTypeFk',
label: t('globals.type'),
format: (row) => row.type,
columnFilter: {
component: 'select',
name: 'vehicleTypeFk',
options: vehicleTypes.value,
},
cardVisible: true,
},
{
name: 'vehicleStateFk',
label: t('globals.state'),
columnFilter: {
component: 'select',
name: 'vehicleStateFk',
optionLabel: 'state',
options: vehicleStates.value,
},
format: (row, dashIfEmpty) => dashIfEmpty(row.state),
},
{
name: 'chassis',
label: t('vehicle.chassis'),
},
{
name: 'leasing',
label: t('vehicle.leasing'),
},
{ {
name: 'warehouseFk', name: 'warehouseFk',
label: t('globals.warehouse'), label: t('globals.warehouse'),
@ -60,12 +85,15 @@ const columns = computed(() => [
cardVisible: true, cardVisible: true,
}, },
{ {
name: 'chassis', name: 'companyFk',
label: t('vehicle.chassis'), label: t('globals.company'),
}, format: (row, dashIfEmpty) => dashIfEmpty(row.company),
{ columnFilter: {
name: 'leasing', component: 'select',
label: t('vehicle.leasing'), name: 'companyFk',
optionLabel: 'code',
options: companies.value,
},
}, },
{ {
name: 'countryCodeFk', name: 'countryCodeFk',
@ -77,23 +105,6 @@ const columns = computed(() => [
optionLabel: 'code', optionLabel: 'code',
options: countries.value, options: countries.value,
}, },
cardVisible: true,
},
{
name: 'isKmTruckRate',
label: t('vehicle.isKmTruckRate'),
},
{
name: 'vehicleStateFk',
label: t('globals.state'),
columnFilter: {
component: 'select',
name: 'vehicleStateFk',
optionLabel: 'state',
options: vehicleStates.value,
},
sortable: false,
format: (row, dashIfEmpty) => dashIfEmpty(row.state),
}, },
{ {
align: 'right', align: 'right',
@ -133,11 +144,25 @@ const columns = computed(() => [
@on-fetch="(data) => (vehicleStates = data)" @on-fetch="(data) => (vehicleStates = data)"
auto-load auto-load
/> />
<FetchData
url="VehicleTypes"
:filter="{ fields: ['id', 'name'] }"
@on-fetch="(data) => (vehicleTypes = data)"
auto-load
/>
<VehicleSearchbar /> <VehicleSearchbar />
<VnTable <VnTable
data-key="VehicleList" data-key="VehicleList"
url="Vehicles/filter" url="Vehicles/filter"
:columns="columns" :columns="columns"
redirect="vehicle" redirect="vehicle"
/> >
<template #column-isActive="{ row }">
<span>
<QIcon v-if="!row.isActive" name="help" color="primary" size="xs">
<QTooltip>{{ $t('globals.inactive') }}</QTooltip>
</QIcon>
</span>
</template>
</VnTable>
</template> </template>

View File

@ -1,10 +1,9 @@
vehicle: vehicle:
tradeMark: Trade Mark tradeMark: Trade Mark
numberPlate: Number Plate numberPlate: Nº Plate
chassis: Chassis chassis: Chassis
leasing: Leasing leasing: Leasing
isKmTruckRate: Trailer isKmTruckRate: Trailer
countryCode: Country Code
delete: Delete Vehicle delete: Delete Vehicle
supplierCooler: Supplier Cooler supplierCooler: Supplier Cooler
vin: VIN vin: VIN

View File

@ -1,16 +1,15 @@
vehicle: vehicle:
tradeMark: Marca tradeMark: Marca
numberPlate: Matrícula numberPlate: Matrícula
chassis: Número de bastidor chassis: Nº de bastidor
leasing: leasing leasing: Leasing
isKmTruckRate: Trailer isKmTruckRate: Trailer
countryCode: Código de país
delete: Eliminar vehículo delete: Eliminar vehículo
supplierCooler: Proveedor Frío supplierCooler: Proveedor Frío
vin: VIN vin: VIN
ppe: nº Inmovilizado ppe: Nº Inmovilizado
isActive: Activo isActive: Activo
nLeasing: Leasing nLeasing: leasing
searchbar: searchbar:
label: Buscar Vehículo label: Buscar Vehículo
info: Buscar por id o matrícula info: Buscar por id o matrícula

View File

@ -41,16 +41,6 @@ export default {
component: () => component: () =>
import('src/pages/Route/Vehicle/Card/VehicleBasicData.vue'), import('src/pages/Route/Vehicle/Card/VehicleBasicData.vue'),
}, },
{
name: 'VehicleNotes',
path: 'notes',
meta: {
title: 'notes',
icon: 'vn:notes',
},
component: () =>
import('src/pages/Route/Vehicle/Card/VehicleNotes.vue'),
},
], ],
}, },
], ],