Update vin-lookup page.

This commit is contained in:
bmauger 2022-03-11 16:03:38 -05:00
parent 94d8f165fc
commit 2ffc311f22
3 changed files with 67 additions and 1 deletions

View file

@ -33,6 +33,7 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper";
import { storeActions } from "@/constants/store-actions";
import store from "@/store";
import { storeMutations } from "@/constants/store-mutations";
import baseMixin from "@/mixins/base-mixin";
import { Form, defineRule } from "vee-validate";
import { required } from "@/helpers/validation-rules";
@ -86,6 +87,22 @@ export default {
arePagePrerequisitesValid() {
return true;
},
resetDependentState() {
store.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, null);
store.commit(storeMutations.UPDATE_REGISTRATION_CITY, null);
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, null);
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, null);
store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, null);
store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, null);
store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, null);
},
backButtonAction() {
// route to move backwards
this.$router.navigate(
this.navigationScenarios.CLICKED_BACK,
this.$route
);
},
},
components: {
funnelHeader,

View file

@ -97,6 +97,19 @@ const routingTable = [
},
],
},
{
fmgPageValue: fmgPageValues.VIN_LOOKUP,
maps: [
{
scenario: navigationScenarios.CLICKED_BACK,
destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
},
{
scenario: navigationScenarios.VIN_LOOKUP,
destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
},
],
},
];
export { routingTable };

View file

@ -19,6 +19,15 @@ export const state = {
imageUrl: null,
imageVifNumber: null,
imageColor: null,
registration: {
licensePlate: null,
address: null,
city: null,
state: null,
zipCode: null,
firstName: null,
lastName: null,
},
},
damage: {
isRepair: null,
@ -81,6 +90,33 @@ export const mutations = {
updatePageData(state, pageData){
state.applicationUser.pageData[pageData.page] = pageData.data;
},
updateRegistrationAddress(state, registrationAddress){
state.order.vehicle.registration.address = registrationAddress;
},
updateRegistrationCity(state, registrationCity){
state.order.vehicle.registration.city = registrationCity;
},
updateRegistrationState(state, registrationState){
state.order.vehicle.registration.state = registrationState;
},
updateRegistrationZipCode(state, registrationZipCode){
state.order.vehicle.registration.zipCode = registrationZipCode;
},
updateRegistrationFirstName(state, registrationFirstName){
state.order.vehicle.registration.firstName = registrationFirstName;
},
updateRegistrationLastName(state, registrationLastName){
state.order.vehicle.registration.lastName = registrationLastName;
},
updateRegistrationLicensePlate(state, registrationLicensePlate){
state.order.vehicle.registration.licensePlate = registrationLicensePlate;
},
updateServiceLocationZip(state, ServiceLocationZip){
state.order.vehicle.serviceLocation.zip = ServiceLocationZip;
},
updateCustomerEmailAddress(state, CustomerEmailAddress){
state.order.vehicle.customer.emailAddress = CustomerEmailAddress;
},
// EVENT BUS MUTATIONS
addEventToBus(state, event) {
@ -288,4 +324,4 @@ export default createStore({
mutations,
getters,
actions,
});
});