Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m31s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m31s
* develop: fix: education placement ปีเริ่ม-สิ้นสุดการศึกษา
This commit is contained in:
commit
7ba7bb3e21
2 changed files with 43 additions and 21 deletions
|
|
@ -79,10 +79,10 @@ const durationYear = ref<number>(0);
|
|||
const other = ref<string>();
|
||||
const fundName = ref<string>();
|
||||
const finishDate = ref<Date>(new Date());
|
||||
const startDate = ref<number>(new Date().getFullYear());
|
||||
const startDate2 = ref<Date>(new Date());
|
||||
const endDate = ref<number>(new Date().getFullYear());
|
||||
const endDate2 = ref<Date>(new Date());
|
||||
const startDate = ref<number | null>(new Date().getFullYear());
|
||||
const startDate2 = ref<Date | null>(new Date());
|
||||
const endDate = ref<number | null>(new Date().getFullYear());
|
||||
const endDate2 = ref<Date | null>(new Date());
|
||||
const minDate = ref<Date>();
|
||||
const myForm = ref<any>(); //form data input
|
||||
const edit = ref<boolean>(false); //เช็คการกดปุ่มแก้ไขใน dialog
|
||||
|
|
@ -451,12 +451,20 @@ const saveData = async () => {
|
|||
finishDate: convertDateToAPI(finishDate.value),
|
||||
startDate:
|
||||
isDate.value == "true"
|
||||
? convertDateToAPI(new Date(startDate2.value))
|
||||
: convertDateToAPI(new Date(`${startDate.value}-01-01`)),
|
||||
? startDate2.value
|
||||
? convertDateToAPI(new Date(startDate2.value))
|
||||
: null
|
||||
: startDate.value
|
||||
? convertDateToAPI(new Date(`${startDate.value}-01-01`))
|
||||
: null,
|
||||
endDate:
|
||||
isDate.value == "true"
|
||||
? convertDateToAPI(new Date(endDate2.value))
|
||||
: convertDateToAPI(new Date(`${endDate.value}-01-01`)),
|
||||
? endDate2.value
|
||||
? convertDateToAPI(new Date(endDate2.value))
|
||||
: null
|
||||
: endDate.value
|
||||
? convertDateToAPI(new Date(`${endDate.value}-01-01`))
|
||||
: null,
|
||||
isDate: isDate.value == "true",
|
||||
})
|
||||
.then(async () => {
|
||||
|
|
@ -499,12 +507,20 @@ const editData = async () => {
|
|||
finishDate: new Date(finishDate.value),
|
||||
startDate:
|
||||
isDate.value == "true"
|
||||
? convertDateToAPI(new Date(startDate2.value))
|
||||
: convertDateToAPI(new Date(`${startDate.value}-01-01`)),
|
||||
? startDate2.value
|
||||
? convertDateToAPI(new Date(startDate2.value))
|
||||
: null
|
||||
: startDate.value
|
||||
? convertDateToAPI(new Date(`${startDate.value}-01-01`))
|
||||
: null,
|
||||
endDate:
|
||||
isDate.value == "true"
|
||||
? convertDateToAPI(new Date(endDate2.value))
|
||||
: convertDateToAPI(new Date(`${endDate.value}-01-01`)),
|
||||
? endDate2.value
|
||||
? convertDateToAPI(new Date(endDate2.value))
|
||||
: null
|
||||
: endDate.value
|
||||
? convertDateToAPI(new Date(`${endDate.value}-01-01`))
|
||||
: null,
|
||||
isDate: isDate.value == "true",
|
||||
})
|
||||
.then(async () => {
|
||||
|
|
@ -594,10 +610,16 @@ const selectData = async (_props: DataProps) => {
|
|||
other.value = _props.row.other;
|
||||
fundName.value = _props.row.fundName;
|
||||
finishDate.value = _props.row.finishDate;
|
||||
startDate.value = new Date(_props.row.startDate).getFullYear();
|
||||
endDate.value = new Date(_props.row.endDate).getFullYear();
|
||||
startDate2.value = new Date(_props.row.startDate);
|
||||
endDate2.value = new Date(_props.row.endDate);
|
||||
startDate.value = _props.row.startDate
|
||||
? new Date(_props.row.startDate).getFullYear()
|
||||
: null;
|
||||
endDate.value = _props.row.endDate
|
||||
? new Date(_props.row.endDate).getFullYear()
|
||||
: null;
|
||||
startDate2.value = _props.row.startDate
|
||||
? new Date(_props.row.startDate)
|
||||
: null;
|
||||
endDate2.value = _props.row.endDate ? new Date(_props.row.endDate) : null;
|
||||
id.value = _props.row.id;
|
||||
isDate.value = _props.row.isDate;
|
||||
isEducation.value = _props.row.isEducation;
|
||||
|
|
@ -778,7 +800,7 @@ onMounted(async () => {
|
|||
@submit.prevent
|
||||
@validation-success="clickSave"
|
||||
>
|
||||
<DialogHeader tittle="ปรqweqwะวัติการศึกษา" :close="clickClose" />
|
||||
<DialogHeader tittle="ประวัติการศึกษา" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<div class="row col-12 items-top q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
|
|
@ -868,7 +890,7 @@ onMounted(async () => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
:borderless="!edit"
|
||||
:model-value="startDate + 543"
|
||||
:model-value="startDate ? startDate + 543 : ''"
|
||||
:rules="[
|
||||
(val:string) =>
|
||||
!!val || `${'กรุณาเลือกปีที่เริ่มต้นศึกษา'}`,
|
||||
|
|
@ -961,7 +983,7 @@ onMounted(async () => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
:borderless="!edit"
|
||||
:model-value="endDate + 543"
|
||||
:model-value="endDate ? endDate + 543 : ''"
|
||||
:rules="[
|
||||
(val:string) => !!val || `${'กรุณาเลือกปีที่จบการศึกษา'}`,
|
||||
]"
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ interface RequestItemsObject {
|
|||
other: string;
|
||||
fundName: string;
|
||||
finishDate: Date;
|
||||
startDate: number;
|
||||
endDate: number;
|
||||
startDate: number | null;
|
||||
endDate: number | null;
|
||||
createdFullName: string;
|
||||
createdAt: Date;
|
||||
isDate: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue