Compare commits
No commits in common. "59320f90bbe115be1e23314d87ae0bd897e39de5" and "4401a541ebab404acf41e6ada3e60e3c016813f3" have entirely different histories.
59320f90bb
...
4401a541eb
1 changed files with 155 additions and 117 deletions
|
|
@ -1,127 +1,165 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="overview-container">
|
<div class="overview-container">
|
||||||
<template v-if="!editMode">
|
<template v-if="isNew || editMode">
|
||||||
<Button
|
<ClientInformationForm
|
||||||
@click="toggleEditMode"
|
ref="clientInfoRef"
|
||||||
icon="pi pi-pencil"
|
:form-data="formData"
|
||||||
label="Edit Information"
|
@update:form-data="formData = $event"
|
||||||
size="small"
|
:is-submitting="isSubmitting"
|
||||||
severity="secondary"
|
:is-edit-mode="editMode"
|
||||||
|
@new-client-toggle="handleNewClientToggle"
|
||||||
|
@customer-selected="handleCustomerSelected"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ContactInformationForm
|
||||||
|
ref="contactInfoRef"
|
||||||
|
:form-data="formData"
|
||||||
|
@update:form-data="formData = $event"
|
||||||
|
:is-submitting="isSubmitting"
|
||||||
|
:is-edit-mode="editMode"
|
||||||
|
:is-new-client-locked="isNewClientMode"
|
||||||
|
:available-contacts="availableContacts"
|
||||||
|
@new-contact-toggle="handleNewContactToggle"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<AddressInformationForm
|
||||||
|
:form-data="formData"
|
||||||
|
@update:form-data="formData = $event"
|
||||||
|
:is-submitting="isSubmitting"
|
||||||
|
:is-edit-mode="editMode"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<div class="status-cards">
|
|
||||||
<template v-if="isNew || editMode">
|
|
||||||
<template v-if="isNew || editMode">
|
|
||||||
<ClientInformationForm
|
|
||||||
ref="clientInfoRef"
|
|
||||||
:form-data="formData"
|
|
||||||
@update:form-data="formData = $event"
|
|
||||||
:is-submitting="isSubmitting"
|
|
||||||
:is-edit-mode="editMode"
|
|
||||||
@new-client-toggle="handleNewClientToggle"
|
|
||||||
@customer-selected="handleCustomerSelected"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ContactInformationForm
|
<!-- Display Mode (existing client view) -->
|
||||||
ref="contactInfoRef"
|
<template v-else>
|
||||||
:form-data="formData"
|
<!-- Client Basic Info Card -->
|
||||||
@update:form-data="formData = $event"
|
<div class="info-card">
|
||||||
:is-submitting="isSubmitting"
|
<div class="card-header">
|
||||||
:is-edit-mode="editMode"
|
<h3>Client Information</h3>
|
||||||
:is-new-client-locked="isNewClientMode"
|
<Button
|
||||||
:available-contacts="availableContacts"
|
@click="toggleEditMode"
|
||||||
@new-contact-toggle="handleNewContactToggle"
|
icon="pi pi-pencil"
|
||||||
/>
|
label="Edit"
|
||||||
|
size="small"
|
||||||
<AddressInformationForm
|
severity="secondary"
|
||||||
:form-data="formData"
|
/>
|
||||||
@update:form-data="formData = $event"
|
</div>
|
||||||
:is-submitting="isSubmitting"
|
<div class="info-grid">
|
||||||
:is-edit-mode="editMode"
|
<div class="info-item">
|
||||||
/>
|
<label>Customer Name:</label>
|
||||||
</template>
|
<span>{{ clientData?.customerName || "N/A" }}</span>
|
||||||
|
</div>
|
||||||
<!-- Display Mode (existing client view) -->
|
<div class="info-item">
|
||||||
<template v-else>
|
<label>Customer Type:</label>
|
||||||
<!-- Address Info Card -->
|
<span>{{ clientData?.customerType || "N/A" }}</span>
|
||||||
<div class="info-card" v-if="selectedAddressData">
|
</div>
|
||||||
<h3>General Information</h3>
|
<div class="info-item">
|
||||||
<div class="info-grid">
|
<label>Customer Group:</label>
|
||||||
<div class="info-item full-width">
|
<span>{{ clientData?.customerGroup || "N/A" }}</span>
|
||||||
<label>Address Title:</label>
|
</div>
|
||||||
<span>{{ selectedAddressData.addressTitle || "N/A" }}</span>
|
<div class="info-item">
|
||||||
</div>
|
<label>Territory:</label>
|
||||||
<div class="info-item full-width">
|
<span>{{ clientData?.territory || "N/A" }}</span>
|
||||||
<label>Full Address:</label>
|
|
||||||
<span>{{ fullAddress }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item full-width">
|
|
||||||
<label>City:</label>
|
|
||||||
<span>{{ selectedAddressData.city || "N/A" }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item full-width">
|
|
||||||
<label>State:</label>
|
|
||||||
<span>{{ selectedAddressData.state || "N/A" }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item full-width">
|
|
||||||
<label>Zip Code:</label>
|
|
||||||
<span>{{ selectedAddressData.pincode || "N/A" }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Client Basic Info Card -->
|
<!-- Address Info Card -->
|
||||||
<div class="info-card">
|
<div class="info-card" v-if="selectedAddressData">
|
||||||
<h3>Contact Information</h3>
|
<h3>Address Information</h3>
|
||||||
<template v-if="contactsForAddress.length > 0">
|
<div class="info-grid">
|
||||||
<div class="info-grid">
|
<div class="info-item full-width">
|
||||||
<div class="info-item">
|
<label>Address Title:</label>
|
||||||
<label>Customer Name:</label>
|
<span>{{ selectedAddressData.addressTitle || "N/A" }}</span>
|
||||||
<span>{{ clientData?.customerName || "N/A" }}</span>
|
</div>
|
||||||
</div>
|
<div class="info-item full-width">
|
||||||
<div class="info-item">
|
<label>Full Address:</label>
|
||||||
<label>Customer Type:</label>
|
<span>{{ fullAddress }}</span>
|
||||||
<span>{{ clientData?.customerType || "N/A" }}</span>
|
</div>
|
||||||
</div>
|
<div class="info-item">
|
||||||
<div v-if="contactsForAddress.length > 1" class="contact-selector">
|
<label>City:</label>
|
||||||
<Dropdown
|
<span>{{ selectedAddressData.city || "N/A" }}</span>
|
||||||
v-model="selectedContactIndex"
|
</div>
|
||||||
:options="contactOptions"
|
<div class="info-item">
|
||||||
option-label="label"
|
<label>State:</label>
|
||||||
option-value="value"
|
<span>{{ selectedAddressData.state || "N/A" }}</span>
|
||||||
placeholder="Select Contact"
|
</div>
|
||||||
class="w-full"
|
<div class="info-item">
|
||||||
/>
|
<label>Zip Code:</label>
|
||||||
</div>
|
<span>{{ selectedAddressData.pincode || "N/A" }}</span>
|
||||||
<div class="info-grid">
|
</div>
|
||||||
<div class="info-item">
|
|
||||||
<label>Contact Name:</label>
|
|
||||||
<span>{{ contactFullName }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<label>Phone:</label>
|
|
||||||
<span>{{ primaryContactPhone }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<label>Email:</label>
|
|
||||||
<span>{{ primaryContactEmail }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<label>Customer Group:</label>
|
|
||||||
<span>{{ clientData?.customerGroup || "N/A" }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<label>Territory:</label>
|
|
||||||
<span>{{ clientData?.territory || "N/A" }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<p>No contacts available for this address.</p>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
|
|
||||||
|
<!-- Contact Info Card -->
|
||||||
|
<div class="info-card" v-if="selectedAddressData">
|
||||||
|
<h3>Contact Information</h3>
|
||||||
|
<template v-if="contactsForAddress.length > 0">
|
||||||
|
<div v-if="contactsForAddress.length > 1" class="contact-selector">
|
||||||
|
<Dropdown
|
||||||
|
v-model="selectedContactIndex"
|
||||||
|
:options="contactOptions"
|
||||||
|
option-label="label"
|
||||||
|
option-value="value"
|
||||||
|
placeholder="Select Contact"
|
||||||
|
class="w-full"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="info-grid">
|
||||||
|
<div class="info-item">
|
||||||
|
<label>Contact Name:</label>
|
||||||
|
<span>{{ contactFullName }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="info-item">
|
||||||
|
<label>Phone:</label>
|
||||||
|
<span>{{ primaryContactPhone }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="info-item">
|
||||||
|
<label>Email:</label>
|
||||||
|
<span>{{ primaryContactEmail }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<p>No contacts available for this address.</p>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- Status Cards (only for existing clients) -->
|
||||||
|
<div class="status-cards" v-if="!isNew && !editMode && selectedAddressData">
|
||||||
|
<div class="status-card">
|
||||||
|
<h4>On-Site Meeting</h4>
|
||||||
|
<Button
|
||||||
|
:label="selectedAddressData.customOnsiteMeetingScheduled || 'Not Started'"
|
||||||
|
:severity="getStatusSeverity(selectedAddressData.customOnsiteMeetingScheduled)"
|
||||||
|
@click="handleStatusClick('onsite')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="status-card">
|
||||||
|
<h4>Estimate Sent</h4>
|
||||||
|
<Button
|
||||||
|
:label="selectedAddressData.customEstimateSentStatus || 'Not Started'"
|
||||||
|
:severity="getStatusSeverity(selectedAddressData.customEstimateSentStatus)"
|
||||||
|
@click="handleStatusClick('estimate')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="status-card">
|
||||||
|
<h4>Job Status</h4>
|
||||||
|
<Button
|
||||||
|
:label="selectedAddressData.customJobStatus || 'Not Started'"
|
||||||
|
:severity="getStatusSeverity(selectedAddressData.customJobStatus)"
|
||||||
|
@click="handleStatusClick('job')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="status-card">
|
||||||
|
<h4>Payment Received</h4>
|
||||||
|
<Button
|
||||||
|
:label="selectedAddressData.customPaymentReceivedStatus || 'Not Started'"
|
||||||
|
:severity="getStatusSeverity(selectedAddressData.customPaymentReceivedStatus)"
|
||||||
|
@click="handleStatusClick('payment')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Form Actions -->
|
<!-- Form Actions -->
|
||||||
|
|
@ -372,7 +410,7 @@ const isFormValid = computed(() => {
|
||||||
const hasCity = formData.value.city?.trim();
|
const hasCity = formData.value.city?.trim();
|
||||||
const hasState = formData.value.state?.trim();
|
const hasState = formData.value.state?.trim();
|
||||||
const hasContacts = formData.value.contacts && formData.value.contacts.length > 0;
|
const hasContacts = formData.value.contacts && formData.value.contacts.length > 0;
|
||||||
|
|
||||||
// Check that all contacts have required fields
|
// Check that all contacts have required fields
|
||||||
const allContactsValid = formData.value.contacts?.every((contact) => {
|
const allContactsValid = formData.value.contacts?.every((contact) => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -648,7 +686,7 @@ const handleCancel = () => {
|
||||||
|
|
||||||
.info-item {
|
.info-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue