From a3c10761fa8783e7b331f7362144dfd583b6a7d0 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Fri, 29 Mar 2024 16:33:59 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4:=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=20=E0=B8=9F=E0=B8=AD=E0=B8=A3=E0=B9=8C=E0=B8=A1?= =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B8=82=E0=B9=89?= =?UTF-8?q?=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogAddData.vue | 142 +++++++----------- 1 file changed, 51 insertions(+), 91 deletions(-) diff --git a/src/modules/04_registryNew/components/DialogAddData.vue b/src/modules/04_registryNew/components/DialogAddData.vue index 909e18506..44b9f34ab 100644 --- a/src/modules/04_registryNew/components/DialogAddData.vue +++ b/src/modules/04_registryNew/components/DialogAddData.vue @@ -21,11 +21,9 @@ const profileStore = useProfileDataStore(); const $q = useQuasar(); const store = useRegistryNewDataStore(); const { - dialogRemove, dialogConfirm, success, messageError, - showLoader, hideLoader, dialogMessageNotify, date2Thai, @@ -54,24 +52,6 @@ const formData = reactive({ birthDate: null, }); -const prefixRef = ref(null); -const firstNameRef = ref(null); -const lastNameRef = ref(null); -const citizenIdRef = ref(null); -const positionRef = ref(null); -const posTypeIdRef = ref(null); -const posLevelIdRef = ref(null); - -const objectRef: MyObjectRef = { - prefix: prefixRef, - firstName: firstNameRef, - lastName: lastNameRef, - citizenId: citizenIdRef, - position: positionRef, - posTypeId: posTypeIdRef, - posLevelId: posLevelIdRef, -}; - function fetchPrefix() { http .get(config.API.orgPrefix) @@ -152,22 +132,6 @@ function clearFormData() { formData.birthDate = null; } -function validateForm() { - const hasError = []; - for (const key in objectRef) { - if (Object.prototype.hasOwnProperty.call(objectRef, key)) { - const property = objectRef[key]; - if (property.value && typeof property.value.validate === "function") { - const isValid = property.value.validate(); - hasError.push(isValid); - } - } - } - if (hasError.every((result) => result === true)) { - onSubmit(); - } -} - async function onSubmit() { dialogConfirm($q, async () => { await http @@ -209,35 +173,38 @@ watch(