From dc75f326e4ae876a4707a1d8049a1c50c98708c9 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Fri, 13 Oct 2023 07:58:08 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AA=E0=B8=AD=E0=B8=9A=E0=B8=84=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD=E0=B8=94validate?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4?= =?UTF-8?q?=E0=B8=97=E0=B8=B3=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/01_exam/components/Form/Career.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/01_exam/components/Form/Career.vue b/src/modules/01_exam/components/Form/Career.vue index 90749f9..dc204eb 100644 --- a/src/modules/01_exam/components/Form/Career.vue +++ b/src/modules/01_exam/components/Form/Career.vue @@ -157,7 +157,10 @@ lazy-rules :borderless="!edit" :model-value="date2Thai(startDate)" - :rules="[(val) => !!val || `${'กรุณาเลือกวันที่เริ่ม'}`, endDateValidation]" + :rules="[ + (val) => !!val || `${'กรุณาเลือกวันที่เริ่ม'}`, + (val) => startDate <= endDate || `${'กรุณาเลือกวันที่เริ่มให้ถูกต้อง'}` + ]" hide-bottom-space :label="`${'วันที่เริ่ม'}`" > @@ -199,7 +202,10 @@ lazy-rules :borderless="!edit" :model-value="date2Thai(endDate)" - :rules="[(val) => !!val || `${'กรุณาเลือกวันที่สิ้นสุด'}`, endDateValidation]" + :rules="[ + (val) => !!val || `${'กรุณาเลือกวันที่สิ้นสุด'}`, + (val) => startDate <= endDate || `${'กรุณาเลือกวันที่สิ้นสุดให้ถูกต้อง'}` + ]" hide-bottom-space :label="`${'วันที่สิ้นสุด'}`" > @@ -764,6 +770,7 @@ const addRow = () => { * เช็คว่ามีการแก้ไขข้อมูล */ const clickEditRow = () => { + myForm.value.validate() editRow.value = true }