SSR-383
policy number disabling functionality
This commit is contained in:
parent
cea20119bf
commit
121dd208d8
2 changed files with 38 additions and 1 deletions
|
|
@ -14,6 +14,7 @@
|
|||
isRequired
|
||||
ref="policyNumber"
|
||||
disableAutoFill
|
||||
:isDisabled="this.isClientPassed"
|
||||
validationRules="policy-number-required" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -166,6 +167,7 @@ import { required, regex } from "@/helpers/validation-rules";
|
|||
import { errorMessages } from "@/constants/error-messages";
|
||||
import BaseFormMixin from '@/mixins/base-form-mixin.js';
|
||||
import { useMainStore } from '@/store';
|
||||
import { issPageValues } from "@/router/router-constants/issPage-values"
|
||||
|
||||
//define validation rules
|
||||
defineRule("loss-date-required", required(errorMessages.LOSS_DATE_REQUIRED));
|
||||
|
|
@ -233,6 +235,16 @@ export default {
|
|||
methods:
|
||||
{
|
||||
async forwardButtonAction() {
|
||||
if (this.isClientPassed)
|
||||
{
|
||||
//if disabled state is broken maliciously and policy number is changed, do not update new policy number
|
||||
if (this.welcomePageModel.policyNumber != this.mainStore.order.policy.policyNumber)
|
||||
{
|
||||
this.welcomePageModel.policyNumber = this.mainStore.order.policy.policyNumber
|
||||
}
|
||||
this.mainStore.order.policy.IsPolicyNumberDisabled = true;
|
||||
}
|
||||
|
||||
this.mainStore.updatePolicyData(this.welcomePageModel);
|
||||
return this.navigateForward();
|
||||
},
|
||||
|
|
@ -351,7 +363,30 @@ export default {
|
|||
else{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
isClientPassed()
|
||||
{
|
||||
|
||||
const visitedPolicyHolderPage = this.mainStore.pageData(issPageValues.POLICY_HOLDER_DETAILS) ? true : false;
|
||||
|
||||
if(this.mainStore.issConfig.isAuthenticated)
|
||||
{
|
||||
if (!visitedPolicyHolderPage){ //checking if the page is loaded for the first time
|
||||
if(this.mainStore.order.policy.policyNumber )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}else
|
||||
{
|
||||
if (this.mainStore.order.policy.IsPolicyNumberDisabled)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
components: {
|
||||
siteHeader,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ const getDefaultState = () => {
|
|||
damageCause: null,
|
||||
damageState: null,
|
||||
damageCity: null,
|
||||
isDamageGlassOnly: null
|
||||
isDamageGlassOnly: null,
|
||||
isPolicyNumberDisabled: false
|
||||
},
|
||||
customer: {
|
||||
address: {
|
||||
|
|
@ -814,6 +815,7 @@ export const useMainStore = defineStore({
|
|||
this.order.policy.isDamageGlassOnly = welcomePageModel?.isDamageGlassOnly;
|
||||
this.order.customer.phoneNumber = welcomePageModel?.phoneNumber;
|
||||
this.order.customer.emailAddress = welcomePageModel?.email;
|
||||
this.order.policy.isPolicyNumberDisabled = welcomePageModel?.isPolicyNumberDisabled;
|
||||
},
|
||||
updatePolicyHolderDetails(customerQuestions)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue