logic to display correct coverage statement

This commit is contained in:
Kroell 2023-02-27 11:33:19 -05:00
parent 442405e8a2
commit 1898949565

View file

@ -82,11 +82,21 @@ export default {
},
data() {
return {
isRepair: useMainStore().order.damage.isRepair,
unverifiedADASNextSteps: false,
unverifiedNonADASNextSteps: false,
unverifiedNonADASRepair: false,
};
},
created() {
// check if repair or replace, if repair, display NonADASRepair
if (this.isRepair) {
this.unverifiedNonADASRepair = true;
}
else {
this.coverageStatementToDisplay();
}
},
computed: {
continueWithSchedulingBodyText() {
return this.getCmsContent('continueWithSchedulingCopy', 'BodyText');
@ -110,9 +120,6 @@ export default {
vm.setCmsContent(resultMap.cmsContent);
});
},
mounted() {
this.coverageStatementToDisplay();
},
methods: {
arePagePrerequisiteValid() {
return true;
@ -124,31 +131,24 @@ export default {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
},
coverageStatementToDisplay() {
// check if repair or replace
const isRepair = useMainStore().order.damage.isRepair;
if (isRepair) {
this.unverifiedNonADASRepair === true
}
else {
// get array of parts
let parts = useMainStore().order.lineItems.glassParts;
// get array of parts for vehicle
let parts = useMainStore().order.lineItems.glassParts;
// loop through parts to check for ADAS
for (let part of parts) {
if (part.requiresRecalibration) {
this.unverifiedADASNextSteps === true
}
else {
this.unverifiedNonADASNextSteps === true
}
// loop through parts to check for ADAS
for (let part of parts) {
// if ADAS, display ADASNextSteps
if (part.requiresRecalibration) {
this.unverifiedADASNextSteps = true
}
// if non-ADAS, display NonADASNextSteps
else {
this.unverifiedNonADASNextSteps = true
}
}
},
}
},
async forwardButtonAction() {},
resetDependentState() {},
},
};
</script>