diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue
index b92c14bc9..424e7cf2b 100644
--- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue
+++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue
@@ -137,6 +137,9 @@ export default {
alertInvalidZipWidgetName: String,
customComponentId: String,
validationRules: String,
+ optionalCallback: {
+ type: Function,
+ },
},
computed: {
mobileLocationLinkPromptText() {
@@ -257,6 +260,10 @@ export default {
// Update the page level model
this.$emit("update:modelValue", this.internalModel);
+ if (this.optionalCallback) {
+ await this.optionalCallback(serviceZipCode);
+ }
+
this.closeModal();
}
},
diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue
index 3033e91a1..921a279b7 100644
--- a/src/layouts/service-location/service-location.vue
+++ b/src/layouts/service-location/service-location.vue
@@ -12,7 +12,8 @@
@updated-serviceability="setServiceabilityDetails"
@updated-contains-military-base="setContainsMilitaryBase"
linkWidgetName="ServiceZipLinkWidget"
- modalWidgetName="ServiceZipModalWidget" />
+ modalWidgetName="ServiceZipModalWidget"
+ :optionalCallback="reloadShopData" />
+ modalWidgetName="MobileLocationModalWidget"
+ :optionalCallback="reloadShopData" />
@@ -268,6 +268,12 @@ export default {
return this.isGlassServiceableInshop;
}
},
+ isShopQuestionDisplayed() {
+ return (
+ this.selectedAppointmentType === "Inshop" ||
+ this.selectedAppointmentType === "Dropoff"
+ );
+ },
// Specifically check for isRecalibrationServiceableMobile === false, not null or true.
requiresInshopRecalibration() {
return (
@@ -364,6 +370,9 @@ export default {
openModalAction(modalName) {
this.$refs[modalName].openModal();
},
+ async reloadShopData() {
+ await this.$refs.shopQuestion.reloadShopData(this.zipCode);
+ },
},
components: {
alert,
diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue
index 0698fc340..39703c311 100644
--- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue
+++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue
@@ -69,6 +69,9 @@ export default {
},
linkWidgetName: String,
modalWidgetName: String,
+ optionalCallback: {
+ type: Function,
+ },
},
setup() {
const textboxQuestionWidgetName = "ServiceZipQuestionWidget";
@@ -161,6 +164,10 @@ export default {
// Update the page level model
this.$emit("update:modelValue", this.internalModel);
+ if (this.optionalCallback) {
+ await this.optionalCallback(serviceZipCode);
+ }
+
this.closeModal();
}
} else {
diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue
index ce3ee3355..97524c1a4 100644
--- a/src/layouts/service-location/shop-question/shop-question.vue
+++ b/src/layouts/service-location/shop-question/shop-question.vue
@@ -1,6 +1,6 @@
-
+
provider.providerNumber == newValue
);
+
this.$emit("update:modelValue", provider);
},
},
@@ -98,6 +102,9 @@ export default {
},
methods: {
loadInitialData(serviceZipCode) {
+ return this.loadData(serviceZipCode);
+ },
+ loadData(serviceZipCode) {
return baseMixin.methods.dispatchStoreAction(storeActions.GET_PROVIDERS, {
serviceZipCode: serviceZipCode,
});
@@ -164,44 +171,28 @@ export default {
this.answers = [];
this.shopIndex = 0;
this.selectedValue = "";
- this.$refs.buttonQuestion.resetField();
},
async reloadShopData(serviceZipCode) {
- const result = await this.loadInitialData(serviceZipCode);
- this.initializeComponent(result);
+ const result = await this.loadData(serviceZipCode);
+ this.initializeComponent(result.data);
+
this.resetShopList();
+
+ await nextTick();
+ await this.getNextShopsFromList();
},
},
watch: {
- serviceZipCode: {
- async handler(newValue) {
- await this.reloadShopData(newValue);
- },
- },
selectedAppointmentType: {
- async handler() {
- // If the validation has been previously triggered, clear it before displaying the component
- this.$refs.buttonQuestion.resetField();
-
- this.resetShopList();
- await this.getNextShopsFromList();
-
- await this.$nextTick();
-
- this.scrollToPageBottom();
- },
- },
- shopProviders: {
async handler(newValue) {
- this.$refs.buttonQuestion.resetField();
- const selectedShopIndex = newValue.findIndex(
- (provider) => provider.providerNumber == this.modelValue?.providerNumber
- );
-
- if (selectedShopIndex >= 3) {
- await this.getNextShopsFromList(selectedShopIndex + 1);
- } else {
+ this.resetShopList();
+ await this.$nextTick();
+ if (newValue !== "Mobile") {
await this.getNextShopsFromList();
+
+ await this.$nextTick();
+
+ this.scrollToPageBottom();
}
},
},