ตรวจสอบ กรอกเวลาไม่ครบ 10 หลัก

This commit is contained in:
Net 2024-02-16 09:57:04 +07:00
parent bdeda2d089
commit 75d871fc64
5 changed files with 56 additions and 9 deletions

View file

@ -65,6 +65,8 @@
mask="##/##/####"
dense
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"
:error="dayChecked"
error-message="กรุณากรอกวันที่"
/>
<datepicker
@ -178,7 +180,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { validateTime } from "@/modules/04_registry/stores/time";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -436,6 +438,9 @@ const clickAdd = async () => {
* กดบนทกใน dialog
*/
const clickSave = async () => {
dayChecked.value = validateTime(inputDate.value);
if (dayChecked.value) return;
myForm.value.validate().then(async (result: boolean) => {
if (result) {
if (modalEdit.value) {
@ -546,6 +551,7 @@ const clickClose = async () => {
modal.value = false;
next.value = false;
previous.value = false;
dayChecked.value = false;
}
};