diff --git a/frontend/src/components/pages/Estimates.vue b/frontend/src/components/pages/Estimates.vue index 9c83974..c83ef9d 100644 --- a/frontend/src/components/pages/Estimates.vue +++ b/frontend/src/components/pages/Estimates.vue @@ -154,9 +154,13 @@ const filteredItems= [] // End junk const columns = [ - { label: "Estimate Address", fieldName: "address", type: "text", sortable: true, filterable: true }, + { label: "Estimate Address", fieldName: "address", type: "link", sortable: true, filterable:true, + onLinkClick: (link, rowData) => handlePropertyClick(link, rowData), + }, //{ label: "Address", fieldName: "customInstallationAddress", type: "text", sortable: true }, - { label: "Customer", fieldName: "customer", type: "text", sortable: true, filterable: true }, + { label: "Customer", fieldName: "customer", type: "link", sortable: true, filterable: true, + onLinkClick: (link, rowData) => handleCustomerClick(link, rowData), + }, { label: "Status", fieldName: "status", @@ -194,6 +198,19 @@ const closeSubmitEstimateModal = () => { showSubmitEstimateModal.value = false; }; +const handleCustomerClick = (link, rowData) => { + console.log("DEBUG: Customer Link Clicked."); + const client = encodeURIComponent(rowData.customer); + const address = encodeURIComponent(rowData.address); + router.push(`/client?client=${client}&address=${address}`); +} + +const handlePropertyClick = (link, rowData) => { + console.log("DEBUG: Property Link Clicked."); + const client = encodeURIComponent(rowData.customer); + const address = encodeURIComponent(rowData.address); + router.push(`/property?client=${client}&address=${address}`); +} const handleLazyLoad = async (event) => { console.log("Estimates page - handling lazy load:", event);