From 73e150a509d6619d1d481387fdacb506978f4dc3 Mon Sep 17 00:00:00 2001 From: Thanit Konmek Date: Mon, 28 Aug 2023 10:11:40 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B9=81?= =?UTF-8?q?=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82=E0=B8=97=E0=B8=B0=E0=B9=80?= =?UTF-8?q?=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=A5=E0=B8=B9=E0=B8=81?= =?UTF-8?q?=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Information/Information.vue | 6 ++++++ .../views/Information/Information.vue | 14 ++++++++++---- .../08_registryEmployee/views/information.vue | 15 +++++++++------ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/modules/04_registry/components/Information/Information.vue b/src/modules/04_registry/components/Information/Information.vue index 2937e53cb..a2aaa480e 100644 --- a/src/modules/04_registry/components/Information/Information.vue +++ b/src/modules/04_registry/components/Information/Information.vue @@ -282,6 +282,12 @@ :borderless="!edit" v-model="informaData.tel" :label="`${'เบอร์โทร'}`" + :rules="[ + (val:string) => !!val || `${'กรุณากรอก เบอร์โทร'}`, + (val:string) => + val.length >= 10 || + `${'กรุณากรอกเบอร์โทรให้ครบ'}`, + ]" mask="##########" /> diff --git a/src/modules/08_registryEmployee/views/Information/Information.vue b/src/modules/08_registryEmployee/views/Information/Information.vue index bf6a869f4..c6d077732 100644 --- a/src/modules/08_registryEmployee/views/Information/Information.vue +++ b/src/modules/08_registryEmployee/views/Information/Information.vue @@ -283,6 +283,12 @@ v-model="informaData.tel" :label="`${'เบอร์โทร'}`" mask="##########" + :rules="[ + (val:string) => !!val || `${'กรุณากรอก เบอร์โทร'}`, + (val:string) => + val.length >= 10 || + `${'กรุณากรอกเบอร์โทรให้ครบ'}`, + ]" />
{ // }); }; -const saveData = async () =>{ - dialogConfirm($q,()=>Datasave()) -} +const saveData = async () => { + dialogConfirm($q, () => Datasave()); +}; const Datasave = async () => { if (myform.value != null) { await myform.value.validate().then(async (success: boolean) => { diff --git a/src/modules/08_registryEmployee/views/information.vue b/src/modules/08_registryEmployee/views/information.vue index 0f83e7fbe..0f5fa37a8 100644 --- a/src/modules/08_registryEmployee/views/information.vue +++ b/src/modules/08_registryEmployee/views/information.vue @@ -286,6 +286,12 @@ :borderless="!edit" v-model="informaData.tel" :label="`${'เบอร์โทร'}`" + :rules="[ + (val:string) => !!val || `${'กรุณากรอก เบอร์โทร'}`, + (val:string) => + val.length >= 10 || + `${'กรุณากรอกเบอร์โทรให้ครบ'}`, + ]" mask="##########" />
@@ -439,7 +445,7 @@ const { dialogMessage, showLoader, hideLoader, - dialogConfirm + dialogConfirm, } = mixin; const profileStore = useProfileDataStore(); @@ -1091,7 +1097,7 @@ const addData = async () => { emit("update:statusEdit", false); await fetchData(); await changeBirth(informaData.value.birthDate ?? new Date()); - await clickBack() + await clickBack(); hideLoader(); }); console.log(body); @@ -1103,10 +1109,7 @@ const saveData = async () => { if (myform.value != null) { await myform.value.validate().then(async (saveDataTest: Boolean) => { if (saveDataTest) { - dialogConfirm( - $q, - () => addData() - ) + dialogConfirm($q, () => addData()); } }); }