#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
2 changed files with 25 additions and 1 deletions
Showing only changes of commit 3807e74fe4 - Show all commits

View File

@ -5,8 +5,10 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue'; import VnTitle from 'src/components/common/VnTitle.vue';
const props = defineProps({ id: { type: [Number, String], default: 0 } });
const route = useRoute(); const route = useRoute();
const entityId = computed(() => +route.params.id); const entityId = computed(() => props.id || +route.params.id);
const links = { const links = {
'basic-data': `#/vehicle/${entityId.value}/basic-data`, 'basic-data': `#/vehicle/${entityId.value}/basic-data`,
notes: `#/vehicle/${entityId.value}/notes`, notes: `#/vehicle/${entityId.value}/notes`,

View File

@ -4,8 +4,11 @@ import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import FetchData from 'src/components/FetchData.vue'; 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 VehicleSummary from 'src/pages/Route/Vehicle/Card/VehicleSummary.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const warehouses = ref([]); const warehouses = ref([]);
const companies = ref([]); const companies = ref([]);
const countries = ref([]); const countries = ref([]);
@ -15,6 +18,10 @@ const columns = computed(() => [
{ {
name: 'id', name: 'id',
label: t('globals.id'), label: t('globals.id'),
isId: true,
chip: {
condition: () => true,
},
}, },
{ {
name: 'description', name: 'description',
@ -34,10 +41,12 @@ const columns = computed(() => [
{ {
name: 'tradeMark', name: 'tradeMark',
label: t('vehicle.tradeMark'), label: t('vehicle.tradeMark'),
cardVisible: true,
}, },
{ {
name: 'numberPlate', name: 'numberPlate',
label: t('vehicle.numberPlate'), label: t('vehicle.numberPlate'),
isTitle: true,
}, },
{ {
name: 'warehouseFk', name: 'warehouseFk',
@ -48,6 +57,7 @@ const columns = computed(() => [
name: 'warehouseFk', name: 'warehouseFk',
options: warehouses.value, options: warehouses.value,
}, },
cardVisible: true,
}, },
{ {
name: 'chassis', name: 'chassis',
@ -67,6 +77,7 @@ const columns = computed(() => [
optionLabel: 'code', optionLabel: 'code',
options: countries.value, options: countries.value,
}, },
cardVisible: true,
}, },
{ {
name: 'isKmTruckRate', name: 'isKmTruckRate',
@ -79,6 +90,17 @@ const columns = computed(() => [
sortable: false, sortable: false,
format: (row, dashIfEmpty) => dashIfEmpty(row.event?.state?.state), format: (row, dashIfEmpty) => dashIfEmpty(row.event?.state?.state),
}, },
{
align: 'right',
name: 'tableActions',
actions: [
{
title: t('components.smartCard.openSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, VehicleSummary),
},
],
},
]); ]);
</script> </script>
<template> <template>