ต่อ Api หน้ Address
This commit is contained in:
parent
79182a1e86
commit
8d2b93b6a3
4 changed files with 48 additions and 26 deletions
|
|
@ -2,6 +2,7 @@ import env from '../index'
|
||||||
const candidate = `${env.API_URI}/candidate/`
|
const candidate = `${env.API_URI}/candidate/`
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
countDashbordSubHistory: (examId: string) => `${candidate}information/${examId}`,
|
candidateInformation: (examId: string) => `${candidate}information/${examId}`,
|
||||||
|
candidateAddress: (examId: string) => `${candidate}address/${examId}`,
|
||||||
candidate
|
candidate
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ import { useExamDataStore } from '@/modules/01_exam/store'
|
||||||
const mixin = useCounterMixin()
|
const mixin = useCounterMixin()
|
||||||
const store = useExamDataStore()
|
const store = useExamDataStore()
|
||||||
const { date2Thai, calAge } = mixin
|
const { date2Thai, calAge } = mixin
|
||||||
|
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
|
||||||
const edit = ref<boolean>(false)
|
const edit = ref<boolean>(false)
|
||||||
const addressData = ref<Address>(defaultAddress)
|
const addressData = ref<Address>(defaultAddress)
|
||||||
const myform = ref<any>()
|
const myform = ref<any>()
|
||||||
|
|
@ -272,11 +272,32 @@ const props = defineProps({
|
||||||
|
|
||||||
const emit = defineEmits(['update:statusEdit'])
|
const emit = defineEmits(['update:statusEdit'])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
fetchProvince()
|
await fetchData()
|
||||||
fetchDistrict(addressData.value.provinceId, '1')
|
await fetchProvince()
|
||||||
fetchDistrict(addressData.value.provinceIdC, '2')
|
await fetchDistrict(addressData.value.provinceId, '1')
|
||||||
|
await fetchDistrict(addressData.value.provinceIdC, '2')
|
||||||
})
|
})
|
||||||
|
const fetchData = async () => {
|
||||||
|
await http
|
||||||
|
.get(config.API.candidateAddress(candidateId.value))
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result
|
||||||
|
addressData.value.provinceId = data.registProvinceId
|
||||||
|
addressData.value.provinceIdC = data.currentProvinceId
|
||||||
|
addressData.value.districtId = data.registDistrictId
|
||||||
|
addressData.value.districtIdC = data.currentDistrictId
|
||||||
|
addressData.value.subdistrictId = data.registSubDistrictId
|
||||||
|
addressData.value.subdistrictIdC = data.currentSubDistrictId
|
||||||
|
addressData.value.code = data.registZipCode
|
||||||
|
addressData.value.codeC = data.currentZipCode
|
||||||
|
// informaData.value = data
|
||||||
|
})
|
||||||
|
.catch((e: any) => {})
|
||||||
|
.finally(() => {
|
||||||
|
// loader.value = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
if (store.consend == true) {
|
if (store.consend == true) {
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@ onMounted(async () => {
|
||||||
})
|
})
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.countDashbordSubHistory(candidateId.value))
|
.get(config.API.candidateInformation(candidateId.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result
|
const data = res.data.result
|
||||||
informaData.value.prefix = data.prefixId
|
informaData.value.prefix = data.prefixId
|
||||||
|
|
|
||||||
|
|
@ -216,25 +216,25 @@ const defaultAddress: Address = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultInformation: Information = {
|
const defaultInformation: Information = {
|
||||||
cardid: '10238002345325',
|
cardid: '',
|
||||||
prefix: 'นางสาว',
|
prefix: '',
|
||||||
prefixId: 'นางสาว',
|
prefixId: '',
|
||||||
firstname: 'ณัฐกา',
|
firstname: '',
|
||||||
lastname: 'ชมสิน',
|
lastname: '',
|
||||||
birthDate: new Date('2002-01-01'),
|
birthDate: new Date(''),
|
||||||
genderId: 'หญิง',
|
genderId: '',
|
||||||
bloodId: 'O',
|
bloodId: '',
|
||||||
nationality: 'ไทย',
|
nationality: '',
|
||||||
ethnicity: 'ไทย',
|
ethnicity: '',
|
||||||
religionId: 'พุทธ',
|
religionId: '',
|
||||||
tel: '0914569982',
|
tel: '',
|
||||||
phone: '0914569982',
|
phone: '',
|
||||||
email: 'kittapath@frappet.com',
|
email: '',
|
||||||
province: 'กรุงเทพ',
|
province: '',
|
||||||
cardIdDate: new Date('2000-01-10'),
|
cardIdDate: new Date(''),
|
||||||
relationship: 'โสด',
|
relationship: '',
|
||||||
knowledge: 'excel, word, photoshop',
|
knowledge: '',
|
||||||
district: 'บางพลัด'
|
districtId: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultFamily: Family = {
|
const defaultFamily: Family = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue