From a36d83547be8e2cfa15fb8163e89b72ab27ab3b2 Mon Sep 17 00:00:00 2001 From: jtubau Date: Tue, 18 Feb 2025 14:47:55 +0100 Subject: [PATCH] refactor: refs #8630 add vehicle translations and enhance route list columns --- src/composables/getColAlign.js | 1 + src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Route/Card/RouteFilter.vue | 54 +++++-------------------- src/pages/Route/RouteExtendedList.vue | 57 +++++++++++++-------------- src/pages/Route/RouteList.vue | 44 +++++++++++++++------ src/pages/Route/locale/en.yml | 40 +++++++++++-------- src/pages/Route/locale/es.yml | 47 ++++++++++++---------- 8 files changed, 123 insertions(+), 122 deletions(-) diff --git a/src/composables/getColAlign.js b/src/composables/getColAlign.js index c0338a984..ed6fe30d4 100644 --- a/src/composables/getColAlign.js +++ b/src/composables/getColAlign.js @@ -8,6 +8,7 @@ export function getColAlign(col) { align = 'right'; break; case 'date': + case 'time': case 'checkbox': align = 'center'; break; diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index acfdefb67..669d776b4 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -157,6 +157,7 @@ globals: raid: 'Raid {daysInForward} days' isVies: Vies noData: No data available + vehicle: Vehicle pageTitles: logIn: Login addressEdit: Update address diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 6bf3affc0..44fb56e75 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -161,6 +161,7 @@ globals: raid: 'Redada {daysInForward} días' isVies: Vies noData: Datos no disponibles + vehicle: Vehículo pageTitles: logIn: Inicio de sesión addressEdit: Modificar consignatario diff --git a/src/pages/Route/Card/RouteFilter.vue b/src/pages/Route/Card/RouteFilter.vue index 21858102b..cb5158517 100644 --- a/src/pages/Route/Card/RouteFilter.vue +++ b/src/pages/Route/Card/RouteFilter.vue @@ -25,7 +25,7 @@ const emit = defineEmits(['search']); > @@ -33,6 +33,7 @@ const emit = defineEmits(['search']); @@ -146,7 +147,7 @@ const emit = defineEmits(['search']); @@ -154,38 +155,3 @@ const emit = defineEmits(['search']); - - -en: - params: - warehouseFk: Warehouse - description: Description - m3: m³ - scopeDays: Days Onward - vehicleFk: Vehicle - agencyModeFk: Agency - workerFk: Worker - from: From - to: To - Served: Served -es: - params: - warehouseFk: Almacén - description: Descripción - m3: m³ - scopeDays: Días en adelante - vehicleFk: Vehículo - agencyModeFk: Agencia - workerFk: Trabajador - from: Desde - to: Hasta - Warehouse: Almacén - Description: Descripción - Vehicle: Vehículo - Agency: Agencia - Worker: Trabajador - From: Desde - To: Hasta - Served: Servida - Days Onward: Días en adelante - diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue index 46bc1a690..bae8d25c2 100644 --- a/src/pages/Route/RouteExtendedList.vue +++ b/src/pages/Route/RouteExtendedList.vue @@ -38,7 +38,7 @@ const routeFilter = { }; const columns = computed(() => [ { - align: 'center', + align: 'right', name: 'id', label: 'Id', chip: { @@ -46,11 +46,11 @@ const columns = computed(() => [ }, isId: true, columnFilter: false, + width: '25px', }, { - align: 'center', name: 'workerFk', - label: t('route.Worker'), + label: t('globals.worker'), create: true, component: 'select', attrs: { @@ -71,9 +71,8 @@ const columns = computed(() => [ format: (row, dashIfEmpty) => dashIfEmpty(row.workerUserName), }, { - align: 'center', name: 'agencyModeFk', - label: t('route.Agency'), + label: t('globals.agency'), isTitle: true, cardVisible: true, create: true, @@ -90,9 +89,8 @@ const columns = computed(() => [ format: (row, dashIfEmpty) => dashIfEmpty(row.agencyName), }, { - align: 'center', name: 'vehicleFk', - label: t('route.Vehicle'), + label: t('globals.vehicle'), cardVisible: true, create: true, component: 'select', @@ -111,9 +109,8 @@ const columns = computed(() => [ format: (row, dashIfEmpty) => dashIfEmpty(row.vehiclePlateNumber), }, { - align: 'center', name: 'dated', - label: t('route.Date'), + label: t('globals.date'), columnFilter: false, cardVisible: true, create: true, @@ -122,9 +119,8 @@ const columns = computed(() => [ dated === '0000-00-00' ? dashIfEmpty(null) : toDate(dated), }, { - align: 'center', name: 'from', - label: t('route.From'), + label: t('globals.from'), visible: false, cardVisible: true, create: true, @@ -132,9 +128,8 @@ const columns = computed(() => [ format: ({ from }) => toDate(from), }, { - align: 'center', name: 'to', - label: t('route.To'), + label: t('globals.to'), visible: false, cardVisible: true, create: true, @@ -142,30 +137,31 @@ const columns = computed(() => [ format: ({ date }) => toDate(date), }, { - align: 'center', + align: 'right', name: 'm3', label: 'm3', cardVisible: true, columnClass: 'shrink', + width: '50px', }, { - align: 'center', name: 'started', label: t('route.hourStarted'), component: 'time', columnFilter: false, format: ({ started }) => toHour(started), + width: '50px', }, { - align: 'center', name: 'finished', label: t('route.hourFinished'), component: 'time', columnFilter: false, format: ({ finished }) => toHour(finished), + width: '50px', }, { - align: 'center', + align: 'right', name: 'kmStart', label: t('route.KmStart'), columnClass: 'shrink', @@ -173,7 +169,7 @@ const columns = computed(() => [ visible: false, }, { - align: 'center', + align: 'right', name: 'kmEnd', label: t('route.KmEnd'), columnClass: 'shrink', @@ -181,16 +177,15 @@ const columns = computed(() => [ visible: false, }, { - align: 'center', + align: 'left', name: 'description', - label: t('route.Description'), + label: t('globals.description'), isTitle: true, create: true, component: 'input', field: 'description', }, { - align: 'center', name: 'isOk', label: t('route.Served'), component: 'checkbox', @@ -202,7 +197,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('route.Add tickets'), + title: t('route.addTicket'), icon: 'vn:ticketAdd', action: (row) => openTicketsDialog(row?.id), isPrimary: true, @@ -214,7 +209,7 @@ const columns = computed(() => [ isPrimary: true, }, { - title: t('route.Route summary'), + title: t('route.routeSummary'), icon: 'arrow_forward', action: (row) => navigate(row?.id), isPrimary: true, @@ -276,11 +271,13 @@ const openTicketsDialog = (id) => { -

