ทะเบียนประวัติ => ประวัติการศึกษา clear form

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-15 17:54:35 +07:00
parent 545fce692f
commit 5d25d9be8d
5 changed files with 124 additions and 78 deletions

View file

@ -175,5 +175,5 @@ export default {
//ข้อมูลครอบครับ //ข้อมูลครอบครับ
profileFamily: (empType: string, type: string) => profileFamily: (empType: string, type: string) =>
`${registryNew}${empType}/${type}`, `${registryNew}${empType}/family/${type}`,
}; };

View file

@ -406,7 +406,7 @@ function getData() {
formMain.containDate = data.dateAppoint; formMain.containDate = data.dateAppoint;
formMain.workDate = data.dateStart; formMain.workDate = data.dateStart;
formMain.reasonSameDate = data.reasonSameDate; formMain.reasonSameDate = data.reasonSameDate;
formMain.retireDate = data.dateRetire; formMain.retireDate = data.dateLeave;
formMain.dateRetireLaw = data.dateRetireLaw; formMain.dateRetireLaw = data.dateRetireLaw;
formMain.ageAll = data.govAge; formMain.ageAll = data.govAge;
formMain.absent = data.govAgeAbsent; formMain.absent = data.govAgeAbsent;
@ -596,8 +596,8 @@ onMounted(() => {
</div> </div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
<span>{{ <span>{{
formMain.dateRetire formMain.retireDate
? date2Thai(formMain.dateRetire as Date) ? date2Thai(formMain.retireDate as Date)
: "-" : "-"
}}</span> }}</span>
</div> </div>

View file

@ -103,7 +103,7 @@ const columns = ref<QTableProps["columns"]>([
const rows = ref<any[]>([]); const rows = ref<any[]>([]);
const childData = ref<any[]>([{}]); const childData = ref<any[]>([{}]);
const spouseData = ref<any[]>([{}]); const coupleData = ref<any[]>([{}]);
const fatherData = ref({ const fatherData = ref({
isLive: 1, isLive: 1,
citizenId: "1231231231231", citizenId: "1231231231231",
@ -143,6 +143,48 @@ const fromData = reactive({
statusMarital: "", statusMarital: "",
}); });
function fetchDataFather() {
showLoader();
http
.get(config.API.profileFamily(empType.value, "father"))
.then((res) => {
console.log(res);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function fetchDataMother() {
showLoader();
http
.get(config.API.profileFamily(empType.value, "mother "))
.then((res) => {
console.log(res);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function fetchDataCouple() {
showLoader();
http
.get(config.API.profileFamily(empType.value, "couple"))
.then((res) => {
console.log(res);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function fetchDataChildren() { function fetchDataChildren() {
showLoader(); showLoader();
http http
@ -159,12 +201,10 @@ function fetchDataChildren() {
} }
function onSubmit(type: string) { function onSubmit(type: string) {
console.log(type);
dialogConfirm($q, () => { dialogConfirm($q, () => {
if (type === "father") { if (type === "father") {
} else if (type === "mom") { } else if (type === "mom") {
} else if (type === "spouse") { } else if (type === "couple") {
} else if (type === "child") { } else if (type === "child") {
submitChildren(); submitChildren();
} }
@ -214,7 +254,7 @@ function onOpenDialogForm(
fromData.lastName = momData.value.lastName; fromData.lastName = momData.value.lastName;
fromData.job = momData.value.job; fromData.job = momData.value.job;
} }
} else if (type === "spouse") { } else if (type === "couple") {
titleForm.value = "คู่สมรส"; titleForm.value = "คู่สมรส";
} else if (type === "child") { } else if (type === "child") {
titleForm.value = "บุตร"; titleForm.value = "บุตร";
@ -231,35 +271,35 @@ function onOpenDialogHistory(type: string) {
modalHistory.value = true; modalHistory.value = true;
} }
function fetchData() { // function fetchData() {
const data = [ // const data = [
{ // {
isLive: 0, // isLive: 0,
citizenId: "123456789101", // citizenId: "123456789101",
prefix: "นาง", // prefix: "",
firstName: "บุษดี", // firstName: "",
lastName: "มาดีหกหฟก", // lastName: "",
job: "12", // job: "12",
lastNameOld: "", // lastNameOld: "",
statusMarital: "แต่งงาน", // statusMarital: "",
}, // },
]; // ];
const data2 = [ // const data2 = [
{ // {
isLive: 1, // isLive: 1,
citizenId: "123456789101", // citizenId: "123456789101",
prefix: "นาง", // prefix: "",
firstName: "บุษดี", // firstName: "",
lastName: "มาดีหกหฟก", // lastName: "",
job: "12", // job: "12",
lastNameOld: "", // lastNameOld: "",
statusMarital: "แต่งงาน", // statusMarital: "",
}, // },
]; // ];
spouseData.value = data; // coupleData.value = data;
childData.value = data2; // childData.value = data2;
} // }
function fetchDataRelationship() { function fetchDataRelationship() {
showLoader(); showLoader();
@ -323,7 +363,9 @@ function submitChildren() {
} }
onMounted(() => { onMounted(() => {
fetchData(); fetchDataFather();
fetchDataMother();
fetchDataCouple();
fetchDataChildren(); fetchDataChildren();
fetchDataRelationship(); fetchDataRelationship();
}); });
@ -482,7 +524,7 @@ onMounted(() => {
color="primary" color="primary"
icon="add" icon="add"
size="14px" size="14px"
@click="onOpenDialogForm('spouse')" @click="onOpenDialogForm('couple')"
> >
<q-tooltip>เพมคสมรส</q-tooltip></q-btn <q-tooltip>เพมคสมรส</q-tooltip></q-btn
> >
@ -496,14 +538,14 @@ onMounted(() => {
color="info" color="info"
icon="mdi-history" icon="mdi-history"
size="14px" size="14px"
@click="onOpenDialogHistory('spouse')" @click="onOpenDialogHistory('couple')"
> >
<q-tooltip>ประวการแกไขขอมลครอบคร</q-tooltip></q-btn <q-tooltip>ประวการแกไขขอมลครอบคร</q-tooltip></q-btn
> >
</div> </div>
</q-toolbar> </q-toolbar>
<div v-for="(item, index) in spouseData" :key="index"> <div v-for="(item, index) in coupleData" :key="index">
<q-card bordered class="bg-grey-1 q-pb-md"> <q-card bordered class="bg-grey-1 q-pb-md">
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center"> <div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center">
<div class="text-weight-medium q-pr-md"> <div class="text-weight-medium q-pr-md">
@ -670,7 +712,7 @@ onMounted(() => {
</div> </div>
</div> --> </div> -->
<div class="q-col-gutter-sm"> <div class="q-col-gutter-sm">
<div class="row col" v-if="typeForm === 'spouse'"> <div class="row col" v-if="typeForm === 'couple'">
<q-select <q-select
outlined outlined
bg-color="white" bg-color="white"
@ -704,7 +746,7 @@ onMounted(() => {
:label="`${'เลขประจำตัวประชาชน'}`" :label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13" maxlength="13"
:rules=" :rules="
typeForm !== 'spouse' typeForm !== 'couple'
? [ ? [
(val) => (val) =>
val.length === 13 || 'กรุณากรอกเลขบัตรประชาชน', val.length === 13 || 'กรุณากรอกเลขบัตรประชาชน',
@ -724,7 +766,7 @@ onMounted(() => {
dense dense
class="inputgreen" class="inputgreen"
:rules=" :rules="
typeForm !== 'spouse' typeForm !== 'couple'
? [(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ'] ? [(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
: [] : []
" "
@ -751,7 +793,7 @@ onMounted(() => {
lazy-rules lazy-rules
v-model="fromData.firstName" v-model="fromData.firstName"
:rules=" :rules="
typeForm !== 'spouse' typeForm !== 'couple'
? [(val) => !!val || 'กรุณากรอกชื่อ'] ? [(val) => !!val || 'กรุณากรอกชื่อ']
: [] : []
" "
@ -768,14 +810,14 @@ onMounted(() => {
lazy-rules lazy-rules
v-model="fromData.lastName" v-model="fromData.lastName"
:rules=" :rules="
typeForm !== 'spouse' typeForm !== 'couple'
? [(val) => !!val || 'กรุณากรอกนามสกุล'] ? [(val) => !!val || 'กรุณากรอกนามสกุล']
: [] : []
" "
label="นามสกุล" label="นามสกุล"
/> />
</div> </div>
<div class="col" v-if="typeForm === 'spouse'"> <div class="col" v-if="typeForm === 'couple'">
<q-input <q-input
outlined outlined
dense dense

View file

@ -425,7 +425,7 @@ const educationData = reactive<RequestItemsObject>({
institute: "", institute: "",
startYear: new Date().getFullYear(), startYear: new Date().getFullYear(),
endYear: new Date().getFullYear(), endYear: new Date().getFullYear(),
finishDate: new Date(), finishDate: null,
startDate: new Date(), startDate: new Date(),
endDate: new Date(), endDate: new Date(),
isEducation: null, isEducation: null,
@ -532,7 +532,7 @@ function clearForm() {
educationData.institute = ""; educationData.institute = "";
educationData.startYear = new Date().getFullYear(); educationData.startYear = new Date().getFullYear();
educationData.endYear = new Date().getFullYear(); educationData.endYear = new Date().getFullYear();
educationData.finishDate = new Date(); educationData.finishDate = null;
educationData.startDate = new Date(); educationData.startDate = new Date();
educationData.endDate = new Date(); educationData.endDate = new Date();
educationData.isEducation = null; educationData.isEducation = null;
@ -1225,11 +1225,8 @@ onMounted(async () => {
dense dense
class="inputgreen" class="inputgreen"
:model-value="date2Thai(educationData.finishDate)" :model-value="date2Thai(educationData.finishDate)"
:rules="[
(val) => !!val || `${'กรุณาเลือกวันที่สำเร็จการศึกษา'}`,
]"
hide-bottom-space hide-bottom-space
:label="`${'วันที่สำเร็จการศึกษา'}`" :label="`${'วันที่สำเร็จการศึกษาs'}`"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -1239,6 +1236,13 @@ onMounted(async () => {
> >
</q-icon> </q-icon>
</template> </template>
<template v-if="educationData.finishDate" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="educationData.finishDate = null"
class="cursor-pointer"
/>
</template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
@ -1262,6 +1266,7 @@ onMounted(async () => {
) " ) "
label="เป็นวุฒิการศึกษาในตำแหน่ง" label="เป็นวุฒิการศึกษาในตำแหน่ง"
hide-bottom-space hide-bottom-space
clearable
/> />
</div> </div>

View file

@ -1,27 +1,26 @@
interface RequestItemsObject { interface RequestItemsObject {
profileId: string profileId: string;
educationLevel: string; educationLevel: string;
institute: string; institute: string;
startYear: number; startYear: number;
endYear: number; endYear: number;
finishDate: Date; finishDate: Date | null;
startDate: Date; startDate: Date;
endDate: Date; endDate: Date;
isEducation: boolean | null; isEducation: boolean | null;
degree: string; degree: string;
field: string; field: string;
fundName: string; fundName: string;
gpa: string; gpa: string;
country: string; country: string;
other: string; other: string;
duration: string; duration: string;
durationYear: number | null; durationYear: number | null;
note: string; note: string;
educationLevelId: string, educationLevelId: string;
positionPath: string, positionPath: string;
positionPathId: string, positionPathId: string;
isDate: boolean isDate: boolean;
} }
export type { RequestItemsObject };
export type { RequestItemsObject };