From f7c831520936e2aa6d63ccf627a0380bc96f0c0f Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 17 May 2024 13:16:13 +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=82=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=A1=E0=B8=B9=E0=B8=A5=E0=B8=84=E0=B8=A3=E0=B8=AD=E0=B8=9A?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=B1=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalInformation/04_FamilyNew.vue | 38 +++++++++++++------ .../04_registryNew/interface/index/family.ts | 30 +++++++++++++++ 2 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 src/modules/04_registryNew/interface/index/family.ts 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 6d8d6c5b1..ee306a972 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue @@ -2,12 +2,15 @@ import { reactive, ref, onMounted } from "vue"; import { useQuasar } from "quasar"; import { useRoute } from "vue-router"; - import http from "@/plugins/http"; import config from "@/app.config"; import type { QTableProps } from "quasar"; import type { DataOption } from "@/modules/04_registryNew/interface/index/Main"; +import type { + FormPerson, + FormChildren, +} from "@/modules/04_registryNew/interface/index/family"; import DialogHeader from "@/components/DialogHeader.vue"; @@ -109,7 +112,7 @@ const columns = ref([ const rows = ref([]); /** ข้อมูล*/ -const fatherData = reactive({ +const fatherData = reactive({ isLive: null, citizenId: "", prefix: "", @@ -117,7 +120,7 @@ const fatherData = reactive({ lastName: "", job: "", }); -const motherData = reactive({ +const motherData = reactive({ isLive: null, citizenId: "", prefix: "", @@ -125,7 +128,7 @@ const motherData = reactive({ lastName: "", job: "", }); -const coupleData = reactive({ +const coupleData = reactive({ isLive: null, citizenId: "", prefix: "", @@ -135,7 +138,7 @@ const coupleData = reactive({ lastNameOld: "", statusMarital: "", }); -const childData = ref([{}]); +const childData = ref([]); const modal = ref(false); const modalHistory = ref(false); @@ -150,7 +153,7 @@ const optionRelationshipMain = ref([]); const optionRelationship = ref([]); const fromData = reactive({ - isLive: 0, + isLive: 1, citizenId: "", prefix: "", firstName: "", @@ -300,7 +303,7 @@ function onSubmit(type: string) { function closeDialog() { modal.value = false; modalHistory.value = false; - fromData.isLive = 0; + fromData.isLive = 1; fromData.citizenId = ""; fromData.prefix = ""; fromData.firstName = ""; @@ -322,8 +325,10 @@ function onOpenDialogForm( if (type === "father") { titleForm.value = "บิดา"; + console.log(fatherData.isLive); - fromData.isLive = fatherData.isLive ? 1 : 0; + fromData.isLive = + fatherData.isLive === null ? 1 : fatherData.isLive ? 1 : 0; fromData.citizenId = fatherData.citizenId; fromData.prefix = fatherData.prefix; fromData.firstName = fatherData.firstName; @@ -332,7 +337,8 @@ function onOpenDialogForm( } else if (type === "mother") { titleForm.value = "มารดา"; - fromData.isLive = motherData.isLive ? 1 : 0; + fromData.isLive = + motherData.isLive === null ? 1 : motherData.isLive ? 1 : 0; fromData.citizenId = motherData.citizenId; fromData.prefix = motherData.prefix; fromData.firstName = motherData.firstName; @@ -340,11 +346,13 @@ function onOpenDialogForm( fromData.job = motherData.job; } else if (type === "couple") { titleForm.value = "คู่สมรส"; + fromData.isLive = 1; } else if (type === "children") { titleForm.value = "บุตร"; if (isStatusEdit) { childernId.value = data.id; - fromData.isLive = data.childrenLive ? 1 : 0; + fromData.isLive = + data.childrenLive === null ? 1 : data.childrenLive ? 1 : 0; fromData.citizenId = data.childrenCitizenId; fromData.prefix = data.childrenPrefix; fromData.firstName = data.childrenFirstName; @@ -593,7 +601,7 @@ onMounted(() => { > -
+
{ {{ coupleData.job ?? "-" }}
+
+
นามสกุลเดิม
+
+ {{ coupleData.lastNameOld }} +
+
สถานภาพการมีชีวิต @@ -775,7 +789,7 @@ onMounted(() => { diff --git a/src/modules/04_registryNew/interface/index/family.ts b/src/modules/04_registryNew/interface/index/family.ts new file mode 100644 index 000000000..c143e79a6 --- /dev/null +++ b/src/modules/04_registryNew/interface/index/family.ts @@ -0,0 +1,30 @@ +interface FormPerson { + isLive: null | number | boolean | string; + citizenId: string; + prefix: string; + firstName: string; + lastName: string; + job: string; + lastNameOld?: string; + statusMarital?: string; +} + +interface FormChildren { + id: string; + createdAt: string; + createdUserId: string; + lastUpdatedAt: string; + lastUpdateUserId: string; + createdFullName: string; + lastUpdateFullName: string; + childrenCareer: string; + childrenFirstName: string; + childrenLastName: string; + childrenPrefix: string; + childrenLive: boolean | number | null; + childrenCitizenId: string; + profileId: string | null; + profileEmployeeId: string | null; +} + +export type { FormPerson, FormChildren };