format only
This commit is contained in:
parent
4e14826647
commit
af647c0acc
1 changed files with 25 additions and 42 deletions
|
|
@ -66,7 +66,7 @@ export default {
|
|||
buttonQuestion,
|
||||
siteFooter,
|
||||
// eslint-disable-next-line vue/no-reserved-component-names
|
||||
Form,
|
||||
Form
|
||||
},
|
||||
mixins: [BaseFormMixin],
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -87,26 +87,20 @@ export default {
|
|||
siteHeader: 'SiteHeaderWidget',
|
||||
siteSubHeader: 'SiteSubHeaderWidget',
|
||||
existingOrNewQuestion: 'ExistingOrNewQuestion',
|
||||
siteFooter: 'SiteFooterWidget',
|
||||
siteFooter: 'SiteFooterWidget'
|
||||
},
|
||||
rules: {
|
||||
selectionRequired: globalRules.OPTION_REQUIRED,
|
||||
},
|
||||
selectionRequired: globalRules.OPTION_REQUIRED
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
questionText() {
|
||||
return this.getCmsContent(
|
||||
this.widget.existingOrNewQuestion,
|
||||
'QuestionText'
|
||||
);
|
||||
return this.getCmsContent(this.widget.existingOrNewQuestion, 'QuestionText');
|
||||
},
|
||||
answersFromCms() {
|
||||
return (
|
||||
this.getCmsContent(
|
||||
this.widget.existingOrNewQuestion,
|
||||
'Answers'
|
||||
) ?? []
|
||||
this.getCmsContent(this.widget.existingOrNewQuestion, 'Answers') ?? []
|
||||
);
|
||||
},
|
||||
getNewOrderSelectionName() {
|
||||
|
|
@ -117,32 +111,28 @@ export default {
|
|||
const orders = useMainStore().applicationUser.duplicateOrders;
|
||||
return (
|
||||
orders?.map((o) => {
|
||||
const vehicle =
|
||||
!!o.vehicleYear && !!o.vehicleMake && !!o.vehicleModel
|
||||
? `${o.vehicleYear} ${o.vehicleMake} ${o.vehicleModel}`
|
||||
: null;
|
||||
|
||||
const dateOfLoss =
|
||||
o.responseDate == null
|
||||
? ''
|
||||
: new Date(o.responseDate).toLocaleDateString();
|
||||
const subtext =
|
||||
vehicle && o.responseDate
|
||||
? `${vehicle}, ${dateOfLoss}`
|
||||
: (vehicle ?? '').concat(dateOfLoss);
|
||||
const vehicle = !!o.vehicleYear && !!o.vehicleMake && !!o.vehicleModel
|
||||
? `${o.vehicleYear} ${o.vehicleMake} ${o.vehicleModel}`
|
||||
: null;
|
||||
const dateOfLoss = o.responseDate == null
|
||||
? ''
|
||||
: new Date(o.responseDate).toLocaleDateString();
|
||||
const subtext = vehicle && o.responseDate
|
||||
? `${vehicle}, ${dateOfLoss}`
|
||||
: (vehicle ?? '').concat(dateOfLoss);
|
||||
|
||||
return {
|
||||
Text: duplicateOrderText,
|
||||
Name: o.referralNumber,
|
||||
SubText: toTitleCase(subtext),
|
||||
value: o.correlationId,
|
||||
value: o.correlationId
|
||||
};
|
||||
}) ?? []
|
||||
);
|
||||
},
|
||||
answers() {
|
||||
return [...this.duplicateOrders, ...this.answersFromCms];
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
|
|
@ -151,9 +141,7 @@ export default {
|
|||
async forwardButtonAction() {
|
||||
if (this.selectedAnswer !== null) {
|
||||
const selectedReferral =
|
||||
this.mainStore.applicationUser.duplicateOrders.find(
|
||||
(o) => o.correlationId === this.selectedAnswer
|
||||
);
|
||||
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
|
||||
if (selectedReferral) {
|
||||
await this.mainStore
|
||||
.loadSession(selectedReferral)
|
||||
|
|
@ -179,14 +167,12 @@ export default {
|
|||
if (!this.mainStore.order.loadedFromDupeCheck) {
|
||||
if (policyVehicles.length !== 0) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios
|
||||
.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||
this.$route
|
||||
);
|
||||
} else {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios
|
||||
.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
|
|
@ -195,25 +181,22 @@ export default {
|
|||
|
||||
if (this.mainStore.order.vehicle.vin) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios
|
||||
.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_POLICY_VEHICLE,
|
||||
this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_POLICY_VEHICLE,
|
||||
this.$route
|
||||
);
|
||||
} else if (policyVehicles.length !== 0) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios
|
||||
.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NON_POLICY_VEHICLE,
|
||||
this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NON_POLICY_VEHICLE,
|
||||
this.$route
|
||||
);
|
||||
} else {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios
|
||||
.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NO_POLICY_VEHICLES,
|
||||
this.navigationScenarios.CLICKED_FORWARD_LOADED_DUPLICATE_WITH_NO_POLICY_VEHICLES,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue