From cd5a64fcc6489b5791f076d91401f56352c6bd4e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 17 Jun 2024 22:32:39 +0200 Subject: [PATCH] fat: #6321 handle events through components --- src/pages/Item/components/ItemProposal.vue | 18 +++++-- .../Ticket/Negative/TicketLackDetail.vue | 47 +++++++++++++------ 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/src/pages/Item/components/ItemProposal.vue b/src/pages/Item/components/ItemProposal.vue index d326a7d98..8206c0fa9 100644 --- a/src/pages/Item/components/ItemProposal.vue +++ b/src/pages/Item/components/ItemProposal.vue @@ -8,6 +8,7 @@ import { useSession } from 'src/composables/useSession'; import VnLv from 'src/components/ui/VnLv.vue'; import { toCurrency } from 'filters/index'; import VnStockValueDisplay from 'src/components/ui/VnStockValueDisplay.vue'; +import { useDialogPluginComponent } from 'quasar'; const MATCH_VALUES = [5, 6, 7, 8]; const { t } = useI18n(); @@ -156,8 +157,7 @@ const columns = computed(() => [ }, ]); async function confirm() { - console.log(''); - quantity.value = 0; + // console.log(''); // const response = { address: address.value }; // if (props.promise) { // isLoading.value = true; @@ -170,7 +170,18 @@ async function confirm() { // isLoading.value = false; // } // } - // onDialogOK(response); + // onDialogOK({ data: true }); + dialogRef.value.hide({ type: 'refresh', itemProposal: proposalSelected.value[0] }); +} +const { dialogRef, onDialogOK, onDialogCancel } = useDialogPluginComponent(); + +// Definir el emisor de eventos +const emit = defineEmits(['dialogClosed']); + +function onDialogClose() { + console.log('Dialog has been closed'); + // Emitir el evento personalizado + emit('dialogClosed', { data: true }); }