diff --git a/src/components/displays/department/pos/orders/ordersTable.vue b/src/components/displays/department/pos/orders/ordersTable.vue index d2c80b11..f4d3bee7 100644 --- a/src/components/displays/department/pos/orders/ordersTable.vue +++ b/src/components/displays/department/pos/orders/ordersTable.vue @@ -57,9 +57,14 @@ import WhiteBoxCard from "@/components/displays/boxes/WhiteBoxCard.vue"; const redirectDepartmentOrderPage = (orderId, departmentId, newTab = true) => { - // Send the user to the order page (In a new tab) - // `/admin/${departmentId}/modules/pos/orders/${orderId}` - window.open(`/admin/${departmentId}/modules/pos/orders/${orderId}`, newTab ? '_blank' : '_self'); + // Check if the user has access to the department + if (!SessionUser.canAccessDepartment(departmentId)) { + window.open('/user/orders/' + orderId, newTab ? '_blank' : '_self'); + } else { + // Send the user to the order page (In a new tab) + // `/admin/${departmentId}/modules/pos/orders/${orderId}` + window.open(`/admin/${departmentId}/modules/pos/orders/${orderId}`, newTab ? '_blank' : '_self'); + } }; const redirectSuperUserInvoiceCollectionPage = (invoiceCollectionId) => { diff --git a/src/views/dashboards/userDashboard/wash/MyWashStart.vue b/src/views/dashboards/userDashboard/wash/MyWashStart.vue index e013c6a5..2e90b041 100644 --- a/src/views/dashboards/userDashboard/wash/MyWashStart.vue +++ b/src/views/dashboards/userDashboard/wash/MyWashStart.vue @@ -119,6 +119,27 @@ const timeSinceWashStart = computed(() => { return 0; }); +// Helpers for a cleaner in-progress display +const pad2 = (n: number) => n.toString().padStart(2, '0'); +const formattedElapsed = computed(() => { + const totalSeconds = Math.floor(timeSinceWashStart.value / 1000); + const minutes = Math.floor(totalSeconds / 60); + const seconds = totalSeconds % 60; + return `${pad2(minutes)}:${pad2(seconds)}`; +}); +const humanElapsed = computed(() => { + const totalSeconds = Math.floor(timeSinceWashStart.value / 1000); + const minutes = Math.floor(totalSeconds / 60); + const seconds = totalSeconds % 60; + return `${minutes} minutter og ${seconds} sekunder`; +}); + +// Current lane (for nicer labeling than just ID) +const currentLane = computed(() => { + const lanes = nearestDepartment.value?.lanes || []; + return lanes.find((l: any) => l.id === washLaneId.value) || null; +}); + const onStartWash = (laneId, licensePlate, customerNumber) => { if (!nearestDepartment.value) { alert('Ingen afdeling valgt.'); @@ -454,24 +475,13 @@ watch(() => nearestDepartment.value, (newValue) => {

Vask i gang

-

- {{ Math.floor(timeSinceWashStart / 60000) }} minutter og {{ Math.floor((timeSinceWashStart % 60000) / 1000) }} sekunder. -

+

+ {{ formattedElapsed }} +

+ Vasken er startet på bane {{ (currentLane && currentLane.name) ? currentLane.name : washLaneId }}. Når vasken er færdig, skal du trykke på knappen "Færdig" nedenfor for at afslutte processen.

- - - Vasken er startet på bane {{ washLaneId }}. Følg venligst instruktionerne på stedet for at fuldføre vasken. -
- Stop vask -