แก้ไขประวัติการศึกษา

This commit is contained in:
Warunee Tamkoo 2024-02-07 18:35:51 +07:00
parent d6545569d9
commit 8f81cb2c32
3 changed files with 25 additions and 24 deletions

View file

@ -349,13 +349,14 @@
dense
lazy-rules
:borderless="!edit"
:model-value="date2Thai(finishDate)"
:rules="[
(val) => !!val || `${'กรุณาเลือกวันที่สำเร็จการศึกษา'}`,
]"
:model-value="finishDate ? date2Thai(finishDate) : null"
hide-bottom-space
:label="`${'วันที่สำเร็จการศึกษา'}`"
>
<!-- :rules="[
(val) => !!val || `${'กรุณาเลือกวันที่สำเร็จการศึกษา'}`,
]" -->
<template v-slot:prepend>
<q-icon
name="event"
@ -420,11 +421,11 @@
:readonly="!edit"
:borderless="!edit"
v-model="field"
:rules="[(val) => !!val || `${'กรุณากรอกสาขาวิชา/ทาง'}`]"
hide-bottom-space
:label="`${'สาขาวิชา/ทาง'}`"
@update:modelValue="clickEditRow"
/>
<!-- :rules="[(val) => !!val || `${'กรุณากรอกสาขาวิชา/ทาง'}`]" -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
@ -449,11 +450,11 @@
:readonly="!edit"
:borderless="!edit"
v-model="gpa"
:rules="[(val) => !!val || `${'กรุณากรอกเกรดเฉลี่ย'}`]"
hide-bottom-space
:label="`${'เกรดเฉลี่ย'}`"
@update:modelValue="clickEditRow"
/>
<!-- :rules="[(val) => !!val || `${'กรุณากรอกเกรดเฉลี่ย'}`]" -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
@ -464,11 +465,11 @@
:readonly="!edit"
:borderless="!edit"
v-model="country"
:rules="[(val) => !!val || `${'กรุณากรอกประเทศ'}`]"
hide-bottom-space
:label="`${'ประเทศ'}`"
@update:modelValue="clickEditRow"
/>
<!-- :rules="[(val) => !!val || `${'กรุณากรอกประเทศ'}`]" -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
@ -507,12 +508,12 @@
:readonly="!edit"
:borderless="!edit"
v-model="durationYear"
:rules="[(val) => !!val || `${'กรุณากรอกระยะเวลาหลักสูตร'}`]"
hide-bottom-space
:label="`${'ระยะเวลาหลักสูตร'}`"
@update:modelValue="clickEditRow"
type="number"
/>
<!-- :rules="[(val) => !!val || `${'กรุณากรอกระยะเวลาหลักสูตร'}`]" -->
</div>
</div>
</q-card-section>
@ -635,7 +636,7 @@ const durationYear = ref<number>(0);
const other = ref<string>();
const fundName = ref<string>();
const isDate = ref<string | null>("true");
const finishDate = ref<Date>(new Date());
const finishDate = ref<Date | null>(null);
const startDate = ref<number>(new Date().getFullYear());
const startDate2 = ref<Date>(new Date());
const endDate = ref<number>(new Date().getFullYear());
@ -1125,19 +1126,19 @@ const fetchData = async () => {
id: e.id,
level: e.educationLevel,
levelId: e.educationLevelId,
positionPath: e.positionPath,
positionPath: e.positionPath ? e.positionPath : "-",
isEducation: e.isEducation,
institute: e.institute,
degree: e.degree,
field: e.field,
gpa: e.gpa,
country: e.country,
duration: e.duration,
institute: e.institute ? e.institute : "-",
degree: e.degree ? e.degree : "-",
field: e.field ? e.field : "-",
gpa: e.gpa ? e.gpa : "-",
country: e.country ? e.country : "-",
duration: e.duration ? e.duration : "-",
durationYear: e.durationYear,
other: e.other,
other: e.other ? e.other : "-",
fundName: e.fundName,
isDate: e.isDate == null ? null : e.isDate.toString(),
finishDate: new Date(e.finishDate),
finishDate: e.finishDate ? new Date(e.finishDate) : "-",
startDate: new Date(e.startDate).getFullYear(),
endDate: new Date(e.endDate).getFullYear(),
startDate2: new Date(e.startDate),
@ -1277,7 +1278,7 @@ const saveData = async () => {
other: other.value,
fundName: fundName.value,
isDate: isDate.value == "true" ? true : false,
finishDate: dateToISO(finishDate.value),
finishDate: finishDate.value ? dateToISO(finishDate.value) : null,
startDate:
isDate.value == "true"
? dateToISO(startDate2.value)
@ -1327,7 +1328,7 @@ const editData = async () => {
other: other.value,
fundName: fundName.value,
isDate: isDate.value == "true" ? true : false,
finishDate: dateToISO(finishDate.value),
finishDate: finishDate.value ? dateToISO(finishDate.value) : null,
startDate:
isDate.value == "true"
? dateToISO(startDate2.value)
@ -1453,7 +1454,7 @@ const addData = () => {
other.value = "";
fundName.value = "";
isDate.value = "true";
finishDate.value = new Date();
finishDate.value = null;
startDate.value = new Date().getFullYear();
endDate.value = new Date().getFullYear();
startDate2.value = new Date();
@ -1519,7 +1520,7 @@ const clickHistory = async (row: RequestItemsObject) => {
other: e.other,
fundName: e.fundName,
isDate: e.isDate,
finishDate: new Date(e.finishDate),
finishDate: e.finishDate ? new Date(e.finishDate) : null,
startDate: new Date(e.startDate).getFullYear(),
endDate: new Date(e.endDate).getFullYear(),
startDate2: new Date(e.startDate2),

View file

@ -20,7 +20,7 @@ interface RequestItemsObject {
other: string;
fundName: string;
isDate: string | null;
finishDate: Date;
finishDate: Date | null;
startDate: number;
endDate: number;
startDate2: Date;

View file

@ -15,7 +15,7 @@ interface ResponseObject {
other: string;
fundName: string;
isDate: string | null;
finishDate: Date;
finishDate: Date | null | string;
startDate: number;
endDate: number;
startDate2: Date;