Added quick action buttons to Clients page and Client Detail Page.
This commit is contained in:
parent
e615b84728
commit
181db2c4e6
3 changed files with 66 additions and 25 deletions
|
|
@ -254,7 +254,7 @@ defineExpose({
|
||||||
background: var(--surface-card);
|
background: var(--surface-card);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
border: 1px solid var(--surface-border);
|
/*border: 1px solid var(--surface-border);*/
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="overview-container">
|
<div class="overview-container">
|
||||||
<template v-if="!editMode && !isNew">
|
<template v-if="!editMode && !isNew">
|
||||||
<Button
|
<div class=quick-action-bar>
|
||||||
@click="toggleEditMode"
|
<Button
|
||||||
icon="pi pi-pencil"
|
@click="toggleEditMode"
|
||||||
label="Edit Information"
|
icon="pi pi-pencil"
|
||||||
size="small"
|
label="Edit Information"
|
||||||
severity="secondary"
|
size="small"
|
||||||
/>
|
severity="secondary"
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
@click="handleCreateEstimate"
|
||||||
|
icon=""
|
||||||
|
label="Create Estimate"
|
||||||
|
size="small"
|
||||||
|
severity="secondary"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="status-cards">
|
<div class="status-cards">
|
||||||
<template v-if="isNew || editMode">
|
<template v-if="isNew || editMode">
|
||||||
|
|
@ -43,7 +52,7 @@
|
||||||
<!-- Display Mode (existing client view) -->
|
<!-- Display Mode (existing client view) -->
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<!-- Address Info Card -->
|
<!-- Address Info Card -->
|
||||||
<div class="info-card" v-if="selectedAddressData">
|
<div class="info-card w-half" v-if="selectedAddressData">
|
||||||
<h3>General Information</h3>
|
<h3>General Information</h3>
|
||||||
<div class="info-grid">
|
<div class="info-grid">
|
||||||
<div class="info-item full-width">
|
<div class="info-item full-width">
|
||||||
|
|
@ -70,7 +79,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Client Basic Info Card -->
|
<!-- Client Basic Info Card -->
|
||||||
<div class="info-card">
|
<div class="info-card w-half">
|
||||||
<h3>Contact Information</h3>
|
<h3>Contact Information</h3>
|
||||||
<template v-if="contactsForAddress.length > 0">
|
<template v-if="contactsForAddress.length > 0">
|
||||||
<div class="info-grid">
|
<div class="info-grid">
|
||||||
|
|
@ -122,7 +131,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Financials At a Glance -->
|
<!-- Financials At a Glance -->
|
||||||
<div class="info-card">
|
<div class="info-card w-half">
|
||||||
<h3>Open Balances</h3>
|
<h3>Open Balances</h3>
|
||||||
<span>$3200.00</span>
|
<span>$3200.00</span>
|
||||||
<button class="sidebar-button" @click="navigateTo('/invoices')">
|
<button class="sidebar-button" @click="navigateTo('/invoices')">
|
||||||
|
|
@ -150,7 +159,7 @@
|
||||||
|
|
||||||
<div class="status-cards">
|
<div class="status-cards">
|
||||||
<!-- Location Map (only for existing clients) -->
|
<!-- Location Map (only for existing clients) -->
|
||||||
<div class="map-card" v-if="!isNew && !editMode">
|
<div class="map-card w-half" v-if="!isNew && !editMode">
|
||||||
<h3>Location</h3>
|
<h3>Location</h3>
|
||||||
<LeafletMap
|
<LeafletMap
|
||||||
:latitude="latitude"
|
:latitude="latitude"
|
||||||
|
|
@ -168,7 +177,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Client History -->
|
<!-- Client History -->
|
||||||
<div class="info-card">
|
<div class="info-card w-half">
|
||||||
<History/>
|
<History/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -538,6 +547,12 @@ const handleNewContactToggle = (isNewContact) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCreateEstimate = () => {
|
||||||
|
if (props.selectedAddress) {
|
||||||
|
router.push(`/estimate?new=true&address=${props.selectedAddress}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Edit mode methods
|
// Edit mode methods
|
||||||
const toggleEditMode = () => {
|
const toggleEditMode = () => {
|
||||||
showEditConfirmDialog.value = true;
|
showEditConfirmDialog.value = true;
|
||||||
|
|
@ -631,8 +646,15 @@ const handleCancel = () => {
|
||||||
.overview-container {
|
.overview-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1.5rem;
|
gap: 1rem;
|
||||||
padding: 1rem;
|
/*padding: 1rem;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.quick-action-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 1rem;
|
||||||
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-card,
|
.info-card,
|
||||||
|
|
@ -643,6 +665,13 @@ const handleCancel = () => {
|
||||||
border: 1px solid var(--surface-border);
|
border: 1px solid var(--surface-border);
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
.info-card {
|
||||||
|
flex: 1 1 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-card {
|
||||||
|
flex: 1 1 600px;
|
||||||
|
}
|
||||||
|
|
||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -664,9 +693,8 @@ const handleCancel = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-grid {
|
.info-grid {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
flex-direction: column;
|
||||||
gap: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-item {
|
.info-item {
|
||||||
|
|
@ -772,6 +800,10 @@ const handleCancel = () => {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*.w-half {
|
||||||
|
width: 45% !important;
|
||||||
|
}*/
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.overview-container {
|
.overview-container {
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,13 @@ const columns = [
|
||||||
filterInputId: "propertySearchInput",
|
filterInputId: "propertySearchInput",
|
||||||
},
|
},
|
||||||
//{
|
//{
|
||||||
|
// label: "Create Estimate",
|
||||||
|
// fieldName: "createEstimate",
|
||||||
|
// type: "status-button",
|
||||||
|
// buttonVariant: "outlined",
|
||||||
|
// onStatusClick: (status, rowData) => handleEstimateClick(status, rowData),
|
||||||
|
//},
|
||||||
|
//{
|
||||||
// label: "Appt. Scheduled",
|
// label: "Appt. Scheduled",
|
||||||
// fieldName: "appointmentScheduledStatus",
|
// fieldName: "appointmentScheduledStatus",
|
||||||
// type: "status-button",
|
// type: "status-button",
|
||||||
|
|
@ -184,6 +191,14 @@ const tableActions = [
|
||||||
},
|
},
|
||||||
// Global action - always available
|
// Global action - always available
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Create Estimate",
|
||||||
|
rowAction: true,
|
||||||
|
action: (rowData) => {
|
||||||
|
const address = encodeURIComponent(rowData.address);
|
||||||
|
router.push(`/estimate?new=true&address=${address}`);
|
||||||
|
},
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// label: "Export Selected",
|
// label: "Export Selected",
|
||||||
// action: (selectedRows) => {
|
// action: (selectedRows) => {
|
||||||
|
|
@ -284,13 +299,7 @@ const handleAppointmentClick = (status, rowData) => {
|
||||||
|
|
||||||
const handleEstimateClick = (status, rowData) => {
|
const handleEstimateClick = (status, rowData) => {
|
||||||
const address = encodeURIComponent(rowData.address);
|
const address = encodeURIComponent(rowData.address);
|
||||||
if (status?.toLowerCase() === "not started") {
|
router.push(`/estimate?new=true&address=${address}`);
|
||||||
// Navigate to create quotation/estimate
|
|
||||||
router.push(`/estimate?new=true&address=${address}`);
|
|
||||||
} else {
|
|
||||||
// Navigate to view estimate details
|
|
||||||
router.push('/estimate?address=' + address);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePaymentClick = (status, rowData) => {
|
const handlePaymentClick = (status, rowData) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue