#7119 add VehicleList page and routing configuration #1129

Merged
jorgep merged 71 commits from 7119-createVehicle into dev 2025-02-06 09:24:16 +00:00
8 changed files with 96 additions and 32 deletions
Showing only changes of commit 834f686475 - Show all commits

View File

@ -358,6 +358,7 @@ globals:
fuel: Fuel fuel: Fuel
active: Active active: Active
inactive: Inactive inactive: Inactive
deliveryPoint: Delivery point
errors: errors:
statusUnauthorized: Access denied statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred statusInternalServerError: An internal server error has ocurred

View File

@ -360,6 +360,7 @@ globals:
fuel: Combustible fuel: Combustible
active: Activo active: Activo
inactive: Inactivo inactive: Inactivo
deliveryPoint: Punto de entrega
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

@ -41,22 +41,8 @@ const bankPolicies = ref([]);
<FormModel model="Vehicle" :url-update="`Vehicles/${$route.params.id}`"> <FormModel model="Vehicle" :url-update="`Vehicles/${$route.params.id}`">
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>
<VnInput v-model="data.numberPlate" :label="$t('vehicle.numberPlate')" />
<VnInput v-model="data.description" :label="$t('globals.description')" /> <VnInput v-model="data.description" :label="$t('globals.description')" />
</VnRow> <VnInput v-model="data.numberPlate" :label="$t('vehicle.numberPlate')" />
<VnRow>
<VnInput
v-model="data.tradeMark"
:label="$t('vehicle.tradeMark')"
:required="true"
/>
<VnSelect
v-model="data.fuelTypeFk"
:label="$t('globals.fuel')"
:options="fuelTypes"
option-label="name"
option-value="id"
/>
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnInput <VnInput
@ -69,15 +55,21 @@ const bankPolicies = ref([]);
v-model="data.vehicleTypeFk" v-model="data.vehicleTypeFk"
:label="$t('globals.type')" :label="$t('globals.type')"
/> />
<VnSelect
url="Ppes"
option-label="id"
v-model="data.ppeFk"
:label="$t('vehicle.ppe')"
/>
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnInput
v-model="data.tradeMark"
:label="$t('vehicle.tradeMark')"
:required="true"
/>
<VnInput v-model="data.chassis" :label="$t('vehicle.chassis')" /> <VnInput v-model="data.chassis" :label="$t('vehicle.chassis')" />
</VnRow>
<VnRow>
<VnSelect
v-model="data.fuelTypeFk"
:label="$t('globals.fuel')"
:options="fuelTypes"
/>
<VnInput v-model="data.vin" :label="$t('vehicle.vin')" /> <VnInput v-model="data.vin" :label="$t('vehicle.vin')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
@ -107,7 +99,6 @@ const bankPolicies = ref([]);
:label="$t('vehicle.supplierCooler')" :label="$t('vehicle.supplierCooler')"
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnSelect <VnSelect
url="BankPolicies" url="BankPolicies"
@ -121,30 +112,36 @@ const bankPolicies = ref([]);
<VnInput v-model="data.leasing" :label="$t('vehicle.nLeasing')" /> <VnInput v-model="data.leasing" :label="$t('vehicle.nLeasing')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnInputNumber v-model="data.import" :label="$t('globals.amount')" />
<VnInputNumber
v-model="data.importCooler"
:label="$t('vehicle.amountCooler')"
/>
</VnRow>
<VnRow>
<VnSelect
url="Ppes"
option-label="id"
v-model="data.ppeFk"
:label="$t('vehicle.ppe')"
/>
<VnSelect <VnSelect
v-model="data.countryCodeFk" v-model="data.countryCodeFk"
:label="$t('vehicle.countryCode')" :label="$t('globals.country')"
:options="countries" :options="countries"
option-label="code" option-label="code"
option-value="code" option-value="code"
/> />
<VnInputNumber v-model="data.import" :label="$t('globals.amount')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<span>
<QCheckbox
v-model="data.isKmTruckRate"
:label="$t('vehicle.isKmTruckRate')"
:false-value="0"
:true-value="1"
/>
</span>
<span> <span>
<QCheckbox <QCheckbox
v-model="data.isActive" v-model="data.isActive"
:label="$t('vehicle.isActive')" :label="$t('vehicle.isActive')"
:false-value="0" :false-value="0"
:true-value="1" :true-value="1"
dense
class="q-mt-sm"
/> />
</span> </span>
</VnRow> </VnRow>

View File

