CSR-1077 supporting items changes
This was required to get repair orders to load when the customer didn't progress past the parts page to quote. the load wouldn't have any parts and no chips to indicate repair.
This commit is contained in:
parent
448308b0d1
commit
678f0b96a3
2 changed files with 34 additions and 13 deletions
|
|
@ -252,6 +252,25 @@ export default {
|
||||||
} else if (this.$store.getters.order.referralNumber?.length === 6) {
|
} else if (this.$store.getters.order.referralNumber?.length === 6) {
|
||||||
await this.navigateForwardWithSingleCarMatch();
|
await this.navigateForwardWithSingleCarMatch();
|
||||||
} else if (this.isRepair) {
|
} else if (this.isRepair) {
|
||||||
|
const supportingItemsPromise = await this.dispatchStoreAction(
|
||||||
|
storeActions.GET_SUPPORTING_ITEMS
|
||||||
|
);
|
||||||
|
|
||||||
|
const promiseResultMap = [
|
||||||
|
{
|
||||||
|
resultKey: "supportingItems",
|
||||||
|
promise: supportingItemsPromise,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_SUPPORTING_ITEMS,
|
||||||
|
resultMap.supportingItems,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
// call saveSession here - navigateWithSaving saves too late in the flow
|
// call saveSession here - navigateWithSaving saves too late in the flow
|
||||||
await saveSession({});
|
await saveSession({});
|
||||||
return this.$router.navigateWithoutSaving(
|
return this.$router.navigateWithoutSaving(
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
availableLineItems() {
|
availableLineItems() {
|
||||||
if (this.$store.getters.lineItems.supportingItems) {
|
if (this.$store.getters.lineItems.vaps) {
|
||||||
this.selectDefaultPackage();
|
this.selectDefaultPackage();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -212,6 +212,7 @@ export default {
|
||||||
selectDefaultPackage() {
|
selectDefaultPackage() {
|
||||||
const vapsFromStore = this.$store.getters.lineItems.vaps;
|
const vapsFromStore = this.$store.getters.lineItems.vaps;
|
||||||
let lowestTierForPackage = packageNames.TIER_ONE;
|
let lowestTierForPackage = packageNames.TIER_ONE;
|
||||||
|
if (vapsFromStore.length > 0) {
|
||||||
vapsFromStore.every((vapsItem) => {
|
vapsFromStore.every((vapsItem) => {
|
||||||
let lowestTierForThisItem = this.getLowestTierForThisItem(vapsItem);
|
let lowestTierForThisItem = this.getLowestTierForThisItem(vapsItem);
|
||||||
if (lowestTierForThisItem === packageNames.TIER_THREE) {
|
if (lowestTierForThisItem === packageNames.TIER_THREE) {
|
||||||
|
|
@ -224,6 +225,7 @@ export default {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
this.selectedPackageName = lowestTierForPackage;
|
this.selectedPackageName = lowestTierForPackage;
|
||||||
},
|
},
|
||||||
getLowestTierForThisItem(vapsItem) {
|
getLowestTierForThisItem(vapsItem) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue