From 42591d078119e6a1051669a104c977f7c6b4abc2 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:27:56 +0200 Subject: [PATCH 1/8] feat #7271 router --- src/router/modules/index.js | 2 + src/router/modules/zone.js | 139 +++++++++++++++++++++++++++++++ src/router/routes.js | 2 + src/stores/useNavigationStore.js | 1 + 4 files changed, 144 insertions(+) create mode 100644 src/router/modules/zone.js diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 302ba7fe0..2fe40038f 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -15,6 +15,7 @@ import Department from './department'; import Entry from './entry'; import roadmap from './roadmap'; import Parking from './parking'; +import Zone from './zone'; export default [ Item, @@ -34,4 +35,5 @@ export default [ Entry, roadmap, Parking, + Zone, ]; diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js new file mode 100644 index 000000000..be11ced11 --- /dev/null +++ b/src/router/modules/zone.js @@ -0,0 +1,139 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/zone', + name: 'Zone', + meta: { + title: 'zones', + icon: 'vn:zone', + moduleName: 'Zone', + }, + component: RouterView, + redirect: { name: 'ZoneMain' }, + menus: { + main: ['ZoneList', 'ZoneDeliveryList', 'ZoneUpcomingList'], + card: [], + }, + children: [ + { + path: '/zone', + name: 'ZoneMain', + component: () => import('src/pages/Zone/ZoneMain.vue'), + redirect: { name: 'ZoneList' }, + children: [ + { + path: 'list', + name: 'ZoneList', + meta: { + title: 'zonesList', + icon: 'vn:zone', + }, + component: () => import('src/pages/Zone/ZoneList.vue'), + }, + { + path: 'create', + name: 'ZoneCreate', + meta: { + title: 'zoneCreate', + icon: 'create', + }, + component: () => import('src/pages/Zone/ZoneCreate.vue'), + }, + { + path: ':id/edit', + name: 'ZoneEdit', + meta: { + title: 'zoneEdit', + icon: 'edit', + }, + component: () => import('src/pages/Zone/ZoneCreate.vue'), + }, + { + path: 'counter', + name: 'ZoneCounter', + meta: { + title: 'zoneCounter', + icon: 'add_circle', + }, + component: () => import('src/pages/Zone/ZoneCounter.vue'), + }, + ], + }, + { + path: '/zone/delivery', + name: 'ZoneDeliveryMain', + component: () => import('src/pages/Zone/ZoneMain.vue'), + redirect: { name: 'ZoneDeliveryList' }, + children: [ + { + path: 'list', + name: 'ZoneDeliveryList', + meta: { + title: 'deliveryList', + icon: 'today', + }, + component: () => + import('src/pages/Zone/Delivery/ZoneDeliveryList.vue'), + }, + { + path: 'create', + name: 'ZoneDeliveryCreate', + meta: { + title: 'deliveryCreate', + icon: 'create', + }, + component: () => + import('src/pages/Zone/Delivery/ZoneDeliveryCreate.vue'), + }, + { + path: ':id/edit', + name: 'ZoneDeliveryEdit', + meta: { + title: 'deliveryEdit', + icon: 'edit', + }, + component: () => + import('src/pages/Zone/Delivery/ZoneDeliveryCreate.vue'), + }, + ], + }, + { + path: '/zone/upcoming', + name: 'ZoneUpcomingMain', + component: () => import('src/pages/Zone/ZoneMain.vue'), + redirect: { name: 'ZoneUpcomingList' }, + children: [ + { + path: 'list', + name: 'ZoneUpcomingList', + meta: { + title: 'upcomingList', + icon: 'today', + }, + component: () => + import('src/pages/Zone/Upcoming/ZoneUpcomingList.vue'), + }, + { + path: 'create', + name: 'ZoneUpcomingCreate', + meta: { + title: 'upcomingCreate', + icon: 'create', + }, + component: () => + import('src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue'), + }, + { + path: ':id/edit', + name: 'ZoneUpcomingEdit', + meta: { + title: 'upcomingEdit', + icon: 'edit', + }, + component: () => + import('src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/routes.js b/src/router/routes.js index 51e726a62..14bf6665f 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -15,6 +15,7 @@ import order from 'src/router/modules/order'; import entry from 'src/router/modules/entry'; import roadmap from 'src/router/modules/roadmap'; import parking from 'src/router/modules/parking'; +import zone from 'src/router/modules/zone'; const routes = [ { @@ -71,6 +72,7 @@ const routes = [ roadmap, entry, parking, + zone, { path: '/:catchAll(.*)*', name: 'NotFound', diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index f075301f6..ee1e04e9b 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -21,6 +21,7 @@ export const useNavigationStore = defineStore('navigationStore', () => { 'ticket', 'worker', 'wagon', + 'zone', ]; const pinnedModules = ref([]); const role = useRole(); From b4e3157887e6ace9072ba5f686b9d26046bf2360 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:28:06 +0200 Subject: [PATCH 2/8] feat #7271 i18n --- src/i18n/locale/en.yml | 6 ++++++ src/i18n/locale/es.yml | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index ff57bf968..aa65ce08c 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1165,6 +1165,12 @@ item: type: Type intrastat: Intrastat origin: Origin +zone: + pageTitles: + zones: Zone + zonesList: Zones + deliveryList: Delivery days + upcomingList: Upcoming deliveries components: topbar: {} itemsFilterPanel: diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f9278a9b0..da421432d 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -287,7 +287,7 @@ customer: hasSepaVnl: Recibido B2B VNL entry: pageTitles: - entries: Entradas + entries: Entrasdadas list: Listado summary: Resumen basicData: Datos básicos @@ -1164,6 +1164,12 @@ item: type: Tipo intrastat: Intrastat origin: Origen +zone: + pageTitles: + zones: Zona + zonesList: Zonas + deliveryList: Días de entrega + upcomingList: Próximos repartos components: topbar: {} itemsFilterPanel: From b1871c33fd0ad1eb86f7ca6985af6ec41a770709 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:30:16 +0200 Subject: [PATCH 3/8] feat #7271 Zone Components boilerplate --- src/pages/Zone/Card/ZoneCard.vue | 6 + .../Zone/Delivery/ZoneDeliveryCreate.vue | 432 ++++++++++++++++++ src/pages/Zone/Delivery/ZoneDeliveryList.vue | 81 ++++ .../Zone/Upcoming/ZoneUpcomingCreate.vue | 432 ++++++++++++++++++ src/pages/Zone/Upcoming/ZoneUpcomingList.vue | 81 ++++ src/pages/Zone/ZoneCreate.vue | 184 ++++++++ src/pages/Zone/ZoneList.vue | 97 ++++ src/pages/Zone/ZoneMain.vue | 17 + 8 files changed, 1330 insertions(+) create mode 100644 src/pages/Zone/Card/ZoneCard.vue create mode 100644 src/pages/Zone/Delivery/ZoneDeliveryCreate.vue create mode 100644 src/pages/Zone/Delivery/ZoneDeliveryList.vue create mode 100644 src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue create mode 100644 src/pages/Zone/Upcoming/ZoneUpcomingList.vue create mode 100644 src/pages/Zone/ZoneCreate.vue create mode 100644 src/pages/Zone/ZoneList.vue create mode 100644 src/pages/Zone/ZoneMain.vue diff --git a/src/pages/Zone/Card/ZoneCard.vue b/src/pages/Zone/Card/ZoneCard.vue new file mode 100644 index 000000000..948636c55 --- /dev/null +++ b/src/pages/Zone/Card/ZoneCard.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/Zone/Delivery/ZoneDeliveryCreate.vue b/src/pages/Zone/Delivery/ZoneDeliveryCreate.vue new file mode 100644 index 000000000..a48eaf278 --- /dev/null +++ b/src/pages/Zone/Delivery/ZoneDeliveryCreate.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/src/pages/Zone/Delivery/ZoneDeliveryList.vue b/src/pages/Zone/Delivery/ZoneDeliveryList.vue new file mode 100644 index 000000000..c7a3cbcdb --- /dev/null +++ b/src/pages/Zone/Delivery/ZoneDeliveryList.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue b/src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue new file mode 100644 index 000000000..6bc04c428 --- /dev/null +++ b/src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/src/pages/Zone/Upcoming/ZoneUpcomingList.vue b/src/pages/Zone/Upcoming/ZoneUpcomingList.vue new file mode 100644 index 000000000..5c417df8f --- /dev/null +++ b/src/pages/Zone/Upcoming/ZoneUpcomingList.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/pages/Zone/ZoneCreate.vue b/src/pages/Zone/ZoneCreate.vue new file mode 100644 index 000000000..8c0ba8c17 --- /dev/null +++ b/src/pages/Zone/ZoneCreate.vue @@ -0,0 +1,184 @@ + + + + + diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue new file mode 100644 index 000000000..00502e1f7 --- /dev/null +++ b/src/pages/Zone/ZoneList.vue @@ -0,0 +1,97 @@ + + + diff --git a/src/pages/Zone/ZoneMain.vue b/src/pages/Zone/ZoneMain.vue new file mode 100644 index 000000000..66ce78f23 --- /dev/null +++ b/src/pages/Zone/ZoneMain.vue @@ -0,0 +1,17 @@ + + + From f14d6310514c949c81de6ac07083dd686e37e87b Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 14:32:42 +0200 Subject: [PATCH 4/8] feat #7271 ZoneDescriptor --- src/pages/Zone/Card/ZoneDescriptor.vue | 127 ++++++++++++++++++ .../Zone/Card/ZoneDescriptorMenuItems.vue | 108 +++++++++++++++ src/pages/Zone/Card/ZoneDescriptorProxy.vue | 16 +++ 3 files changed, 251 insertions(+) create mode 100644 src/pages/Zone/Card/ZoneDescriptor.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorMenuItems.vue create mode 100644 src/pages/Zone/Card/ZoneDescriptorProxy.vue diff --git a/src/pages/Zone/Card/ZoneDescriptor.vue b/src/pages/Zone/Card/ZoneDescriptor.vue new file mode 100644 index 000000000..665cb6f0e --- /dev/null +++ b/src/pages/Zone/Card/ZoneDescriptor.vue @@ -0,0 +1,127 @@ + + + + + +es: + Go to module index: Ir al índice del módulo + The travel will be deleted: El envío será eliminado + Do you want to delete this travel?: ¿Quieres eliminar este envío? + All travels with current agency: Todos los envíos con la agencia actual + diff --git a/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue b/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue new file mode 100644 index 000000000..920d83dfe --- /dev/null +++ b/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue @@ -0,0 +1,108 @@ + + + + + +es: + The travel will be deleted: El envío será eliminado + Do you want to delete this travel?: ¿Quieres eliminar este envío? + diff --git a/src/pages/Zone/Card/ZoneDescriptorProxy.vue b/src/pages/Zone/Card/ZoneDescriptorProxy.vue new file mode 100644 index 000000000..15c5fb0e5 --- /dev/null +++ b/src/pages/Zone/Card/ZoneDescriptorProxy.vue @@ -0,0 +1,16 @@ + + + From cb0d7214650b02e1ab5a7af4e348e037a03b8e84 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 2 May 2024 14:40:56 +0200 Subject: [PATCH 5/8] feat: zoneSummary --- src/pages/Zone/Card/ZoneSummary.vue | 94 +++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/pages/Zone/Card/ZoneSummary.vue diff --git a/src/pages/Zone/Card/ZoneSummary.vue b/src/pages/Zone/Card/ZoneSummary.vue new file mode 100644 index 000000000..00df03cb0 --- /dev/null +++ b/src/pages/Zone/Card/ZoneSummary.vue @@ -0,0 +1,94 @@ + + + From 1a5f2fbea2a7c821ca7d9e70fa5224f6a82dc22f Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 3 May 2024 12:30:53 +0200 Subject: [PATCH 6/8] feat: refs #7271 advanced structure --- src/i18n/locale/en.yml | 4 + src/i18n/locale/es.yml | 6 +- src/pages/Zone/Card/ZoneBasicData.vue | 103 +++++++++++++++++++ src/pages/Zone/Card/ZoneCalendar.vue | 0 src/pages/Zone/Card/ZoneLocations.vue | 0 src/pages/Zone/Card/ZoneLog.vue | 6 ++ src/pages/Zone/Card/ZoneSummary.vue | 3 + src/pages/Zone/Card/ZoneWarehouses.vue | 59 +++++++++++ src/pages/Zone/Delivery/ZoneDeliveryList.vue | 3 +- src/pages/Zone/Upcoming/ZoneUpcomingList.vue | 3 +- src/pages/Zone/ZoneCreate.vue | 8 +- src/pages/Zone/ZoneDeliveryDays.vue | 0 src/pages/Zone/ZoneFilterPanel.vue | 55 ++++++++++ src/pages/Zone/ZoneList.vue | 67 +++++++----- src/pages/Zone/ZoneUpcoming.vue | 53 ++++++++++ src/pages/Zone/locale/en.yml | 19 ++++ src/pages/Zone/locale/es.yml | 19 ++++ 17 files changed, 376 insertions(+), 32 deletions(-) create mode 100644 src/pages/Zone/Card/ZoneBasicData.vue create mode 100644 src/pages/Zone/Card/ZoneCalendar.vue create mode 100644 src/pages/Zone/Card/ZoneLocations.vue create mode 100644 src/pages/Zone/Card/ZoneLog.vue create mode 100644 src/pages/Zone/Card/ZoneSummary.vue create mode 100644 src/pages/Zone/Card/ZoneWarehouses.vue create mode 100644 src/pages/Zone/ZoneDeliveryDays.vue create mode 100644 src/pages/Zone/ZoneFilterPanel.vue create mode 100644 src/pages/Zone/ZoneUpcoming.vue create mode 100644 src/pages/Zone/locale/en.yml create mode 100644 src/pages/Zone/locale/es.yml diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index aa65ce08c..a580f2553 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -90,6 +90,10 @@ globals: basicData: Basic data log: Logs parkingList: Parkings list + zones: Zones + zonesList: Zones + deliveryList: Delivery days + upcomingList: Upcoming deliveries created: Created worker: Worker now: Now diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index da421432d..ef7ebf22b 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -90,6 +90,10 @@ globals: basicData: Datos básicos log: Historial parkingList: Listado de parkings + zones: Zonas + zonesList: Zonas + deliveryList: Días de entrega + upcomingList: Próximos repartos created: Fecha creación worker: Trabajador now: Ahora @@ -287,7 +291,7 @@ customer: hasSepaVnl: Recibido B2B VNL entry: pageTitles: - entries: Entrasdadas + entries: Entradas list: Listado summary: Resumen basicData: Datos básicos diff --git a/src/pages/Zone/Card/ZoneBasicData.vue b/src/pages/Zone/Card/ZoneBasicData.vue new file mode 100644 index 000000000..5d57b920e --- /dev/null +++ b/src/pages/Zone/Card/ZoneBasicData.vue @@ -0,0 +1,103 @@ + + + + + +es: + Name: Nombre + Agency: Agencia + Max m³: Medida máxima + Maximum m³: M³ maximo + Traveling days: Dias de viaje + Closing: Cierre + Price: Precio + Bonus: Bonificación + Inflation: Inflación + Volumetric: Volumétrico + diff --git a/src/pages/Zone/Card/ZoneCalendar.vue b/src/pages/Zone/Card/ZoneCalendar.vue new file mode 100644 index 000000000..e69de29bb diff --git a/src/pages/Zone/Card/ZoneLocations.vue b/src/pages/Zone/Card/ZoneLocations.vue new file mode 100644 index 000000000..e69de29bb diff --git a/src/pages/Zone/Card/ZoneLog.vue b/src/pages/Zone/Card/ZoneLog.vue new file mode 100644 index 000000000..373d210b5 --- /dev/null +++ b/src/pages/Zone/Card/ZoneLog.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/Zone/Card/ZoneSummary.vue b/src/pages/Zone/Card/ZoneSummary.vue new file mode 100644 index 000000000..63090b5d4 --- /dev/null +++ b/src/pages/Zone/Card/ZoneSummary.vue @@ -0,0 +1,3 @@ + diff --git a/src/pages/Zone/Card/ZoneWarehouses.vue b/src/pages/Zone/Card/ZoneWarehouses.vue new file mode 100644 index 000000000..67a81ba4d --- /dev/null +++ b/src/pages/Zone/Card/ZoneWarehouses.vue @@ -0,0 +1,59 @@ + + + + + + es: + Remove row: Eliminar fila + diff --git a/src/pages/Zone/Delivery/ZoneDeliveryList.vue b/src/pages/Zone/Delivery/ZoneDeliveryList.vue index c7a3cbcdb..695388a9b 100644 --- a/src/pages/Zone/Delivery/ZoneDeliveryList.vue +++ b/src/pages/Zone/Delivery/ZoneDeliveryList.vue @@ -6,7 +6,6 @@ import { useArrayData } from 'src/composables/useArrayData'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import CardList from 'components/ui/CardList.vue'; -import VnLv from 'components/ui/VnLv.vue'; const quasar = useQuasar(); const arrayData = useArrayData('ZoneDeliveryList'); @@ -45,7 +44,7 @@ async function remove(row) {
diff --git a/src/pages/Zone/Upcoming/ZoneUpcomingList.vue b/src/pages/Zone/Upcoming/ZoneUpcomingList.vue index 5c417df8f..2d3016f25 100644 --- a/src/pages/Zone/Upcoming/ZoneUpcomingList.vue +++ b/src/pages/Zone/Upcoming/ZoneUpcomingList.vue @@ -6,7 +6,6 @@ import { useArrayData } from 'src/composables/useArrayData'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import CardList from 'components/ui/CardList.vue'; -import VnLv from 'components/ui/VnLv.vue'; const quasar = useQuasar(); const arrayData = useArrayData('ZoneUpcomingList'); @@ -45,7 +44,7 @@ async function remove(row) {
diff --git a/src/pages/Zone/ZoneCreate.vue b/src/pages/Zone/ZoneCreate.vue index 8c0ba8c17..93ea9589b 100644 --- a/src/pages/Zone/ZoneCreate.vue +++ b/src/pages/Zone/ZoneCreate.vue @@ -96,7 +96,7 @@ function filterType(val, update) {
@@ -116,7 +116,7 @@ function filterType(val, update) { +import { ref } from 'vue'; +import { useI18n } from 'vue-i18n'; +import VnInput from 'components/common/VnInput.vue'; +import FetchData from 'components/FetchData.vue'; +import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; +import VnSelectFilter from 'components/common/VnSelectFilter.vue'; + +const { t } = useI18n(); +const props = defineProps({ + dataKey: { + type: String, + required: true, + }, + exprBuilder: { + type: Function, + default: null, + }, +}); +const agencies = ref([]); + + + diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue index 00502e1f7..2140c5e14 100644 --- a/src/pages/Zone/ZoneList.vue +++ b/src/pages/Zone/ZoneList.vue @@ -7,21 +7,15 @@ import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import CardList from 'components/ui/CardList.vue'; import VnLv from 'components/ui/VnLv.vue'; +import FetchData from 'src/components/FetchData.vue'; +import { useSummaryDialog } from 'src/composables/useSummaryDialog'; const quasar = useQuasar(); const arrayData = useArrayData('ZoneList'); const store = arrayData.store; const router = useRouter(); const { t } = useI18n(); - -const filter = { - include: { - relation: 'type', - scope: { - fields: 'name', - }, - }, -}; +const { viewSummary } = useSummaryDialog(); function navigate(id) { router.push({ path: `/zone/${id}/edit` }); @@ -44,18 +38,25 @@ async function remove(row) { // } } + +function extractHour(dateTime) { + const date = new Date(dateTime); + const hours = date.getHours().toString().padStart(2, '0'); + const minutes = date.getMinutes().toString().padStart(2, '0'); + return `${hours}:${minutes}`; +}