Finally everything *seems* to be working
This commit is contained in:
parent
f87368f5e6
commit
38b346a05e
3 changed files with 11 additions and 44 deletions
|
|
@ -137,13 +137,6 @@ export default {
|
|||
|
||||
// Reset the validation form
|
||||
this.$refs[this.modalName].form.resetForm();
|
||||
// {
|
||||
// values: {
|
||||
// state: this.modelValue.addressQuestions.state,
|
||||
// zipCode: this.modelValue.addressQuestions.zipCode,
|
||||
// },
|
||||
// dirty: false,
|
||||
// });
|
||||
|
||||
// Reinitialize the Address Auto Complete
|
||||
this.$refs.addressQuestions.setupAddressLookup();
|
||||
|
|
@ -164,6 +157,7 @@ export default {
|
|||
async setMobileLocation() {
|
||||
// TODO: Any lookups or actions to be taken before assigning the Mobile Location
|
||||
|
||||
// Update the page level model
|
||||
this.$emit("update:modelValue", this.internalModel);
|
||||
|
||||
this.closeModal();
|
||||
|
|
|
|||
|
|
@ -38,15 +38,6 @@ import serviceZipQuestion from "@/layouts/service-location/service-zip-modal-que
|
|||
import modal from "@/digital-components/modal/modal";
|
||||
import alert from "@/ux-components/alert/alert";
|
||||
|
||||
//Supporting Files
|
||||
import { defineRule, useForm } from "vee-validate";
|
||||
import { required, regex } from "@/helpers/validation-rules";
|
||||
import { errorMessages } from "@/constants/error-messages";
|
||||
|
||||
// Define Validation Rules
|
||||
// defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||
// defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT));
|
||||
|
||||
export default {
|
||||
name: "service-zip-modal-question",
|
||||
data() {
|
||||
|
|
@ -85,14 +76,6 @@ export default {
|
|||
modalName() {
|
||||
return this.modalWidgetName;
|
||||
},
|
||||
// serviceZipModel: {
|
||||
// get: function () {
|
||||
// return this.modelValue;
|
||||
// },
|
||||
// set: function (newValue) {
|
||||
// this.$emit("update:modelValue", newValue);
|
||||
// },
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
resetAlerts() {
|
||||
|
|
@ -105,7 +88,8 @@ export default {
|
|||
},
|
||||
|
||||
focusOnZipInput() {
|
||||
const input = document.getElementById("serviceZipCodeTextBoxQuestion");
|
||||
const inputId = this.$refs.serviceZipQuestion.$refs.zipInputTextQuestion.inputId;
|
||||
const input = document.getElementById(inputId);
|
||||
input.focus();
|
||||
},
|
||||
|
||||
|
|
@ -125,15 +109,9 @@ export default {
|
|||
this.$refs[this.modalName].closeModal();
|
||||
},
|
||||
|
||||
// onModalOpened() {
|
||||
// this.serviceZipCodeInput = this.serviceZipModel.zipCode;
|
||||
// this.focusOnZipInput();
|
||||
// },
|
||||
|
||||
// onModalClosed() {
|
||||
// this.serviceZipCodeInput = this.serviceZipModel.zipCode;
|
||||
// this.resetsOnZipInput();
|
||||
// },
|
||||
onModalOpened() {
|
||||
this.focusOnZipInput();
|
||||
},
|
||||
|
||||
async setZipCode() {
|
||||
this.resetAlerts();
|
||||
|
|
@ -147,14 +125,10 @@ export default {
|
|||
this.internalModel.state = zipCodeData.state;
|
||||
this.internalModel.isServiceable = zipCodeData.isServiceable;
|
||||
|
||||
// if the service zip code is changing we need to clear the Mobile Location Model
|
||||
if (
|
||||
this.modelValue.zipCode !== "" &&
|
||||
this.internalModel.zipCode !== this.modelValue.zipCode
|
||||
) {
|
||||
this.$emit("service-zip-updated");
|
||||
}
|
||||
|
||||
// Notify the page that the service zip has been updated to clear Mobile Location form
|
||||
this.$emit("service-zip-updated");
|
||||
|
||||
// Update the page level model
|
||||
this.$emit("update:modelValue", this.internalModel);
|
||||
|
||||
this.closeModal();
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@
|
|||
v-model="value"
|
||||
inputId="serviceZipCode"
|
||||
questionAlignment="center"
|
||||
mask="#####"
|
||||
:preventAutoFill="true"
|
||||
mask="#####"
|
||||
:displayQuestionText="false"
|
||||
isRequired
|
||||
validationRules="zip-required|zip-format" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue