fix: refs #7119 update VehicleList.vue to improve data formatting and add column filter for vehicle state
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-12-30 17:31:59 +01:00
parent f1f2b94747
commit 6f5aed2cbe
1 changed files with 9 additions and 4 deletions

View File

@ -30,7 +30,7 @@ const columns = computed(() => [
{ {
name: 'companyFk', name: 'companyFk',
label: t('globals.company'), label: t('globals.company'),
format: (row, dashIfEmpty) => dashIfEmpty(row.company?.code), format: (row, dashIfEmpty) => dashIfEmpty(row.company),
columnFilter: { columnFilter: {
component: 'select', component: 'select',
name: 'companyFk', name: 'companyFk',
@ -51,7 +51,7 @@ const columns = computed(() => [
{ {
name: 'warehouseFk', name: 'warehouseFk',
label: t('globals.warehouse'), label: t('globals.warehouse'),
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouse?.name), format: (row, dashIfEmpty) => dashIfEmpty(row.warehouse),
columnFilter: { columnFilter: {
component: 'select', component: 'select',
name: 'warehouseFk', name: 'warehouseFk',
@ -86,9 +86,14 @@ const columns = computed(() => [
{ {
name: 'vehicleStateFk', name: 'vehicleStateFk',
label: t('globals.state'), label: t('globals.state'),
columnFilter: false, columnFilter: {
component: 'select',
name: 'vehicleStateFk',
optionLabel: 'state',
options: vehicleStates.value,
},
sortable: false, sortable: false,
format: (row, dashIfEmpty) => dashIfEmpty(row.event?.state?.state), format: (row, dashIfEmpty) => dashIfEmpty(row.state),
}, },
{ {
align: 'right', align: 'right',