start of logic for displaying coverage statement
This commit is contained in:
parent
5f693ad3ea
commit
442405e8a2
1 changed files with 44 additions and 1 deletions
|
|
@ -26,6 +26,17 @@
|
|||
<textBlock
|
||||
cmsWidgetName="UnverifiedADASNextStepsWidget"
|
||||
typeStyle="body"
|
||||
v-if="unverifiedADASNextSteps"
|
||||
/>
|
||||
<textBlock
|
||||
cmsWidgetName="UnverifiedNonADASNextStepsWidget"
|
||||
typeStyle="body"
|
||||
v-if="unverifiedNonADASNextSteps"
|
||||
/>
|
||||
<textBlock
|
||||
cmsWidgetName="UnverifiedNonADASRepairWidget"
|
||||
typeStyle="body"
|
||||
v-if="unverifiedNonADASRepair"
|
||||
/>
|
||||
<a href="#!" data-bs-toggle="modal" data-bs-target="#RecalModal" aria-label="Modal window">Recalibration</a>
|
||||
<modal cmsWidgetName="RecalModal" />
|
||||
|
|
@ -55,6 +66,7 @@ import modal from "@/digital-components/modal/modal";
|
|||
// Import Supporting Files
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||
import { useMainStore } from "@/store"
|
||||
|
||||
export default {
|
||||
name: 'coverage-statement',
|
||||
|
|
@ -69,7 +81,11 @@ export default {
|
|||
modal,
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
unverifiedADASNextSteps: false,
|
||||
unverifiedNonADASNextSteps: false,
|
||||
unverifiedNonADASRepair: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
continueWithSchedulingBodyText() {
|
||||
|
|
@ -77,6 +93,7 @@ export default {
|
|||
}
|
||||
},
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
// Call APIs
|
||||
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
||||
|
||||
// Settle promises and get results
|
||||
|
|
@ -93,6 +110,9 @@ export default {
|
|||
vm.setCmsContent(resultMap.cmsContent);
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.coverageStatementToDisplay();
|
||||
},
|
||||
methods: {
|
||||
arePagePrerequisiteValid() {
|
||||
return true;
|
||||
|
|
@ -103,6 +123,29 @@ 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;
|
||||
|
||||
// loop through parts to check for ADAS
|
||||
for (let part of parts) {
|
||||
if (part.requiresRecalibration) {
|
||||
this.unverifiedADASNextSteps === true
|
||||
}
|
||||
else {
|
||||
this.unverifiedNonADASNextSteps === true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async forwardButtonAction() {},
|
||||
resetDependentState() {},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue