เพิ่ม api check เลขบัตรประชาชน

This commit is contained in:
AnandaTon 2023-10-06 10:36:47 +07:00
parent 468f27f74b
commit 02e0760e07
2 changed files with 17 additions and 1 deletions

View file

@ -23,7 +23,8 @@
:class="getClass(status == 'register' || status == 'rejectRegister')"
:borderless="!(status == 'register' || status == 'rejectRegister')"
:rules="[
(val) => (val != null && val.length == 13) || `${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}`,
(val) =>
(val != null && val.length == 13) || `${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}`,
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}`
]"
v-model="defaultInformation.cardid"
@ -484,11 +485,24 @@ const checkCardId = async () => {
if (result) {
idModel.value = false
defaultInformation.value.cardid = cardid2.value
await http
.put(config.API.candidateCheckCitizen(examId.value, positionId.value), {
citizenId: cardid2.value
})
.then((res) => {
success
})
.catch((e) => {
messageError($q, e)
})
.finally(async () => {})
return
} else {
notifyError($q, 'กรอกเลขบัตรประชาชนไม่ถูกต้อง')
}
})
}
const selectPrefix = async () => {
defaultInformation.value.prefix =
props.prefixOptions.filter((x) => x.id == defaultInformation.value.prefixId).length == 0