license plate lookup updates

This commit is contained in:
Bill Richardson 2026-02-04 16:04:58 -05:00
parent 1873a955be
commit 1a4cbab356

View file

@ -17,14 +17,14 @@
<alert <alert
v-if="displayVinNotFoundAlert" v-if="displayVinNotFoundAlert"
ref="alertVinNotFound" ref="alertVinNotFound"
class="mb-4" class="mt-5"
cmsWidgetName="AlertVinNotFoundWidget" cmsWidgetName="AlertVinNotFoundWidget"
alertClass="alert-danger" alertClass="alert-danger"
:isDismissible="false" /> :isDismissible="false" />
<alert <alert
v-if="displayMatchedDifferentVehicleAlert" v-if="displayMatchedDifferentVehicleAlert"
ref="alertMatchedDifferentVehicle" ref="alertMatchedDifferentVehicle"
class="mb-4" class="mt-5"
cmsWidgetName="AlertMatchedDifferentVehicleWidget" cmsWidgetName="AlertMatchedDifferentVehicleWidget"
:manualHeadline="AlertMatchedDifferentVehicleHeader" :manualHeadline="AlertMatchedDifferentVehicleHeader"
:manualCopy="AlertMatchedDifferentVehicleBody" :manualCopy="AlertMatchedDifferentVehicleBody"
@ -33,7 +33,7 @@
<alert <alert
v-if="displayMatchedTwoIdenticalYMMVehicleAlert" v-if="displayMatchedTwoIdenticalYMMVehicleAlert"
ref="alertMatchedTwoIdenticalYMMVehicle" ref="alertMatchedTwoIdenticalYMMVehicle"
class="mb-4" class="mt-5"
cmsWidgetName="AlertMatchedTwoIdenticalYMMVehicleWidget" cmsWidgetName="AlertMatchedTwoIdenticalYMMVehicleWidget"
:manualHeadline=" :manualHeadline="
AlertMatchedTwoIdenticalYMMVehicleHeader AlertMatchedTwoIdenticalYMMVehicleHeader
@ -44,7 +44,7 @@
<alert <alert
v-if="displayNoServiceAlert" v-if="displayNoServiceAlert"
ref="alertNoService" ref="alertNoService"
class="my-5" class="mt-5"
cmsWidgetName="AlertNoServiceWidget" cmsWidgetName="AlertNoServiceWidget"
alertClass="alert-danger" alertClass="alert-danger"
:isDismissable="false" /> :isDismissable="false" />
@ -55,6 +55,7 @@
isRequired isRequired
disableAutoFill disableAutoFill
inputId="license-plate-question" inputId="license-plate-question"
class="mt-4"
validationRules="license-plate-required" /> validationRules="license-plate-required" />
<dropdownQuestion <dropdownQuestion
ref="state" ref="state"
@ -64,7 +65,7 @@
:options="stateOptions" :options="stateOptions"
disableAutoFill disableAutoFill
validationRules="state-required" validationRules="state-required"
class="mt-4 mb-2" /> class="mt-4" />
<siteFooter <siteFooter
ref="siteFooter" ref="siteFooter"
class="mt-5" class="mt-5"
@ -91,6 +92,7 @@ import {
} from '@/helpers/damage-helper.js'; } from '@/helpers/damage-helper.js';
import routerParams from '@/router/router-constants/router-params.js'; import routerParams from '@/router/router-constants/router-params.js';
import states from '@/constants/states'; import states from '@/constants/states';
import showIssLoadingModal from '@/helpers/loading-modal-helper.js';
// Import Component // Import Component
import baseFormMixin from '@/mixins/base-form-mixin'; import baseFormMixin from '@/mixins/base-form-mixin';
@ -266,22 +268,22 @@ export default {
if (vinLookupResponse.error) { if (vinLookupResponse.error) {
this.displayVinNotFoundAlert = true; this.displayVinNotFoundAlert = true;
this.previouslyEnteredCarId = null; this.previouslyEnteredCarId = null;
showIssLoadingModal(false);
return this.$refs.siteFooter.disableForwardButton(); return this.$refs.siteFooter.disableForwardButton();
} }
// Vehicle found from VIN lookup // Vehicle found from VIN lookup
const vehicleFromLookup = vinLookupResponse.data.vehicle; const vehicleFromLookup = vinLookupResponse.data.vehicle;
if (!vehicleFromLookup.canSafeliteService) { if (!vehicleFromLookup.canSafeliteService) {
this.displayNoServiceAlert = true; this.displayNoServiceAlert = true;
showIssLoadingModal(false);
return this.$refs.siteFooter.disableForwardButton(); return this.$refs.siteFooter.disableForwardButton();
} }
// Check if the CarId has changed // Check if the CarId has changed
this.isCarIdDifferent = vehicleFromLookup.carId !== useMainStore().order.vehicle.carId; this.isCarIdDifferent = vehicleFromLookup.carId !== useMainStore().order.vehicle.carId;
// Handle changing car // Handle changing car
if (this.isCarIdDifferent if (this.isCarIdDifferent && vehicleFromLookup.carId !== this.previouslyEnteredCarId
&& vehicleFromLookup.carId !== this.previouslyEnteredCarId
) { ) {
// Display Alert // Display Alert
this.previouslyEnteredCarId = vehicleFromLookup.carId; this.previouslyEnteredCarId = vehicleFromLookup.carId;
@ -295,6 +297,7 @@ export default {
} }
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleFromLookup.carId); this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleFromLookup.carId);
showIssLoadingModal(false);
// Update button "Continue with..." // Update button "Continue with..."
return this.$refs.siteFooter return this.$refs.siteFooter
@ -320,8 +323,7 @@ export default {
// If a different vehicle is found than the one entered and the selected glass is // If a different vehicle is found than the one entered and the selected glass is
// not available for that vehicle then navigate back to "vehicle-damage" // not available for that vehicle then navigate back to "vehicle-damage"
// display vehicle changed alert on that page. // display vehicle changed alert on that page.
if (this.isCarIdDifferent if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle
&& !this.isSelectedGlassAvailableForVehicle
) { ) {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
@ -349,6 +351,10 @@ export default {
min-height: 1px; min-height: 1px;
padding-left: .9375rem; padding-left: .9375rem;
padding-right: .9375rem; padding-right: .9375rem;
div.alert {
margin-bottom: 0;
}
} }
} }