From 61bd4cf2f4c2f75f651810834483cffbe4982663 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 9 Feb 2024 15:49:53 +0700 Subject: [PATCH] no message --- .../components/Information/Address.vue | 24 +++---- .../components/Information/Family.vue | 65 +++++++++++++------ .../components/Information/Government.vue | 45 +++++++------ .../interface/response/Government.ts | 23 ++++++- 4 files changed, 102 insertions(+), 55 deletions(-) diff --git a/src/modules/04_registry/components/Information/Address.vue b/src/modules/04_registry/components/Information/Address.vue index 4ac6c6611..50f1cbfb1 100644 --- a/src/modules/04_registry/components/Information/Address.vue +++ b/src/modules/04_registry/components/Information/Address.vue @@ -594,19 +594,19 @@ const clickHistory = async () => { rowsHistory.value = []; data.map((e: RequestItemsHistoryObject) => { rowsHistory.value.push({ - currentAddress: e.currentAddress, - currentDistrict: e.currentDistrict, - currentProvince: e.currentProvince, - currentSubDistrict: e.currentSubDistrict, - currentZipCode: e.currentZipCode, + currentAddress: e.currentAddress ?? "-", + currentDistrict: e.currentDistrict ?? "-", + currentProvince: e.currentProvince ?? "-", + currentSubDistrict: e.currentSubDistrict ?? "-", + currentZipCode: e.currentZipCode ?? "-", registrationSame: e.registrationSame, - registrationAddress: e.registrationAddress, - registrationDistrict: e.registrationDistrict, - registrationProvince: e.registrationProvince, - registrationSubDistrict: e.registrationSubDistrict, - registrationZipCode: e.registrationZipCode, - createdFullName: e.createdFullName, - createdAt: new Date(e.createdAt), + registrationAddress: e.registrationAddress ?? "-", + registrationDistrict: e.registrationDistrict ?? "-", + registrationProvince: e.registrationProvince ?? "-", + registrationSubDistrict: e.registrationSubDistrict ?? "-", + registrationZipCode: e.registrationZipCode ?? "-", + createdFullName: e.createdFullName ?? "-", + createdAt: new Date(e.createdAt) ?? "-", }); }); }) diff --git a/src/modules/04_registry/components/Information/Family.vue b/src/modules/04_registry/components/Information/Family.vue index 994cc37a0..6e2edd344 100644 --- a/src/modules/04_registry/components/Information/Family.vue +++ b/src/modules/04_registry/components/Information/Family.vue @@ -467,7 +467,8 @@ />
-
{ }); }; +const childrenPrefixIdRef = ref(); +const childrenFirstNameRef = ref(); +const childrenLastNameRef = ref(); + const addChildren = async () => { familyData.value.childrens.push({ id: `${familyData.value.childrens.length + 1}`, @@ -1617,6 +1624,22 @@ const addChildren = async () => { familyData.value.childrens.sort( (a: childrenFamily, b: childrenFamily) => Number(b.id) - Number(a.id) ); + + if (childrenPrefixIdRef.value) { + childrenPrefixIdRef.value.forEach((e: any) => { + e.resetValidation(); + }); + } + if (childrenFirstNameRef.value) { + childrenFirstNameRef.value.forEach((e: any) => { + e.resetValidation(); + }); + } + if (childrenLastNameRef.value) { + childrenLastNameRef.value.forEach((e: any) => { + e.resetValidation(); + }); + } }; const deleteChildren = (items: childrenFamily) => { @@ -1637,28 +1660,28 @@ const fetchHistory = async () => { data.map((row: ResponseObject) => { const arrayData: ResponseHistory = { couple: row.couple ? "1" : "0", - couplePrefixId: row.couplePrefixId, - coupleFirstName: row.coupleFirstName, - coupleLastName: row.coupleLastName, - coupleLastNameOld: row.coupleLastNameOld, - coupleCareer: row.coupleCareer, + couplePrefixId: row.couplePrefixId ?? "-", + coupleFirstName: row.coupleFirstName ?? "-", + coupleLastName: row.coupleLastName ?? "-", + coupleLastNameOld: row.coupleLastNameOld ?? "-", + coupleCareer: row.coupleCareer ?? "-", coupleLive: row.coupleLive ? "1" : "0", - coupleCitizenId: row.coupleCitizenId, - fatherPrefixId: row.fatherPrefixId, - fatherFirstName: row.fatherFirstName, - fatherLastName: row.fatherLastName, - fatherCareer: row.fatherCareer, + coupleCitizenId: row.coupleCitizenId ?? "-", + fatherPrefixId: row.fatherPrefixId ?? "-", + fatherFirstName: row.fatherFirstName ?? "-", + fatherLastName: row.fatherLastName ?? "-", + fatherCareer: row.fatherCareer ?? "-", fatherLive: row.fatherLive ? "1" : "0", - fatherCitizenId: row.fatherCitizenId, - motherPrefixId: row.motherPrefixId, - motherFirstName: row.motherFirstName, - motherLastName: row.motherLastName, - motherCareer: row.motherCareer, + fatherCitizenId: row.fatherCitizenId ?? "-", + motherPrefixId: row.motherPrefixId ?? "-", + motherFirstName: row.motherFirstName ?? "-", + motherLastName: row.motherLastName ?? "-", + motherCareer: row.motherCareer ?? "-", motherLive: row.motherLive ? "1" : "0", - motherCitizenId: row.motherCitizenId, - childrens: row.childrens, - createdFullName: row.createdFullName, - createdAt: new Date(row.createdAt), + motherCitizenId: row.motherCitizenId ?? "-", + childrens: row.childrens ?? "-", + createdFullName: row.createdFullName ?? "-", + createdAt: new Date(row.createdAt) ?? "-", }; familyDataHistory.value.push(arrayData); }); @@ -1752,7 +1775,7 @@ const fetchData = async () => { }) .finally(async () => { // hideLoader(); - profileStore.isLoad++ + profileStore.isLoad++; }); } }; diff --git a/src/modules/04_registry/components/Information/Government.vue b/src/modules/04_registry/components/Information/Government.vue index 3d9b7f808..ec6d54d8b 100644 --- a/src/modules/04_registry/components/Information/Government.vue +++ b/src/modules/04_registry/components/Information/Government.vue @@ -325,7 +325,7 @@ " class="table_ellipsis" > - {{ date2Thai(col.value) }} + {{ col.value }}
{{ col.value }} @@ -347,7 +347,10 @@ import http from "@/plugins/http"; import config from "@/app.config"; import HistoryTable from "@/components/TableHistory.vue"; import type { RequestItemsHistoryObject } from "@/modules/04_registry/interface/request/Government"; -import type { ResponseObject } from "@/modules/04_registry/interface/response/Government"; +import type { + ResponseObject, + RowHistory, +} from "@/modules/04_registry/interface/response/Government"; import { useRoute } from "vue-router"; import { useProfileDataStore } from "@/modules/04_registry/store"; import { storeToRefs } from "pinia"; @@ -380,7 +383,7 @@ const { birthDate, retireText } = storeToRefs(profileStore); const edit = ref(false); const govermentData = ref(defaultGoverment); const myform = ref(); -const rowsHistory = ref([]); //select data history +const rowsHistory = ref([]); //select data history const tittleHistory = ref("ประวัติแก้ไขข้อมูลราชการ"); // const filterHistory = ref(""); //search data table history const modalHistory = ref(false); //modal ประวัติการแก้ไขข้อมูล @@ -722,24 +725,24 @@ const clickHistory = async () => { rowsHistory.value = []; data.map((e: RequestItemsHistoryObject) => { rowsHistory.value.push({ - oc: e.oc, - position: e.position, - positionPathSide: e.positionPathSide, - posNo: e.posNo, - positionLine: e.positionLine, - positionType: e.positionType, - positionLevel: e.positionLevel, - positionExecutive: e.positionExecutive, - positionExecutiveSide: e.positionExecutiveSide, - dateAppoint: new Date(e.dateAppoint), - dateStart: new Date(e.dateStart), - retireDate: e.retireDate, - govAge: e.govAge, - govAgeAbsent: e.govAgeAbsent, - govAgePlus: e.govAgePlus, - reasonSameDate: e.reasonSameDate, - createdFullName: e.createdFullName, - createdAt: new Date(e.createdAt), + oc: e.oc ?? "-", + position: e.position ?? "-", + positionPathSide: e.positionPathSide ?? "-", + posNo: e.posNo ?? "-", + positionLine: e.positionLine ?? "-", + positionType: e.positionType ?? "-", + positionLevel: e.positionLevel ?? "-", + positionExecutive: e.positionExecutive ?? "-", + positionExecutiveSide: e.positionExecutiveSide ?? "-", + dateAppoint: date2Thai(e.dateAppoint) ?? "-", + dateStart: date2Thai(e.dateStart) ?? "-", + retireDate: e.retireDate ?? "-", + govAge: e.govAge ?? "-", + govAgeAbsent: e.govAgeAbsent ?? "-", + govAgePlus: e.govAgePlus ?? "-", + reasonSameDate: e.reasonSameDate ?? "-", + createdFullName: e.createdFullName ?? "-", + createdAt: date2Thai(e.createdAt) ?? "-", }); }); }) diff --git a/src/modules/04_registry/interface/response/Government.ts b/src/modules/04_registry/interface/response/Government.ts index 69a4ef3aa..b4082fd31 100644 --- a/src/modules/04_registry/interface/response/Government.ts +++ b/src/modules/04_registry/interface/response/Government.ts @@ -20,4 +20,25 @@ interface ResponseObject { reasonSameDate: string | null; } -export type { ResponseObject }; +interface RowHistory { + oc: string | null; + position: string | null; + positionPathSide: string | null; + posNo: string | null; + positionLine: string | null; + positionType: string | null; + positionLevel: string | null; + positionExecutive: string | null; + positionExecutiveSide: string | null; + dateAppoint: string | null; + dateStart: string | null; + retireDate: string | null; + govAge: string | null; + govAgeAbsent: string | null; + govAgePlus: string | null; + reasonSameDate: string | null; + createdFullName: string | null; + createdAt: string | null; +} + +export type { ResponseObject, RowHistory };