diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index f20250bad..cb5fc4a92 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -8,6 +8,7 @@ export default { registryNewByProfileId: (profileId: string) => `${registryNew}${profileId}`, // metadata + profileNewMetaMain: `${metadata}main/person`, profileNewGender: `${metadata}gender`, profileNewReligion: `${metadata}religion`, profileNewRelationship: `${metadata}relationship`, @@ -141,4 +142,13 @@ profileNewLeaveType:()=>`${env.API_URI}/leave/type`, profileSalaryNew: `${env.API_URI}/org/profileSalary`, profileSalaryNewById: (id: string) => `${env.API_URI}/org/profileSalary/${id}`, + + // ประวัติการเปลี่ยนชื่อ-นามสกุล +profileNewChangeName: `${registryNew}changeName`, +profileNewChangeNameByProfileId: (profileId: string) => + `${registryNew}changeName/${profileId}`, +profileNewChangeNameByChangeNameId: (changeNameId: string) => + `${registryNew}changeName/${changeNameId}`, +profileNewChangeNameHisByChangeNameId: (changeNameId: string) => + `${registryNew}changeName/history/${changeNameId}`, }; diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue index 98e075ef0..91fd224cd 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/02_NameChangeHistory.vue @@ -1,37 +1,73 @@ + diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue index 5996edee9..797cdfcfe 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue @@ -7,7 +7,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useRoute } from "vue-router"; import DialogHistory from "@/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyHistory.vue"; - +import { useProfileDataStore } from "@/modules/04_registryNew/stores/profile"; const mixin = useCounterMixin(); const $q = useQuasar(); const { @@ -20,6 +20,7 @@ const { date2Thai, } = mixin; +const store = useProfileDataStore(); const route = useRoute(); const id = ref(route.params.id.toString()); const dialog = ref(false); @@ -64,7 +65,7 @@ const spouseData = reactive({ const rows = ref([]); const historyRows = ref([]); - +const prefixFilter = ref([]); const childrenData: any = reactive({ childrens: [], }); @@ -233,8 +234,32 @@ function deleteChildren(items: any) { } onMounted(async () => { + if ( + store.Ops.prefixOps.length === 0 || + store.Ops.genderOps.length === 0 || + store.Ops.bloodOps.length === 0 || + store.Ops.statusOps.length === 0 || + store.Ops.religionOps.length === 0 + ) { + await fetchPerson(); + } + prefixFilter.value = store.Ops.prefixOps; await fetchData(id.value); }); + +function filterSelector(val: string, update: Function, refData: string) { + switch (refData) { + case "prefixOps": + update(() => { + store.Ops.prefixOps = prefixFilter.value.filter( + (v: any) => v.name.indexOf(val) > -1 + ); + }); + break; + default: + break; + } +} -