diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 032b42268..6f251333f 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -302,8 +302,8 @@ export default { store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.customerQuestions.addressQuestions.zipCode); store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, this.customerQuestions.firstName); store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, this.customerQuestions.lastName); - store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip); - store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.customerQuestions.email); + store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip); + store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.customerQuestions.emailAddress); }, }, diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 1db7a57fd..264e24383 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -300,6 +300,8 @@ export default { if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); } + console.log("A") + console.log(this.licensePlate) store.commit(storeMutations.UPDATE_VEHICLE_VIN, vin); store.commit(storeMutations.UPDATE_YEAR, vehicleInfo.year); store.commit(storeMutations.UPDATE_MAKE, vehicleInfo.make); diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 4c43eb513..c9bf44f62 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -250,7 +250,13 @@ export default { return store.getters.vehicle.vin }, getZipFromStore(){ - return store.getters.vehicle.registration.zipCode + var serviceZip = store.getters.order.serviceLocation.zipCode; + + if (!serviceZip) { + serviceZip = store.getters.vehicle.registration.zipCode; + } + + return serviceZip; }, attachCustomEvents() { this.prependActionToMethod(this, this.forwardButtonAction, () => { @@ -263,7 +269,12 @@ export default { }); }, backButtonAction() { - this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); + if (store.getters.vehicle.vin) { + this.$router.navigate(this.navigationScenarios.CLICKED_BACK_WITH_VIN, this.$route); + } + else { + this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); + } }, async forwardButtonAction() { const zipValidation = await this.validateZip(this.zip); diff --git a/src/router/index.js b/src/router/index.js index 23732d405..32f999820 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -166,6 +166,7 @@ async function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery const currentComponent = currentRoute.matched[0].components; if (invalidateOnSave) { + console.log("A") resetDependentState(currentComponent); } diff --git a/src/store/index.js b/src/store/index.js index 0417aee8c..416ff3aee 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -133,6 +133,7 @@ export const mutations = { state.order.payment.insuranceCoverage.isVerified = isVerified; }, updateRegistrationLicensePlate(state, licensePlate){ + console.log(licensePlate) state.order.vehicle.registration.licensePlate = licensePlate; }, updateRegistrationState(state, registrationState){ @@ -148,13 +149,13 @@ export const mutations = { state.order.serviceLocation.zipCode = serviceLocationZipCode; }, updateRegistrationCity(state, serviceCity){ - state.order.serviceLocation.city = serviceCity; + state.order.vehicle.registration.city = serviceCity; }, updateRegistrationFirstName(state, firstName){ - state.order.serviceLocation.firstName = firstName; + state.order.vehicle.registration.firstName = firstName; }, updateRegistrationLastName(state, lastName){ - state.order.serviceLocation.lastName = lastName; + state.order.vehicle.registration.lastName = lastName; }, updateCustomerEmailAddress(state, customerEmailAddress){ state.order.customer.emailAddress = customerEmailAddress; @@ -235,7 +236,7 @@ export const mutations = { city: orderInformation.vehicle.registration.city, state: orderInformation.vehicle.registration.state, zipCode: orderInformation.vehicle.registration.zipCode, // TODO CSR-416 make sure customer vs service is different - licensePlate: null, + licensePlate: orderInformation.vehicle.registration.licensePlate, } }); @@ -245,7 +246,7 @@ export const mutations = { state.order.lineItems.glassParts = orderInformation.parts; state.order.accountNumber = orderInformation.accountNumber; - state.order.serviceLocation.zip = orderInformation.zipCode; // TODO CSR-416 make sure customer vs service is different, add this to service + state.order.serviceLocation.zipCode = orderInformation.serviceLocation.zipCode; // TODO CSR-416 make sure customer vs service is different, add this to service state.order.payment.isInsurance = orderInformation.IsInsuranceOrder; state.order.payment.insuranceCoverage.isVerified = orderInformation?.insuranceInfo.coverageVerified; @@ -533,8 +534,11 @@ export const actions = { registration: { firstName: vehicle.registration.firstName, lastName: vehicle.registration.lastName, - licensePlate: vehicle.registration.licensePlate, - zipCode: vehicle.registration.zipCode + streetAddress: vehicle.registration.address, + city: vehicle.registration.city, + state: vehicle.registration.state, + zipCode: vehicle.registration.zipCode, + licensePlateNumber: vehicle.registration.licensePlate, }, }, damage: {