|
@@ -12,6 +12,7 @@
|
|
|
v-if="pendingSchedules.length > 0"
|
|
v-if="pendingSchedules.length > 0"
|
|
|
:data="pendingSchedules"
|
|
:data="pendingSchedules"
|
|
|
@view-details="openAcceptedDialog"
|
|
@view-details="openAcceptedDialog"
|
|
|
|
|
+ @cancel="cancelSchedule"
|
|
|
/>
|
|
/>
|
|
|
<DashboardScrollAreaSchedules />
|
|
<DashboardScrollAreaSchedules />
|
|
|
<DashboardPendingCustomSchedules />
|
|
<DashboardPendingCustomSchedules />
|
|
@@ -37,8 +38,9 @@ import FinalSuccesModal from '../schedules/components/FinalSuccesModal.vue';
|
|
|
import DashboardPendingCustomSchedules from 'src/pages/dashboard/components/DashboardPendingCustomSchedules.vue';
|
|
import DashboardPendingCustomSchedules from 'src/pages/dashboard/components/DashboardPendingCustomSchedules.vue';
|
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
|
import { onMounted, ref } from 'vue';
|
|
import { onMounted, ref } from 'vue';
|
|
|
-import { useQuasar } from 'quasar';
|
|
|
|
|
|
|
+import { useDialogPluginComponent, useQuasar } from 'quasar';
|
|
|
import { dadosDashboard } from 'src/api/dashboard';
|
|
import { dadosDashboard } from 'src/api/dashboard';
|
|
|
|
|
+import ScheduleCancelDialog from 'src/components/dashboard/ScheduleCancelDialog.vue';
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
const headerBar = ref({});
|
|
const headerBar = ref({});
|
|
@@ -52,6 +54,7 @@ const $q = useQuasar();
|
|
|
const loading = ref(true);
|
|
const loading = ref(true);
|
|
|
|
|
|
|
|
const showSuccessModal = ref(router.currentRoute.value.fullPath.includes('showSuccessModal') || false);
|
|
const showSuccessModal = ref(router.currentRoute.value.fullPath.includes('showSuccessModal') || false);
|
|
|
|
|
+const { onDialogOK } = useDialogPluginComponent();
|
|
|
|
|
|
|
|
const openAcceptedDialog = (schedule) => {
|
|
const openAcceptedDialog = (schedule) => {
|
|
|
$q.dialog({
|
|
$q.dialog({
|
|
@@ -80,12 +83,23 @@ const reloadDashboard = async () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
showSuccessModal.value = false;
|
|
showSuccessModal.value = false;
|
|
|
|
|
+ router.replace({ path: router.currentRoute.value.path, query: {} });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const cancelSchedule = (schedule) => {
|
|
|
|
|
+ console.log(schedule)
|
|
|
|
|
+ $q.dialog({
|
|
|
|
|
+ component: ScheduleCancelDialog,
|
|
|
|
|
+ componentProps: { schedule: schedule }
|
|
|
|
|
+ }).onDismiss(() => {
|
|
|
|
|
+ onDialogOK(reloadDashboard());
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await reloadDashboard();
|
|
await reloadDashboard();
|
|
|
});
|
|
});
|