diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue new file mode 100644 index 000000000..b705d91f6 --- /dev/null +++ b/src/components/common/VnInputTime.vue @@ -0,0 +1,108 @@ + + + + + + + +es: + Cancel: Cancelar + diff --git a/src/filters/index.js b/src/filters/index.js index f0120e663..478cb0ac8 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -8,11 +8,13 @@ import toPercentage from './toPercentage'; import toLowerCamel from './toLowerCamel'; import dashIfEmpty from './dashIfEmpty'; import dateRange from './dateRange'; +import toHour from './toHour'; export { toLowerCase, toLowerCamel, toDate, + toHour, toDateString, toDateHour, toRelativeDate, diff --git a/src/filters/isValidDate.js b/src/filters/isValidDate.js new file mode 100644 index 000000000..8365564b8 --- /dev/null +++ b/src/filters/isValidDate.js @@ -0,0 +1,3 @@ +export default function isValidDate(date) { + return !isNaN(new Date(date).getTime()); +} diff --git a/src/filters/toHour.js b/src/filters/toHour.js new file mode 100644 index 000000000..f24f81949 --- /dev/null +++ b/src/filters/toHour.js @@ -0,0 +1,16 @@ +import isValidDate from 'filters/isValidDate'; + +export default function toHour(date) { + if (!isValidDate(date)) { + return '--:--'; + } + const dateHour = new Date(date); + let hours = dateHour.getUTCHours(); + hours = hours % 12; + hours = hours ? hours : 12; + + let minutes = dateHour.getUTCMinutes(); + minutes = minutes < 10 ? minutes.toString().padStart(2, '0') : minutes; + + return `${hours}:${minutes} ${dateHour.getUTCHours() >= 12 ? 'PM' : 'AM'}`; +} diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index bd59edad1..72ed1cba8 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -807,6 +807,7 @@ export default { pageTitles: { routes: 'Routes', cmrsList: 'External CMRs list', + RouteList: 'List' }, cmr: { list: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 94f508429..f5a7483f4 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -806,6 +806,7 @@ export default { pageTitles: { routes: 'Rutas', cmrsList: 'Listado de CMRs externos', + RouteList: 'Listado' }, cmr: { list: { diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue new file mode 100644 index 000000000..408119751 --- /dev/null +++ b/src/pages/Route/RouteList.vue @@ -0,0 +1,407 @@ + + + + + + +es: + ID: ID + Worker: Trabajador + Agency: Agencia + Vehicle: Vehículo + Date: Fecha + Description: Descripción + Hour started: Hora inicio + Hour finished: Hora fin + diff --git a/src/router/modules/route.js b/src/router/modules/route.js index acda898de..70c92f84b 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -10,7 +10,7 @@ export default { component: RouterView, redirect: { name: 'RouteMain' }, menus: { - main: ['CmrList'], + main: ['RouteList', 'CmrList'], card: [], }, children: [ @@ -29,6 +29,15 @@ export default { }, component: () => import('src/pages/Route/Cmr/CmrList.vue'), }, + { + path: 'list', + name: 'RouteList', + meta: { + title: 'RouteList', + icon: 'vn:delivery', + }, + component: () => import('src/pages/Route/RouteList.vue'), + }, ], }, ],