Changes for license plate lookup

This commit is contained in:
Max 2022-03-14 15:16:07 -04:00
parent b0f9a1beff
commit 7e42384a7c
3 changed files with 37 additions and 8 deletions

View file

@ -10,10 +10,12 @@ const storeMutations = {
UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl", UPDATE_VEHICLE_IMAGE_URL: "updateVehicleImageUrl",
UPDATE_VEHICLE_IMAGE_VIF_NUMBER: "updateVehicleImageVifNumber", UPDATE_VEHICLE_IMAGE_VIF_NUMBER: "updateVehicleImageVifNumber",
UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor", UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor",
UPDATE_VEHICLE_VIN: "updateVehicleVin",
UPDATE_IS_REPAIR: "updateIsRepair", UPDATE_IS_REPAIR: "updateIsRepair",
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips", UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
UPDATE_GLASS_TO_REPLACE: "updateGlassToReplace", UPDATE_GLASS_TO_REPLACE: "updateGlassToReplace",
UPDATE_PARTS: "updateParts", UPDATE_PARTS: "updateParts",
UPDATE_REGISTRATION_LICENSE_PLATE : "updateRegistrationLicensePlate",
UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress", UPDATE_REGISTRATION_ADDRESS: "updateRegistrationAddress",
UPDATE_REGISTRATION_CITY: "updateRegistrationCity", UPDATE_REGISTRATION_CITY: "updateRegistrationCity",
UPDATE_REGISTRATION_STATE: "updateRegistrationState", UPDATE_REGISTRATION_STATE: "updateRegistrationState",

View file

@ -3,8 +3,8 @@
<funnelHeader ref="funnelHeader" /> <funnelHeader ref="funnelHeader" />
<vehicleBanner ref="vehicleBanner" :displayGenericVehicleImage=false /> <vehicleBanner ref="vehicleBanner" :displayGenericVehicleImage=false />
<funnelSubHeader ref="funnelSubHeader" /> <funnelSubHeader ref="funnelSubHeader" />
<textboxQuestion ref="licensePlateNumber" /> <textboxQuestion />
<funnel-footer <funnelFooter
ref="funnelFooter" ref="funnelFooter"
@back-clicked="backButtonAction" @back-clicked="backButtonAction"
@ForwardClicked="forwardButtonAction" @ForwardClicked="forwardButtonAction"
@ -57,24 +57,24 @@ export default {
vm.$refs.funnelFooter.initializeComponent( vm.$refs.funnelFooter.initializeComponent(
resultMap.cmsContent.FunnelFooterWidget resultMap.cmsContent.FunnelFooterWidget
); );
vm.$refs.licensePlateNumber.initializeComponent( // vm.$refs.licensePlateNumber.initializeComponent(
resultMap.cmsContent.LicensePlateNumber // resultMap.cmsContent.LicensePlateNumber
); // );
console.log(resultMap) console.log(resultMap)
}); });
}, },
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid(){
return store.getters.vehicle.carId !== null; return store.getters.vehicle.carId !== null;
}, },
resetDependentState() { resetDependentState(){
store.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, null); store.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, null);
store.commit(storeMutations.UPDATE_REGISTRATION_CITY, null); store.commit(storeMutations.UPDATE_REGISTRATION_CITY, null);
store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, null); store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, null);
store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, null); store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, null);
store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES); store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
}, },
backButtonAction() { backButtonAction(){
// route to move backwards // route to move backwards
this.$router.navigate( this.$router.navigate(
this.navigationScenarios.CLICKED_BACK, this.navigationScenarios.CLICKED_BACK,
@ -83,6 +83,26 @@ export default {
}, },
forwardButtonAction(){ forwardButtonAction(){
},
updateStore(){
if(vehicleDamage){
store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
}
store.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
store.commit(storeMutations.UPDATE_YEAR, null);
store.commit(storeMutations.UPDATE_MAKE, null);
store.commit(storeMutations.UPDATE_MODEL, null);
store.commit(storeMutations.UPDATE_STYLE, null);
store.commit(storeMutations.UPDATE_CAR_ID, null);
store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, null);
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, null);
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, null);
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, null);
store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, null);
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, null);
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, null);
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP, null);
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, null);
} }
}, },
components: { components: {

View file

@ -19,6 +19,7 @@ export const state = {
imageUrl: null, imageUrl: null,
imageVifNumber: null, imageVifNumber: null,
imageColor: null, imageColor: null,
vin: null,
registration: { registration: {
licensePlate: null, licensePlate: null,
address: null, address: null,
@ -81,6 +82,9 @@ export const mutations = {
updateVehicleImageColor(state, imageColor) { updateVehicleImageColor(state, imageColor) {
state.order.vehicle.imageColor = imageColor; state.order.vehicle.imageColor = imageColor;
}, },
updateVehicleVin(state, vin) {
state.order.vehicle.vin = vin;
},
updateIsRepair(state, isRepair){ updateIsRepair(state, isRepair){
state.order.damage.isRepair = isRepair; state.order.damage.isRepair = isRepair;
}, },
@ -96,6 +100,9 @@ export const mutations = {
updatePageData(state, pageData){ updatePageData(state, pageData){
state.applicationUser.pageData[pageData.page] = pageData.data; state.applicationUser.pageData[pageData.page] = pageData.data;
}, },
updateRegistrationLicensePlate(state, registrationLicensePlate){
state.order.vehicle.registration.licensePlate = registrationLicensePlate;
},
updateRegistrationAddress(state, registrationAddress){ updateRegistrationAddress(state, registrationAddress){
state.order.vehicle.registration.address = registrationAddress; state.order.vehicle.registration.address = registrationAddress;
}, },