CASH-816
CASH-816 formatting
This commit is contained in:
parent
87013401f5
commit
9e6965b0ab
1 changed files with 60 additions and 60 deletions
|
|
@ -520,75 +520,75 @@ export default {
|
||||||
const selectedProvider = this.shopProviders.find(
|
const selectedProvider = this.shopProviders.find(
|
||||||
(provider) => provider.providerNumber == this.selectedProviderNumber
|
(provider) => provider.providerNumber == this.selectedProviderNumber
|
||||||
);
|
);
|
||||||
this.resetAlerts();
|
this.resetAlerts();
|
||||||
|
|
||||||
const zipCodeData = await this.getZipCodeData(
|
const zipCodeData = await this.getZipCodeData(
|
||||||
selectedProvider.address.zipCode,
|
selectedProvider.address.zipCode,
|
||||||
|
"service-location"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!zipCodeData.isValid) {
|
||||||
|
this.displayInvalidZipAlert = true;
|
||||||
|
this.focusOnZipInput();
|
||||||
|
this.resetModalButtonStyle();
|
||||||
|
} else {
|
||||||
|
if (this.isVehicleHeavyTruck) {
|
||||||
|
// check the location endpoint to verify this zip can service a heavy truck
|
||||||
|
const closestShops = await getClosestApplicableShops(
|
||||||
|
selectedProvider.address.zipCode,
|
||||||
|
this.carId,
|
||||||
|
"service-location"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!closestShops || closestShops.providers?.length === 0) {
|
||||||
|
this.displayNoServiceAlert = true;
|
||||||
|
this.focusOnZipInput();
|
||||||
|
this.resetModalButtonStyle();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
selectedProvider.address.state = zipCodeData.state;
|
||||||
|
selectedProvider.address.zipCodeCtu = zipCodeData.zipCodeCtu;
|
||||||
|
|
||||||
|
// retrieve mobile fee part
|
||||||
|
const serviceZipCode = selectedProvider.address.zipCode;
|
||||||
|
const mobileFeePart = await getPricedMobileFeePart(
|
||||||
|
serviceZipCode,
|
||||||
"service-location"
|
"service-location"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!zipCodeData.isValid) {
|
// retrieve recycle fee part
|
||||||
this.displayInvalidZipAlert = true;
|
const recycleFeePart = await getPricedRecycleFeePart(
|
||||||
this.focusOnZipInput();
|
serviceZipCode,
|
||||||
this.resetModalButtonStyle();
|
"service-location"
|
||||||
} else {
|
);
|
||||||
if (this.isVehicleHeavyTruck) {
|
|
||||||
// check the location endpoint to verify this zip can service a heavy truck
|
|
||||||
const closestShops = await getClosestApplicableShops(
|
|
||||||
selectedProvider.address.zipCode,
|
|
||||||
this.carId,
|
|
||||||
"service-location"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!closestShops || closestShops.providers?.length === 0) {
|
// retrieve serviceability details
|
||||||
this.displayNoServiceAlert = true;
|
const serviceabilityDetails = await getServiceabilityDetails(
|
||||||
this.focusOnZipInput();
|
serviceZipCode,
|
||||||
this.resetModalButtonStyle();
|
null,
|
||||||
return null;
|
"service-location"
|
||||||
}
|
);
|
||||||
}
|
|
||||||
|
|
||||||
selectedProvider.address.state = zipCodeData.state;
|
const billToAccountNumber = await getBillToAccountNumber(
|
||||||
selectedProvider.address.zipCodeCtu = zipCodeData.zipCodeCtu;
|
selectedProvider.address.zipCodeCtu
|
||||||
|
);
|
||||||
|
|
||||||
// retrieve mobile fee part
|
// update content related to service zip code
|
||||||
const serviceZipCode = selectedProvider.address.zipCode;
|
this.$emit("updated-mobile-fee-part", mobileFeePart);
|
||||||
const mobileFeePart = await getPricedMobileFeePart(
|
this.$emit("updated-recycle-fee-part", recycleFeePart);
|
||||||
serviceZipCode,
|
this.$emit("updated-serviceability", serviceabilityDetails.data);
|
||||||
"service-location"
|
this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase);
|
||||||
);
|
this.$emit("updated-bill-to-account-number", billToAccountNumber);
|
||||||
|
this.$emit("updated-zipcode-ctu", selectedProvider.address.zipCodeCtu);
|
||||||
|
|
||||||
// retrieve recycle fee part
|
this.$emit("update:modelValue", this.selectedValue);
|
||||||
const recycleFeePart = await getPricedRecycleFeePart(
|
this.$emit("update-shop-provider-data", this.localShopProviderData);
|
||||||
serviceZipCode,
|
this.$emit("shop-selected", selectedProvider);
|
||||||
"service-location"
|
|
||||||
);
|
|
||||||
|
|
||||||
// retrieve serviceability details
|
this.closeModal();
|
||||||
const serviceabilityDetails = await getServiceabilityDetails(
|
}
|
||||||
serviceZipCode,
|
|
||||||
null,
|
|
||||||
"service-location"
|
|
||||||
);
|
|
||||||
|
|
||||||
const billToAccountNumber = await getBillToAccountNumber(
|
|
||||||
selectedProvider.address.zipCodeCtu
|
|
||||||
);
|
|
||||||
|
|
||||||
// update content related to service zip code
|
|
||||||
this.$emit("updated-mobile-fee-part", mobileFeePart);
|
|
||||||
this.$emit("updated-recycle-fee-part", recycleFeePart);
|
|
||||||
this.$emit("updated-serviceability", serviceabilityDetails.data);
|
|
||||||
this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase);
|
|
||||||
this.$emit("updated-bill-to-account-number", billToAccountNumber);
|
|
||||||
this.$emit("updated-zipcode-ctu", selectedProvider.address.zipCodeCtu);
|
|
||||||
|
|
||||||
this.$emit("update:modelValue", this.selectedValue);
|
|
||||||
this.$emit("update-shop-provider-data", this.localShopProviderData);
|
|
||||||
this.$emit("shop-selected", selectedProvider);
|
|
||||||
|
|
||||||
this.closeModal();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue