Bladeren bron

feat: :sparkles: feat(adicionar novo card) Foi adicionado um novo dialog para propostas aceitas

Foi adiicionado um novo dialog para propostas aceitas visando mostrar para o presatdor que mesmo que ele aceitou ainda precisa da validação do cliente, tambem foi adicionado as traduções

fase:dev | origin:escopo
kayo henrique 5 dagen geleden
bovenliggende
commit
f8360b6466

+ 61 - 0
src/components/dashboard/ProposalAcceptedDialog.vue

@@ -0,0 +1,61 @@
+<template>
+  <q-dialog
+    ref="dialogRef"
+    @hide="onDialogHide"
+  >
+    <q-card class="dialog-card">
+
+      <q-card-section class="text-center q-pt-xl">
+
+        <q-icon
+          name="check_circle"
+          color="positive"
+          size="64px"
+        />
+
+        <div class="text-h6 q-mt-md">
+            {{ $t("provider.dashboard.proposal_accepted.title") }}
+        </div>
+
+        <div class="q-mt-sm text-grey-7">
+            {{ $t("provider.dashboard.proposal_accepted.description") }}
+        </div>
+
+      </q-card-section>
+
+      <q-card-actions class="justify-center q-pb-lg">
+        <q-btn
+          color="secondary"
+          rounded
+          unelevated
+          no-caps
+          :label="$t('provider.dashboard.proposal_accepted.button_ok')"
+          @click="onDialogOK"
+        />
+      </q-card-actions>
+
+    </q-card>
+  </q-dialog>
+</template>
+
+<script setup>
+import { useDialogPluginComponent } from "quasar";
+
+defineEmits([
+  ...useDialogPluginComponent.emits,
+]);
+
+const {
+  dialogRef,
+  onDialogHide,
+  onDialogOK,
+} = useDialogPluginComponent();
+</script>
+
+<style scoped>
+.dialog-card {
+  width: 320px;
+  max-width: 92vw;
+  border-radius: 20px;
+}
+</style>

+ 5 - 0
src/i18n/locales/en.json

@@ -343,6 +343,11 @@
         "message": "If your request is accepted by the client, you will receive a confirmation and it will appear in your upcoming services.",
         "close": "Close"
       },
+      "proposal_accepted": {
+        "title": "You accepted the proposal!",
+        "description": "As soon as the client confirms, the appointment will appear in your upcoming services.",
+        "button_ok": "OK"
+      },
       "refuse_opportunity_dialog": {
         "title": "Reject opportunity",
         "description": "Do you really want to reject this service?",

+ 5 - 0
src/i18n/locales/es.json

@@ -343,6 +343,11 @@
         "message": "Si su solicitud es aceptada por el cliente, recibirá una confirmación y aparecerá en sus próximos servicios.",
         "close": "Cerrar"
       },
+      "proposal_accepted": {
+        "title": "¡Has aceptado la propuesta!",
+        "description": "Tan pronto como el cliente confirme, el servicio aparecerá en tus próximos servicios.",
+        "button_ok": "OK"
+      },
       "refuse_opportunity_dialog": {
         "title": "Rechazar oportunidad",
         "description": "¿Desea realmente rechazar esta atención?",

+ 5 - 0
src/i18n/locales/pt.json

@@ -343,6 +343,11 @@
         "message": "Se seu pedido for aceito pelo cliente, você receberá um aviso confirmando o agendamento e aparecerá nos seus próximos serviços.",
         "close": "Fechar"
       },
+      "proposal_accepted": {
+        "title": "Você aceitou a proposta!",
+        "description": "Assim que o cliente confirmar, o agendamento aparecerá nos seus próximos serviços.",
+        "button_ok": "OK"
+      },
       "refuse_opportunity_dialog": {
         "title": "Recusar oportunidade",
         "description": "Deseja mesmo recusar este atendimento?",

+ 14 - 9
src/pages/dashboard/DashboardPage.vue

@@ -69,6 +69,7 @@ import DashboardTodayServices from "src/components/dashboard/DashboardTodayServi
 import NextSchedulesDetailsDialog from "src/components/dashboard/NextSchedulesDetailsDialog.vue";
 import ScheduleRatingDialog from "src/components/dashboard/ScheduleRatingDialog.vue";
 import SolicitationDetailsDialog from "src/components/dashboard/SolicitationDetailsDialog.vue";
+import ProposalAcceptedDialog from "src/components/dashboard/ProposalAcceptedDialog.vue";
 import OpportunityDialog from "src/pages/opportunities/components/OpportunityDialog.vue";
 import DashboardPendingConfirmation from "src/components/dashboard/DashboardPendingConfirmation.vue";
 
@@ -109,8 +110,6 @@ const handleScheduleAction = async (id, status, ids = [], servicePackageId = nul
 
 const loadDashboard = async () => {
   const response = await dadosDashboard();
-  console.log(response);
-console.log(response.solicitations);
 
   if (response) {
     headerBar.value = response.headerBar;
@@ -138,13 +137,19 @@ const openDetailsDialog = (solicitation, initialView = "details") => {
     component: SolicitationDetailsDialog,
     componentProps: { initialView, solicitation },
   }).onOk(async ({ action, id, ids, service_package_id }) => {
-    await handleScheduleAction(
-      id,
-      action === "accept" ? "accepted" : "rejected",
-      ids,
-      service_package_id,
-    );
-  });
+  await handleScheduleAction(
+    id,
+    action === "accept" ? "accepted" : "rejected",
+    ids,
+    service_package_id,
+  );
+
+  if (action === "accept") {
+    $q.dialog({
+      component: ProposalAcceptedDialog,
+    });
+  }
+});
 };
 
 const openNextScheduleDialog = (schedule) => {