diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 2056f1907..3b4482b07 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -809,7 +809,8 @@ export default { cmrsList: 'External CMRs list', RouteList: 'List', create: 'Create', - basicData: 'Basic Data' + basicData: 'Basic Data', + summary: 'Summary' }, cmr: { list: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 970f23231..322f08df4 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -809,6 +809,7 @@ export default { RouteList: 'Listado', create: 'Crear', basicData: 'Datos básicos', + summary: 'Summary', }, cmr: { list: { diff --git a/src/pages/Route/Card/RouteCard.vue b/src/pages/Route/Card/RouteCard.vue index 2082b67df..46b997b65 100644 --- a/src/pages/Route/Card/RouteCard.vue +++ b/src/pages/Route/Card/RouteCard.vue @@ -1,6 +1,7 @@ + + + +es: + Date: Fecha + Agency: Agencia + Zone: Zona + Volume: Volumen + Description: Descripción + diff --git a/src/pages/Route/Card/RouteDescriptorMenu.vue b/src/pages/Route/Card/RouteDescriptorMenu.vue new file mode 100644 index 000000000..b661d1cd7 --- /dev/null +++ b/src/pages/Route/Card/RouteDescriptorMenu.vue @@ -0,0 +1,63 @@ + + + + +en: + confirmDeletion: Confirm deletion + confirmDeletionMessage: Are you sure you want to delete this route? + deleteRoute: Delete route +es: + confirmDeletion: Confirmar eliminación, + confirmDeletionMessage: Seguro que quieres eliminar esta ruta? + deleteRoute: Eliminar ruta + diff --git a/src/pages/Route/Card/RouteDescriptorProxy.vue b/src/pages/Route/Card/RouteDescriptorProxy.vue new file mode 100644 index 000000000..541f9716a --- /dev/null +++ b/src/pages/Route/Card/RouteDescriptorProxy.vue @@ -0,0 +1,15 @@ + + diff --git a/src/pages/Route/Card/RouteForm.vue b/src/pages/Route/Card/RouteForm.vue index 00ea18f4f..49a067c00 100644 --- a/src/pages/Route/Card/RouteForm.vue +++ b/src/pages/Route/Card/RouteForm.vue @@ -72,8 +72,7 @@ const routeFilter = { const onSave = (data, response) => { if (isNew) { axios.post(`Routes/${response.data?.id}/updateWorkCenter`); - // TODO: Add summary - // router.push({ name: 'RouteSummary', params: { id: response.data?.id } }); + router.push({ name: 'RouteSummary', params: { id: response.data?.id } }); } }; diff --git a/src/pages/Route/Card/RouteSummary.vue b/src/pages/Route/Card/RouteSummary.vue new file mode 100644 index 000000000..a10ca088e --- /dev/null +++ b/src/pages/Route/Card/RouteSummary.vue @@ -0,0 +1,314 @@ + + + + +en: + route: + summary: + date: Date + agency: Agency + vehicle: Vehicle + driver: Driver + cost: Cost + started: Started time + finished: Finished time + kmStart: Km start + kmEnd: Km end + volume: Volume + packages: Packages + description: Description + tickets: Tickets + order: Order + street: Street + city: City + pc: PC + client: Client + warehouse: Warehouse + m3: m³ + packaging: Packaging + ticket: Ticket +es: + route: + summary: + date: Fecha + agency: Agencia + vehicle: Vehículo + driver: Conductor + cost: Costo + started: Hora inicio + finished: Hora fin + kmStart: Km inicio + kmEnd: Km fin + volume: Volumen + packages: Bultos + description: Descripción + tickets: Tickets + order: Orden + street: Dirección fiscal + city: Población + pc: CP + client: Cliente + warehouse: Almacén + packaging: Encajado + diff --git a/src/pages/Route/Card/RouteSummaryDialog.vue b/src/pages/Route/Card/RouteSummaryDialog.vue new file mode 100644 index 000000000..4a943a93a --- /dev/null +++ b/src/pages/Route/Card/RouteSummaryDialog.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 5972a6959..591f723e9 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -13,12 +13,13 @@ import VnInputTime from 'components/common/VnInputTime.vue'; import axios from 'axios'; import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; import RouteFilter from 'pages/Route/Card/RouteFilter.vue'; +import { useQuasar } from 'quasar'; +import RouteSummaryDialog from 'pages/Route/Card/RouteSummaryDialog.vue'; const stateStore = useStateStore(); -// const router = useRouter(); -// const quasar = useQuasar(); const { t } = useI18n(); const { validate } = useValidator(); +const quasar = useQuasar(); const to = Date.vnNew(); to.setDate(to.getDate() + 1); @@ -98,6 +99,12 @@ const columns = computed(() => [ sortable: true, align: 'left', }, + { + name: 'actions', + label: '', + sortable: false, + align: 'right', + }, ]); const refreshKey = ref(0); @@ -151,6 +158,18 @@ const markAsServed = () => { refreshKey.value++; startingDate.value = null; }; + +function previewRoute(id) { + if (!id) { + return; + } + quasar.dialog({ + component: RouteSummaryDialog, + componentProps: { + id, + }, + }); +} diff --git a/src/router/modules/route.js b/src/router/modules/route.js index f6553a4f1..614345913 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -11,14 +11,14 @@ export default { redirect: { name: 'RouteMain' }, menus: { main: ['RouteList', 'CmrList'], - card: [], + card: ['RouteBasicData'], }, children: [ { path: '/route', name: 'RouteMain', component: () => import('src/pages/Route/RouteMain.vue'), - redirect: { name: 'CmrList' }, + redirect: { name: 'RouteList' }, children: [ { path: 'cmr', @@ -34,7 +34,7 @@ export default { name: 'RouteList', meta: { title: 'RouteList', - icon: 'vn:delivery', + icon: 'view_list', }, component: () => import('src/pages/Route/RouteList.vue'), }, @@ -52,8 +52,7 @@ export default { name: 'RouteCard', path: ':id', component: () => import('src/pages/Route/Card/RouteCard.vue'), - // TODO: Add summary - redirect: { name: 'RouteBasicData' }, + redirect: { name: 'RouteSummary' }, children: [ { name: 'RouteBasicData', @@ -64,6 +63,15 @@ export default { }, component: () => import('pages/Route/Card/RouteForm.vue'), }, + { + name: 'RouteSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'open_in_new', + }, + component: () => import('pages/Route/Card/RouteSummary.vue'), + }, ], }, ],