{{ t('route.Select the starting date') }}

+

+ {{ t('route.extendedList.selectStartingDate') }} +

@@ -288,7 +285,7 @@ const openTicketsDialog = (id) => { @@ -339,7 +336,7 @@ const openTicketsDialog = (id) => { :disable="!selectedRows?.length" @click="confirmationDialog = true" > - {{ t('route.Clone Selected Routes') }} + {{ t('route.extendedList.cloneSelectedRoutes') }} { :disable="!selectedRows?.length" @click="showRouteReport" > - {{ t('route.Download selected routes as PDF') }} + {{ + t('route.extendedList.downloadSelectedRoutes') + }} { :disable="!selectedRows?.length" @click="markAsServed()" > - {{ t('route.Mark as served') }} + {{ t('route.extendedList.markServed') }} diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 9dad8ba22..afad2235c 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -33,11 +33,11 @@ const columns = computed(() => [ condition: () => true, }, columnFilter: false, + width: '25px', }, { - align: 'left', name: 'workerFk', - label: t('route.Worker'), + label: t('gloabls.worker'), component: 'select', attrs: { url: 'Workers/activeWithInheritedRole', @@ -50,15 +50,19 @@ const columns = computed(() => [ }, }, create: true, - cardVisible: true, format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef), columnFilter: false, + width: '100px', }, { - align: 'left', - name: 'agencyName', - label: t('route.Agency'), + name: 'workerFk', + label: t('globals.worker'), + visible: false, cardVisible: true, + }, + { + name: 'agencyName', + label: t('globals.agency'), component: 'select', attrs: { url: 'agencyModes', @@ -71,12 +75,17 @@ const columns = computed(() => [ create: true, columnClass: 'expand', columnFilter: false, + width: '150px', }, { - align: 'left', - name: 'vehiclePlateNumber', - label: t('route.Vehicle'), + name: 'agencyName', + label: t('globals.agency'), + visible: false, cardVisible: true, + }, + { + name: 'vehiclePlateNumber', + label: t('globals.vehicle'), component: 'select', attrs: { url: 'vehicles', @@ -90,27 +99,36 @@ const columns = computed(() => [ }, create: true, columnFilter: false, + width: '75px', }, { - align: 'left', + name: 'vehiclePlateNumber', + label: t('globals.vehicle'), + visible: false, + cardVisible: true, + }, + { + align: 'center', name: 'started', label: t('route.hourStarted'), cardVisible: true, columnFilter: false, format: (row) => toHour(row.started), + width: '50px', }, { - align: 'left', + align: 'center', name: 'finished', label: t('route.hourFinished'), cardVisible: true, columnFilter: false, format: (row) => toHour(row.started), + width: '50px', }, { align: 'left', name: 'description', - label: t('route.Description'), + label: t('globals.description'), cardVisible: true, isTitle: true, create: true, @@ -118,7 +136,6 @@ const columns = computed(() => [ columnFilter: false, }, { - align: 'left', name: 'isOk', label: t('route.Served'), component: 'checkbox', @@ -154,6 +171,7 @@ const columns = computed(() => [