add accept estimate without sent

This commit is contained in:
Casey 2026-02-23 12:42:00 -06:00
parent c56f1a2930
commit 9f9318ddef
3 changed files with 139 additions and 7 deletions

View file

@ -2,8 +2,8 @@
<div class="estimate-page">
<h2>{{ isNew ? 'Create Estimate' : 'View Estimate' }}</h2>
<div v-if="!isNew && estimate" class="page-actions">
<div v-if="estimate && estimate.customSent === 1">
<Button label="Estimate Response" @click="showResponseModal = true" />
<div v-if="estimate">
<Button label="Estimate Response" @click="handleResponseClick" />
</div>
<Button label="Duplicate" icon="pi pi-copy" @click="duplicateEstimate" />
</div>
@ -245,7 +245,7 @@
<div v-if="estimate">
<Button label="Send Estimate" @click="initiateSendEstimate" :disabled="estimate.customSent === 1"/>
</div>
<div v-if="estimate && estimate.customSent === 1" class="response-status">
<div v-if="estimate && (estimate.customSent === 1 || estimateResponse)" class="response-status">
<h4>Customer Response:</h4>
<span :class="getResponseClass(getResponseText(estimateResponse))">
{{ getResponseText(estimateResponse) }}
@ -270,6 +270,27 @@
<Button label="Submit" @click="submitResponse"/>
</Modal>
<!-- Unsent Estimate Warning Modal -->
<Modal
:visible="showUnsentWarningModal"
@update:visible="showUnsentWarningModal = $event"
@close="showUnsentWarningModal = false"
:options="{ showActions: false }"
>
<template #title>Warning</template>
<div class="modal-content">
<p>This estimate has not been sent. Are you sure you want to manually set a response?</p>
<div class="confirmation-buttons">
<Button
label="No"
@click="showUnsentWarningModal = false"
severity="secondary"
/>
<Button label="Yes" @click="confirmUnsentWarning" />
</div>
</div>
</Modal>
<!-- Save Template Modal -->
<SaveTemplateModal
:visible="showSaveTemplateModal"
@ -485,6 +506,7 @@ const showAddItemModal = ref(false);
const showConfirmationModal = ref(false);
const showDownPaymentWarningModal = ref(false);
const showResponseModal = ref(false);
const showUnsentWarningModal = ref(false);
const showSaveTemplateModal = ref(false);
const showSavePackageModal = ref(false);
const addressSearchResults = ref([]);
@ -820,6 +842,19 @@ const submitResponse = () => {
showResponseModal.value = false;
}
const handleResponseClick = () => {
if (estimate.value.customSent !== 1) {
showUnsentWarningModal.value = true;
} else {
showResponseModal.value = true;
}
};
const confirmUnsentWarning = () => {
showUnsentWarningModal.value = false;
showResponseModal.value = true;
};
const duplicateEstimate = () => {
if (!estimate.value) return;