diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue
index 473a8960f..a63bd8573 100644
--- a/src/pages/Zone/Card/ZoneEvents.vue
+++ b/src/pages/Zone/Card/ZoneEvents.vue
@@ -1,31 +1,21 @@
@@ -234,39 +71,13 @@ onUnmounted(() => arrayData.destroy());
-
-
-
-
-
-
+
arrayData.destroy());
-
-
diff --git a/src/pages/Zone/Card/ZoneEventsPanel.vue b/src/pages/Zone/Card/ZoneEventsPanel.vue
index 1ec82c54c..6cb31a093 100644
--- a/src/pages/Zone/Card/ZoneEventsPanel.vue
+++ b/src/pages/Zone/Card/ZoneEventsPanel.vue
@@ -1,5 +1,5 @@
diff --git a/src/pages/Zone/ZoneCalendar.vue b/src/pages/Zone/ZoneCalendar.vue
index 9e273d2cf..f336415a4 100644
--- a/src/pages/Zone/ZoneCalendar.vue
+++ b/src/pages/Zone/ZoneCalendar.vue
@@ -2,6 +2,7 @@
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { date } from 'quasar';
+import { useRoute } from 'vue-router';
import ZoneClosingTable from './ZoneClosingTable.vue';
import QCalendarMonthWrapper from 'src/components/ui/QCalendarMonthWrapper.vue';
@@ -36,19 +37,12 @@ const props = defineProps({
type: Object,
default: null,
},
- isZoneDeliveryView: {
- type: Boolean,
- default: false,
- },
- formModeName: {
- type: String,
- default: 'include',
- },
});
-const emit = defineEmits(['openZoneForm']);
+const emit = defineEmits(['onDateSelected']);
const { locale } = useI18n();
+const route = useRoute();
const calendarRef = ref(null);
const weekdayStore = useWeekdayStore();
@@ -62,8 +56,10 @@ const todayTimestamp = computed(() => {
});
const _monthDate = computed(() => date.formatDate(props.monthDate, 'YYYY-MM-DD'));
+const isZoneDeliveryView = computed(() => route.name === 'ZoneDeliveryDays');
+
const onEventSelection = async ({ year, month, day }) => {
- if (!props.isZoneDeliveryView) return;
+ if (!isZoneDeliveryView.value) return;
const date = new Date(year, month - 1, day);
const stamp = date.getTime();
@@ -125,7 +121,7 @@ const calendarHeaderTitle = computed(() => {
});
const handleDateClick = (timestamp) => {
- if (props.isZoneDeliveryView) return;
+ if (isZoneDeliveryView.value) return;
const event = getEventByTimestamp(timestamp);
const { year, month, day } = timestamp;
@@ -137,7 +133,7 @@ const handleDateClick = (timestamp) => {
if (eventType === 'geoExclusion')
geoIds = props.geoExclusions[stamp].map((geoExclusion) => geoExclusion.geoFk);
- emit('openZoneForm', {
+ emit('onDateSelected', {
date,
isNewMode: !event,
event: event && event.length > 0 ? event[0] : null,
diff --git a/src/pages/Zone/ZoneCalendarGrid.vue b/src/pages/Zone/ZoneCalendarGrid.vue
new file mode 100644
index 000000000..98916e7c4
--- /dev/null
+++ b/src/pages/Zone/ZoneCalendarGrid.vue
@@ -0,0 +1,250 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Zone/ZoneDeliveryDays.vue b/src/pages/Zone/ZoneDeliveryDays.vue
index be51a8d77..3c985c98a 100644
--- a/src/pages/Zone/ZoneDeliveryDays.vue
+++ b/src/pages/Zone/ZoneDeliveryDays.vue
@@ -1,182 +1,18 @@
@@ -203,56 +39,11 @@ onUnmounted(() => arrayData.destroy());
-
-
-
-
-
-
+
-
-
diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue
index c754d484f..03f534701 100644
--- a/src/pages/Zone/ZoneDeliveryPanel.vue
+++ b/src/pages/Zone/ZoneDeliveryPanel.vue
@@ -2,7 +2,6 @@
import { onMounted, ref, reactive } from 'vue';
import { useI18n } from 'vue-i18n';
-import FetchData from 'components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import { useArrayData } from 'src/composables/useArrayData';