@ -86,6 +86,10 @@ const links = {
:label="$t('globals.company')" :label="$t('globals.company')"
:value="entity.company?.code" :value="entity.company?.code"
/> />
<VnLv
:label="$t('globals.deliveryPoint')"
:value="entity.deliveryPoint?.name"
/>
<VnLv <VnLv
:label="$t('globals.country')" :label="$t('globals.country')"
:value="entity.countryCodeFk" :value="entity.countryCodeFk"

View File

@ -13,6 +13,7 @@ export default {
'tradeMark', 'tradeMark',
'fuelTypeFk', 'fuelTypeFk',
'import', 'import',
'importCooler',
'vin', 'vin',
'model', 'model',
'ppeFk', 'ppeFk',
@ -20,6 +21,7 @@ export default {
'leasing', 'leasing',
'bankPolicyFk', 'bankPolicyFk',
'vehicleTypeFk', 'vehicleTypeFk',
'deliveryPointFk',
], ],
include: [ include: [
{ {
@ -64,5 +66,11 @@ export default {
fields: ['id'], fields: ['id'],
}, },
}, },
{
relation: 'deliveryPoint',
scope: {
fields: ['id', 'name'],
},
},
], ],
}; };

View File

@ -6,6 +6,8 @@ import FetchData from 'src/components/FetchData.vue';
import VehicleSearchbar from 'src/pages/Route/Vehicle/VehicleSearchbar.vue'; import VehicleSearchbar from 'src/pages/Route/Vehicle/VehicleSearchbar.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VehicleSummary from 'src/pages/Route/Vehicle/Card/VehicleSummary.vue'; import VehicleSummary from 'src/pages/Route/Vehicle/Card/VehicleSummary.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
@ -14,6 +16,7 @@ const companies = ref([]);
const countries = ref([]); const countries = ref([]);
const vehicleStates = ref([]); const vehicleStates = ref([]);
const vehicleTypes = ref([]); const vehicleTypes = ref([]);
const deliveryPoints = ref([]);
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -150,12 +153,25 @@ const columns = computed(() => [
@on-fetch="(data) => (vehicleTypes = data)" @on-fetch="(data) => (vehicleTypes = data)"
auto-load auto-load
/> />
<FetchData
url="DeliveryPoints"
:filter="{ fields: ['id', 'name'] }"
@on-fetch="(data) => (deliveryPoints = data)"
auto-load
/>
<VehicleSearchbar /> <VehicleSearchbar />
<VnTable <VnTable
ref="tableRef"
data-key="VehicleList" data-key="VehicleList"
url="Vehicles/filter" url="Vehicles/filter"
:columns="columns" :columns="columns"
redirect="vehicle" redirect="vehicle"
:create="{
urlCreate: 'Vehicles',
title: t('vehicle.create'),
onDataSaved: ({ id }) => $refs.tableRef.redirect(id),
formInitialData: { isActive: true, isKmTruckRate: false },
}"
> >
<template #column-isActive="{ row }"> <template #column-isActive="{ row }">
<span> <span>
@ -164,5 +180,38 @@ const columns = computed(() => [
</QIcon> </QIcon>
</span> </span>
</template> </template>
<template #more-create-dialog="{ data }">
<VnInput
v-model="data.numberPlate"
:label="$t('vehicle.numberPlate')"
:uppercase="true"
/>
<VnInput v-model="data.tradeMark" :label="$t('vehicle.tradeMark')" />
<VnInput v-model="data.model" :label="$t('globals.model')" />
<VnSelect
v-model="data.vehicleTypeFk"
:label="$t('globals.type')"
:options="vehicleTypes"
/>
<VnSelect
v-model="data.warehouseFk"
:label="$t('globals.warehouse')"
:options="warehouses"
/>
<VnSelect
v-model="data.countryCodeFk"
:label="$t('globals.country')"
option-value="code"
option-label="code"
:options="countries"
/>
<VnInput v-model="data.description" :label="$t('globals.description')" />
<VnSelect
v-model="data.deliveryPointFk"
:label="$t('globals.deliveryPoint')"
:options="deliveryPoints"
/>
<QCheckbox to v-model="data.isActive" :label="$t('globals.active')" />
</template>
</VnTable> </VnTable>
</template> </template>

View File

@ -10,6 +10,8 @@ vehicle:
ppe: Ppe ppe: Ppe
isActive: Active isActive: Active
nLeasing: Nº Leasing nLeasing: Nº Leasing
create: Create Vehicle
amountCooler: Amount cooler
searchbar: searchbar:
label: Search Vehicle label: Search Vehicle
info: Search by id or number plate info: Search by id or number plate

View File

@ -8,6 +8,8 @@ vehicle:
supplierCooler: Proveedor Frío supplierCooler: Proveedor Frío
vin: VIN vin: VIN
ppe: Nº Inmovilizado ppe: Nº Inmovilizado
create: Crear vehículo
amountCooler: Importe frío
isActive: Activo isActive: Activo
nLeasing: Nº leasing nLeasing: Nº leasing
searchbar: searchbar: