validationDate => Exit interview
This commit is contained in:
parent
1bbf1b6d0a
commit
bd348d1663
1 changed files with 42 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ import type { ResponseItems } from "@/modules/06_retirement/interface/response/e
|
||||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||||
import { identity } from "@fullcalendar/core/internal";
|
import { identity } from "@fullcalendar/core/internal";
|
||||||
|
import { tabList } from "@/interface/request/main/main";
|
||||||
|
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -138,6 +139,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
const visibleColumns = ref<string[]>([]);
|
const visibleColumns = ref<string[]>([]);
|
||||||
|
|
||||||
const dateBreak = ref<Date | null>(null);
|
const dateBreak = ref<Date | null>(null);
|
||||||
|
const daterow = ref<string | null>("");
|
||||||
const id = ref<string>("");
|
const id = ref<string>("");
|
||||||
const filters = ref<ResponseItems[]>([]);
|
const filters = ref<ResponseItems[]>([]);
|
||||||
const rows2 = ref<ResponseItems[]>([]);
|
const rows2 = ref<ResponseItems[]>([]);
|
||||||
|
|
@ -177,6 +179,7 @@ const openModalCalendar = (rows: any) => {
|
||||||
openModal();
|
openModal();
|
||||||
dateBreak.value = null;
|
dateBreak.value = null;
|
||||||
id.value = rows.id;
|
id.value = rows.id;
|
||||||
|
daterow.value = convertThaiDateToNumeric(rows.datetext);
|
||||||
};
|
};
|
||||||
|
|
||||||
const openModalOrder = () => {
|
const openModalOrder = () => {
|
||||||
|
|
@ -256,6 +259,38 @@ const saveAppoint = async () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const validationDate = (thaiDate: string | null) => {
|
||||||
|
if (thaiDate && daterow.value) {
|
||||||
|
let a = convertThaiDateToNumeric(thaiDate);
|
||||||
|
let b = daterow.value;
|
||||||
|
if (a) {
|
||||||
|
return a > b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const convertThaiDateToNumeric = (thaiDate: string) => {
|
||||||
|
const parts = thaiDate.split(" ");
|
||||||
|
if (parts.length !== 3) return null;
|
||||||
|
const [day, month, year] = parts;
|
||||||
|
const monthMap: any = {
|
||||||
|
"ม.ค.": "01",
|
||||||
|
"ก.พ.": "02",
|
||||||
|
"มี.ค.": "03",
|
||||||
|
"เม.ย.": "04",
|
||||||
|
"พ.ค.": "05",
|
||||||
|
"มิ.ย.": "06",
|
||||||
|
"ก.ค.": "07",
|
||||||
|
"ส.ค.": "08",
|
||||||
|
"ก.ย.": "09",
|
||||||
|
"ต.ค.": "10",
|
||||||
|
"พ.ย.": "11",
|
||||||
|
"ธ.ค.": "12",
|
||||||
|
};
|
||||||
|
if (!(month in monthMap)) return null;
|
||||||
|
const numericDate = `${year}${monthMap[month]}${day}`;
|
||||||
|
return numericDate;
|
||||||
|
};
|
||||||
|
|
||||||
// const saveOrder = async () => {
|
// const saveOrder = async () => {
|
||||||
// const id = selected.value.map((r) => r.id);
|
// const id = selected.value.map((r) => r.id);
|
||||||
// const body = {
|
// const body = {
|
||||||
|
|
@ -617,8 +652,14 @@ const saveAppoint = async () => {
|
||||||
"
|
"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${' วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก'}`"
|
:label="`${' วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก'}`"
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณาเลือกลงวันที่'}`,
|
||||||
|
(val) =>
|
||||||
|
validationDate(val) ||
|
||||||
|
`${'วันที่นัดหมายต้องมากกว่าวันที่สร้าง'}`,
|
||||||
|
]"
|
||||||
>
|
>
|
||||||
|
<!-- :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" -->
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="event"
|
name="event"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue