From 15738c766878e3441f3a0099c0da85c9bc30684e Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Thu, 16 May 2024 15:43:18 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=A5?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=AD=E0=B8=B5=E0=B8=A2=E0=B8=94=E0=B8=82?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=AA=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A=E0=B8=9C=E0=B9=88=E0=B8=B2=E0=B8=99=20=E0=B9=80?= =?UTF-8?q?=E0=B9=80=E0=B8=81=E0=B9=89=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=99?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=87=20name=20=E0=B9=81=E0=B8=97?= =?UTF-8?q?=E0=B8=99=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonalDetail/Detail.vue | 17 ++++++++--------- .../components/PersonalDetail/Education.vue | 3 ++- .../PersonalDetail/Information/Address.vue | 10 +++++----- .../PersonalDetail/Information/Family.vue | 6 +++--- .../PersonalDetail/Information/Information.vue | 18 ++++++++++++------ .../05_placement/interface/index/Main.ts | 6 +++--- 6 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/modules/05_placement/components/PersonalDetail/Detail.vue b/src/modules/05_placement/components/PersonalDetail/Detail.vue index cb0b02695..865eec87f 100644 --- a/src/modules/05_placement/components/PersonalDetail/Detail.vue +++ b/src/modules/05_placement/components/PersonalDetail/Detail.vue @@ -129,12 +129,11 @@ const fetchData = async () => { InformationData.value.lastname = data.lastname; InformationData.value.nationality = data.nationality; InformationData.value.race = data.race; - InformationData.value.genderId = guidCheck(data.genderId) ?? ""; - InformationData.value.prefixId = guidCheck(data.prefixId) ?? ""; - InformationData.value.relationshipId = - guidCheck(data.relationshipId) ?? ""; - InformationData.value.religionId = guidCheck(data.religionId) ?? ""; - InformationData.value.bloodGroupId = guidCheck(data.bloodGroupId) ?? ""; + InformationData.value.genderId = guidCheck(data.gender) ?? ""; + InformationData.value.prefixId = guidCheck(data.prefix) ?? ""; + InformationData.value.relationshipId = guidCheck(data.relationship) ?? ""; + InformationData.value.religionId = guidCheck(data.religion) ?? ""; + InformationData.value.bloodGroupId = guidCheck(data.bloodGroup) ?? ""; InformationData.value.dateOfBirth = new Date(data.dateOfBirth); InformationData.value.age = data.age; InformationData.value.telephone = data.telephone; @@ -165,17 +164,17 @@ const fetchData = async () => { FamilyData.value.couple = data.couple ? "1" : "0"; FamilyData.value.marryPrefix = data.marryPrefix ?? ""; - FamilyData.value.marryPrefixId = guidCheck(data.marryPrefixId) ?? ""; + FamilyData.value.marryPrefixId = guidCheck(data.marryPrefix) ?? ""; FamilyData.value.marryFirstName = data.marryFirstName ?? ""; FamilyData.value.marryLastName = data.marryLastName ?? ""; FamilyData.value.marryOccupation = data.marryOccupation ?? ""; FamilyData.value.fatherPrefix = data.fatherPrefix ?? ""; - FamilyData.value.fatherPrefixId = guidCheck(data.fatherPrefixId) ?? ""; + FamilyData.value.fatherPrefixId = guidCheck(data.fatherPrefix) ?? ""; FamilyData.value.fatherFirstName = data.fatherFirstName ?? ""; FamilyData.value.fatherLastName = data.fatherLastName ?? ""; FamilyData.value.fatherOccupation = data.fatherOccupation ?? ""; FamilyData.value.motherPrefix = data.motherPrefix ?? ""; - FamilyData.value.motherPrefixId = guidCheck(data.motherPrefixId) ?? ""; + FamilyData.value.motherPrefixId = guidCheck(data.motherPrefix) ?? ""; FamilyData.value.motherFirstName = data.motherFirstName ?? ""; FamilyData.value.motherLastName = data.motherLastName ?? ""; FamilyData.value.motherOccupation = data.motherOccupation ?? ""; diff --git a/src/modules/05_placement/components/PersonalDetail/Education.vue b/src/modules/05_placement/components/PersonalDetail/Education.vue index 99ed48ec7..46fd997b3 100644 --- a/src/modules/05_placement/components/PersonalDetail/Education.vue +++ b/src/modules/05_placement/components/PersonalDetail/Education.vue @@ -291,7 +291,7 @@ onMounted(async () => { const fetchLevel = async () => { showLoader(); await http - .get(config.API.educationLevel) + .get(config.API.orgEducationLevel) .then((res) => { const data = res.data.result; let option: optionData[] = []; @@ -774,6 +774,7 @@ const getClass = (val: boolean) => { + diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Address.vue b/src/modules/05_placement/components/PersonalDetail/Information/Address.vue index d2d34dfd2..f03007b2a 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Address.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Address.vue @@ -247,7 +247,7 @@ const selectSubDistrict = (e: string | null, name: string) => { const fetchProvince = async () => { showLoader(); await http - .get(config.API.province) + .get(config.API.orgProvince) .then(async (res) => { const data = res.data.result; let option: optionData[] = []; @@ -326,9 +326,9 @@ const fetchDistrict = async (id: string | null, position: string) => { if (id != null && id != "") { showLoader(); await http - .get(config.API.listDistrict(id)) + .get(config.API.orgProvince+`/${id}`) .then(async (res) => { - const data = res.data.result; + const data = res.data.result.districts; let option: optionData[] = []; data.map((r: any) => { option.push({ id: r.id.toString(), name: r.name.toString() }); @@ -372,9 +372,9 @@ const fetchSubDistrict = async (id: string | null, position: string) => { if (id != null && id != "") { showLoader(); await http - .get(config.API.listSubDistrict(id)) + .get(config.API.orgDistrict+`/${id}`) .then(async (res) => { - const data = res.data.result; + const data = res.data.result.subDistricts; let option: zipCodeOption[] = []; data.map((r: any) => { option.push({ diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Family.vue b/src/modules/05_placement/components/PersonalDetail/Information/Family.vue index d46471d5c..2e3b21712 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Family.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Family.vue @@ -81,12 +81,12 @@ const refreshData = async () => { const fetchPrefix = async () => { showLoader(); await http - .get(config.API.prefix) + .get(config.API.profileNewMetaMain) .then((res) => { const data = res.data.result; let option: DataOption[] = []; - data.map((r: any) => { - option.push({ id: r.id.toString(), name: r.name.toString() }); + data.prefixs.map((r: any) => { + option.push({ id: r.name.toString(), name: r.name.toString() }); }); Ops.value.prefixOps = option; OpsFilter.value.prefixOps = option; diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Information.vue b/src/modules/05_placement/components/PersonalDetail/Information/Information.vue index fb2a30ebc..e2b67d78f 100644 --- a/src/modules/05_placement/components/PersonalDetail/Information/Information.vue +++ b/src/modules/05_placement/components/PersonalDetail/Information/Information.vue @@ -112,53 +112,59 @@ const onCancel = async () => { const fetchPerson = async () => { showLoader(); await http - .get(config.API.person) + .get(config.API.profileNewMetaMain) .then((res) => { const data = res.data.result; + + //กรุ๊ปเลือด let optionbloodGroups: optionData[] = []; data.bloodGroups.map((r: any) => { optionbloodGroups.push({ - id: r.id ?? "", + id: r.name ?? "", name: r.name ?? "", }); }); Ops.value.bloodOps = optionbloodGroups; OpsFilter.value.bloodOps = optionbloodGroups; + //เพศ let optiongenders: optionData[] = []; data.genders.map((r: any) => { optiongenders.push({ - id: r.id ?? "", + id: r.name ?? "", name: r.name ?? "", }); }); Ops.value.genderOps = optiongenders; OpsFilter.value.genderOps = optiongenders; + //คำนำหน้าชื่อ let optionprefixs: optionData[] = []; data.prefixs.map((r: any) => { optionprefixs.push({ - id: r.id ?? "", + id: r.name ?? "", name: r.name ?? "", }); }); Ops.value.prefixOps = optionprefixs; OpsFilter.value.prefixOps = optionprefixs; + //สถานภาพ let optionrelationships: optionData[] = []; data.relationships.map((r: any) => { optionrelationships.push({ - id: r.id ?? "", + id: r.name ?? "", name: r.name ?? "", }); }); Ops.value.statusOps = optionrelationships; OpsFilter.value.statusOps = optionrelationships; + //ศาสนา let optionreligions: optionData[] = []; data.religions.map((r: any) => { optionreligions.push({ - id: r.id ?? "", + id: r.name ?? "", name: r.name ?? "", }); }); diff --git a/src/modules/05_placement/interface/index/Main.ts b/src/modules/05_placement/interface/index/Main.ts index 759b0b69f..5e497bd00 100644 --- a/src/modules/05_placement/interface/index/Main.ts +++ b/src/modules/05_placement/interface/index/Main.ts @@ -142,10 +142,10 @@ interface Address { } interface AddressData { - subDistrictId: string; + subDistrictId: any; zipCode: string; - districtId: string; - provinceId: string; + districtId: any; + provinceId: any; } interface Certificate {