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());
}
});
}