Fixed an issue with responsive UI related to setting the customer response.
This commit is contained in:
parent
d30fc77527
commit
d4240e0cc3
2 changed files with 17 additions and 8 deletions
|
|
@ -176,13 +176,14 @@ def manual_response(name, response):
|
||||||
new_status = "Estimate Accepted" if accepted else "Lost"
|
new_status = "Estimate Accepted" if accepted else "Lost"
|
||||||
|
|
||||||
estimate.custom_response = response
|
estimate.custom_response = response
|
||||||
estimate.custom_current_status = new_status
|
# estimate.custom_current_status = new_status
|
||||||
estimate.status = "Ordered" if accepted else "Closed"
|
# estimate.status = "Ordered" if accepted else "Closed"
|
||||||
estimate.flags.ignore_permissions = True
|
estimate.flags.ignore_permissions = True
|
||||||
print("DEBUG: Updating estimate with response:", response, "and status:", new_status)
|
print("DEBUG: Updating estimate with response:", response, "and status:", new_status)
|
||||||
estimate.save()
|
estimate.save()
|
||||||
|
return build_success_response(estimate.as_dict())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return e
|
return build_error_response(str(e), 500)
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist(allow_guest=True)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
<div class="estimate-page">
|
<div class="estimate-page">
|
||||||
<h2>{{ isNew ? 'Create Estimate' : 'View Estimate' }}</h2>
|
<h2>{{ isNew ? 'Create Estimate' : 'View Estimate' }}</h2>
|
||||||
<div v-if="!isNew && estimate" class="page-actions">
|
<div v-if="!isNew && estimate" class="page-actions">
|
||||||
|
<div v-if="estimate && estimate.customSent === 1">
|
||||||
<Button label="Estimate Response" @click="showResponseModal = true" />
|
<Button label="Estimate Response" @click="showResponseModal = true" />
|
||||||
|
</div>
|
||||||
<Button label="Duplicate" icon="pi pi-copy" @click="duplicateEstimate" />
|
<Button label="Duplicate" icon="pi pi-copy" @click="duplicateEstimate" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -108,8 +110,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-if="estimate && estimate.customSent === 1" class="response-status">
|
<div v-if="estimate && estimate.customSent === 1" class="response-status">
|
||||||
<h4>Customer Response:</h4>
|
<h4>Customer Response:</h4>
|
||||||
<span :class="getResponseClass(estimate.customResponse)">
|
<span :class="getResponseClass(getResponseText(estimateResponse))">
|
||||||
{{ getResponseText(estimate.customResponse) }}
|
{{ getResponseText(estimateResponse) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -122,7 +124,7 @@
|
||||||
:options="{ showActions: false }"
|
:options="{ showActions: false }"
|
||||||
>
|
>
|
||||||
<template #title>Set Response</template>
|
<template #title>Set Response</template>
|
||||||
<Select v-model="estimateResponse" :options="responses" placeholder="Select Response"/>
|
<Select v-model="estimateResponseSelection" :options="responses" placeholder="Select Response"/>
|
||||||
<Button label="Submit" @click="submitResponse"/>
|
<Button label="Submit" @click="submitResponse"/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
|
@ -273,7 +275,9 @@ const formData = reactive({
|
||||||
|
|
||||||
const selectedAddress = ref(null);
|
const selectedAddress = ref(null);
|
||||||
const selectedContact = ref(null);
|
const selectedContact = ref(null);
|
||||||
|
const estimateResponseClass = ref(null);
|
||||||
const estimateResponse = ref(null);
|
const estimateResponse = ref(null);
|
||||||
|
const estimateResponseSelection = ref(null);
|
||||||
const contacts = ref([]);
|
const contacts = ref([]);
|
||||||
const contactOptions = ref([]);
|
const contactOptions = ref([]);
|
||||||
const quotationItems = ref([]);
|
const quotationItems = ref([]);
|
||||||
|
|
@ -412,7 +416,9 @@ const saveDraft = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitResponse = () => {
|
const submitResponse = () => {
|
||||||
Api.updateEstimateResponse(estimate.value.name, estimateResponse.value, false);
|
Api.updateEstimateResponse(estimate.value.name, estimateResponseSelection.value, false);
|
||||||
|
estimateResponse.value = estimateResponseSelection.value;
|
||||||
|
showResponseModal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const duplicateEstimate = () => {
|
const duplicateEstimate = () => {
|
||||||
|
|
@ -602,6 +608,8 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
formData.requiresHalfPayment = estimate.value.custom_requires_half_payment || false;
|
formData.requiresHalfPayment = estimate.value.custom_requires_half_payment || false;
|
||||||
|
estimateResponse.value = estimate.value.customResponse;
|
||||||
|
estimateResponseSelection.value = estimate.value.customResponse;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error loading estimate:", error);
|
console.error("Error loading estimate:", error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue