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