commit
This commit is contained in:
parent
87bd5205fe
commit
9b470eb959
2 changed files with 39 additions and 10 deletions
|
|
@ -145,6 +145,7 @@
|
||||||
import { required, regex } from "@/helpers/validation-rules";
|
import { required, regex } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
||||||
|
import { useMainStore } from '@/store';
|
||||||
|
|
||||||
//define validation rules
|
//define validation rules
|
||||||
defineRule("loss-date-required", required(errorMessages.LOSS_DATE_REQUIRED));
|
defineRule("loss-date-required", required(errorMessages.LOSS_DATE_REQUIRED));
|
||||||
|
|
@ -177,7 +178,6 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
policyNumber: "",
|
policyNumber: "",
|
||||||
policyZipCode: "",
|
|
||||||
dateOfLoss: "",
|
dateOfLoss: "",
|
||||||
damageCause: "",
|
damageCause: "",
|
||||||
damageState: "",
|
damageState: "",
|
||||||
|
|
@ -187,6 +187,10 @@
|
||||||
email: ""
|
email: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
setup() {
|
||||||
|
const mainStore = useMainStore();
|
||||||
|
return { mainStore };
|
||||||
|
},
|
||||||
async beforeRouteEnter(to, from, next)
|
async beforeRouteEnter(to, from, next)
|
||||||
{
|
{
|
||||||
// Call APIs
|
// Call APIs
|
||||||
|
|
@ -210,6 +214,18 @@
|
||||||
methods:
|
methods:
|
||||||
{
|
{
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
|
const welcomePageModel = JSON.stringify({
|
||||||
|
PolicyNumber: this.policyNumber,
|
||||||
|
DateOfLoss: this.dateOfLoss,
|
||||||
|
DamageCause: this.damageCause,
|
||||||
|
DamageState: this.damageState,
|
||||||
|
DamageCity: this.damageCity,
|
||||||
|
IsDamageGlassOnly: this.isDamageGlassOnly,
|
||||||
|
PhoneNumber: this.phoneNumber,
|
||||||
|
Email: this.email
|
||||||
|
});
|
||||||
|
|
||||||
|
this.mainStore.updatePolicyData(welcomePageModel);
|
||||||
return this.navigateForward();
|
return this.navigateForward();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -299,14 +315,6 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
welcomePageModel: {
|
|
||||||
get: function () {
|
|
||||||
return this.modelValue;
|
|
||||||
},
|
|
||||||
set: function (newValue) {
|
|
||||||
this.$emit("update:modelValue", newValue);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
siteHeader,
|
siteHeader,
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,16 @@ const getDefaultState = () => {
|
||||||
moldingQuestionAnswers: null,
|
moldingQuestionAnswers: null,
|
||||||
capabilityQuestionAnswers: null,
|
capabilityQuestionAnswers: null,
|
||||||
},
|
},
|
||||||
|
policy:{
|
||||||
|
policyNumber: null,
|
||||||
|
dateOfLoss: null,
|
||||||
|
damageCause: null,
|
||||||
|
damageState: null,
|
||||||
|
damageCity: null,
|
||||||
|
isDamageGlassOnly: null,
|
||||||
|
phoneNumber: null,
|
||||||
|
email: null,
|
||||||
|
},
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
address: null,
|
address: null,
|
||||||
city: null,
|
city: null,
|
||||||
|
|
@ -541,7 +551,18 @@ export const useMainStore = defineStore({
|
||||||
updatePageData(pageData) {
|
updatePageData(pageData) {
|
||||||
this.applicationUser.pageData[pageData.page] = pageData.data;
|
this.applicationUser.pageData[pageData.page] = pageData.data;
|
||||||
},
|
},
|
||||||
|
updatePolicyData(welcomePageModel)
|
||||||
|
{
|
||||||
|
const welcomePageData = JSON.parse(welcomePageModel);
|
||||||
|
this.order.policy.policyNumber = welcomePageData.PolicyNumber;
|
||||||
|
this.order.policy.dateOfLoss = welcomePageData.DateOfLoss;
|
||||||
|
this.order.policy.damageCause = welcomePageData.DamageCause;
|
||||||
|
this.order.policy.damageState = welcomePageData.DamageState;
|
||||||
|
this.order.policy.damageCity = welcomePageData.DamageCity;
|
||||||
|
this.order.policy.isDamageGlassOnly = welcomePageData.IsDamageGlassOnly;
|
||||||
|
this.order.policy.phoneNumber = welcomePageData.PhoneNumber;
|
||||||
|
this.order.policy.email = welcomePageData.Email;
|
||||||
|
},
|
||||||
savePartQuestionAnswers(partQuestionAnswersArray) {
|
savePartQuestionAnswers(partQuestionAnswersArray) {
|
||||||
// if part question answers have changed, reset subsequent question answers
|
// if part question answers have changed, reset subsequent question answers
|
||||||
const sortedPreviousResultsArray = sortArrayOfObjectsByPropertyValue(
|
const sortedPreviousResultsArray = sortArrayOfObjectsByPropertyValue(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue