Schedule PreReqs
This commit is contained in:
parent
210447ca7e
commit
d248b44222
3 changed files with 40 additions and 15 deletions
|
|
@ -27,6 +27,7 @@ import siteHeader from '@/iss-components/site-header/site-header.vue';
|
|||
import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||
|
||||
// Supporting files
|
||||
import { AppointmentTypeStrings } from '@/constants/schedule-constants.js';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import settleAllPromises from '@/helpers/layout-helper';
|
||||
import { Form } from 'vee-validate';
|
||||
|
|
@ -67,19 +68,42 @@ export default {
|
|||
data() {
|
||||
|
||||
},
|
||||
methods:
|
||||
{
|
||||
backButtonAction() {
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
methods: {
|
||||
arePagePrerequisitesValid() {
|
||||
console.log('schedule preReqs...');
|
||||
console.log('serviceLocation...');
|
||||
const { serviceLocation } = useMainStore().order;
|
||||
console.log(serviceLocation);
|
||||
const serviceLocationPreReqs = serviceLocation.zipCode
|
||||
&& serviceLocation.zipCodeCtu
|
||||
&& serviceLocation.appointmentType
|
||||
&& (serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|
||||
|| serviceLocation.provider.providerNumber);
|
||||
console.log('paymentInfo...');
|
||||
const paymentInfo = useMainStore().payment.isInsurance !== null;
|
||||
console.log(paymentInfo);
|
||||
console.log('supportingItems...');
|
||||
const supportingItems = useMainStore().lineItems.supportingItems !== null;
|
||||
console.log(supportingItems);
|
||||
console.log('damageInfo...');
|
||||
const damageInfo =
|
||||
useMainStore().order.damage.isRepair
|
||||
|| (useMainStore().order.lineItems?.glassParts != null
|
||||
&& useMainStore().order.lineItems.glassParts.length > 0);
|
||||
console.log(damageInfo);
|
||||
return serviceLocationPreReqs && paymentInfo && supportingItems && damageInfo;
|
||||
},
|
||||
backButtonAction() {
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
|
||||
forwardButtonAction() {
|
||||
// validate and save here
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||
},
|
||||
forwardButtonAction() {
|
||||
// validate and save here
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||
},
|
||||
|
||||
navigateForward() {
|
||||
}
|
||||
navigateForward() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -390,6 +390,7 @@ export default {
|
|||
setData(zipCodeData, serviceabilityDetails, mobileFeePart) {
|
||||
if (zipCodeData) {
|
||||
this.zipContainsMilitaryBase = zipCodeData.containsMilitaryBase;
|
||||
this.zipCodeCtu = zipCodeData.zipCodeCtu;
|
||||
}
|
||||
|
||||
if (serviceabilityDetails) {
|
||||
|
|
|
|||
|
|
@ -751,8 +751,10 @@ export const useMainStore = defineStore({
|
|||
return [];
|
||||
});
|
||||
|
||||
availableLineItems = addPricesToLineItems(availableLineItems, response.data.lineItems);
|
||||
|
||||
if (response.data?.lineItems) {
|
||||
const retAvailableLineItems = addPricesToLineItems(availableLineItems, response.data.lineItems);
|
||||
return retAvailableLineItems;
|
||||
}
|
||||
return availableLineItems;
|
||||
},
|
||||
|
||||
|
|
@ -995,7 +997,6 @@ export const useMainStore = defineStore({
|
|||
this.order.vehicle.registration.firstName = registrationInfo?.firstName;
|
||||
this.order.vehicle.registration.lastName = registrationInfo?.lastName;
|
||||
},
|
||||
|
||||
updateServiceLocation(serviceLocationInfo) {
|
||||
state.order.serviceLocation.address = serviceLocationInfo.address;
|
||||
state.order.serviceLocation.address2 = serviceLocationInfo.address2;
|
||||
|
|
@ -1264,7 +1265,6 @@ export const useMainStore = defineStore({
|
|||
this.order.customer.address.zipCode = customerQuestions.addressQuestions.zipCode;
|
||||
this.order.customer.firstName = customerQuestions.firstName;
|
||||
this.order.customer.lastName = customerQuestions.lastName;
|
||||
this.order.serviceLocation.zipCode = customerQuestions.addressQuestions.zipCode;
|
||||
},
|
||||
savePartQuestionAnswers(partQuestionAnswersArray) {
|
||||
// if part question answers have changed, reset subsequent question answers
|
||||
|
|
|
|||
Loading…
Reference in a new issue