เลือกวุฒิการศึกษา
This commit is contained in:
parent
07dad32620
commit
96f92a5b69
6 changed files with 55 additions and 17 deletions
|
|
@ -241,6 +241,7 @@ const saveData = async () => {
|
|||
notifyError($q, 'กรุณาอัพโหลดรูปถ่าย')
|
||||
return
|
||||
}
|
||||
console.log(defaultInformation.value.tel)
|
||||
await formInformation.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formAddress.value.validate().then(async (suc: boolean) => {
|
||||
|
|
|
|||
|
|
@ -27,9 +27,10 @@
|
|||
v-model="defaultEducation.educationLevelExamId"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก วุฒิที่ใช้สมัครสอบ'}`]"
|
||||
:label="`${'วุฒิที่ใช้สมัครสอบ'}`"
|
||||
@update:model-value="(value) => checkInputName()"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
<div class="col-xs-12 col-sm-3" v-if="showEducationName">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
|
|
@ -114,7 +115,11 @@
|
|||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
:model-value="date2Thai(defaultEducation.educationEndDate)"
|
||||
:model-value="
|
||||
defaultEducation.educationEndDate == null
|
||||
? null
|
||||
: date2Thai(defaultEducation.educationEndDate)
|
||||
"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สำเร็จการศึกษา'}`]"
|
||||
:label="`${'วันที่สำเร็จการศึกษา'}`"
|
||||
>
|
||||
|
|
@ -200,6 +205,7 @@ const props = defineProps({
|
|||
|
||||
const $q = useQuasar()
|
||||
const edit = ref<boolean>(true)
|
||||
const showEducationName = ref<boolean>(true)
|
||||
const myform = ref<any>({})
|
||||
const route = useRoute()
|
||||
const examId = ref<string>(route.params.id.toString())
|
||||
|
|
@ -245,9 +251,11 @@ const fetchData = async () => {
|
|||
defaultEducation.value.educationMajor = data.educationMajor
|
||||
defaultEducation.value.educationLocation = data.educationLocation
|
||||
defaultEducation.value.educationType = data.educationType
|
||||
defaultEducation.value.educationEndDate = new Date(data.educationEndDate)
|
||||
defaultEducation.value.educationEndDate =
|
||||
data.educationEndDate == null ? null : new Date(data.educationEndDate)
|
||||
defaultEducation.value.educationScores = data.educationScores
|
||||
defaultEducation.value.educationLevelHighId = data.educationLevelHighId
|
||||
checkInputName()
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e)
|
||||
|
|
@ -257,6 +265,17 @@ const fetchData = async () => {
|
|||
})
|
||||
}
|
||||
|
||||
const checkInputName = () => {
|
||||
showEducationName.value =
|
||||
props.educationLevelOptions.filter(
|
||||
(x) =>
|
||||
x.id == defaultEducation.value.educationLevelExamId &&
|
||||
(x.name == 'ปริญญาตรี' || x.name == 'ปริญญาโท' || x.name == 'ปริญญาเอก')
|
||||
).length == 0
|
||||
? false
|
||||
: true
|
||||
}
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
'full-width inputgreen cursor-pointer': val,
|
||||
|
|
|
|||
|
|
@ -224,6 +224,7 @@
|
|||
v-model="defaultInformation.tel"
|
||||
:label="`${'โทรศัพท์'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอก โทรศัพท์'}`,
|
||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}`
|
||||
]"
|
||||
|
|
@ -424,6 +425,7 @@ const img = ref<string>('')
|
|||
const fileProfile = ref<File[]>([])
|
||||
const cardid1 = ref<string | null>('')
|
||||
const cardid2 = ref<string | null>('')
|
||||
const registerEndDate = ref<Date>(new Date())
|
||||
|
||||
const opNat = ref(['ไทย'])
|
||||
const idModel = ref<boolean>(false)
|
||||
|
|
@ -441,6 +443,7 @@ onMounted(async () => {
|
|||
await fetchImgData()
|
||||
if (defaultInformation.value.provinceId != null)
|
||||
await fetchDistrict(defaultInformation.value.provinceId)
|
||||
candidateCheck()
|
||||
})
|
||||
|
||||
const fetchData = async () => {
|
||||
|
|
@ -454,8 +457,8 @@ const fetchData = async () => {
|
|||
if (data.lastName == null || data.lastName == '') {
|
||||
data.lastName = keycloak.tokenParsed == null ? '' : keycloak.tokenParsed.family_name
|
||||
}
|
||||
if (data.firstname == null || data.firstname == '') {
|
||||
data.firstname = keycloak.tokenParsed == null ? '' : keycloak.tokenParsed.given_name
|
||||
if (data.firstName == null || data.firstName == '') {
|
||||
data.firstName = keycloak.tokenParsed == null ? '' : keycloak.tokenParsed.given_name
|
||||
}
|
||||
if (data.email == null || data.email == '') {
|
||||
data.email = keycloak.tokenParsed == null ? '' : keycloak.tokenParsed.email
|
||||
|
|
@ -521,17 +524,33 @@ const selectPrefix = async () => {
|
|||
}
|
||||
const selectBirthDate = async () => {
|
||||
if (defaultInformation.value.birthDate != null) {
|
||||
console.log(calAgeYear(defaultInformation.value.birthDate))
|
||||
if (calAgeYear(defaultInformation.value.birthDate) < 18) {
|
||||
if (calAgeYear(defaultInformation.value.birthDate, registerEndDate.value) < 18) {
|
||||
defaultInformation.value.birthDate = null
|
||||
notifyError($q, 'อายุไม่ถึง18')
|
||||
} else if (calAgeYear(defaultInformation.value.birthDate) > 60) {
|
||||
} else if (calAgeYear(defaultInformation.value.birthDate, registerEndDate.value) > 60) {
|
||||
defaultInformation.value.birthDate = null
|
||||
notifyError($q, 'อายุเกิน60')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const candidateCheck = async () => {
|
||||
loaderPage(true)
|
||||
await http
|
||||
.get(config.API.candidateCheckCreate(examId.value, positionId.value))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result
|
||||
registerEndDate.value =
|
||||
data.registerEndDate == null ? new Date() : new Date(data.registerEndDate)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false)
|
||||
})
|
||||
}
|
||||
|
||||
const fetchImgData = async () => {
|
||||
loaderPage(true)
|
||||
await http
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@
|
|||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="defaultOccupation.tel"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอก เบอร์โทรที่ทำงาน'}`,
|
||||
(val) => val.length == 10 || `${'กรุณากรอก เบอร์โทรที่ทำงาน'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || 'กรุณากรอก เบอร์โทรที่ทำงานให้ถูกต้อง'
|
||||
]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue