ทะเบียนประวัติ => ประวัติการศึกษา clear form
This commit is contained in:
parent
545fce692f
commit
5d25d9be8d
5 changed files with 124 additions and 78 deletions
|
|
@ -175,5 +175,5 @@ export default {
|
|||
|
||||
//ข้อมูลครอบครับ
|
||||
profileFamily: (empType: string, type: string) =>
|
||||
`${registryNew}${empType}/${type}`,
|
||||
`${registryNew}${empType}/family/${type}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ function getData() {
|
|||
formMain.containDate = data.dateAppoint;
|
||||
formMain.workDate = data.dateStart;
|
||||
formMain.reasonSameDate = data.reasonSameDate;
|
||||
formMain.retireDate = data.dateRetire;
|
||||
formMain.retireDate = data.dateLeave;
|
||||
formMain.dateRetireLaw = data.dateRetireLaw;
|
||||
formMain.ageAll = data.govAge;
|
||||
formMain.absent = data.govAgeAbsent;
|
||||
|
|
@ -596,8 +596,8 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-7">
|
||||
<span>{{
|
||||
formMain.dateRetire
|
||||
? date2Thai(formMain.dateRetire as Date)
|
||||
formMain.retireDate
|
||||
? date2Thai(formMain.retireDate as Date)
|
||||
: "-"
|
||||
}}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
const rows = ref<any[]>([]);
|
||||
|
||||
const childData = ref<any[]>([{}]);
|
||||
const spouseData = ref<any[]>([{}]);
|
||||
const coupleData = ref<any[]>([{}]);
|
||||
const fatherData = ref({
|
||||
isLive: 1,
|
||||
citizenId: "1231231231231",
|
||||
|
|
@ -143,6 +143,48 @@ const fromData = reactive({
|
|||
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() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -159,12 +201,10 @@ function fetchDataChildren() {
|
|||
}
|
||||
|
||||
function onSubmit(type: string) {
|
||||
console.log(type);
|
||||
|
||||
dialogConfirm($q, () => {
|
||||
if (type === "father") {
|
||||
} else if (type === "mom") {
|
||||
} else if (type === "spouse") {
|
||||
} else if (type === "couple") {
|
||||
} else if (type === "child") {
|
||||
submitChildren();
|
||||
}
|
||||
|
|
@ -214,7 +254,7 @@ function onOpenDialogForm(
|
|||
fromData.lastName = momData.value.lastName;
|
||||
fromData.job = momData.value.job;
|
||||
}
|
||||
} else if (type === "spouse") {
|
||||
} else if (type === "couple") {
|
||||
titleForm.value = "คู่สมรส";
|
||||
} else if (type === "child") {
|
||||
titleForm.value = "บุตร";
|
||||
|
|
@ -231,35 +271,35 @@ function onOpenDialogHistory(type: string) {
|
|||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
function fetchData() {
|
||||
const data = [
|
||||
{
|
||||
isLive: 0,
|
||||
citizenId: "123456789101",
|
||||
prefix: "นาง",
|
||||
firstName: "บุษดี",
|
||||
lastName: "มาดีหกหฟก",
|
||||
job: "12",
|
||||
lastNameOld: "",
|
||||
statusMarital: "แต่งงาน",
|
||||
},
|
||||
];
|
||||
const data2 = [
|
||||
{
|
||||
isLive: 1,
|
||||
citizenId: "123456789101",
|
||||
prefix: "นาง",
|
||||
firstName: "บุษดี",
|
||||
lastName: "มาดีหกหฟก",
|
||||
job: "12",
|
||||
lastNameOld: "",
|
||||
statusMarital: "แต่งงาน",
|
||||
},
|
||||
];
|
||||
// function fetchData() {
|
||||
// const data = [
|
||||
// {
|
||||
// isLive: 0,
|
||||
// citizenId: "123456789101",
|
||||
// prefix: "นาง",
|
||||
// firstName: "บุษดี",
|
||||
// lastName: "มาดีหกหฟก",
|
||||
// job: "12",
|
||||
// lastNameOld: "",
|
||||
// statusMarital: "แต่งงาน",
|
||||
// },
|
||||
// ];
|
||||
// const data2 = [
|
||||
// {
|
||||
// isLive: 1,
|
||||
// citizenId: "123456789101",
|
||||
// prefix: "นาง",
|
||||
// firstName: "บุษดี",
|
||||
// lastName: "มาดีหกหฟก",
|
||||
// job: "12",
|
||||
// lastNameOld: "",
|
||||
// statusMarital: "แต่งงาน",
|
||||
// },
|
||||
// ];
|
||||
|
||||
spouseData.value = data;
|
||||
childData.value = data2;
|
||||
}
|
||||
// coupleData.value = data;
|
||||
// childData.value = data2;
|
||||
// }
|
||||
|
||||
function fetchDataRelationship() {
|
||||
showLoader();
|
||||
|
|
@ -323,7 +363,9 @@ function submitChildren() {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
fetchDataFather();
|
||||
fetchDataMother();
|
||||
fetchDataCouple();
|
||||
fetchDataChildren();
|
||||
fetchDataRelationship();
|
||||
});
|
||||
|
|
@ -482,7 +524,7 @@ onMounted(() => {
|
|||
color="primary"
|
||||
icon="add"
|
||||
size="14px"
|
||||
@click="onOpenDialogForm('spouse')"
|
||||
@click="onOpenDialogForm('couple')"
|
||||
>
|
||||
<q-tooltip>เพิ่มคู่สมรส</q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -496,14 +538,14 @@ onMounted(() => {
|
|||
color="info"
|
||||
icon="mdi-history"
|
||||
size="14px"
|
||||
@click="onOpenDialogHistory('spouse')"
|
||||
@click="onOpenDialogHistory('couple')"
|
||||
>
|
||||
<q-tooltip>ประวัติการแก้ไขข้อมูลครอบครัว</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</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">
|
||||
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center">
|
||||
<div class="text-weight-medium q-pr-md">
|
||||
|
|
@ -670,7 +712,7 @@ onMounted(() => {
|
|||
</div>
|
||||
</div> -->
|
||||
<div class="q-col-gutter-sm">
|
||||
<div class="row col" v-if="typeForm === 'spouse'">
|
||||
<div class="row col" v-if="typeForm === 'couple'">
|
||||
<q-select
|
||||
outlined
|
||||
bg-color="white"
|
||||
|
|
@ -704,7 +746,7 @@ onMounted(() => {
|
|||
:label="`${'เลขประจำตัวประชาชน'}`"
|
||||
maxlength="13"
|
||||
:rules="
|
||||
typeForm !== 'spouse'
|
||||
typeForm !== 'couple'
|
||||
? [
|
||||
(val) =>
|
||||
val.length === 13 || 'กรุณากรอกเลขบัตรประชาชน',
|
||||
|
|
@ -724,7 +766,7 @@ onMounted(() => {
|
|||
dense
|
||||
class="inputgreen"
|
||||
:rules="
|
||||
typeForm !== 'spouse'
|
||||
typeForm !== 'couple'
|
||||
? [(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
|
||||
: []
|
||||
"
|
||||
|
|
@ -751,7 +793,7 @@ onMounted(() => {
|
|||
lazy-rules
|
||||
v-model="fromData.firstName"
|
||||
:rules="
|
||||
typeForm !== 'spouse'
|
||||
typeForm !== 'couple'
|
||||
? [(val) => !!val || 'กรุณากรอกชื่อ']
|
||||
: []
|
||||
"
|
||||
|
|
@ -768,14 +810,14 @@ onMounted(() => {
|
|||
lazy-rules
|
||||
v-model="fromData.lastName"
|
||||
:rules="
|
||||
typeForm !== 'spouse'
|
||||
typeForm !== 'couple'
|
||||
? [(val) => !!val || 'กรุณากรอกนามสกุล']
|
||||
: []
|
||||
"
|
||||
label="นามสกุล"
|
||||
/>
|
||||
</div>
|
||||
<div class="col" v-if="typeForm === 'spouse'">
|
||||
<div class="col" v-if="typeForm === 'couple'">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ const educationData = reactive<RequestItemsObject>({
|
|||
institute: "",
|
||||
startYear: new Date().getFullYear(),
|
||||
endYear: new Date().getFullYear(),
|
||||
finishDate: new Date(),
|
||||
finishDate: null,
|
||||
startDate: new Date(),
|
||||
endDate: new Date(),
|
||||
isEducation: null,
|
||||
|
|
@ -532,7 +532,7 @@ function clearForm() {
|
|||
educationData.institute = "";
|
||||
educationData.startYear = new Date().getFullYear();
|
||||
educationData.endYear = new Date().getFullYear();
|
||||
educationData.finishDate = new Date();
|
||||
educationData.finishDate = null;
|
||||
educationData.startDate = new Date();
|
||||
educationData.endDate = new Date();
|
||||
educationData.isEducation = null;
|
||||
|
|
@ -1225,11 +1225,8 @@ onMounted(async () => {
|
|||
dense
|
||||
class="inputgreen"
|
||||
:model-value="date2Thai(educationData.finishDate)"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่สำเร็จการศึกษา'}`,
|
||||
]"
|
||||
hide-bottom-space
|
||||
:label="`${'วันที่สำเร็จการศึกษา'}`"
|
||||
:label="`${'วันที่สำเร็จการศึกษาs'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -1239,6 +1236,13 @@ onMounted(async () => {
|
|||
>
|
||||
</q-icon>
|
||||
</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>
|
||||
</template>
|
||||
</datepicker>
|
||||
|
|
@ -1262,6 +1266,7 @@ onMounted(async () => {
|
|||
) "
|
||||
label="เป็นวุฒิการศึกษาในตำแหน่ง"
|
||||
hide-bottom-space
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,26 @@
|
|||
interface RequestItemsObject {
|
||||
profileId: string
|
||||
educationLevel: string;
|
||||
institute: string;
|
||||
startYear: number;
|
||||
endYear: number;
|
||||
finishDate: Date;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
isEducation: boolean | null;
|
||||
degree: string;
|
||||
field: string;
|
||||
fundName: string;
|
||||
gpa: string;
|
||||
country: string;
|
||||
other: string;
|
||||
duration: string;
|
||||
durationYear: number | null;
|
||||
note: string;
|
||||
educationLevelId: string,
|
||||
positionPath: string,
|
||||
positionPathId: string,
|
||||
isDate: boolean
|
||||
}
|
||||
|
||||
export type { RequestItemsObject };
|
||||
profileId: string;
|
||||
educationLevel: string;
|
||||
institute: string;
|
||||
startYear: number;
|
||||
endYear: number;
|
||||
finishDate: Date | null;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
isEducation: boolean | null;
|
||||
degree: string;
|
||||
field: string;
|
||||
fundName: string;
|
||||
gpa: string;
|
||||
country: string;
|
||||
other: string;
|
||||
duration: string;
|
||||
durationYear: number | null;
|
||||
note: string;
|
||||
educationLevelId: string;
|
||||
positionPath: string;
|
||||
positionPathId: string;
|
||||
isDate: boolean;
|
||||
}
|
||||
|
||||
export type { RequestItemsObject };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue