ยืนยันประวัติทำงาน
This commit is contained in:
parent
d7019ba001
commit
16b5ce734d
4 changed files with 91 additions and 77 deletions
|
|
@ -130,7 +130,8 @@ import {
|
|||
defaultOccupation,
|
||||
defaultAddress,
|
||||
defaultEducation,
|
||||
defaultContact
|
||||
defaultContact,
|
||||
defaultCareer
|
||||
} from '@/modules/01_exam/interface/index/Main'
|
||||
import Profile from '@/modules/01_exam/components/Form/Profile.vue'
|
||||
|
||||
|
|
@ -250,81 +251,85 @@ const saveData = async () => {
|
|||
if (suc) {
|
||||
await formOccupation.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formContact.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
loaderPage(true)
|
||||
await http
|
||||
.post(config.API.candidateId(examId.value, positionId.value), {
|
||||
prefixId: defaultInformation.value.prefixId,
|
||||
prefixName: defaultInformation.value.prefixId,
|
||||
lastName: defaultInformation.value.lastname,
|
||||
dateOfBirth:
|
||||
defaultInformation.value.birthDate == null
|
||||
? null
|
||||
: dateToISO(defaultInformation.value.birthDate),
|
||||
citizenId: defaultInformation.value.cardid,
|
||||
firstName: defaultInformation.value.firstname,
|
||||
religionId: defaultInformation.value.religionId,
|
||||
nationality: defaultInformation.value.nationality,
|
||||
email: defaultInformation.value.email,
|
||||
mobilePhone: defaultInformation.value.phone,
|
||||
telephone: defaultInformation.value.tel,
|
||||
knowledge: defaultInformation.value.knowledge,
|
||||
occupationOrg: defaultOccupation.value.org,
|
||||
occupationPile: defaultOccupation.value.pile,
|
||||
occupationGroup: defaultOccupation.value.group,
|
||||
occupationSalary: defaultOccupation.value.salary,
|
||||
occupationPosition: defaultOccupation.value.position,
|
||||
occupationPositionType: defaultOccupation.value.positionType,
|
||||
occupationTelephone: defaultOccupation.value.tel,
|
||||
registAddress: defaultAddress.value.address,
|
||||
currentAddress: defaultAddress.value.addressC,
|
||||
registProvinceId: defaultAddress.value.provinceId,
|
||||
currentProvinceId: defaultAddress.value.provinceIdC,
|
||||
registDistrictId: defaultAddress.value.districtId,
|
||||
currentDistrictId: defaultAddress.value.districtIdC,
|
||||
registSubDistrictId: defaultAddress.value.subdistrictId,
|
||||
currentSubDistrictId: defaultAddress.value.subdistrictIdC,
|
||||
registZipCode: defaultAddress.value.code,
|
||||
currentZipCode: defaultAddress.value.codeC,
|
||||
registSame:
|
||||
defaultAddress.value.same == '1'
|
||||
? true
|
||||
: defaultAddress.value.same == '0'
|
||||
? false
|
||||
: null,
|
||||
educationLevelExamId: defaultEducation.value.educationLevelExamId,
|
||||
educationName: defaultEducation.value.educationName,
|
||||
educationMajor: defaultEducation.value.educationMajor,
|
||||
educationLocation: defaultEducation.value.educationLocation,
|
||||
educationType: defaultEducation.value.educationType,
|
||||
educationEndDate:
|
||||
defaultEducation.value.educationEndDate == null
|
||||
? null
|
||||
: dateToISO(defaultEducation.value.educationEndDate),
|
||||
educationScores: defaultEducation.value.educationScores,
|
||||
educationLevelHighId: defaultEducation.value.educationLevelHighId,
|
||||
if (defaultCareer == true) {
|
||||
await formContact.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
loaderPage(true)
|
||||
await http
|
||||
.post(config.API.candidateId(examId.value, positionId.value), {
|
||||
prefixId: defaultInformation.value.prefixId,
|
||||
prefixName: defaultInformation.value.prefixId,
|
||||
lastName: defaultInformation.value.lastname,
|
||||
dateOfBirth:
|
||||
defaultInformation.value.birthDate == null
|
||||
? null
|
||||
: dateToISO(defaultInformation.value.birthDate),
|
||||
citizenId: defaultInformation.value.cardid,
|
||||
firstName: defaultInformation.value.firstname,
|
||||
religionId: defaultInformation.value.religionId,
|
||||
nationality: defaultInformation.value.nationality,
|
||||
email: defaultInformation.value.email,
|
||||
mobilePhone: defaultInformation.value.phone,
|
||||
telephone: defaultInformation.value.tel,
|
||||
knowledge: defaultInformation.value.knowledge,
|
||||
occupationOrg: defaultOccupation.value.org,
|
||||
occupationPile: defaultOccupation.value.pile,
|
||||
occupationGroup: defaultOccupation.value.group,
|
||||
occupationSalary: defaultOccupation.value.salary,
|
||||
occupationPosition: defaultOccupation.value.position,
|
||||
occupationPositionType: defaultOccupation.value.positionType,
|
||||
occupationTelephone: defaultOccupation.value.tel,
|
||||
registAddress: defaultAddress.value.address,
|
||||
currentAddress: defaultAddress.value.addressC,
|
||||
registProvinceId: defaultAddress.value.provinceId,
|
||||
currentProvinceId: defaultAddress.value.provinceIdC,
|
||||
registDistrictId: defaultAddress.value.districtId,
|
||||
currentDistrictId: defaultAddress.value.districtIdC,
|
||||
registSubDistrictId: defaultAddress.value.subdistrictId,
|
||||
currentSubDistrictId: defaultAddress.value.subdistrictIdC,
|
||||
registZipCode: defaultAddress.value.code,
|
||||
currentZipCode: defaultAddress.value.codeC,
|
||||
registSame:
|
||||
defaultAddress.value.same == '1'
|
||||
? true
|
||||
: defaultAddress.value.same == '0'
|
||||
? false
|
||||
: null,
|
||||
educationLevelExamId: defaultEducation.value.educationLevelExamId,
|
||||
educationName: defaultEducation.value.educationName,
|
||||
educationMajor: defaultEducation.value.educationMajor,
|
||||
educationLocation: defaultEducation.value.educationLocation,
|
||||
educationType: defaultEducation.value.educationType,
|
||||
educationEndDate:
|
||||
defaultEducation.value.educationEndDate == null
|
||||
? null
|
||||
: dateToISO(defaultEducation.value.educationEndDate),
|
||||
educationScores: defaultEducation.value.educationScores,
|
||||
educationLevelHighId: defaultEducation.value.educationLevelHighId,
|
||||
|
||||
contactprefixId: defaultContact.value.contactprefixId,
|
||||
contactfirstname: defaultContact.value.contactfirstname,
|
||||
contactlastname: defaultContact.value.contactlastname,
|
||||
contactrelations: defaultContact.value.contactrelations,
|
||||
contacttel: defaultContact.value.contacttel
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||
await saveForm()
|
||||
await props.fetchStep()
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
loaderPage(false)
|
||||
})
|
||||
.finally(async () => {})
|
||||
} else {
|
||||
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
||||
}
|
||||
})
|
||||
contactprefixId: defaultContact.value.contactprefixId,
|
||||
contactfirstname: defaultContact.value.contactfirstname,
|
||||
contactlastname: defaultContact.value.contactlastname,
|
||||
contactrelations: defaultContact.value.contactrelations,
|
||||
contacttel: defaultContact.value.contacttel
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||
await saveForm()
|
||||
await props.fetchStep()
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
loaderPage(false)
|
||||
})
|
||||
.finally(async () => {})
|
||||
} else {
|
||||
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
notifyError($q, 'กรุณากรอกข้อมูลประวัติการทำงาน')
|
||||
}
|
||||
} else {
|
||||
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,6 +274,7 @@ import type { ResponseObject } from '@/modules/01_exam/interface/response/Career
|
|||
import Table from '@/components/Table.vue'
|
||||
import DialogHeader from '@/components/DialogHeader.vue'
|
||||
import DialogFooter from '@/components/DialogFooter.vue'
|
||||
import { changeData } from '@/modules/01_exam/interface/index/Main'
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
|
|
@ -520,7 +521,7 @@ const fetchData = async () => {
|
|||
loaderPage(true)
|
||||
await http
|
||||
.get(config.API.candidateCareer(examId.value, positionId.value))
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const data = res.data.result
|
||||
var yearDiff = 0
|
||||
var monthDiff = 0
|
||||
|
|
@ -550,6 +551,11 @@ const fetchData = async () => {
|
|||
}${dayDiff > 0 ? dayDiff + ' วัน ' : ''}`
|
||||
})
|
||||
})
|
||||
if (data.length > 0) {
|
||||
await changeData('education', true)
|
||||
} else {
|
||||
await changeData('education', false)
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e)
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ const defaultEducation = ref<Education>({
|
|||
educationScores: null,
|
||||
educationLevelHighId: null
|
||||
})
|
||||
const defaultCareer = ref<boolean>(false)
|
||||
|
||||
const changeData = (system: String, val: any) => {
|
||||
if (system == 'information') defaultInformation.value = val
|
||||
|
|
@ -231,6 +232,7 @@ const changeData = (system: String, val: any) => {
|
|||
if (system == 'occupation') defaultOccupation.value = val
|
||||
if (system == 'contact') defaultContact.value = val
|
||||
if (system == 'education') defaultEducation.value = val
|
||||
if (system == 'career') defaultCareer.value = val
|
||||
}
|
||||
|
||||
export {
|
||||
|
|
@ -240,6 +242,7 @@ export {
|
|||
defaultOccupation,
|
||||
defaultContact,
|
||||
defaultEducation,
|
||||
defaultCareer,
|
||||
changeData
|
||||
}
|
||||
export type {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue