diff --git a/src/pages/Zone/Card/ZoneSummary.vue b/src/pages/Zone/Card/ZoneSummary.vue index b39d2aaab..d46282c10 100644 --- a/src/pages/Zone/Card/ZoneSummary.vue +++ b/src/pages/Zone/Card/ZoneSummary.vue @@ -32,7 +32,7 @@ const filter = computed(() => { fields: ['name'], }, where: { - id: route.params.id, + id: entityId, }, }; return filter; diff --git a/src/pages/Zone/ZoneClosingTable.vue b/src/pages/Zone/ZoneClosingTable.vue new file mode 100644 index 000000000..ec8ad48c6 --- /dev/null +++ b/src/pages/Zone/ZoneClosingTable.vue @@ -0,0 +1,111 @@ + + + + + + {{ t('zoneClosingTable.zones') }} + + redirectToZoneSummary(row.id)" + style="max-height: 400px" + > + + + + + {{ t('zoneClosingTable.preview') }} + + + + + + + + + diff --git a/src/pages/Zone/ZoneDeliveryCalendar.vue b/src/pages/Zone/ZoneDeliveryCalendar.vue new file mode 100644 index 000000000..7403d86a3 --- /dev/null +++ b/src/pages/Zone/ZoneDeliveryCalendar.vue @@ -0,0 +1,197 @@ + + + + + + {{ + calendarHeaderTitle + }} + + + + + + + + + + + + + + + + + diff --git a/src/pages/Zone/ZoneDeliveryDays.vue b/src/pages/Zone/ZoneDeliveryDays.vue index 485500dba..3535eefec 100644 --- a/src/pages/Zone/ZoneDeliveryDays.vue +++ b/src/pages/Zone/ZoneDeliveryDays.vue @@ -1 +1,242 @@ -Zone Delivery days + + + + + + + + + {{ t('globals.collapseMenu') }} + + + + + + + + (data = $event)" /> + + + + + + + {{ headerTitle }} + + + + + + + + + + diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue new file mode 100644 index 000000000..ff2a4c5d5 --- /dev/null +++ b/src/pages/Zone/ZoneDeliveryPanel.vue @@ -0,0 +1,158 @@ + + + + (postcodesOptions = data)" + auto-load + /> + + + + + + + + + {{ opt.code }} + {{ opt.town?.province?.name }}, + {{ opt.town?.province?.country?.country }} + + + + + + + + + diff --git a/src/pages/Zone/locale/en.yml b/src/pages/Zone/locale/en.yml index d0a22ebcd..61eff5cb2 100644 --- a/src/pages/Zone/locale/en.yml +++ b/src/pages/Zone/locale/en.yml @@ -2,7 +2,7 @@ zone: pageTitles: zones: Zone zonesList: Zones - deliveryList: Delivery days + deliveryDays: Delivery days upcomingList: Upcoming deliveries list: clone: Clone @@ -38,3 +38,19 @@ summary: filterPanel: name: Name agencyModeFk: Agency +deliveryPanel: + pickup: Pick up + delivery: Delivery + postcode: Postcode + agency: Agency + warehouse: Warehouse + query: Query + noEventsWarning: No service for the specified zone +zoneClosingTable: + id: Id + name: Name + agency: Agency + closing: Closing + price: Precio + preview: Preview + zones: Zones diff --git a/src/pages/Zone/locale/es.yml b/src/pages/Zone/locale/es.yml index ad740d5f7..7f5df416c 100644 --- a/src/pages/Zone/locale/es.yml +++ b/src/pages/Zone/locale/es.yml @@ -2,7 +2,7 @@ zone: pageTitles: zones: Zonas zonesList: Zonas - deliveryList: Días de entrega + deliveryDays: Días de entrega upcomingList: Próximos repartos list: clone: Clonar @@ -38,5 +38,18 @@ summary: filterPanel: name: Nombre agencyModeFk: Agencia -Search zones: Buscar zonas -You can search by zone reference: Puedes buscar por referencia de la zona +deliveryPanel: + pickup: Recogida + delivery: Entrega + postcode: Código postal + agency: Agencia + warehouse: Almacén + query: Consultar + noEventsWarning: No hay servicio para la zona especificada +ZoneClosingTable: + id: Id + name: Nombre + agency: Agencia + closing: Cierre + price: Precio + zones: Zonas diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js index d39ed82d0..b6e2822fb 100644 --- a/src/router/modules/zone.js +++ b/src/router/modules/zone.js @@ -11,7 +11,7 @@ export default { component: RouterView, redirect: { name: 'ZoneMain' }, menus: { - main: ['ZoneList', 'ZoneDeliveryList', 'ZoneUpcomingList'], + main: ['ZoneList', 'ZoneDeliveryDays', 'ZoneUpcomingList'], card: ['ZoneBasicData'], }, children: [ @@ -30,6 +30,15 @@ export default { }, component: () => import('src/pages/Zone/ZoneList.vue'), }, + { + path: 'delivery-days', + name: 'ZoneDeliveryDays', + meta: { + title: 'deliveryDays', + icon: 'vn:calendar', + }, + component: () => import('src/pages/Zone/ZoneDeliveryDays.vue'), + }, { path: 'create', name: 'ZoneCreate', diff --git a/src/stores/useWeekdayStore.js b/src/stores/useWeekdayStore.js index a7b0496c6..ac17356ae 100644 --- a/src/stores/useWeekdayStore.js +++ b/src/stores/useWeekdayStore.js @@ -85,6 +85,27 @@ export const useWeekdayStore = defineStore('weekdayStore', () => { return locales; }); + /** + * Transforms weekday set into an array whose indexes are weekday index + * with selected days set to %true. + * + * @param {String} weekDays Weekday codes separated by commas + * @return {Array} Array with selected days set to %true + */ + const fromSet = (_weekDays) => { + let wdays = []; + + if (_weekDays) { + let codes = _weekDays.split(','); + for (let code of codes) { + let data = weekdaysMap[code]; + if (data) wdays[data.index] = true; + } + } + + return wdays; + }; + return { initStore, weekdaysMap, @@ -93,5 +114,6 @@ export const useWeekdayStore = defineStore('weekdayStore', () => { weekdays, monthCodes, getLocaleMonths, + fromSet, }; });