Set Date เป็น null ในหน้าเพิ่มข้อมูลลูกจ้าง

This commit is contained in:
AnandaTon 2023-07-28 17:29:47 +07:00
parent 51c4c777e5
commit de0c00baca
3 changed files with 1140 additions and 4 deletions

View file

@ -14,7 +14,7 @@ interface Information {
prefixId: string | null;
firstname: string | null;
lastname: string | null;
birthDate: Date;
birthDate: Date | null;
genderId: string | null;
bloodId: string | null;
nationality: string | null;
@ -135,7 +135,7 @@ const defaultInformation: Information = {
prefixId: null,
firstname: null,
lastname: null,
birthDate: new Date(),
birthDate: null,
genderId: null,
bloodId: null,
nationality: null,

File diff suppressed because it is too large Load diff

View file

@ -117,7 +117,11 @@
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="date2Thai(informaData.birthDate)"
:model-value="
informaData.birthDate == null
? null
: date2Thai(informaData.birthDate)
"
:rules="[(val:string) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
:label="`${'วัน/เดือน/ปี เกิด'}`"
>
@ -692,7 +696,7 @@ const defaultAdd = () => {
prefixId: null,
firstname: null,
lastname: null,
birthDate: new Date(),
birthDate: null,
genderId: null,
bloodId: null,
nationality: null,