CASH-2025: add oem question and logic
This commit is contained in:
parent
c6e006020c
commit
e7e499ca46
1 changed files with 48 additions and 10 deletions
|
|
@ -93,6 +93,11 @@
|
||||||
isInsuranceSelected ? isInsuranceContinueButtonText : ''
|
isInsuranceSelected ? isInsuranceContinueButtonText : ''
|
||||||
" />
|
" />
|
||||||
|
|
||||||
|
<oemGlassQuestion
|
||||||
|
cmsWidgetName="OemGlassQuestionWidget"
|
||||||
|
v-if="offerOem"
|
||||||
|
v-model="isOemGlassSelected" />
|
||||||
|
|
||||||
<saveProgressModalQuestion
|
<saveProgressModalQuestion
|
||||||
modalWidgetName="SaveProgressModalWidget"
|
modalWidgetName="SaveProgressModalWidget"
|
||||||
modalName="SaveProgressModal"
|
modalName="SaveProgressModal"
|
||||||
|
|
@ -136,6 +141,7 @@ import afterpayModalBanner from "@/layouts/quote/afterpay-modal-banner/afterpay-
|
||||||
import recalDisclaimer from "@/layouts/quote/recal-disclaimer/recal-disclaimer.vue";
|
import recalDisclaimer from "@/layouts/quote/recal-disclaimer/recal-disclaimer.vue";
|
||||||
import saveProgressModalQuestion from "@/fmg-components/save-progress-modal-question/save-progress-modal-question";
|
import saveProgressModalQuestion from "@/fmg-components/save-progress-modal-question/save-progress-modal-question";
|
||||||
import saveProgressPopupQuestion from "@/fmg-components/save-progress-popup-question/save-progress-popup-question";
|
import saveProgressPopupQuestion from "@/fmg-components/save-progress-popup-question/save-progress-popup-question";
|
||||||
|
import oemGlassQuestion from "./oem-glass-question/oem-glass-question.vue";
|
||||||
|
|
||||||
// Supporting files
|
// Supporting files
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
|
@ -227,17 +233,16 @@ export default {
|
||||||
);
|
);
|
||||||
|
|
||||||
// call API oem-after-market-parts method
|
// call API oem-after-market-parts method
|
||||||
const offerOem = experimentMixin.methods.hasSettingEqualTo(
|
const experimentAllowsOfferOem = true;
|
||||||
experimentSettings.OFFER_OEM,
|
// const experimentAllowsOfferOem = experimentMixin.methods.hasSettingEqualTo(
|
||||||
"true"
|
// experimentSettings.OFFER_OEM,
|
||||||
|
// "true"
|
||||||
|
// );
|
||||||
|
const oemGlassCheckPromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
storeActions.GET_OEM_AFTERMARKET_PARTS,
|
||||||
|
null,
|
||||||
|
"quote"
|
||||||
);
|
);
|
||||||
if (offerOem) {
|
|
||||||
const oemAfterMarketParts = baseMixin.methods.dispatchStoreActionWithLogging(
|
|
||||||
storeActions.GET_OEM_AFTERMARKET_PARTS,
|
|
||||||
null,
|
|
||||||
"quote"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const shouldExposeSkipQuote = store.getters.isRecalibrationOnOrder;
|
const shouldExposeSkipQuote = store.getters.isRecalibrationOnOrder;
|
||||||
const skipQuoteExperiment = store.getters.applicationUser.experiments.find(
|
const skipQuoteExperiment = store.getters.applicationUser.experiments.find(
|
||||||
|
|
@ -311,6 +316,10 @@ export default {
|
||||||
resultKey: "supportingItems",
|
resultKey: "supportingItems",
|
||||||
promise: supportingItemsPromise,
|
promise: supportingItemsPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "oemGlassCheck",
|
||||||
|
promise: oemGlassCheckPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
@ -332,6 +341,24 @@ export default {
|
||||||
lineItems.vaps = lineItems.vaps ?? [];
|
lineItems.vaps = lineItems.vaps ?? [];
|
||||||
const nullSafeGlassParts = lineItems.glassParts ?? [];
|
const nullSafeGlassParts = lineItems.glassParts ?? [];
|
||||||
|
|
||||||
|
const oemGlassCheck = resultMap.oemGlassCheck;
|
||||||
|
const offerOem = experimentAllowsOfferOem ? oemGlassCheck.offerOem : false;
|
||||||
|
console.log("offerOem: ", offerOem);
|
||||||
|
const oemGlassPieceParts = oemGlassCheck?.glassPieceParts;
|
||||||
|
const oemGlassParts = oemGlassPieceParts ? oemGlassPieceParts[0].parts : null;
|
||||||
|
|
||||||
|
let alternateGlassPartsForOem;
|
||||||
|
// if (oemGlassCheck.glassPieceParts[0].parts) {
|
||||||
|
// // yes, it's a toyota or lexus
|
||||||
|
// console.log("BRE yes, oem available: ", oemGlassCheck.glassPieceParts[0].parts)
|
||||||
|
// alternateGlassPartsForOem = oemGlassCheck.glassPieceParts[0].parts;
|
||||||
|
// }
|
||||||
|
if (oemGlassParts) {
|
||||||
|
// yes, it's a toyota or lexus
|
||||||
|
alternateGlassPartsForOem = oemGlassParts;
|
||||||
|
console.log("BRE yes, oem available: ", alternateGlassPartsForOem);
|
||||||
|
}
|
||||||
|
|
||||||
const quotePageDiscountPartsInfo = getAvailableQuotePageDiscounts();
|
const quotePageDiscountPartsInfo = getAvailableQuotePageDiscounts();
|
||||||
|
|
||||||
const quotePageDiscountParts = quotePageDiscountPartsInfo.map((partInfo) => ({
|
const quotePageDiscountParts = quotePageDiscountPartsInfo.map((partInfo) => ({
|
||||||
|
|
@ -410,6 +437,8 @@ export default {
|
||||||
vm.holdParentAccountNumber = holdParentAccountNumber;
|
vm.holdParentAccountNumber = holdParentAccountNumber;
|
||||||
vm.holdBillToAccountNumber = holdBillToAccountNumber;
|
vm.holdBillToAccountNumber = holdBillToAccountNumber;
|
||||||
vm.skipToInsurance = shouldSkipToInsurance;
|
vm.skipToInsurance = shouldSkipToInsurance;
|
||||||
|
vm.offerOem = offerOem;
|
||||||
|
vm.alternateGlassPartsForOem = alternateGlassPartsForOem; // oemParts
|
||||||
|
|
||||||
if (revalidatePromoResponse) {
|
if (revalidatePromoResponse) {
|
||||||
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
const revalidateAlerts = buildToastMessagesFromRevalidateOrValidatePromoResponse(
|
||||||
|
|
@ -577,6 +606,8 @@ export default {
|
||||||
availableLineItems: null,
|
availableLineItems: null,
|
||||||
lineItems: [],
|
lineItems: [],
|
||||||
addableVaps: [],
|
addableVaps: [],
|
||||||
|
offerOem: null,
|
||||||
|
alternateGlassPartsForOem: null,
|
||||||
servicePackage: null,
|
servicePackage: null,
|
||||||
holdParentAccountNumber: null,
|
holdParentAccountNumber: null,
|
||||||
holdBillToAccountNumber: null,
|
holdBillToAccountNumber: null,
|
||||||
|
|
@ -586,6 +617,7 @@ export default {
|
||||||
packageNumber: null,
|
packageNumber: null,
|
||||||
skipToInsurance: null,
|
skipToInsurance: null,
|
||||||
servicePackageSelected: null,
|
servicePackageSelected: null,
|
||||||
|
isOemGlassSelected: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
|
@ -788,6 +820,11 @@ export default {
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_IS_OEM_GLASS_SELECTED,
|
||||||
|
this.isOemGlassSelected,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
await savePageData(
|
await savePageData(
|
||||||
this.pageName,
|
this.pageName,
|
||||||
|
|
@ -922,6 +959,7 @@ export default {
|
||||||
recalDisclaimer,
|
recalDisclaimer,
|
||||||
saveProgressModalQuestion,
|
saveProgressModalQuestion,
|
||||||
saveProgressPopupQuestion,
|
saveProgressPopupQuestion,
|
||||||
|
oemGlassQuestion,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue