From f404243d63be8fdc5d34efa4c27f0ce827bf5fd2 Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 3 Apr 2024 08:38:26 +0200 Subject: [PATCH 01/15] feat(route): refs # agency add agencyList --- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/pages/Route/Agency/AgencyList.vue | 39 +++++++++++++++++++++++++++ src/router/modules/route.js | 11 +++++++- 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/pages/Route/Agency/AgencyList.vue diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 9e0ad7c9b..a91f9586b 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -937,6 +937,7 @@ export default { pageTitles: { routes: 'Routes', cmrsList: 'External CMRs list', + agencyList: 'Agency', RouteList: 'List', create: 'Create', basicData: 'Basic Data', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 6083dfad7..3b664a8e4 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -937,6 +937,7 @@ export default { pageTitles: { routes: 'Rutas', cmrsList: 'Listado de CMRs externos', + agency: 'Agency', RouteList: 'Listado', create: 'Crear', basicData: 'Datos básicos', diff --git a/src/pages/Route/Agency/AgencyList.vue b/src/pages/Route/Agency/AgencyList.vue new file mode 100644 index 000000000..ca5197986 --- /dev/null +++ b/src/pages/Route/Agency/AgencyList.vue @@ -0,0 +1,39 @@ + + + diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 614345913..4031e74bf 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: ['RouteList', 'CmrList'], + main: ['RouteList', 'CmrList', 'agencyList'], card: ['RouteBasicData'], }, children: [ @@ -29,6 +29,15 @@ export default { }, component: () => import('src/pages/Route/Cmr/CmrList.vue'), }, + { + path: 'agency', + name: 'agencyList', + meta: { + title: 'agencyList', + icon: 'package', + }, + component: () => import('src/pages/Route/Agency/AgencyList.vue'), + }, { path: 'list', name: 'RouteList', From fb6a2c809789eb74f23bdb2f62d0d90be6bc1753 Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 3 Apr 2024 14:59:51 +0200 Subject: [PATCH 02/15] feat: refs #4988 add agencyList and searchBar --- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 3 +- src/pages/Agency/AgencyList.vue | 92 +++++++++++++++++++++++++++ src/pages/Agency/Card/AgencyCard.vue | 39 ++++++++++++ src/pages/Route/Agency/AgencyList.vue | 39 ------------ src/router/modules/agency.js | 54 ++++++++++++++++ src/router/modules/route.js | 26 +++++--- 7 files changed, 204 insertions(+), 50 deletions(-) create mode 100644 src/pages/Agency/AgencyList.vue create mode 100644 src/pages/Agency/Card/AgencyCard.vue delete mode 100644 src/pages/Route/Agency/AgencyList.vue create mode 100644 src/router/modules/agency.js diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 054668042..9d0488cab 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -91,6 +91,7 @@ export default { basicData: 'Basic data', log: 'Logs', parkingList: 'Parkings list', + agencyList: 'Agencies list', }, }, errors: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 099f97938..478c93467 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -91,6 +91,7 @@ export default { basicData: 'Datos básicos', log: 'Historial', parkingList: 'Listado de parkings', + agencyList: 'Listado de agencias', }, }, errors: { @@ -992,7 +993,7 @@ export default { routes: 'Rutas', cmrsList: 'Listado de CMRs externos', agency: 'Agency', - RouteList: 'Listado', + RouteList: 'Listado de rutas', create: 'Crear', basicData: 'Datos básicos', summary: 'Resumen', diff --git a/src/pages/Agency/AgencyList.vue b/src/pages/Agency/AgencyList.vue new file mode 100644 index 000000000..2746f8529 --- /dev/null +++ b/src/pages/Agency/AgencyList.vue @@ -0,0 +1,92 @@ + + + + es: + isOwn: Tiene propietario + isAnyVolumeAllowed: Permite cualquier volumen + Search agency: Buscar agencia + You can search by name: Puedes buscar por nombre + en: + isOwn: Has owner + isAnyVolumeAllowed: Allows any volume + diff --git a/src/pages/Agency/Card/AgencyCard.vue b/src/pages/Agency/Card/AgencyCard.vue new file mode 100644 index 000000000..1c7e3cc10 --- /dev/null +++ b/src/pages/Agency/Card/AgencyCard.vue @@ -0,0 +1,39 @@ + + diff --git a/src/pages/Route/Agency/AgencyList.vue b/src/pages/Route/Agency/AgencyList.vue deleted file mode 100644 index ca5197986..000000000 --- a/src/pages/Route/Agency/AgencyList.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/src/router/modules/agency.js b/src/router/modules/agency.js new file mode 100644 index 000000000..42b139b95 --- /dev/null +++ b/src/router/modules/agency.js @@ -0,0 +1,54 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/agency', + name: 'Agency', + meta: { + title: 'agency', + icon: 'garage_home', + moduleName: 'Agency', + }, + component: RouterView, + redirect: { name: 'AgencyCard' }, + menus: { + main: [], + card: ['AgencyBasicData', 'AgencyLog'], + }, + children: [ + { + path: '/agency/:id', + name: 'AgencyCard', + component: () => import('src/pages/Agency/Card/AgencyCard.vue'), + redirect: { name: 'AgencySummary' }, + children: [ + { + name: 'AgencySummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'view_list', + }, + component: () => import('src/pages/Agency/Card/AgencySummary.vue'), + }, + { + name: 'AgencyBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('pages/Agency/Card/AgencyBasicData.vue'), + }, + { + name: 'AgencyLog', + path: 'log', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Agency/Card/AgencyLog.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 1e392fa0f..cfa8c9c35 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -11,7 +11,7 @@ export default { component: RouterView, redirect: { name: 'RouteMain' }, menus: { - main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList', 'agencyList'], + main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList', 'AgencyList'], card: ['RouteBasicData', 'RouteTickets', 'RouteLog'], }, children: [ @@ -21,15 +21,6 @@ export default { component: () => import('src/pages/Route/RouteMain.vue'), redirect: { name: 'RouteList' }, children: [ - { - path: 'agency', - name: 'agencyList', - meta: { - title: 'agencyList', - icon: 'package', - }, - component: () => import('src/pages/Route/Agency/AgencyList.vue'), - }, { path: 'list', name: 'RouteList', @@ -83,6 +74,21 @@ export default { }, component: () => import('src/pages/Route/Cmr/CmrList.vue'), }, + { + path: '/agency', + redirect: { name: 'agencyList' }, + children: [ + { + path: 'list', + name: 'AgencyList', + meta: { + title: 'agencyList', + icon: 'view_list', + }, + component: () => import('src/pages/Agency/AgencyList.vue'), + }, + ], + }, ], }, { From c65c09c39c990bd6b72be4cc59e65db1814c80fe Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 16 Apr 2024 07:45:33 +0200 Subject: [PATCH 03/15] feat(agency): refs #4988 add agency router and sections --- src/components/common/VnBreadcrumbs.vue | 1 + src/i18n/en/index.js | 8 ++- src/pages/Agency/AgencyList.vue | 9 ++-- src/pages/Agency/Card/AgencyBasicData.vue | 59 ++++++++++++++++++++++ src/pages/Agency/Card/AgencyCard.vue | 46 +++++++++++------ src/pages/Agency/Card/AgencyDescriptor.vue | 39 ++++++++++++++ src/pages/Agency/Card/AgencyLog.vue | 6 +++ src/pages/Agency/Card/AgencySummary.vue | 44 ++++++++++++++++ src/router/modules/index.js | 2 + src/router/routes.js | 2 + 10 files changed, 196 insertions(+), 20 deletions(-) create mode 100644 src/pages/Agency/Card/AgencyBasicData.vue create mode 100644 src/pages/Agency/Card/AgencyDescriptor.vue create mode 100644 src/pages/Agency/Card/AgencyLog.vue create mode 100644 src/pages/Agency/Card/AgencySummary.vue diff --git a/src/components/common/VnBreadcrumbs.vue b/src/components/common/VnBreadcrumbs.vue index 337507233..65f6946f4 100644 --- a/src/components/common/VnBreadcrumbs.vue +++ b/src/components/common/VnBreadcrumbs.vue @@ -30,6 +30,7 @@ watchEffect(() => { }); function getBreadcrumb(param) { + console.log('param.meta.title: ', param.meta.title); const breadcrumb = { icon: param.meta.icon, path: param.path, diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 0f90d5f44..d26ee26a3 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -1003,9 +1003,10 @@ export default { }, route: { pageTitles: { + agency: 'Agency', routes: 'Routes', cmrsList: 'External CMRs list', - agencyList: 'Agency', + agencyList: 'Agency list', RouteList: 'List', create: 'Create', basicData: 'Basic Data', @@ -1033,6 +1034,11 @@ export default { }, }, }, + agency: { + pageTitles: { + agency: 'Agency', + }, + }, supplier: { pageTitles: { suppliers: 'Suppliers', diff --git a/src/pages/Agency/AgencyList.vue b/src/pages/Agency/AgencyList.vue index 2746f8529..6f8185864 100644 --- a/src/pages/Agency/AgencyList.vue +++ b/src/pages/Agency/AgencyList.vue @@ -15,10 +15,11 @@ function navigate(id) { router.push({ path: `/agency/${id}` }); } function exprBuilder(param, value) { - switch (param) { - case 'search': - return { name: { like: `%${value}%` } }; - } + if (param !== 'search') return; + + if (!isNaN(value)) return { id: value }; + + return { name: { like: `%${value}%` } }; } diff --git a/src/pages/Agency/Card/AgencyBasicData.vue b/src/pages/Agency/Card/AgencyBasicData.vue index f54f7037d..00595ce1f 100644 --- a/src/pages/Agency/Card/AgencyBasicData.vue +++ b/src/pages/Agency/Card/AgencyBasicData.vue @@ -2,23 +2,18 @@ import { ref } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; -import VnRow from 'components/ui/VnRow.vue'; + +import FormModel from 'components/FormModel.vue'; import FetchData from 'src/components/FetchData.vue'; +import VnRow from 'components/ui/VnRow.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnInput from 'src/components/common/VnInput.vue'; -import FormModel from 'components/FormModel.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; const { t } = useI18n(); const route = useRoute(); -const id = route.params?.id || null; +const routeId = route.params?.id || null; const warehouses = ref([]); -const sectorFilter = { fields: ['id', 'description'] }; - -const filter = { - fields: ['sectorFk', 'code', 'pickingOrder', 'row', 'column'], - include: [{ relation: 'sector', scope: sectorFilter }], -};