From 8124a341a08f65dda51d70ca279e4ed208c9d6de Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 24 Sep 2024 07:25:17 +0200 Subject: [PATCH 1/8] feat: refs #7129 route extended list and simplify route list --- src/components/VnTable/VnTable.vue | 6 +- src/filters/toHour.js | 3 +- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Route/Agency/AgencyList.vue | 41 ++- src/pages/Route/RouteExtendedList.vue | 411 ++++++++++++++++++++++++++ src/pages/Route/RouteList.vue | 297 ++----------------- src/router/modules/route.js | 23 +- 8 files changed, 485 insertions(+), 298 deletions(-) create mode 100644 src/pages/Route/RouteExtendedList.vue diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index a3b64d264..b6023203e 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -10,7 +10,7 @@ import FormModelPopup from 'components/FormModelPopup.vue'; import VnFilterPanel from 'components/ui/VnFilterPanel.vue'; import VnTableColumn from 'components/VnTable/VnColumn.vue'; -import VnTableFilter from 'components/VnTable/VnFilter.vue'; +import VnFilter from 'components/VnTable/VnFilter.vue'; import VnTableChip from 'components/VnTable/VnChip.vue'; import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue'; import VnLv from 'components/ui/VnLv.vue'; @@ -335,7 +335,7 @@ function handleOnDataSaved(_) { )" :key="col.id" > - - [ condition: () => true, }, isId: true, + columnFilter: false, }, { align: 'left', label: t('globals.name'), name: 'name', isTitle: true, + columnFilter: false, + columnClass: 'expand', }, { align: 'left', @@ -70,18 +73,34 @@ const columns = computed(() => [ data-key="AgencyList" :expr-builder="exprBuilder" /> - +
+
+ +
+
+ es: isOwn: Tiene propietario diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue new file mode 100644 index 000000000..1e20df99c --- /dev/null +++ b/src/pages/Route/RouteExtendedList.vue @@ -0,0 +1,411 @@ + + + + + + +en: + newRoute: New Route + hourStarted: Started hour + hourFinished: Finished hour +es: + From: Desde + To: Hasta + Worker: Trabajador + Agency: Agencia + Vehicle: Vehículo + Volume: Volumen + Date: Fecha + Description: Descripción + Hour started: Hora inicio + Hour finished: Hora fin + KmStart: Km inicio + KmEnd: Km fin + Served: Servida + newRoute: Nueva Ruta + Clone Selected Routes: Clonar rutas seleccionadas + Select the starting date: Seleccione la fecha de inicio + Stating date: Fecha de inicio + Cancel: Cancelar + Mark as served: Marcar como servidas + Download selected routes as PDF: Descargar rutas seleccionadas como PDF + Add ticket: Añadir tickets + Preview: Vista previa + Summary: Resumen + Route is closed: La ruta está cerrada + Route is not served: La ruta no está servida + hourStarted: Hora de inicio + hourFinished: Hora de fin + diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 1e20df99c..20e5deb1e 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -1,34 +1,19 @@ -
- - - -en: - newRoute: New Route - hourStarted: Started hour - hourFinished: Finished hour -es: - From: Desde - To: Hasta - Worker: Trabajador - Agency: Agencia - Vehicle: Vehículo - Volume: Volumen - Date: Fecha - Description: Descripción - Hour started: Hora inicio - Hour finished: Hora fin - KmStart: Km inicio - KmEnd: Km fin - Served: Servida - newRoute: Nueva Ruta - Clone Selected Routes: Clonar rutas seleccionadas - Select the starting date: Seleccione la fecha de inicio - Stating date: Fecha de inicio - Cancel: Cancelar - Mark as served: Marcar como servidas - Download selected routes as PDF: Descargar rutas seleccionadas como PDF - Add ticket: Añadir tickets - Preview: Vista previa - Summary: Resumen - Route is closed: La ruta está cerrada - Route is not served: La ruta no está servida - hourStarted: Hora de inicio - hourFinished: Hora de fin - diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index b6c23f8ed..d0feb9a65 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -38,7 +38,7 @@ const columns = computed(() => [ { align: 'left', name: 'workerFk', - label: t('Worker'), + label: t('route.Worker'), create: true, cardVisible: true, format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef), @@ -47,7 +47,7 @@ const columns = computed(() => [ { align: 'left', name: 'agencyName', - label: t('Agency'), + label: t('route.Agency'), cardVisible: true, create: true, columnClass: 'expand', @@ -56,7 +56,7 @@ const columns = computed(() => [ { align: 'left', name: 'vehiclePlateNumber', - label: t('Vehicle'), + label: t('route.Vehicle'), cardVisible: true, create: true, columnFilter: false, @@ -64,7 +64,7 @@ const columns = computed(() => [ { align: 'left', name: 'started', - label: t('hourStarted'), + label: t('route.hourStarted'), cardVisible: true, columnFilter: false, format: (row) => toHour(row.started), @@ -72,7 +72,7 @@ const columns = computed(() => [ { align: 'left', name: 'finished', - label: t('hourFinished'), + label: t('route.hourFinished'), cardVisible: true, columnFilter: false, format: (row) => toHour(row.started), @@ -80,7 +80,7 @@ const columns = computed(() => [ { align: 'left', name: 'description', - label: t('Description'), + label: t('route.Description'), cardVisible: true, isTitle: true, create: true, @@ -90,7 +90,7 @@ const columns = computed(() => [ { align: 'left', name: 'isOk', - label: t('Served'), + label: t('route.Served'), component: 'checkbox', columnFilter: false, columnClass: 'shrink', @@ -103,7 +103,7 @@ const columns = computed(() => [ title: t('components.smartCard.viewSummary'), icon: 'preview', action: (row) => viewSummary(row?.id, RouteSummary), - color: 'primary', + isPrimary: true, }, ], }, @@ -117,7 +117,6 @@ const columns = computed(() => [ [ redirect="route" :create="{ urlCreate: 'Routes', - title: t('Create route'), + title: t('route.createRoute'), onDataSaved: ({ id }) => tableRef.redirect(id), formInitialData: {}, }" @@ -140,12 +139,3 @@ const columns = computed(() => [ - -es: - Worker: Trabajador - Agency: Agencia - Vehicle: Vehículo - Description: Descripción - Hour started: Hora inicio - Hour finished: Hora fin - diff --git a/src/pages/Route/locale/en.yml b/src/pages/Route/locale/en.yml new file mode 100644 index 000000000..617d704d2 --- /dev/null +++ b/src/pages/Route/locale/en.yml @@ -0,0 +1,25 @@ +route: + Worker: Worker + Agency: Agency + Vehicle: Vehicle + Description: Description + hourStarted: H.Start + hourFinished: H.End + createRoute: Create route + From: From + To: To + Date: Date + KmStart: Km start + KmEnd: Km end + Served: Served + Clone Selected Routes: Clone selected routes + Select the starting date: Select the starting date + Stating date: Starting date + Cancel: Cancel + Mark as served: Mark as served + Download selected routes as PDF: Download selected routes as PDF + Add ticket: Add ticket + Preview: Preview + Summary: Summary + Route is closed: Route is closed + Route is not served: Route is not served diff --git a/src/pages/Route/locale/es.yml b/src/pages/Route/locale/es.yml new file mode 100644 index 000000000..ed96ad915 --- /dev/null +++ b/src/pages/Route/locale/es.yml @@ -0,0 +1,25 @@ +route: + Worker: Trabajador + Agency: Agencia + Vehicle: Vehículo + Description: Descripción + hourStarted: H.Inicio + hourFinished: H.Fin + createRoute: Crear ruta + From: Desde + To: Hasta + Date: Fecha + KmStart: Km inicio + KmEnd: Km fin + Served: Servida + Clone Selected Routes: Clonar rutas seleccionadas + Select the starting date: Seleccione la fecha de inicio + Stating date: Fecha de inicio + Cancel: Cancelar + Mark as served: Marcar como servidas + Download selected routes as PDF: Descargar rutas seleccionadas como PDF + Add ticket: Añadir tickets + Preview: Vista previa + Summary: Resumen + Route is closed: La ruta está cerrada + Route is not served: La ruta no está servida diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index d7dce911b..829eb3a17 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -319,7 +319,7 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;