แสดงเลขบัตร/api
This commit is contained in:
parent
02e0760e07
commit
4e35c40b40
1 changed files with 15 additions and 3 deletions
|
|
@ -422,8 +422,8 @@ const myform = ref<any>({})
|
||||||
const myformcitizen = ref<any>({})
|
const myformcitizen = ref<any>({})
|
||||||
const img = ref<string>('')
|
const img = ref<string>('')
|
||||||
const fileProfile = ref<File[]>([])
|
const fileProfile = ref<File[]>([])
|
||||||
const cardid1 = ref<string>('')
|
const cardid1 = ref<string | null>('')
|
||||||
const cardid2 = ref<string>('')
|
const cardid2 = ref<string | null>('')
|
||||||
|
|
||||||
const opNat = ref(['ไทย'])
|
const opNat = ref(['ไทย'])
|
||||||
const idModel = ref<boolean>(false)
|
const idModel = ref<boolean>(false)
|
||||||
|
|
@ -451,6 +451,15 @@ const fetchData = async () => {
|
||||||
const data = res.data.result
|
const data = res.data.result
|
||||||
defaultInformation.value.prefixId = data.prefixId
|
defaultInformation.value.prefixId = data.prefixId
|
||||||
selectPrefix()
|
selectPrefix()
|
||||||
|
if ((data.lastName = null)) {
|
||||||
|
data.lastName = keycloak.tokenParsed == null ? '' : keycloak.tokenParsed.family_name
|
||||||
|
}
|
||||||
|
if ((data.firstname = null)) {
|
||||||
|
data.firstname = keycloak.tokenParsed == null ? '' : keycloak.tokenParsed.given_name
|
||||||
|
}
|
||||||
|
if ((data.email = null)) {
|
||||||
|
data.email = keycloak.tokenParsed == null ? '' : keycloak.tokenParsed.email
|
||||||
|
}
|
||||||
defaultInformation.value.lastname = data.lastName
|
defaultInformation.value.lastname = data.lastName
|
||||||
defaultInformation.value.provinceId = data.citizenProvinceId
|
defaultInformation.value.provinceId = data.citizenProvinceId
|
||||||
defaultInformation.value.districtId = data.citizenDistrictId
|
defaultInformation.value.districtId = data.citizenDistrictId
|
||||||
|
|
@ -484,13 +493,14 @@ const checkCardId = async () => {
|
||||||
myformcitizen.value.validate().then(async (result: boolean) => {
|
myformcitizen.value.validate().then(async (result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
idModel.value = false
|
idModel.value = false
|
||||||
defaultInformation.value.cardid = cardid2.value
|
|
||||||
await http
|
await http
|
||||||
.put(config.API.candidateCheckCitizen(examId.value, positionId.value), {
|
.put(config.API.candidateCheckCitizen(examId.value, positionId.value), {
|
||||||
citizenId: cardid2.value
|
citizenId: cardid2.value
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success
|
success
|
||||||
|
|
||||||
|
defaultInformation.value.cardid = cardid2.value
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e)
|
messageError($q, e)
|
||||||
|
|
@ -595,6 +605,8 @@ const getClass = (val: boolean) => {
|
||||||
|
|
||||||
const idDialog = () => {
|
const idDialog = () => {
|
||||||
idModel.value = true
|
idModel.value = true
|
||||||
|
cardid2.value = defaultInformation.value.cardid
|
||||||
|
cardid1.value = defaultInformation.value.cardid
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue