diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index ae312af07..979126338 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1103,7 +1103,6 @@ export default { this.resetWaitlist(); this.preSelectedDate = null; this.shopProviderData = shopQuestionPopUpData.shopProviderData; - this.setServiceabilityDetails(shopQuestionPopUpData.serviceabilityDetails); const selectedProvider = this.shopProviderData.shopProviders.find((shopProvider) => { return shopProvider.providerNumber === shopQuestionPopUpData.selectedProviderNumber; }); @@ -1591,17 +1590,26 @@ export default { if (newProvider) { this.selectedProvider = newProvider; this.initializeDatePicker(); + } else if (this.appointmentType === this.appointmentTypeStrings.MOBILE) { + this.selectedProvider = { + providerNumber: this.shopProviderData.mobileProviderNumber.toString(), + address: { + streetAddress: null, + city: null, + state: null, + zipCode: null, + zipCodeCtu: null, + }, + }; } else if ( - // use closest shopProvider if none exists !this.selectedProvider?.address?.streetAddress && - this.shopProviderData?.shopProviders + this.shopProviderData?.shopProviders?.length ) { this.selectedProvider = this.shopProviderData.shopProviders[0]; } }, handleZipCodeChange(newZipCode) { this.resetMobileLocation(); - this.appointmentTypeFromAppointmentTypeQuestion = null; getShopProviderData(newZipCode.zipCode).then((result) => { this.shopProviderData = result.data; @@ -1627,6 +1635,7 @@ export default { this.updateFooterButtonText(); if (newAppointmentType === AppointmentTypeStrings.MOBILE) { this.appointmentType = AppointmentTypeStrings.MOBILE; + this.updateSelectedProvider(); } else if (newAppointmentType) { if (this.selectedTimeSlotInfo?.timeSlot?.routeCode) { // update appointmentType based on routeCode to determine if it should be dropoff or inshop @@ -1643,6 +1652,7 @@ export default { this.appointmentType = null; } this.selectedDate = this.getSelectedDate(); + this.setDisplayWaitList(); }, }, watch: { diff --git a/src/layouts/schedule/time-slot-question/time-slot-question.vue b/src/layouts/schedule/time-slot-question/time-slot-question.vue index cb0120539..58a193d2a 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -7,7 +7,8 @@ :answers="answersForDropOffQuestion" isRequired insertOrLabelBeforeFinalOption - groupName="chooseDropOffOrInshop"> + groupName="chooseDropOffOrInshop" + validationRules="time-slot-required">
-
+
@@ -183,6 +187,7 @@ export default { let appointmentTypeCmsWidgetName; if ( + this.selectedDate == null || this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF || this.appointmentType === AppointmentTypeStrings.IN_SHOP || this.appointmentType === AppointmentTypeStrings.DROP_OFF @@ -440,6 +445,8 @@ export default { ); } + this.resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate); + return availableTimeSlots; }, getPremiumAppointmentTimeSlot(timeSlotData) { @@ -535,6 +542,20 @@ export default { successMessageElement.scrollIntoView({ behavior: "smooth" }); } }, + resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate) { + if (this.selectedRouteCode) { + const selectedRouteCodeString = this.selectedRouteCode.replace( + PREMIUM_TIME_SLOT_ID_FLAG, + "" + ); + const matchingTimeSlot = timeSlotsForSelectedDate.find((slot) => { + return slot.id === selectedRouteCodeString; + }); + if (!matchingTimeSlot) { + this.selectedRouteCode = null; + } + } + }, }, watch: { waitListRequested(newVal) { diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue index a9ca720ad..df0a185a3 100644 --- a/src/layouts/service-location/shop-question/shop-question-popup.vue +++ b/src/layouts/service-location/shop-question/shop-question-popup.vue @@ -310,16 +310,8 @@ export default { const selectedProvider = this.shopProviders.find( (provider) => provider.providerNumber == this.localSelectedProviderNumber ); - const serviceZipCode = selectedProvider.address.zipCode; - // retrieve serviceability details - const serviceabilityDetails = await getServiceabilityDetails( - serviceZipCode, - null, - "service-location" - ); const shopQuestionPopUpData = { - serviceabilityDetails: serviceabilityDetails.data, zipCodeData: this.zipCodeData, shopProviderData: this.localShopProviderData, selectedProviderNumber: this.localSelectedProviderNumber,