|
|
@@ -313,11 +313,11 @@ import {
|
|
|
getScheduleTotalWithPlatformFee,
|
|
|
} from "src/helpers/paymentPlatformFees";
|
|
|
|
|
|
-import { onMounted, ref } from "vue";
|
|
|
+import { nextTick, onMounted, ref } from "vue";
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
import { usePaymentPlatformFees } from "src/composables/usePaymentPlatformFees";
|
|
|
import { useQuasar } from "quasar";
|
|
|
-import { useRouter } from "vue-router";
|
|
|
+import { useRoute, useRouter } from "vue-router";
|
|
|
|
|
|
import NextSchedulesDetailsDialog from "src/pages/dashboard/components/schedule/NextSchedulesDetailsDialog.vue";
|
|
|
import ScheduleRatingDialog from "src/pages/dashboard/components/schedule/ScheduleRatingDialog.vue";
|
|
|
@@ -325,6 +325,7 @@ import SchedulingDialog from "src/pages/search/components/SchedulingDialog.vue";
|
|
|
|
|
|
const $q = useQuasar();
|
|
|
const { platformFees, loadPlatformFees } = usePaymentPlatformFees();
|
|
|
+const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
@@ -432,9 +433,26 @@ const statusTextColor = (status) => {
|
|
|
return map[status] ?? "text";
|
|
|
};
|
|
|
|
|
|
+const openScheduleFromQuery = async () => {
|
|
|
+ const scheduleId = Number(route.query.scheduleId);
|
|
|
+
|
|
|
+ if (!scheduleId) return;
|
|
|
+
|
|
|
+ await router.replace({ path: route.path, query: {} });
|
|
|
+ await nextTick();
|
|
|
+
|
|
|
+ const schedule = [...upcomingSchedules.value, ...completedSchedules.value].find(
|
|
|
+ (item) => item.id === scheduleId,
|
|
|
+ );
|
|
|
+
|
|
|
+ if (schedule) openDetailsDialog(schedule);
|
|
|
+};
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
await Promise.all([loadCalendar(), loadPlatformFees().catch(() => {})]);
|
|
|
loading.value = false;
|
|
|
+
|
|
|
+ await openScheduleFromQuery();
|
|
|
});
|
|
|
|
|
|
</script>
|