Merge branch 'main' of https://githaven.org/CaWittMN08/custom_ui
This commit is contained in:
commit
25f6d73fc7
13 changed files with 289 additions and 143 deletions
|
|
@ -2,16 +2,6 @@
|
|||
<div class="form-section">
|
||||
<h3>Address Information</h3>
|
||||
<div class="form-grid">
|
||||
<div class="form-field full-width">
|
||||
<label for="address-title"> Address Title <span class="required">*</span> </label>
|
||||
<InputText
|
||||
id="address-title"
|
||||
v-model="localFormData.addressTitle"
|
||||
:disabled="isSubmitting || isEditMode"
|
||||
placeholder="e.g., Home, Office, Site A"
|
||||
class="w-full"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-field full-width">
|
||||
<label for="address-line1"> Address Line 1 <span class="required">*</span> </label>
|
||||
<InputText
|
||||
|
|
|
|||
|
|
@ -381,11 +381,12 @@ defineExpose({
|
|||
|
||||
.check-btn {
|
||||
border: 1px solid var(--primary-color);
|
||||
color: var(--primary-color);
|
||||
background: var(--surface-card);
|
||||
padding: 0.25rem 0.75rem;
|
||||
min-width: 8rem;
|
||||
color: white;
|
||||
background: var(--primary-color);
|
||||
padding: 0.25rem 0.5rem;
|
||||
min-width: 5rem;
|
||||
justify-content: center;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.check-btn:disabled {
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ import DataUtils from "../../utils";
|
|||
import Api from "../../api";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useNotificationStore } from "../../stores/notifications-primevue";
|
||||
import { useCompanyStore } from "../../stores/company";
|
||||
|
||||
const props = defineProps({
|
||||
clientData: {
|
||||
|
|
@ -230,6 +231,7 @@ const props = defineProps({
|
|||
|
||||
const router = useRouter();
|
||||
const notificationStore = useNotificationStore();
|
||||
const companyStore = useCompanyStore();
|
||||
|
||||
const navigateTo = (path) => {
|
||||
router.push(path);
|
||||
|
|
@ -561,6 +563,7 @@ const handleSave = async () => {
|
|||
const clientData = {
|
||||
customerName: formData.value.customerName,
|
||||
customerType: formData.value.customerType,
|
||||
companyName: companyStore.currentCompany,
|
||||
addressTitle: formData.value.addressTitle,
|
||||
addressLine1: formData.value.addressLine1,
|
||||
addressLine2: formData.value.addressLine2,
|
||||
|
|
|
|||
|
|
@ -87,6 +87,13 @@
|
|||
<div class="total-section">
|
||||
<strong>Total Cost: ${{ totalCost.toFixed(2) }}</strong>
|
||||
</div>
|
||||
<div class="half-payment-section">
|
||||
<v-checkbox
|
||||
v-model="formData.requiresHalfPayment"
|
||||
label="Requires Half Payment"
|
||||
:disabled="!isEditable"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="isEditable" class="action-buttons">
|
||||
<Button label="Clear Items" @click="clearItems" severity="secondary" />
|
||||
<Button
|
||||
|
|
@ -199,6 +206,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
<p><strong>Total:</strong> ${{ totalCost.toFixed(2) }}</p>
|
||||
<p><strong>Requires Half Payment:</strong> {{ formData.requiresHalfPayment ? 'Yes' : 'No' }}</p>
|
||||
<p class="warning-text"><strong>⚠️ Warning:</strong> After sending this estimate, it will be locked and cannot be edited.</p>
|
||||
<div class="confirmation-buttons">
|
||||
<Button
|
||||
|
|
@ -247,6 +255,7 @@ const formData = reactive({
|
|||
addressName: "",
|
||||
contact: "",
|
||||
estimateName: null,
|
||||
requiresHalfPayment: false,
|
||||
});
|
||||
|
||||
const selectedAddress = ref(null);
|
||||
|
|
@ -367,6 +376,7 @@ const saveDraft = async () => {
|
|||
contactName: selectedContact.value.name,
|
||||
items: selectedItems.value.map((i) => ({ itemCode: i.itemCode, qty: i.qty })),
|
||||
estimateName: formData.estimateName,
|
||||
requiresHalfPayment: formData.requiresHalfPayment,
|
||||
company: company.currentCompany
|
||||
};
|
||||
estimate.value = await Api.createEstimate(data);
|
||||
|
|
@ -517,6 +527,7 @@ watch(
|
|||
};
|
||||
});
|
||||
}
|
||||
formData.requiresHalfPayment = estimate.value.custom_requires_half_payment || false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error loading estimate:", error);
|
||||
|
|
@ -570,6 +581,7 @@ onMounted(async () => {
|
|||
};
|
||||
});
|
||||
}
|
||||
formData.requiresHalfPayment = estimate.value.custom_requires_half_payment || false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error loading estimate:", error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue