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