CSR-111 Fix vehicle-parts issue
This commit is contained in:
parent
a418144980
commit
474df4dea4
1 changed files with 7 additions and 5 deletions
|
|
@ -225,7 +225,7 @@ export const mutations = {
|
||||||
},
|
},
|
||||||
|
|
||||||
// applicationUser MUTATIONS
|
// applicationUser MUTATIONS
|
||||||
updateSaveOrderPromise(state, saveOrderPromise){
|
updateSaveOrderPromise(state, saveOrderPromise) {
|
||||||
state.applicationUser.saveOrderPromise = saveOrderPromise;
|
state.applicationUser.saveOrderPromise = saveOrderPromise;
|
||||||
},
|
},
|
||||||
updateSavedSessionId(state, savedSessionId) {
|
updateSavedSessionId(state, savedSessionId) {
|
||||||
|
|
@ -392,7 +392,7 @@ export const getters = {
|
||||||
parentAccountNumber: state.order.accountNumber,
|
parentAccountNumber: state.order.accountNumber,
|
||||||
isCoverageVerified: state.order.payment.insuranceCoverage.isVerified,
|
isCoverageVerified: state.order.payment.insuranceCoverage.isVerified,
|
||||||
orderPartNumbers: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "partNumber"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "partNumber")],
|
orderPartNumbers: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "partNumber"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "partNumber")],
|
||||||
orderPartTypes: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "recalibrationType"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "recalibrationType")],
|
orderPartTypes: [...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "recalibrationType"), ...getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.otherParts, "recalibrationType")],
|
||||||
hasRecalibrationPart: getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "requiresRecalibration")?.length > 0,
|
hasRecalibrationPart: getAllValuesOfPropertyInArrayOfObjects(state.order.lineItems.glassParts, "requiresRecalibration")?.length > 0,
|
||||||
selectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
|
selectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
|
||||||
selectedWindshieldGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.WINDSHIELD),
|
selectedWindshieldGlass: getAllValuesOfPropertyInArrayOfObjects(state.order.damage.glassToReplace, "glassLocation").includes(damageLocationsSelected.WINDSHIELD),
|
||||||
|
|
@ -1022,7 +1022,9 @@ export const actions = {
|
||||||
const previousResultsArray = [{ parts: context.getters.lineItems.glassParts }];
|
const previousResultsArray = [{ parts: context.getters.lineItems.glassParts }];
|
||||||
|
|
||||||
function getAllPartNumbers(partsOrQuestions) {
|
function getAllPartNumbers(partsOrQuestions) {
|
||||||
return [...partsOrQuestions].map(glass => glass.parts).flat().map(part => part.partNumber).filter(partNumber => !partNumber.toUpperCase().includes("FEE")).sort().join(",");
|
return partsOrQuestions[0].parts
|
||||||
|
? [...partsOrQuestions].map(glass => glass.parts).flat().map(part => part.partNumber).filter(partNumber => !partNumber.toUpperCase().includes("FEE")).sort().join(",")
|
||||||
|
: []
|
||||||
}
|
}
|
||||||
|
|
||||||
const previouslySelectedPartNumbers = getAllPartNumbers(previousResultsArray);
|
const previouslySelectedPartNumbers = getAllPartNumbers(previousResultsArray);
|
||||||
|
|
@ -1041,7 +1043,7 @@ export const actions = {
|
||||||
saveMoldingQuestionAnswers(context, moldingQuestionAnswers) {
|
saveMoldingQuestionAnswers(context, moldingQuestionAnswers) {
|
||||||
const previousResultsArray = context.getters.damage.moldingQuestionAnswers;
|
const previousResultsArray = context.getters.damage.moldingQuestionAnswers;
|
||||||
const haveMoldingQuestionAnswersChanged = previousResultsArray?.length !== moldingQuestionAnswers.length ||
|
const haveMoldingQuestionAnswersChanged = previousResultsArray?.length !== moldingQuestionAnswers.length ||
|
||||||
!previousResultsArray.every((x, i) => x.partNum === moldingQuestionAnswers[i].partNum);
|
!previousResultsArray.every((x, i) => x.partNum === moldingQuestionAnswers[i].partNum);
|
||||||
|
|
||||||
if (haveMoldingQuestionAnswersChanged) {
|
if (haveMoldingQuestionAnswersChanged) {
|
||||||
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue