Merge remote-tracking branch 'origin/feature/CASH-532v2' into feature/CASH-532v2

This commit is contained in:
Johnny shultz 2025-05-19 09:13:07 -04:00
commit 3e8123eadf
3 changed files with 23 additions and 31 deletions

View file

@ -688,17 +688,18 @@ export default {
if (!this.months) return; if (!this.months) return;
this.isLoading = true; this.isLoading = true;
let monthToShow; let monthToShow;
let monthStartDateNum = 0; let monthStartDate;
if (this.hideSomeDaysForInitialView) { if (this.hideSomeDaysForInitialView) {
monthToShow = this.months.find( monthToShow = this.months.find(
({ isMonthThatHidesSomeDaysForInitialView }) => ({ isMonthThatHidesSomeDaysForInitialView }) =>
isMonthThatHidesSomeDaysForInitialView isMonthThatHidesSomeDaysForInitialView
); );
// find the first day-hidden to become the next api call start date // find the first day-hidden to become the next api call start date
monthStartDateNum = monthStartDate = monthToShow.dates.find(({ dayClasses }) =>
monthToShow.dates.find(({ dayClasses }) => dayClasses.includes("day-hidden")) dayClasses.includes("day-hidden")
.dateNum - 1; );
} else { } else {
if (this.calendarViewDirection === "future") { if (this.calendarViewDirection === "future") {
monthToShow = this.months.find((month) => monthToShow = this.months.find((month) =>
@ -713,9 +714,13 @@ export default {
} }
} }
if (monthToShow) { if (monthToShow) {
const monthStartDateString = monthStartDate
? monthStartDate.inputValue
: monthToShow.dates[0].inputValue;
// make new API call with this month's start and end dates // make new API call with this month's start and end dates
const moreSelectableDatesData = await this.updateSelectableDates( const moreSelectableDatesData = await this.updateSelectableDates(
monthToShow.dates[monthStartDateNum].inputValue, monthStartDateString,
monthToShow.dates[monthToShow.dates.length - 1].inputValue monthToShow.dates[monthToShow.dates.length - 1].inputValue
); );
this.isLoading = false; this.isLoading = false;
@ -854,7 +859,7 @@ export default {
} }
.calendar-grid-container { .calendar-grid-container {
margin: 0 auto 1rem auto; margin: 0 auto 1rem auto;
max-width: 400px; max-width: 360px;
position: relative; position: relative;
transition: transition:
height ease 2s, height ease 2s,
@ -864,9 +869,6 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 0; padding: 0;
@include media-breakpoint-up(md) {
padding: 0 0.75rem;
}
opacity: 1; opacity: 1;
.grid-item { .grid-item {

View file

@ -225,6 +225,15 @@ export default {
return index; return index;
}, },
async handleUpdate(selectedShopIndex = null) {
this.resetAnswers();
if (selectedShopIndex >= 3) {
await this.getNextShopsFromList(selectedShopIndex + 1);
} else {
await this.getNextShopsFromList();
await nextTick();
}
},
}, },
watch: { watch: {
selectedAppointmentType: { selectedAppointmentType: {
@ -233,27 +242,16 @@ export default {
// nothing to do with this component. We could mitigate this by showing / hiding this component with v-if but that messes // nothing to do with this component. We could mitigate this by showing / hiding this component with v-if but that messes
// up the component initialization on page load. // up the component initialization on page load.
async handler() { async handler() {
await nextTick(); this.handleUpdate();
this.resetAnswers();
this.getNextShopsFromList();
}, },
}, },
shopProviders: { shopProviders: {
async handler(newValue) { async handler(newValue) {
this.resetAnswers();
await nextTick();
const selectedShopIndex = this.getSelectedProviderIndex( const selectedShopIndex = this.getSelectedProviderIndex(
newValue, newValue,
this.selectedProviderNumber this.selectedProviderNumber
); );
this.handleUpdate(selectedShopIndex);
if (selectedShopIndex >= 3) {
await this.getNextShopsFromList(selectedShopIndex + 1);
} else {
await this.getNextShopsFromList();
await nextTick();
}
}, },
}, },
}, },

View file

@ -313,15 +313,7 @@ export default {
} }
// Cash Quote or Cash Price Sub Total // Cash Quote or Cash Price Sub Total
if (isPricingAvailable) { payload.cashPriceSubTotal = store.getters.order?.cashPriceSubTotal ?? "";
const subtotal = baseMixin.methods
.getTotalPriceOfAllLineItemsAndChildParts(combinedLineItems, false)
.toFixed(2);
payload.cashPriceSubTotal = parseFloat(subtotal);
} else {
payload.cashPriceSubTotal = "";
}
//unverified (in scenarios we dont display the price) //unverified (in scenarios we dont display the price)
if ( if (