From 3cd95431ff9caf77c186bab110cc6f339b465318 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:39:21 -0500 Subject: [PATCH] CSR-1858 ctu corrections --- .../mobile-location-modal-questions.vue | 1 + .../service-location/service-location.vue | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) 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 8bac8dbb4..762af0d72 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 @@ -252,6 +252,7 @@ export default { this.$emit("updated-mobile-fee-part", mobileFeePart); this.$emit("updated-serviceability", serviceabilityDetails.data); this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + this.$emit("updated-mobile-ctu", zipCodeData.zipCodeCtu); // update the page level model this.$emit("update:modelValue", this.internalModel); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 0a74ab21e..1c25b8f40 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -83,6 +83,7 @@ @updated-mobile-fee-part="setMobileFeePart" @updated-serviceability="setServiceabilityDetails" @updated-contains-military-base="setContainsMilitaryBase" + @updated-mobile-ctu="setCtuForMobile" validationRules="mobile-location-required" ref="mobileLocationQuestions" linkWidgetName="MobileLocationLinkWidget" @@ -128,6 +129,7 @@ import contentGroupModal from "@/fmg-components/content-group-modal/content-grou // Supporting files import baseMixin from "@/mixins/base-mixin.js"; +import { AppointmentTypeStrings } from "@/constants/schedule-constants"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; @@ -374,6 +376,9 @@ export default { this.zipContainsMilitaryBase = val; } }, + setCtuForMobile(val) { + this.zipCodeCtu = val; + }, setMobileFeePart(mobileFeePart) { this.mobileFeePart = mobileFeePart; }, @@ -472,6 +477,28 @@ export default { } }, async forwardButtonAction() { + // clear items not needed for appointmentType + if (this.selectedAppointmentType == AppointmentTypeStrings.IN_SHOP) { + // if we have a provider.zipCodeCtu that's different than the servicelocation.zipCodeCtu then they + // may have selected a shop in a different ctu. change the servicelocation zip/ctu if different + if (this.zipCodeCtu != this.selectedProvider.address.zipCodeCtu) { + this.zipCodeCtu = this.selectedProvider.address.zipCodeCtu; + this.zipCode = this.selectedProvider.address.zipCode; + } + + this.city = null; + this.streetAddress = null; + } + + if (this.selectedAppointmentType == AppointmentTypeStrings.MOBILE && + this.selectedProvider && this.selectedProvider.address) { + this.selectedProvider.address.streetAddress = null; + this.selectedProvider.address.city = null; + this.selectedProvider.address.state = null; + this.selectedProvider.address.zipCode = null; + this.selectedProvider.address.zipCodeCtu = null; + } + await this.dispatchStoreAction( this.storeActions.SAVE_SERVICE_LOCATION, {