ต่อ api บุคคลที่สามารถติดต่อได้
This commit is contained in:
parent
57d80e33cb
commit
468f27f74b
6 changed files with 254 additions and 183 deletions
|
|
@ -11,6 +11,8 @@ export default {
|
||||||
`${candidate}family/${examId}/${positionId}`,
|
`${candidate}family/${examId}/${positionId}`,
|
||||||
candidateOccupation: (examId: string, positionId: string) =>
|
candidateOccupation: (examId: string, positionId: string) =>
|
||||||
`${candidate}occupation/${examId}/${positionId}`,
|
`${candidate}occupation/${examId}/${positionId}`,
|
||||||
|
candidateContact: (examId: string, positionId: string) =>
|
||||||
|
`${candidate}contact/${examId}/${positionId}`,
|
||||||
candidateEducation: (examId: string, positionId: string) =>
|
candidateEducation: (examId: string, positionId: string) =>
|
||||||
`${candidate}education/${examId}/${positionId}`,
|
`${candidate}education/${examId}/${positionId}`,
|
||||||
candidateCareer: (examId: string, positionId: string) =>
|
candidateCareer: (examId: string, positionId: string) =>
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||||
|
|
||||||
|
<div class="col-xs-4 col-sm-5 text-grey-7">ลำดับที่สอบได้</div>
|
||||||
|
<div class="col-xs-8 col-sm-6 q-pr-xs text-grey-7">
|
||||||
|
{{ number }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-4 col-sm-5 text-weight-bold q-pt-sm">ผลการสอบ</div>
|
<div class="col-xs-4 col-sm-5 text-weight-bold q-pt-sm">ผลการสอบ</div>
|
||||||
<div class="col-xs-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
<div class="col-xs-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
||||||
<span :class="examResultinscore != 'ได้' ? 'text-red' : 'text-positive'">{{
|
<span :class="examResultinscore != 'ได้' ? 'text-red' : 'text-positive'">{{
|
||||||
|
|
@ -107,7 +112,7 @@
|
||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row items-center q-gutter-y-sm col-12">
|
<div class="row items-center q-gutter-y-sm col-12 q-pt-md">
|
||||||
<div class="col-xs-6 col-sm-5 text-grey-7">ตำแหน่ง</div>
|
<div class="col-xs-6 col-sm-5 text-grey-7">ตำแหน่ง</div>
|
||||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||||
{{ position }}
|
{{ position }}
|
||||||
|
|
@ -122,7 +127,7 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="col-xs-6 col-sm-5 text-grey-7">วันหมดอายุบัญชีคัดเลือก</div>
|
<div class="col-xs-6 col-sm-5 text-grey-7">วันหมดอายุบัญชีคัดเลือก</div>
|
||||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||||
{{ score_expired == null ? '' : date2Thai(score_expired) }}
|
{{ score_expired == null ? '-' : date2Thai(score_expired) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
@ -186,7 +191,7 @@ const scoreSumFull = ref<number | null>(null)
|
||||||
const scoreSum = ref<number | null>(null)
|
const scoreSum = ref<number | null>(null)
|
||||||
const examResultinscore = ref<string>('')
|
const examResultinscore = ref<string>('')
|
||||||
const avatar = ref<string>('')
|
const avatar = ref<string>('')
|
||||||
const score_expired = ref<Date>(new Date())
|
const score_expired = ref<Date | null>(new Date())
|
||||||
const number = ref<string>('')
|
const number = ref<string>('')
|
||||||
const reviewPoint = ref<number>(0)
|
const reviewPoint = ref<number>(0)
|
||||||
const review = ref<string>('-')
|
const review = ref<string>('-')
|
||||||
|
|
@ -221,7 +226,7 @@ const fetchStatus = async () => {
|
||||||
parseInt(data.pointTotalC == null ? 0 : data.pointTotalC)
|
parseInt(data.pointTotalC == null ? 0 : data.pointTotalC)
|
||||||
examResultinscore.value = data.pass
|
examResultinscore.value = data.pass
|
||||||
avatar.value = data.avatar
|
avatar.value = data.avatar
|
||||||
score_expired.value = new Date(data.announcementDate)
|
score_expired.value = data.announcementDate == null ? null : new Date(data.announcementDate)
|
||||||
number.value = data.number
|
number.value = data.number
|
||||||
position.value = data.position
|
position.value = data.position
|
||||||
positionLevel.value = data.positionLevel
|
positionLevel.value = data.positionLevel
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
v-model:formAddress="formAddress"
|
v-model:formAddress="formAddress"
|
||||||
v-model:formOccupation="formOccupation"
|
v-model:formOccupation="formOccupation"
|
||||||
v-model:formEducation="formEducation"
|
v-model:formEducation="formEducation"
|
||||||
|
v-model:formContact="formContact"
|
||||||
/>
|
/>
|
||||||
<!-- v-model:formFamily="formFamily" -->
|
<!-- v-model:formFamily="formFamily" -->
|
||||||
<div class="text-center q-pt-sm">
|
<div class="text-center q-pt-sm">
|
||||||
|
|
@ -128,7 +129,8 @@ import {
|
||||||
defaultInformation,
|
defaultInformation,
|
||||||
defaultOccupation,
|
defaultOccupation,
|
||||||
defaultAddress,
|
defaultAddress,
|
||||||
defaultEducation
|
defaultEducation,
|
||||||
|
defaultContact
|
||||||
} from '@/modules/01_exam/interface/index/Main'
|
} from '@/modules/01_exam/interface/index/Main'
|
||||||
import Profile from '@/modules/01_exam/components/Form/Profile.vue'
|
import Profile from '@/modules/01_exam/components/Form/Profile.vue'
|
||||||
|
|
||||||
|
|
@ -170,6 +172,7 @@ const formInformation = ref<any>({})
|
||||||
const formAddress = ref<any>({})
|
const formAddress = ref<any>({})
|
||||||
const formEducation = ref<any>({})
|
const formEducation = ref<any>({})
|
||||||
const formOccupation = ref<any>({})
|
const formOccupation = ref<any>({})
|
||||||
|
const formContact = ref<any>({})
|
||||||
const saveAuto = ref<boolean>(false)
|
const saveAuto = ref<boolean>(false)
|
||||||
const dialog = ref<boolean>(false)
|
const dialog = ref<boolean>(false)
|
||||||
|
|
||||||
|
|
@ -242,69 +245,81 @@ const saveData = async () => {
|
||||||
if (suc) {
|
if (suc) {
|
||||||
await formOccupation.value.validate().then(async (suc: boolean) => {
|
await formOccupation.value.validate().then(async (suc: boolean) => {
|
||||||
if (suc) {
|
if (suc) {
|
||||||
loaderPage(true)
|
await formContact.value.validate().then(async (suc: boolean) => {
|
||||||
await http
|
if (suc) {
|
||||||
.post(config.API.candidateId(examId.value, positionId.value), {
|
loaderPage(true)
|
||||||
prefixId: defaultInformation.value.prefixId,
|
await http
|
||||||
prefixName: defaultInformation.value.prefixId,
|
.post(config.API.candidateId(examId.value, positionId.value), {
|
||||||
lastName: defaultInformation.value.lastname,
|
prefixId: defaultInformation.value.prefixId,
|
||||||
dateOfBirth:
|
prefixName: defaultInformation.value.prefixId,
|
||||||
defaultInformation.value.birthDate == null
|
lastName: defaultInformation.value.lastname,
|
||||||
? null
|
dateOfBirth:
|
||||||
: dateToISO(defaultInformation.value.birthDate),
|
defaultInformation.value.birthDate == null
|
||||||
citizenId: defaultInformation.value.cardid,
|
? null
|
||||||
firstName: defaultInformation.value.firstname,
|
: dateToISO(defaultInformation.value.birthDate),
|
||||||
religionId: defaultInformation.value.religionId,
|
citizenId: defaultInformation.value.cardid,
|
||||||
nationality: defaultInformation.value.nationality,
|
firstName: defaultInformation.value.firstname,
|
||||||
email: defaultInformation.value.email,
|
religionId: defaultInformation.value.religionId,
|
||||||
mobilePhone: defaultInformation.value.phone,
|
nationality: defaultInformation.value.nationality,
|
||||||
telephone: defaultInformation.value.tel,
|
email: defaultInformation.value.email,
|
||||||
knowledge: defaultInformation.value.knowledge,
|
mobilePhone: defaultInformation.value.phone,
|
||||||
occupationOrg: defaultOccupation.value.org,
|
telephone: defaultInformation.value.tel,
|
||||||
occupationPile: defaultOccupation.value.pile,
|
knowledge: defaultInformation.value.knowledge,
|
||||||
occupationGroup: defaultOccupation.value.group,
|
occupationOrg: defaultOccupation.value.org,
|
||||||
occupationSalary: defaultOccupation.value.salary,
|
occupationPile: defaultOccupation.value.pile,
|
||||||
occupationPosition: defaultOccupation.value.position,
|
occupationGroup: defaultOccupation.value.group,
|
||||||
occupationPositionType: defaultOccupation.value.positionType,
|
occupationSalary: defaultOccupation.value.salary,
|
||||||
occupationTelephone: defaultOccupation.value.tel,
|
occupationPosition: defaultOccupation.value.position,
|
||||||
registAddress: defaultAddress.value.address,
|
occupationPositionType: defaultOccupation.value.positionType,
|
||||||
currentAddress: defaultAddress.value.addressC,
|
occupationTelephone: defaultOccupation.value.tel,
|
||||||
registProvinceId: defaultAddress.value.provinceId,
|
registAddress: defaultAddress.value.address,
|
||||||
currentProvinceId: defaultAddress.value.provinceIdC,
|
currentAddress: defaultAddress.value.addressC,
|
||||||
registDistrictId: defaultAddress.value.districtId,
|
registProvinceId: defaultAddress.value.provinceId,
|
||||||
currentDistrictId: defaultAddress.value.districtIdC,
|
currentProvinceId: defaultAddress.value.provinceIdC,
|
||||||
registSubDistrictId: defaultAddress.value.subdistrictId,
|
registDistrictId: defaultAddress.value.districtId,
|
||||||
currentSubDistrictId: defaultAddress.value.subdistrictIdC,
|
currentDistrictId: defaultAddress.value.districtIdC,
|
||||||
registZipCode: defaultAddress.value.code,
|
registSubDistrictId: defaultAddress.value.subdistrictId,
|
||||||
currentZipCode: defaultAddress.value.codeC,
|
currentSubDistrictId: defaultAddress.value.subdistrictIdC,
|
||||||
registSame:
|
registZipCode: defaultAddress.value.code,
|
||||||
defaultAddress.value.same == '1'
|
currentZipCode: defaultAddress.value.codeC,
|
||||||
? true
|
registSame:
|
||||||
: defaultAddress.value.same == '0'
|
defaultAddress.value.same == '1'
|
||||||
? false
|
? true
|
||||||
: null,
|
: defaultAddress.value.same == '0'
|
||||||
educationLevelExamId: defaultEducation.value.educationLevelExamId,
|
? false
|
||||||
educationName: defaultEducation.value.educationName,
|
: null,
|
||||||
educationMajor: defaultEducation.value.educationMajor,
|
educationLevelExamId: defaultEducation.value.educationLevelExamId,
|
||||||
educationLocation: defaultEducation.value.educationLocation,
|
educationName: defaultEducation.value.educationName,
|
||||||
educationType: defaultEducation.value.educationType,
|
educationMajor: defaultEducation.value.educationMajor,
|
||||||
educationEndDate:
|
educationLocation: defaultEducation.value.educationLocation,
|
||||||
defaultEducation.value.educationEndDate == null
|
educationType: defaultEducation.value.educationType,
|
||||||
? null
|
educationEndDate:
|
||||||
: dateToISO(defaultEducation.value.educationEndDate),
|
defaultEducation.value.educationEndDate == null
|
||||||
educationScores: defaultEducation.value.educationScores,
|
? null
|
||||||
educationLevelHighId: defaultEducation.value.educationLevelHighId
|
: dateToISO(defaultEducation.value.educationEndDate),
|
||||||
})
|
educationScores: defaultEducation.value.educationScores,
|
||||||
.then(async () => {
|
educationLevelHighId: defaultEducation.value.educationLevelHighId,
|
||||||
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
|
||||||
if (saveAuto.value) await saveForm()
|
contactprefixId: defaultContact.value.contactprefixId,
|
||||||
await props.fetchStep()
|
contactfirstname: defaultContact.value.contactfirstname,
|
||||||
})
|
contactlastname: defaultContact.value.contactlastname,
|
||||||
.catch((e) => {
|
contactrelations: defaultContact.value.contactrelations,
|
||||||
messageError($q, e)
|
contacttel: defaultContact.value.contacttel
|
||||||
loaderPage(false)
|
})
|
||||||
})
|
.then(async () => {
|
||||||
.finally(async () => {})
|
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||||
|
if (saveAuto.value) await saveForm()
|
||||||
|
await props.fetchStep()
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e)
|
||||||
|
loaderPage(false)
|
||||||
|
})
|
||||||
|
.finally(async () => {})
|
||||||
|
} else {
|
||||||
|
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,146 +1,167 @@
|
||||||
<!-- card บุคคลที่สามารถติดต่อได้ -->
|
<!-- card บุคคลที่สามารถติดต่อได้ -->
|
||||||
<template>
|
<template>
|
||||||
<HeaderTop
|
<HeaderTop
|
||||||
v-model:edit="edit"
|
v-model:edit="edit"
|
||||||
header="บุคคลที่สามารถติดต่อได้"
|
header="บุคคลที่สามารถติดต่อได้"
|
||||||
icon="mdi-account-circle"
|
icon="mdi-account-circle"
|
||||||
:addData="true"
|
:addData="true"
|
||||||
:editOnly="false"
|
:editOnly="false"
|
||||||
:editData="false"
|
:editData="false"
|
||||||
/>
|
/>
|
||||||
<q-form ref="myform">
|
<q-form ref="myform">
|
||||||
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-xs">
|
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-xs">
|
||||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||||
<q-select
|
<q-select
|
||||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
||||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="prefixId"
|
v-model="defaultContact.contactprefixId"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:options="prefixOptions"
|
:options="prefixOptions"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:label="`${'คำนำหน้า'}`"
|
:label="`${'คำนำหน้า'}`"
|
||||||
@update:model-value="(value) => selectPrefix()"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
<q-input
|
||||||
<q-input
|
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
dense
|
||||||
dense
|
lazy-rules
|
||||||
lazy-rules
|
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
v-model="defaultContact.contactfirstname"
|
||||||
v-model="firstname"
|
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
:label="`${'ชื่อ'}`"
|
||||||
:label="`${'ชื่อ'}`"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
<q-input
|
||||||
<q-input
|
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
dense
|
||||||
dense
|
lazy-rules
|
||||||
lazy-rules
|
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
v-model="defaultContact.contactlastname"
|
||||||
v-model="lastname"
|
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
:label="`${'นามสกุล'}`"
|
||||||
:label="`${'นามสกุล'}`"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="col-xs-12 col-sm-3 col-md-4">
|
||||||
<div class="col-xs-12 col-sm-3 col-md-4">
|
<q-input
|
||||||
<q-input
|
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
dense
|
||||||
dense
|
lazy-rules
|
||||||
lazy-rules
|
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
v-model="defaultContact.contactrelations"
|
||||||
v-model="relations"
|
:rules="[(val) => !!val || `${'กรุณากรอกความสัมพันธ์'}`]"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกความสัมพันธ์'}`]"
|
:label="`${'เกี่ยวข้องเป็น'}`"
|
||||||
:label="`${'เกี่ยวข้องเป็น'}`"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="col-xs-12 col-sm-3 col-md-4">
|
||||||
<div class="col-xs-12 col-sm-3 col-md-4">
|
<q-input
|
||||||
<q-input
|
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
dense
|
||||||
dense
|
:counter="status == 'register' || status == 'rejectRegister' ? true : false"
|
||||||
:counter="status == 'register' || status == 'rejectRegister' ? true : false"
|
lazy-rules
|
||||||
lazy-rules
|
type="tel"
|
||||||
type="tel"
|
mask="##########"
|
||||||
mask="##########"
|
maxlength="10"
|
||||||
maxlength="10"
|
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
v-model="defaultContact.contacttel"
|
||||||
v-model="tel"
|
:label="`${'โทรศัพท์'}`"
|
||||||
:label="`${'โทรศัพท์'}`"
|
:rules="[
|
||||||
:rules="[
|
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์'}`,
|
||||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์'}`,
|
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}`
|
||||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}`
|
]"
|
||||||
]"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</q-form>
|
||||||
</q-form>
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch } from 'vue'
|
import { ref, onMounted, watch, PropType } from 'vue'
|
||||||
import http from '@/plugins/http'
|
import http from '@/plugins/http'
|
||||||
import config from '@/app.config'
|
import config from '@/app.config'
|
||||||
|
import { useCounterMixin } from '@/stores/mixin'
|
||||||
import { useDataStore } from '@/stores/data'
|
import { useDataStore } from '@/stores/data'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import type { Occupation } from '@/modules/01_exam/interface/index/Main'
|
import type { Contact } from '@/modules/01_exam/interface/index/Main'
|
||||||
import { defaultOccupation, changeData } from '@/modules/01_exam/interface/index/Main'
|
import { defaultContact, changeData } from '@/modules/01_exam/interface/index/Main'
|
||||||
import HeaderTop from '@/components/top.vue'
|
import HeaderTop from '@/components/top.vue'
|
||||||
|
import { DataOption } from '../../interface/index/Main'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
status: {
|
status: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
}
|
},
|
||||||
|
prefixOptions: {
|
||||||
|
type: Array as PropType<DataOption[]>,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['update:form'])
|
const emit = defineEmits(['update:form'])
|
||||||
|
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const { loaderPage } = dataStore
|
const { loaderPage } = dataStore
|
||||||
|
const mixin = useCounterMixin()
|
||||||
|
const { messageError } = mixin
|
||||||
const edit = ref<boolean>(true)
|
const edit = ref<boolean>(true)
|
||||||
const myform = ref<any>({})
|
const myform = ref<any>({})
|
||||||
|
const route = useRoute()
|
||||||
const prefixId = ref<string>('')
|
const examId = ref<string>(route.params.id.toString())
|
||||||
const prefixOptions = ref<any>({})
|
const positionId = ref<string>(route.params.positionId.toString())
|
||||||
const firstname = ref<string>('')
|
|
||||||
const lastname = ref<string>('')
|
|
||||||
const relations = ref<string>('')
|
|
||||||
const tel = ref<string>('')
|
|
||||||
|
|
||||||
|
|
||||||
watch(myform, async (count: any, prevCount: any) => {
|
watch(myform, async (count: any, prevCount: any) => {
|
||||||
emit('update:form', count)
|
emit('update:form', count)
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(defaultOccupation, async (count: Occupation, prevCount: Occupation) => {
|
watch(defaultContact, async (count: Contact, prevCount: Contact) => {
|
||||||
await changeData('occupation', count)
|
await changeData('contact', count)
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchData()
|
await fetchData()
|
||||||
})
|
})
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
loaderPage(true)
|
loaderPage(true)
|
||||||
|
await http
|
||||||
|
.get(config.API.candidateContact(examId.value, positionId.value))
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result
|
||||||
|
if (data != null) {
|
||||||
|
defaultContact.value.contactprefixId = data.contactPrefixId
|
||||||
|
defaultContact.value.contactfirstname = data.contactFirstname
|
||||||
|
defaultContact.value.contactlastname = data.contactLastname
|
||||||
|
defaultContact.value.contactrelations = data.contactRelations
|
||||||
|
defaultContact.value.contacttel = data.contactTel
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
// messageError($q, e)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loaderPage(false)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getClass = (val: boolean) => {
|
const getClass = (val: boolean) => {
|
||||||
|
|
@ -150,4 +171,3 @@ const getClass = (val: boolean) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -41,13 +41,13 @@
|
||||||
|
|
||||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||||
<div class="q-px-sm">
|
<div class="q-px-sm">
|
||||||
<Contact :status="status" />
|
<Contact :status="status" :prefixOptions="prefixOptions" v-model:form="formContact" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||||
<div class="q-px-sm">
|
<!-- <div class="q-px-sm">
|
||||||
<Document :status="status" />
|
<Document :status="status" />
|
||||||
</div>
|
</div> -->
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch } from 'vue'
|
import { ref, onMounted, watch } from 'vue'
|
||||||
|
|
@ -86,13 +86,18 @@ const props = defineProps({
|
||||||
formOccupation: {
|
formOccupation: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
formContact: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
'update:formInformation',
|
'update:formInformation',
|
||||||
'update:formAddress',
|
'update:formAddress',
|
||||||
'update:formEducation',
|
'update:formEducation',
|
||||||
'update:formOccupation'
|
'update:formOccupation',
|
||||||
|
'update:formContact'
|
||||||
])
|
])
|
||||||
|
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
|
|
@ -108,6 +113,7 @@ const formInformation = ref<any>({})
|
||||||
const formAddress = ref<any>({})
|
const formAddress = ref<any>({})
|
||||||
const formEducation = ref<any>({})
|
const formEducation = ref<any>({})
|
||||||
const formOccupation = ref<any>({})
|
const formOccupation = ref<any>({})
|
||||||
|
const formContact = ref<any>({})
|
||||||
|
|
||||||
watch(formInformation, async (count: Object, prevCount: Object) => {
|
watch(formInformation, async (count: Object, prevCount: Object) => {
|
||||||
emit('update:formInformation', count)
|
emit('update:formInformation', count)
|
||||||
|
|
@ -125,6 +131,10 @@ watch(formOccupation, async (count: Object, prevCount: Object) => {
|
||||||
emit('update:formOccupation', count)
|
emit('update:formOccupation', count)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(formContact, async (count: Object, prevCount: Object) => {
|
||||||
|
emit('update:formContact', count)
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchPerson()
|
await fetchPerson()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,14 @@ interface Occupation {
|
||||||
tel: string | null
|
tel: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Contact {
|
||||||
|
contactprefixId: string | null
|
||||||
|
contactfirstname: string | null
|
||||||
|
contactlastname: string | null
|
||||||
|
contactrelations: string | null
|
||||||
|
contacttel: string | null
|
||||||
|
}
|
||||||
|
|
||||||
interface Education {
|
interface Education {
|
||||||
educationLevelExamId: string | null
|
educationLevelExamId: string | null
|
||||||
educationName: string | null
|
educationName: string | null
|
||||||
|
|
@ -197,6 +205,14 @@ const defaultOccupation = ref<Occupation>({
|
||||||
tel: null
|
tel: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const defaultContact = ref<Contact>({
|
||||||
|
contactprefixId: null,
|
||||||
|
contactfirstname: null,
|
||||||
|
contactlastname: null,
|
||||||
|
contactrelations: null,
|
||||||
|
contacttel: null
|
||||||
|
})
|
||||||
|
|
||||||
const defaultEducation = ref<Education>({
|
const defaultEducation = ref<Education>({
|
||||||
educationLevelExamId: null,
|
educationLevelExamId: null,
|
||||||
educationName: null,
|
educationName: null,
|
||||||
|
|
@ -213,6 +229,7 @@ const changeData = (system: String, val: any) => {
|
||||||
if (system == 'address') defaultAddress.value = val
|
if (system == 'address') defaultAddress.value = val
|
||||||
if (system == 'famliy') defaultFamily.value = val
|
if (system == 'famliy') defaultFamily.value = val
|
||||||
if (system == 'occupation') defaultOccupation.value = val
|
if (system == 'occupation') defaultOccupation.value = val
|
||||||
|
if (system == 'contact') defaultContact.value = val
|
||||||
if (system == 'education') defaultEducation.value = val
|
if (system == 'education') defaultEducation.value = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,6 +238,7 @@ export {
|
||||||
defaultFamily,
|
defaultFamily,
|
||||||
defaultAddress,
|
defaultAddress,
|
||||||
defaultOccupation,
|
defaultOccupation,
|
||||||
|
defaultContact,
|
||||||
defaultEducation,
|
defaultEducation,
|
||||||
changeData
|
changeData
|
||||||
}
|
}
|
||||||
|
|
@ -234,6 +252,7 @@ export type {
|
||||||
Address,
|
Address,
|
||||||
zipCodeOption,
|
zipCodeOption,
|
||||||
Occupation,
|
Occupation,
|
||||||
|
Contact,
|
||||||
Education,
|
Education,
|
||||||
ExamCard,
|
ExamCard,
|
||||||
UploadType
|
UploadType
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue