From cb604433fb5001bc73480f354deed2487211bdc6 Mon Sep 17 00:00:00 2001 From: Daniel Stock Date: Thu, 22 Jan 2026 11:36:00 +0100 Subject: [PATCH] Added phone number dialog --- resources/js/pages/Customers.vue | 90 +++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 18 deletions(-) diff --git a/resources/js/pages/Customers.vue b/resources/js/pages/Customers.vue index ced8626..946aa65 100644 --- a/resources/js/pages/Customers.vue +++ b/resources/js/pages/Customers.vue @@ -14,6 +14,8 @@ import { Delete, Globe, House, LayoutGrid, Mail, Phone, Plus, Rows3, Search, Sma import Fuse from 'fuse.js'; import { getInitials } from '@/composables/useInitials'; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from '@/components/ui/card' +import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogClose } from "@/components/ui/dialog" +import DialogCloseButton from "@/components/DialogCloseButton/DialogCloseButton.vue" import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip' import { TooltipArrow } from 'reka-ui' import CustomerDialog from '@/components/CustomerDialog.vue' @@ -32,6 +34,7 @@ const searchQuery = ref('') const searchField = ref() const activeCustomer = ref(null) const detailDialogOpen = ref(false) +const phoneNumber = ref('') onMounted(() => { customersData.value = props.customersData.toSorted((a, b) => (a.companyName ?? '').localeCompare(b.companyName ?? '')); @@ -113,8 +116,32 @@ const browse = (url: string, event: Event) => { } } +const showPhoneNumber = (number: string, event: Event | null) => { + if (event) { + event.preventDefault() + event.stopPropagation(); + event.returnValue = true + } + + phoneNumber.value = number +} + +const closePhoneNumberDisplay = (event: Event | null) => { + if (event) { + event.preventDefault() + event.stopPropagation(); + event.returnValue = true + } + + phoneNumber.value = '' +} + const call = (number: string, event: Event) => { - event.stopPropagation(); + if (event) { + event.preventDefault() + event.stopPropagation(); + event.returnValue = true + } window.open('tel:' + number, '_self') } @@ -192,7 +219,6 @@ const call = (number: string, event: Event) => {
{{ customer.companyName }} - {{ customer.billingAddress?.lineOne }}
@@ -205,30 +231,25 @@ const call = (number: string, event: Event) => { - - - {{ customer.url }} öffnen - + {{ customer.url }} - - {{ customer.phone }} anrufen - + {{ customer.phone }} @@ -246,8 +267,9 @@ const call = (number: string, event: Event) => { - + {{ getInitials(contact.firstName + ' ' + contact.lastName) }} @@ -264,22 +286,22 @@ const call = (number: string, event: Event) => { @@ -297,6 +319,38 @@ const call = (number: string, event: Event) => { + + + + + + + +
+ {{ phoneNumber }}
+ + + + + + + + + + + +
+
+