From db2ee3d01ec7a88eb984f4f99530ce80d929c455 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Wed, 29 Mar 2023 14:33:05 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=82=E0=B8=9A?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=A3=20=E0=B8=81=E0=B8=B1=E0=B8=9A=20?= =?UTF-8?q?=E0=B9=80=E0=B8=9A=E0=B8=AD=E0=B8=A3=E0=B9=8C=20limit=20type=20?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=99=20int=20=E0=B8=AD=E0=B8=A2?= =?UTF-8?q?=E0=B9=88=E0=B8=B2=E0=B8=87=E0=B9=80=E0=B8=94=E0=B8=B5=E0=B8=A2?= =?UTF-8?q?=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit แก้ไขสามารถบันทึก แก้ไขข้อมูลได้ เลขบัตร กับ เบอร์ limit typt เป็น int อย่างเดียวแล้ว --- src/modules/01_exam/components/Form/Information.vue | 7 ++++--- src/modules/01_exam/components/Form/Occupation.vue | 9 +++++++-- src/modules/01_exam/interface/index/Main.ts | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/modules/01_exam/components/Form/Information.vue b/src/modules/01_exam/components/Form/Information.vue index 7b267b1..4e91286 100644 --- a/src/modules/01_exam/components/Form/Information.vue +++ b/src/modules/01_exam/components/Form/Information.vue @@ -153,6 +153,7 @@ :class="getClass(status == 'register' || status == 'rejectRegister')" :outlined="status == 'register' || status == 'rejectRegister'" dense + type="tel" counter lazy-rules :readonly="!(status == 'register' || status == 'rejectRegister')" @@ -161,7 +162,7 @@ maxlength="13" :rules="[ (val) => !!val || `${'กรุณากรอก เลขบัตรประจำตัวประชาชน'}`, - (val) => val.length >= 13 || `${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}` + (val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ถูกต้อง'}` ]" label="เลขบัตรประจำตัวประชาชน" /> @@ -276,7 +277,7 @@ v-model="informaData.tel" :rules="[ (val) => !!val || `${'กรุณากรอก โทรศัพท์'}`, - (val) => val.length >= 9 || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ครบ'}` + (val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}` ]" :label="`${'โทรศัพท์'}`" /> @@ -295,7 +296,7 @@ v-model="informaData.phone" :rules="[ (val) => !!val || `${'กรุณากรอก โทรศัพท์มือถือ'}`, - (val) => val.length >= 10 || `${'กรุณากรอกข้อมูลโทรศัพท์มือถือให้ครบ'}` + (val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์มือถือให้ถูกต้อง'}` ]" :label="`${'โทรศัพท์มือถือ'}`" /> diff --git a/src/modules/01_exam/components/Form/Occupation.vue b/src/modules/01_exam/components/Form/Occupation.vue index 4f83cd7..c7b8fb6 100644 --- a/src/modules/01_exam/components/Form/Occupation.vue +++ b/src/modules/01_exam/components/Form/Occupation.vue @@ -232,13 +232,18 @@ hide-bottom-space :outlined="status == 'register' || status == 'rejectRegister'" dense + counter + maxlength="10" lazy-rules - type="textarea" + type="tel" autogrow :readonly="!(status == 'register' || status == 'rejectRegister')" :borderless="!(status == 'register' || status == 'rejectRegister')" v-model="occupationData.tel" - :rules="[(val) => !!val || `${'กรุณากรอก โทรศัพท์'}`]" + :rules="[ + (val) => !!val || `${'กรุณากรอก โทรศัพท์'}`, + (val) => /^[0-9]*$/.test(val) || 'กรุณากรอก โทรศัพท์ให้ถูกต้อง' + ]" :label="`${'โทรศัพท์'}`" /> diff --git a/src/modules/01_exam/interface/index/Main.ts b/src/modules/01_exam/interface/index/Main.ts index f08f8c9..bdf03b5 100644 --- a/src/modules/01_exam/interface/index/Main.ts +++ b/src/modules/01_exam/interface/index/Main.ts @@ -25,7 +25,7 @@ interface Information { nationality: string | null ethnicity: string | null religionId: string | null - tel: string | null + tel: int | null phone: string | null email: string | null province: string | null From 63d64c3fd6b798dc67080dc5c6f4fdbd0f8b7585 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Wed, 29 Mar 2023 14:36:15 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20type=20?= =?UTF-8?q?=E0=B9=83=E0=B8=99=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/01_exam/interface/index/Main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/01_exam/interface/index/Main.ts b/src/modules/01_exam/interface/index/Main.ts index bdf03b5..f08f8c9 100644 --- a/src/modules/01_exam/interface/index/Main.ts +++ b/src/modules/01_exam/interface/index/Main.ts @@ -25,7 +25,7 @@ interface Information { nationality: string | null ethnicity: string | null religionId: string | null - tel: int | null + tel: string | null phone: string | null email: string | null province: string | null