From 51bf92e68f9838e90ef82da974669d8d6776fbe2 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Fri, 24 Mar 2023 18:40:33 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=95=E0=B9=88=E0=B8=AD=20api=20Address=20?= =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20api=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/01_exam/components/Form/Profile/Address.vue | 9 +++++++-- .../01_exam/components/Form/Profile/Information.vue | 8 +++++--- src/modules/01_exam/interface/index/Main.ts | 8 +++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/modules/01_exam/components/Form/Profile/Address.vue b/src/modules/01_exam/components/Form/Profile/Address.vue index c4edf93..09b9f52 100644 --- a/src/modules/01_exam/components/Form/Profile/Address.vue +++ b/src/modules/01_exam/components/Form/Profile/Address.vue @@ -100,7 +100,7 @@ lazy-rules readonly borderless - v-model="codep" + v-model="addressData.code" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" /> @@ -212,7 +212,7 @@ lazy-rules readonly borderless - v-model="codec" + v-model="addressData.codeC" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" /> @@ -277,12 +277,16 @@ onMounted(async () => { await fetchProvince() await fetchDistrict(addressData.value.provinceId, '1') await fetchDistrict(addressData.value.provinceIdC, '2') + await fetchSubDistrict(addressData.value.districtId, '1') + await fetchSubDistrict(addressData.value.districtIdC, '2') }) const fetchData = async () => { await http .get(config.API.candidateAddress(candidateId.value)) .then((res) => { const data = res.data.result + addressData.value.address = data.registAddress + addressData.value.addressC = data.currentAddress addressData.value.provinceId = data.registProvinceId addressData.value.provinceIdC = data.currentProvinceId addressData.value.districtId = data.registDistrictId @@ -291,6 +295,7 @@ const fetchData = async () => { addressData.value.subdistrictIdC = data.currentSubDistrictId addressData.value.code = data.registZipCode addressData.value.codeC = data.currentZipCode + addressData.value.same = data.registSame == true ? '1' : '0' // informaData.value = data }) .catch((e: any) => {}) diff --git a/src/modules/01_exam/components/Form/Profile/Information.vue b/src/modules/01_exam/components/Form/Profile/Information.vue index fd90ed1..086858c 100644 --- a/src/modules/01_exam/components/Form/Profile/Information.vue +++ b/src/modules/01_exam/components/Form/Profile/Information.vue @@ -290,7 +290,6 @@ (val) => val.length >= 9 || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ครบ'}` ]" :label="`${'โทรศัพท์'}`" - mask="#########" />
@@ -309,7 +308,6 @@ (val) => val.length >= 10 || `${'กรุณากรอกข้อมูลโทรศัพท์มือถือให้ครบ'}` ]" :label="`${'โทรศัพท์มือถือ'}`" - mask="##########" />
@@ -444,7 +442,7 @@ const fetchData = async () => { const data = res.data.result informaData.value.prefix = data.prefixId informaData.value.lastname = data.lastName - informaData.value.province = data.citizenProvinceId + informaData.value.provinceId = data.citizenProvinceId informaData.value.districtId = data.citizenDistrictId informaData.value.birthDate = new Date(data.dateOfBirth) informaData.value.cardIdDate = new Date(data.dateOfBirth) @@ -453,6 +451,10 @@ const fetchData = async () => { informaData.value.relationship = data.relationshipId informaData.value.nationality = data.nationality informaData.value.email = data.email + informaData.value.phone = data.mobilePhone + informaData.value.tel = data.telephone + informaData.value.knowledge = data.knowledge + // informaData.value = data }) .catch((e: any) => {}) diff --git a/src/modules/01_exam/interface/index/Main.ts b/src/modules/01_exam/interface/index/Main.ts index 68f8b3e..7cd76fd 100644 --- a/src/modules/01_exam/interface/index/Main.ts +++ b/src/modules/01_exam/interface/index/Main.ts @@ -221,7 +221,7 @@ const defaultInformation: Information = { prefixId: '', firstname: '', lastname: '', - birthDate: new Date(''), + birthDate: new Date(), genderId: '', bloodId: '', nationality: '', @@ -231,10 +231,12 @@ const defaultInformation: Information = { phone: '', email: '', province: '', - cardIdDate: new Date(''), + cardIdDate: new Date(), relationship: '', knowledge: '', - districtId: '' + districtId: '', + provinceId: '', + statusId: '' } const defaultFamily: Family = {