From fa120ffa17672d1d9f54ade3a7059e7aa50c0de4 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 8 Aug 2023 14:24:51 +0200 Subject: [PATCH 1/5] refs #5995 Added module route and external cmrs --- src/i18n/en/index.js | 18 +++++ src/i18n/es/index.js | 20 ++++- src/pages/Route/Cmr/CmrFilter.vue | 127 +++++++++++++++++++++++++++++ src/pages/Route/Cmr/CmrList.vue | 130 ++++++++++++++++++++++++++++++ src/pages/Route/RouteMain.vue | 17 ++++ src/router/modules/index.js | 4 +- src/router/modules/route.js | 35 ++++++++ src/router/routes.js | 4 +- src/stores/useNavigationStore.js | 2 +- 9 files changed, 353 insertions(+), 4 deletions(-) create mode 100644 src/pages/Route/Cmr/CmrFilter.vue create mode 100644 src/pages/Route/Cmr/CmrList.vue create mode 100644 src/pages/Route/RouteMain.vue create mode 100644 src/router/modules/route.js diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index a43c5fe7c..3241d155d 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -446,6 +446,24 @@ export default { uncompleteTrays: 'There are incomplete trays', } }, + route: { + pageTitles: { + routes: 'Routes', + cmrsList: 'External CMRs list', + }, + cmr: { + list: { + cmrFk: 'Cmr id', + hasCmrDms: `Attached in gestdoc`, + true: 'Yes', + false: 'No', + ticketFk: 'Ticketd id', + country: 'Country', + clientFk: 'Client id', + shipped: 'Preparation date', + }, + }, + }, components: { topbar: {}, userPanel: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 6328c8f5d..6ac3a28ea 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -444,7 +444,25 @@ export default { minHeightBetweenTrays: 'La distancia mínima entre bandejas es ', maxWagonHeight: 'La altura máxima del vagón es ', uncompleteTrays: 'Hay bandejas sin completar', - } + }, + }, + route: { + pageTitles: { + routes: 'Rutas', + cmrsList: 'Listado de CMRs externos', + }, + cmr: { + list: { + cmrFk: 'Id cmr', + hasCmrDms: 'Adjuntado en gestdoc', + true: 'Sí', + false: 'No', + ticketFk: 'Id ticket', + country: 'País', + clientFk: 'Id cliente', + shipped: 'Fecha preparación', + }, + }, }, components: { topbar: {}, diff --git a/src/pages/Route/Cmr/CmrFilter.vue b/src/pages/Route/Cmr/CmrFilter.vue new file mode 100644 index 000000000..3bf7c6791 --- /dev/null +++ b/src/pages/Route/Cmr/CmrFilter.vue @@ -0,0 +1,127 @@ + + + \ No newline at end of file diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue new file mode 100644 index 000000000..04166c010 --- /dev/null +++ b/src/pages/Route/Cmr/CmrList.vue @@ -0,0 +1,130 @@ + + + + diff --git a/src/pages/Route/RouteMain.vue b/src/pages/Route/RouteMain.vue new file mode 100644 index 000000000..66ce78f23 --- /dev/null +++ b/src/pages/Route/RouteMain.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 30c51939d..2916b98ef 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -4,6 +4,7 @@ import Claim from './claim'; import InvoiceOut from './invoiceOut'; import Worker from './worker'; import Wagon from './wagon'; +import Route from './route'; export default [ Customer, @@ -11,5 +12,6 @@ export default [ Claim, InvoiceOut, Worker, - Wagon + Wagon, + Route ] diff --git a/src/router/modules/route.js b/src/router/modules/route.js new file mode 100644 index 000000000..a3550885c --- /dev/null +++ b/src/router/modules/route.js @@ -0,0 +1,35 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/route', + name: 'Route', + meta: { + title: 'routes', + icon: 'vn:delivery', + }, + component: RouterView, + redirect: { name: 'RouteMain' }, + menus: { + main: ['CmrList'], + card: [], + }, + children: [ + { + path: '/route', + name: 'RouteMain', + component: () => import('src/pages/Route/RouteMain.vue'), + redirect: { name: 'CmrList' }, + children: [ + { + path: 'cmr/list', + name: 'CmrList', + meta: { + title: 'cmrsList', + icon: 'fact_check', + }, + component: () => import('src/pages/Route/Cmr/CmrList.vue') + }, + ], + }, + ], +}; diff --git a/src/router/routes.js b/src/router/routes.js index 17a56505d..08491e475 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -4,6 +4,7 @@ import claim from './modules/claim'; import worker from './modules/worker'; import invoiceOut from './modules/invoiceOut'; import wagon from './modules/wagon'; +import route from './modules/route'; const routes = [ { @@ -35,7 +36,8 @@ const routes = [ name: 'NotFound', component: () => import('../pages/NotFound.vue'), }, - wagon + wagon, + route ], }, ]; diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index bcaeeb953..168c1f9dc 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -6,7 +6,7 @@ import { useRole } from 'src/composables/useRole'; import routes from 'src/router/modules'; export const useNavigationStore = defineStore('navigationStore', () => { - const modules = ['customer', 'claim', 'ticket', 'invoiceOut', 'worker', 'wagon']; + const modules = ['customer', 'claim', 'ticket', 'invoiceOut', 'worker', 'wagon', 'route']; const pinnedModules = ref([]); const role = useRole(); From 4a41ba124748e3d9a4768b1c058b28f092ae9d05 Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 9 Aug 2023 12:02:15 +0200 Subject: [PATCH 2/5] refs #5995 Changes --- src/i18n/es/index.js | 1 + src/pages/Route/Cmr/CmrFilter.vue | 10 +++++----- src/pages/Route/Cmr/CmrList.vue | 27 +++++++++------------------ 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 6ac3a28ea..5ceb10140 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -453,6 +453,7 @@ export default { }, cmr: { list: { + total: 'Total {0} registros', cmrFk: 'Id cmr', hasCmrDms: 'Adjuntado en gestdoc', true: 'Sí', diff --git a/src/pages/Route/Cmr/CmrFilter.vue b/src/pages/Route/Cmr/CmrFilter.vue index 3bf7c6791..cf8b0a90c 100644 --- a/src/pages/Route/Cmr/CmrFilter.vue +++ b/src/pages/Route/Cmr/CmrFilter.vue @@ -37,11 +37,11 @@ const countries = ref(); - - - + diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue index 04166c010..81fad647a 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/Cmr/CmrList.vue @@ -75,13 +75,16 @@ async function openCmr(cmrFk) { :grid="$q.screen.lt.md" auto-load > + @@ -107,24 +110,12 @@ async function openCmr(cmrFk) { .grid-style-transition { transition: transform 0.28s, background-color 0.28s; } -#cmr { - cursor: pointer; -} -#cmr:hover { - text-decoration: underline; -} -.header-cell { - background-color: #ff9800; -} #true { - background-color: #c8e484; - color: black; + background-color: $positive; } #false { - background-color: #fb5252; - color: black; -} -.text-center { - margin: 0 auto; + background-color: $negative; } + + From 446cebc53db48ed0631e50db83ca3a9502e032e7 Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 9 Aug 2023 14:26:13 +0200 Subject: [PATCH 3/5] refs #5995 Changes --- src/pages/Route/Cmr/CmrList.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue index 81fad647a..b3854ada0 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/Cmr/CmrList.vue @@ -11,6 +11,7 @@ import CmrFilter from './CmrFilter.vue'; const stateStore = useStateStore(); const { t } = useI18n(); const session = useSession(); +const token = session.getToken(); const columns = computed(() => [ { @@ -23,6 +24,7 @@ const columns = computed(() => [ name: 'hasCmrDms', label: t('route.cmr.list.hasCmrDms'), field: (row) => row.hasCmrDms, + align: 'center', sortable: true, }, { @@ -41,12 +43,14 @@ const columns = computed(() => [ name: 'country', label: t('route.cmr.list.country'), field: (row) => row.country, + align: 'left', sortable: true, }, { name: 'shipped', label: t('route.cmr.list.shipped'), field: (row) => toDate(row.shipped), + align: 'center', sortable: true, }, ]); @@ -57,6 +61,7 @@ async function openCmr(cmrFk) { + + + en: + params: + cmrFk: Cmr id, + hasCmrDms: Attached in gestdoc, + ticketFk: Ticketd id, + country: Country, + clientFk: Client id, + shipped: Preparation date, + + es: + params: + cmrFk: Id cmr, + hasCmrDms: Adjuntado en gestdoc, + ticketFk: Id ticket, + country: País, + clientFk: Id cliente, + shipped: Fecha preparación, + diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue index b3854ada0..761d79fa2 100644 --- a/src/pages/Route/Cmr/CmrList.vue +++ b/src/pages/Route/Cmr/CmrList.vue @@ -5,7 +5,6 @@ import { useStateStore } from 'stores/useStateStore'; import VnPaginate from 'components/ui/VnPaginate.vue'; import { useSession } from 'src/composables/useSession'; import { toDate } from 'filters/index'; -import { getUrl } from 'composables/getUrl'; import CmrFilter from './CmrFilter.vue'; const stateStore = useStateStore(); @@ -26,6 +25,7 @@ const columns = computed(() => [ field: (row) => row.hasCmrDms, align: 'center', sortable: true, + headerStyle: 'padding-left: 35px', }, { name: 'ticketFk', @@ -52,16 +52,15 @@ const columns = computed(() => [ field: (row) => toDate(row.shipped), align: 'center', sortable: true, + headerStyle: 'padding-left: 33px', }, ]); -async function openCmr(cmrFk) { - const salixUrl = (await getUrl(`Routes/${cmrFk}/cmr`)).replace('#!/', 'api/') - window.open(`${salixUrl.replace('#!/', 'api/')}?access_token=${session.getToken()}`); +function getProjectUrl() { + return ((new URL(window.location)).origin); };