ต่อ 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}`,
|
||||
candidateOccupation: (examId: string, positionId: string) =>
|
||||
`${candidate}occupation/${examId}/${positionId}`,
|
||||
candidateContact: (examId: string, positionId: string) =>
|
||||
`${candidate}contact/${examId}/${positionId}`,
|
||||
candidateEducation: (examId: string, positionId: string) =>
|
||||
`${candidate}education/${examId}/${positionId}`,
|
||||
candidateCareer: (examId: string, positionId: string) =>
|
||||
|
|
|
|||
|
|
@ -100,6 +100,11 @@
|
|||
</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-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
||||
<span :class="examResultinscore != 'ได้' ? 'text-red' : 'text-positive'">{{
|
||||
|
|
@ -107,7 +112,7 @@
|
|||
}}</span>
|
||||
</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-7 q-pr-xs">
|
||||
{{ position }}
|
||||
|
|
@ -122,7 +127,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">
|
||||
{{ score_expired == null ? '' : date2Thai(score_expired) }}
|
||||
{{ score_expired == null ? '-' : date2Thai(score_expired) }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -186,7 +191,7 @@ const scoreSumFull = ref<number | null>(null)
|
|||
const scoreSum = ref<number | null>(null)
|
||||
const examResultinscore = 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 reviewPoint = ref<number>(0)
|
||||
const review = ref<string>('-')
|
||||
|
|
@ -221,7 +226,7 @@ const fetchStatus = async () => {
|
|||
parseInt(data.pointTotalC == null ? 0 : data.pointTotalC)
|
||||
examResultinscore.value = data.pass
|
||||
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
|
||||
position.value = data.position
|
||||
positionLevel.value = data.positionLevel
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
v-model:formAddress="formAddress"
|
||||
v-model:formOccupation="formOccupation"
|
||||
v-model:formEducation="formEducation"
|
||||
v-model:formContact="formContact"
|
||||
/>
|
||||
<!-- v-model:formFamily="formFamily" -->
|
||||
<div class="text-center q-pt-sm">
|
||||
|
|
@ -128,7 +129,8 @@ import {
|
|||
defaultInformation,
|
||||
defaultOccupation,
|
||||
defaultAddress,
|
||||
defaultEducation
|
||||
defaultEducation,
|
||||
defaultContact
|
||||
} from '@/modules/01_exam/interface/index/Main'
|
||||
import Profile from '@/modules/01_exam/components/Form/Profile.vue'
|
||||
|
||||
|
|
@ -170,6 +172,7 @@ const formInformation = ref<any>({})
|
|||
const formAddress = ref<any>({})
|
||||
const formEducation = ref<any>({})
|
||||
const formOccupation = ref<any>({})
|
||||
const formContact = ref<any>({})
|
||||
const saveAuto = ref<boolean>(false)
|
||||
const dialog = ref<boolean>(false)
|
||||
|
||||
|
|
@ -242,69 +245,81 @@ const saveData = async () => {
|
|||
if (suc) {
|
||||
await formOccupation.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
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||
if (saveAuto.value) await saveForm()
|
||||
await props.fetchStep()
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
loaderPage(false)
|
||||
})
|
||||
.finally(async () => {})
|
||||
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, 'บันทึกข้อมูลส่วนตัวสำเร็จ')
|
||||
if (saveAuto.value) await saveForm()
|
||||
await props.fetchStep()
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
loaderPage(false)
|
||||
})
|
||||
.finally(async () => {})
|
||||
} else {
|
||||
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
notifyError($q, 'กรุณากรอกข้อมูลให้ครบถ้วน')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,146 +1,167 @@
|
|||
<!-- card บุคคลที่สามารถติดต่อได้ -->
|
||||
<template>
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="บุคคลที่สามารถติดต่อได้"
|
||||
icon="mdi-account-circle"
|
||||
:addData="true"
|
||||
:editOnly="false"
|
||||
:editData="false"
|
||||
/>
|
||||
<q-form ref="myform">
|
||||
<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">
|
||||
<q-select
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="prefixId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="prefixOptions"
|
||||
option-value="id"
|
||||
:label="`${'คำนำหน้า'}`"
|
||||
@update:model-value="(value) => selectPrefix()"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="firstname"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||
:label="`${'ชื่อ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="lastname"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||
:label="`${'นามสกุล'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-4">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="relations"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกความสัมพันธ์'}`]"
|
||||
:label="`${'เกี่ยวข้องเป็น'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-4">
|
||||
<q-input
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
:counter="status == 'register' || status == 'rejectRegister' ? true : false"
|
||||
lazy-rules
|
||||
type="tel"
|
||||
mask="##########"
|
||||
maxlength="10"
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="tel"
|
||||
:label="`${'โทรศัพท์'}`"
|
||||
:rules="[
|
||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}`
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="บุคคลที่สามารถติดต่อได้"
|
||||
icon="mdi-account-circle"
|
||||
:addData="true"
|
||||
:editOnly="false"
|
||||
:editData="false"
|
||||
/>
|
||||
<q-form ref="myform">
|
||||
<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">
|
||||
<q-select
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultContact.contactprefixId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="prefixOptions"
|
||||
option-value="id"
|
||||
:label="`${'คำนำหน้า'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="defaultContact.contactfirstname"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||
:label="`${'ชื่อ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="defaultContact.contactlastname"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||
:label="`${'นามสกุล'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-4">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="defaultContact.contactrelations"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกความสัมพันธ์'}`]"
|
||||
:label="`${'เกี่ยวข้องเป็น'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-4">
|
||||
<q-input
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
:counter="status == 'register' || status == 'rejectRegister' ? true : false"
|
||||
lazy-rules
|
||||
type="tel"
|
||||
mask="##########"
|
||||
maxlength="10"
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="defaultContact.contacttel"
|
||||
:label="`${'โทรศัพท์'}`"
|
||||
:rules="[
|
||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}`
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ref, onMounted, watch, PropType } from 'vue'
|
||||
import http from '@/plugins/http'
|
||||
import config from '@/app.config'
|
||||
import { useCounterMixin } from '@/stores/mixin'
|
||||
import { useDataStore } from '@/stores/data'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useQuasar } from 'quasar'
|
||||
import type { Occupation } from '@/modules/01_exam/interface/index/Main'
|
||||
import { defaultOccupation, changeData } from '@/modules/01_exam/interface/index/Main'
|
||||
import type { Contact } from '@/modules/01_exam/interface/index/Main'
|
||||
import { defaultContact, changeData } from '@/modules/01_exam/interface/index/Main'
|
||||
import HeaderTop from '@/components/top.vue'
|
||||
import { DataOption } from '../../interface/index/Main'
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
status: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
form: {
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
prefixOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['update:form'])
|
||||
|
||||
const $q = useQuasar()
|
||||
const dataStore = useDataStore()
|
||||
const { loaderPage } = dataStore
|
||||
const mixin = useCounterMixin()
|
||||
const { messageError } = mixin
|
||||
const edit = ref<boolean>(true)
|
||||
const myform = ref<any>({})
|
||||
|
||||
const prefixId = ref<string>('')
|
||||
const prefixOptions = ref<any>({})
|
||||
const firstname = ref<string>('')
|
||||
const lastname = ref<string>('')
|
||||
const relations = ref<string>('')
|
||||
const tel = ref<string>('')
|
||||
|
||||
const route = useRoute()
|
||||
const examId = ref<string>(route.params.id.toString())
|
||||
const positionId = ref<string>(route.params.positionId.toString())
|
||||
|
||||
watch(myform, async (count: any, prevCount: any) => {
|
||||
emit('update:form', count)
|
||||
emit('update:form', count)
|
||||
})
|
||||
|
||||
watch(defaultOccupation, async (count: Occupation, prevCount: Occupation) => {
|
||||
await changeData('occupation', count)
|
||||
watch(defaultContact, async (count: Contact, prevCount: Contact) => {
|
||||
await changeData('contact', count)
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData()
|
||||
await fetchData()
|
||||
})
|
||||
|
||||
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) => {
|
||||
|
|
@ -150,4 +171,3 @@ const getClass = (val: boolean) => {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -41,13 +41,13 @@
|
|||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Contact :status="status" />
|
||||
<Contact :status="status" :prefixOptions="prefixOptions" v-model:form="formContact" />
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<!-- <div class="q-px-sm">
|
||||
<Document :status="status" />
|
||||
</div>
|
||||
</div> -->
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
|
|
@ -86,13 +86,18 @@ const props = defineProps({
|
|||
formOccupation: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
formContact: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
const emit = defineEmits([
|
||||
'update:formInformation',
|
||||
'update:formAddress',
|
||||
'update:formEducation',
|
||||
'update:formOccupation'
|
||||
'update:formOccupation',
|
||||
'update:formContact'
|
||||
])
|
||||
|
||||
const $q = useQuasar()
|
||||
|
|
@ -108,6 +113,7 @@ const formInformation = ref<any>({})
|
|||
const formAddress = ref<any>({})
|
||||
const formEducation = ref<any>({})
|
||||
const formOccupation = ref<any>({})
|
||||
const formContact = ref<any>({})
|
||||
|
||||
watch(formInformation, async (count: Object, prevCount: Object) => {
|
||||
emit('update:formInformation', count)
|
||||
|
|
@ -125,6 +131,10 @@ watch(formOccupation, async (count: Object, prevCount: Object) => {
|
|||
emit('update:formOccupation', count)
|
||||
})
|
||||
|
||||
watch(formContact, async (count: Object, prevCount: Object) => {
|
||||
emit('update:formContact', count)
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchPerson()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -71,6 +71,14 @@ interface Occupation {
|
|||
tel: string | null
|
||||
}
|
||||
|
||||
interface Contact {
|
||||
contactprefixId: string | null
|
||||
contactfirstname: string | null
|
||||
contactlastname: string | null
|
||||
contactrelations: string | null
|
||||
contacttel: string | null
|
||||
}
|
||||
|
||||
interface Education {
|
||||
educationLevelExamId: string | null
|
||||
educationName: string | null
|
||||
|
|
@ -197,6 +205,14 @@ const defaultOccupation = ref<Occupation>({
|
|||
tel: null
|
||||
})
|
||||
|
||||
const defaultContact = ref<Contact>({
|
||||
contactprefixId: null,
|
||||
contactfirstname: null,
|
||||
contactlastname: null,
|
||||
contactrelations: null,
|
||||
contacttel: null
|
||||
})
|
||||
|
||||
const defaultEducation = ref<Education>({
|
||||
educationLevelExamId: null,
|
||||
educationName: null,
|
||||
|
|
@ -213,6 +229,7 @@ const changeData = (system: String, val: any) => {
|
|||
if (system == 'address') defaultAddress.value = val
|
||||
if (system == 'famliy') defaultFamily.value = val
|
||||
if (system == 'occupation') defaultOccupation.value = val
|
||||
if (system == 'contact') defaultContact.value = val
|
||||
if (system == 'education') defaultEducation.value = val
|
||||
}
|
||||
|
||||
|
|
@ -221,6 +238,7 @@ export {
|
|||
defaultFamily,
|
||||
defaultAddress,
|
||||
defaultOccupation,
|
||||
defaultContact,
|
||||
defaultEducation,
|
||||
changeData
|
||||
}
|
||||
|
|
@ -234,6 +252,7 @@ export type {
|
|||
Address,
|
||||
zipCodeOption,
|
||||
Occupation,
|
||||
Contact,
|
||||
Education,
|
||||
ExamCard,
|
||||
UploadType
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue