updates to page pre-reqs
This commit is contained in:
parent
4eabf29468
commit
446a82def7
1 changed files with 33 additions and 8 deletions
|
|
@ -95,6 +95,7 @@ export default {
|
||||||
},
|
},
|
||||||
mixins: [BaseFormMixin],
|
mixins: [BaseFormMixin],
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
|
console.log('beforeRouteEnter just called');
|
||||||
useMainStore().createSubmittedOrder();
|
useMainStore().createSubmittedOrder();
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
||||||
|
|
@ -271,12 +272,13 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
console.log('arePagePrereqsValid was just called');
|
||||||
if (useMainStore().hasSubmittedOrder) {
|
if (useMainStore().hasSubmittedOrder) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Service Location
|
// Service Location
|
||||||
const { serviceLocation } = this.submittedOrder;
|
const { serviceLocation } = useMainStore().order;
|
||||||
const mobileReqs = !!(
|
const mobileReqs = !!(
|
||||||
serviceLocation.address
|
serviceLocation.address
|
||||||
&& serviceLocation.city
|
&& serviceLocation.city
|
||||||
|
|
@ -284,7 +286,7 @@ export default {
|
||||||
&& serviceLocation.zipCode
|
&& serviceLocation.zipCode
|
||||||
);
|
);
|
||||||
|
|
||||||
const { providerLocation } = this.submittedOrder.serviceLocation.provider.address;
|
const { providerLocation } = serviceLocation.provider.address;
|
||||||
const dropOffInShopReqs = !!(
|
const dropOffInShopReqs = !!(
|
||||||
providerLocation.streetAddress
|
providerLocation.streetAddress
|
||||||
&& providerLocation.city
|
&& providerLocation.city
|
||||||
|
|
@ -298,15 +300,38 @@ export default {
|
||||||
const serviceLocationReqs =
|
const serviceLocationReqs =
|
||||||
(isMobile && mobileReqs) || (!isMobile && dropOffInShopReqs);
|
(isMobile && mobileReqs) || (!isMobile && dropOffInShopReqs);
|
||||||
|
|
||||||
|
// Insurance
|
||||||
|
const isInsuranceSet = useMainStore().order.payment.isInsurance !== null;
|
||||||
|
|
||||||
// Schedule
|
// Schedule
|
||||||
const { schedule } = this.submittedOrder;
|
const { schedule } = useMainStore().order;
|
||||||
const scheduleReqs = !!(schedule.date && schedule.startTime && schedule.endTime);
|
const scheduleReqs = !!(
|
||||||
|
schedule.date
|
||||||
|
&& schedule.startTime
|
||||||
|
&& schedule.endTime
|
||||||
|
&& schedule.jobMaxMinutes
|
||||||
|
&& schedule.jobMinMinutes
|
||||||
|
);
|
||||||
|
|
||||||
// Customer
|
// Contact Info
|
||||||
const { customer } = this.submittedOrder;
|
const { contactInfo } = useMainStore().order;
|
||||||
const customerReqs = !!customer.emailAddress;
|
const contactInfoReqs = !!(
|
||||||
|
contactInfo.firstName
|
||||||
|
&& contactInfo.lastName
|
||||||
|
&& contactInfo.phoneNumber
|
||||||
|
&& contactInfo.emailAddress
|
||||||
|
);
|
||||||
|
|
||||||
return serviceLocationReqs && scheduleReqs && customerReqs;
|
// Payment
|
||||||
|
const paymentMethodReqs = useMainStore().order.payment.isPayInAdvance === false;
|
||||||
|
|
||||||
|
return (
|
||||||
|
serviceLocationReqs
|
||||||
|
&& isInsuranceSet
|
||||||
|
&& scheduleReqs
|
||||||
|
&& contactInfoReqs
|
||||||
|
&& paymentMethodReqs
|
||||||
|
);
|
||||||
},
|
},
|
||||||
forwardButtonAction() {
|
forwardButtonAction() {
|
||||||
this.$router.navigateToExternalUrl(this.carrierUrl);
|
this.$router.navigateToExternalUrl(this.carrierUrl);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue