From 5d25d9be8df916c00399dc93ab02604670837c1d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 15 May 2024 17:54:35 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=20=3D>=20=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=A8=E0=B8=B6=E0=B8=81=E0=B8=A9=E0=B8=B2=20clear=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/registry/api.registry.ts | 2 +- .../detail/GovernmentInformation/01_Info.vue | 6 +- .../PersonalInformation/04_FamilyNew.vue | 128 ++++++++++++------ .../PersonalInformation/05_Education.vue | 17 ++- .../interface/request/Education.ts | 49 ++++--- 5 files changed, 124 insertions(+), 78 deletions(-) diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 3edee7305..d353d710a 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -175,5 +175,5 @@ export default { //ข้อมูลครอบครับ profileFamily: (empType: string, type: string) => - `${registryNew}${empType}/${type}`, + `${registryNew}${empType}/family/${type}`, }; diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue index fa8d027f4..78dedc239 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue @@ -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(() => {
{{ - formMain.dateRetire - ? date2Thai(formMain.dateRetire as Date) + formMain.retireDate + ? date2Thai(formMain.retireDate as Date) : "-" }}
diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue index e74bbdee3..39fa919f2 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue @@ -103,7 +103,7 @@ const columns = ref([ const rows = ref([]); const childData = ref([{}]); -const spouseData = ref([{}]); +const coupleData = ref([{}]); 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')" > เพิ่มคู่สมรส @@ -496,14 +538,14 @@ onMounted(() => { color="info" icon="mdi-history" size="14px" - @click="onOpenDialogHistory('spouse')" + @click="onOpenDialogHistory('couple')" > ประวัติการแก้ไขข้อมูลครอบครัว -
+
@@ -670,7 +712,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="นามสกุล" />
-
+
({ 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'}`" > + @@ -1262,6 +1266,7 @@ onMounted(async () => { ) " label="เป็นวุฒิการศึกษาในตำแหน่ง" hide-bottom-space + clearable />
diff --git a/src/modules/04_registryNew/interface/request/Education.ts b/src/modules/04_registryNew/interface/request/Education.ts index 624ac34ba..22f62c362 100644 --- a/src/modules/04_registryNew/interface/request/Education.ts +++ b/src/modules/04_registryNew/interface/request/Education.ts @@ -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 };