|
@@ -238,7 +238,7 @@
|
|
|
v-if="schedulesProposals.length > 0"
|
|
v-if="schedulesProposals.length > 0"
|
|
|
:data="schedulesProposals"
|
|
:data="schedulesProposals"
|
|
|
class="q-pt-md"
|
|
class="q-pt-md"
|
|
|
- @refresh-data="loadCustomRequests"
|
|
|
|
|
|
|
+ @refresh-data="loadOrders"
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
@@ -258,7 +258,39 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
|
- v-if="servicePackage.items.length === 0 && !hasPendingCustomRequests"
|
|
|
|
|
|
|
+ v-if="pendingServicePackages.length > 0"
|
|
|
|
|
+ class="q-pt-md"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="section-title gradient-diarista q-px-md q-mb-sm font16 fontbold">
|
|
|
|
|
+ {{ $t("service_package.awaiting_payment_title") }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <DashboardPendingSchedules
|
|
|
|
|
+ :data="pendingServicePackages"
|
|
|
|
|
+ progress-class="progress-fill--urgent"
|
|
|
|
|
+ type="servicePackage"
|
|
|
|
|
+ @view-details="openServicePackagePaymentDialog"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="pendingSchedules.length > 0"
|
|
|
|
|
+ class="q-pt-md"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="section-title gradient-diarista q-px-md q-mb-sm font16 fontbold">
|
|
|
|
|
+ {{ $t("service_package.pending_default_title") }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <DashboardPendingSchedules
|
|
|
|
|
+ :data="pendingSchedules"
|
|
|
|
|
+ progress-class="progress-fill--urgent"
|
|
|
|
|
+ @cancel="openCancelRequestDialog"
|
|
|
|
|
+ @view-details="openPackageDetailsDialog"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-if="servicePackage.items.length === 0 && !hasPendingCustomRequests && !hasPendingDefaultSchedules"
|
|
|
class="q-px-md q-pt-md"
|
|
class="q-px-md q-pt-md"
|
|
|
>
|
|
>
|
|
|
<q-card
|
|
<q-card
|
|
@@ -330,7 +362,11 @@
|
|
|
import { computed, onMounted, ref } from "vue";
|
|
import { computed, onMounted, ref } from "vue";
|
|
|
import SchedulingDialog from "src/pages/search/components/SchedulingDialog.vue";
|
|
import SchedulingDialog from "src/pages/search/components/SchedulingDialog.vue";
|
|
|
import DashboardClientProposals from "src/pages/dashboard/components/DashboardClientProposals.vue";
|
|
import DashboardClientProposals from "src/pages/dashboard/components/DashboardClientProposals.vue";
|
|
|
|
|
+import DashboardPendingSchedules from "src/components/dashboard/DashboardPendingSchedules.vue";
|
|
|
import CustomScheduleRequestCard from "src/pages/orders/components/CustomScheduleRequestCard.vue";
|
|
import CustomScheduleRequestCard from "src/pages/orders/components/CustomScheduleRequestCard.vue";
|
|
|
|
|
+import PackageScheduleDetailsDialog from "src/components/dashboard/PackageScheduleDetailsDialog.vue";
|
|
|
|
|
+import ScheduleAcceptedDialog from "src/components/dashboard/ScheduleAcceptedDialog.vue";
|
|
|
|
|
+import ScheduleCancelDialog from "src/components/dashboard/ScheduleCancelDialog.vue";
|
|
|
import { createScheduleServicePackage } from "src/api/servicePackage";
|
|
import { createScheduleServicePackage } from "src/api/servicePackage";
|
|
|
import { dadosPedidosCliente } from "src/api/dashboard";
|
|
import { dadosPedidosCliente } from "src/api/dashboard";
|
|
|
import { getAddresses } from "src/api/address";
|
|
import { getAddresses } from "src/api/address";
|
|
@@ -355,6 +391,8 @@ const primaryAddress = ref(null);
|
|
|
const submitting = ref(false);
|
|
const submitting = ref(false);
|
|
|
const customSchedulesNoProposals = ref([]);
|
|
const customSchedulesNoProposals = ref([]);
|
|
|
const schedulesProposals = ref([]);
|
|
const schedulesProposals = ref([]);
|
|
|
|
|
+const pendingSchedules = ref([]);
|
|
|
|
|
+const pendingServicePackages = ref([]);
|
|
|
|
|
|
|
|
const pendingCustomRequests = computed(() => {
|
|
const pendingCustomRequests = computed(() => {
|
|
|
const groups = new Map();
|
|
const groups = new Map();
|
|
@@ -390,6 +428,35 @@ const pendingCustomRequests = computed(() => {
|
|
|
|
|
|
|
|
const hasPendingCustomRequests = computed(() => pendingCustomRequests.value.length > 0);
|
|
const hasPendingCustomRequests = computed(() => pendingCustomRequests.value.length > 0);
|
|
|
|
|
|
|
|
|
|
+const hasPendingDefaultSchedules = computed(
|
|
|
|
|
+ () => pendingSchedules.value.length > 0 || pendingServicePackages.value.length > 0,
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
|
|
+const openServicePackagePaymentDialog = (packageToPay) => {
|
|
|
|
|
+ $q.dialog({
|
|
|
|
|
+ component: ScheduleAcceptedDialog,
|
|
|
|
|
+ componentProps: { servicePackage: packageToPay },
|
|
|
|
|
+ }).onOk(() => {
|
|
|
|
|
+ loadOrders();
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const openPackageDetailsDialog = (schedule) => {
|
|
|
|
|
+ $q.dialog({
|
|
|
|
|
+ component: PackageScheduleDetailsDialog,
|
|
|
|
|
+ componentProps: { schedule },
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const openCancelRequestDialog = (schedule) => {
|
|
|
|
|
+ $q.dialog({
|
|
|
|
|
+ component: ScheduleCancelDialog,
|
|
|
|
|
+ componentProps: { schedule },
|
|
|
|
|
+ }).onDismiss(() => {
|
|
|
|
|
+ loadOrders();
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const isValidFee = (fee) =>
|
|
const isValidFee = (fee) =>
|
|
|
fee !== null && fee !== undefined && Number.isFinite(Number(fee));
|
|
fee !== null && fee !== undefined && Number.isFinite(Number(fee));
|
|
|
|
|
|
|
@@ -668,19 +735,21 @@ const submitServicePackage = async () => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const loadCustomRequests = async () => {
|
|
|
|
|
|
|
+const loadOrders = async () => {
|
|
|
const response = await dadosPedidosCliente();
|
|
const response = await dadosPedidosCliente();
|
|
|
|
|
|
|
|
if (response) {
|
|
if (response) {
|
|
|
customSchedulesNoProposals.value = response.customSchedulesNoProposals ?? [];
|
|
customSchedulesNoProposals.value = response.customSchedulesNoProposals ?? [];
|
|
|
schedulesProposals.value = response.schedulesProposals ?? [];
|
|
schedulesProposals.value = response.schedulesProposals ?? [];
|
|
|
|
|
+ pendingSchedules.value = response.pendingSchedules ?? [];
|
|
|
|
|
+ pendingServicePackages.value = response.pendingServicePackages ?? [];
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
loadPrimaryAddress();
|
|
loadPrimaryAddress();
|
|
|
loadPlatformFees().catch(() => {});
|
|
loadPlatformFees().catch(() => {});
|
|
|
- loadCustomRequests();
|
|
|
|
|
|
|
+ loadOrders();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|