แก้ในสมัครสอบคัดเลือกลบรายละเอียดบัตรประชาชน
This commit is contained in:
parent
f51889882b
commit
e3aa1d8221
4 changed files with 158 additions and 231 deletions
|
|
@ -56,12 +56,12 @@
|
|||
</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'"
|
||||
:class="getClass(false)"
|
||||
:outlined="false"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
:readonly="!false"
|
||||
:borderless="!false"
|
||||
v-model="defaultInformation.nationality"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สัญชาติ'}`]"
|
||||
:label="`${'สัญชาติ'}`"
|
||||
|
|
@ -136,17 +136,17 @@
|
|||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:readonly="!(status == 'register' || status == 'rejectRegister')"
|
||||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก สถานภาพ'}`]"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก ศาสนา'}`]"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultInformation.relationshipId"
|
||||
v-model="defaultInformation.religionId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="relationshipOptions"
|
||||
:options="religionOptions"
|
||||
option-value="id"
|
||||
:label="`${'สถานภาพ'}`"
|
||||
:label="`${'ศาสนา'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
|
|
@ -163,99 +163,12 @@
|
|||
v-model="defaultInformation.cardid"
|
||||
maxlength="13"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอก เลขบัตรประจำตัวประชาชน'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ถูกต้อง'}`
|
||||
(val) => val.length == 13 || `${'กรุณากรอก เลขประจำตัวประชาชน'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}`
|
||||
]"
|
||||
label="เลขบัตรประจำตัวประชาชน"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<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="defaultInformation.provinceId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="provinceOptions"
|
||||
option-value="id"
|
||||
:label="`${'ออกให้ ณ จังหวัด'}`"
|
||||
@update:model-value="(value) => selectProvince(value)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<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="defaultInformation.districtId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="districtOptions"
|
||||
option-value="id"
|
||||
:label="`${'ออกให้ ณ อำเภอ'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="defaultInformation.cardIdDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:max-date="new Date()"
|
||||
:disabled="!(status == 'register' || status == 'rejectRegister')"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<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')"
|
||||
:model-value="
|
||||
defaultInformation.cardIdDate == null
|
||||
? null
|
||||
: date2Thai(defaultInformation.cardIdDate)
|
||||
"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี ที่ออกบัตร'}`]"
|
||||
:label="`${'วัน/เดือน/ปี ที่ออกบัตร'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="mdi-calendar-outline"
|
||||
class="cursor-pointer"
|
||||
:style="
|
||||
status == 'register' || status == 'rejectRegister'
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
|
|
@ -270,10 +183,12 @@
|
|||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="defaultInformation.tel"
|
||||
:label="`${'โทรศัพท์'}`"
|
||||
/>
|
||||
<!-- :rules="[
|
||||
:rules="[
|
||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}`
|
||||
]" -->
|
||||
]"
|
||||
/>
|
||||
<!-- -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
|
|
@ -289,7 +204,7 @@
|
|||
:borderless="!(status == 'register' || status == 'rejectRegister')"
|
||||
v-model="defaultInformation.phone"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอก โทรศัพท์มือถือ'}`,
|
||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์มือถือ'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์มือถือให้ถูกต้อง'}`
|
||||
]"
|
||||
:label="`${'โทรศัพท์มือถือ'}`"
|
||||
|
|
@ -333,7 +248,7 @@
|
|||
<input id="file-upload" type="file" accept="image/*" @change="uploadImage" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9 col-md-12">
|
||||
<!-- <div class="col-xs-12 col-sm-9 col-md-12">
|
||||
<q-input
|
||||
:class="getClass(status == 'register' || status == 'rejectRegister')"
|
||||
:outlined="status == 'register' || status == 'rejectRegister'"
|
||||
|
|
@ -345,7 +260,7 @@
|
|||
label="ความรู้ความสามารถพิเศษ"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</q-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
@ -367,7 +282,7 @@ const props = defineProps({
|
|||
type: Array as PropType<DataOption[]>,
|
||||
required: true
|
||||
},
|
||||
relationshipOptions: {
|
||||
religionOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true
|
||||
},
|
||||
|
|
@ -431,7 +346,7 @@ const fetchData = async () => {
|
|||
data.citizenDate == null ? null : new Date(data.citizenDate)
|
||||
defaultInformation.value.cardid = data.citizenId
|
||||
defaultInformation.value.firstname = data.firstName
|
||||
defaultInformation.value.relationshipId = data.relationshipId
|
||||
defaultInformation.value.religionId = data.religionId
|
||||
defaultInformation.value.nationality = data.nationality
|
||||
defaultInformation.value.email = data.email
|
||||
defaultInformation.value.phone = data.mobilePhone
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="q-px-sm">
|
||||
<Information
|
||||
:prefixOptions="prefixOptions"
|
||||
:relationshipOptions="relationshipOptions"
|
||||
:religionOptions="religionOptions"
|
||||
:provinceOptions="provinceOptions"
|
||||
:status="status"
|
||||
v-model:form="formInformation"
|
||||
|
|
@ -15,10 +15,10 @@
|
|||
<Address :provinceOptions="provinceOptions" :status="status" v-model:form="formAddress" />
|
||||
</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">
|
||||
<Family :prefixOptions="prefixOptions" :status="status" v-model:form="formFamily" />
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
|
|
@ -50,7 +50,7 @@ import { useQuasar } from 'quasar'
|
|||
import type { DataOption } from '@/modules/01_exam/interface/index/Main'
|
||||
import Information from '@/modules/01_exam/components/Form/Information.vue'
|
||||
import Address from '@/modules/01_exam/components/Form/Address.vue'
|
||||
import Family from '@/modules/01_exam/components/Form/Family.vue'
|
||||
// import Family from '@/modules/01_exam/components/Form/Family.vue'
|
||||
import Occupation from '@/modules/01_exam/components/Form/Occupation.vue'
|
||||
import Education from '@/modules/01_exam/components/Form/Education.vue'
|
||||
import Career from '@/modules/01_exam/components/Form/Career.vue'
|
||||
|
|
@ -69,10 +69,10 @@ const props = defineProps({
|
|||
type: Object,
|
||||
required: true
|
||||
},
|
||||
formFamily: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
// formFamily: {
|
||||
// type: Object,
|
||||
// required: true
|
||||
// },
|
||||
formOccupation: {
|
||||
type: Object,
|
||||
required: true
|
||||
|
|
@ -81,7 +81,7 @@ const props = defineProps({
|
|||
const emit = defineEmits([
|
||||
'update:formInformation',
|
||||
'update:formAddress',
|
||||
'update:formFamily',
|
||||
// 'update:formFamily',
|
||||
'update:formOccupation'
|
||||
])
|
||||
|
||||
|
|
@ -91,12 +91,12 @@ const { loaderPage } = dataStore
|
|||
const mixin = useCounterMixin()
|
||||
const { messageError } = mixin
|
||||
const prefixOptions = ref<DataOption[]>([])
|
||||
const relationshipOptions = ref<DataOption[]>([])
|
||||
const religionOptions = ref<DataOption[]>([])
|
||||
const provinceOptions = ref<DataOption[]>([])
|
||||
const educationLevelOptions = ref<DataOption[]>([])
|
||||
const formInformation = ref<any>({})
|
||||
const formAddress = ref<any>({})
|
||||
const formFamily = ref<any>({})
|
||||
// const formFamily = ref<any>({})
|
||||
const formOccupation = ref<any>({})
|
||||
|
||||
watch(formInformation, async (count: Object, prevCount: Object) => {
|
||||
|
|
@ -107,9 +107,9 @@ watch(formAddress, async (count: Object, prevCount: Object) => {
|
|||
emit('update:formAddress', count)
|
||||
})
|
||||
|
||||
watch(formFamily, async (count: Object, prevCount: Object) => {
|
||||
emit('update:formFamily', count)
|
||||
})
|
||||
// watch(formFamily, async (count: Object, prevCount: Object) => {
|
||||
// emit('update:formFamily', count)
|
||||
// })
|
||||
|
||||
watch(formOccupation, async (count: Object, prevCount: Object) => {
|
||||
emit('update:formOccupation', count)
|
||||
|
|
@ -131,11 +131,11 @@ const fetchPerson = async () => {
|
|||
})
|
||||
prefixOptions.value = optionPrefix
|
||||
|
||||
let optionRelationship: DataOption[] = []
|
||||
data.relationships.map((r: any) => {
|
||||
optionRelationship.push({ id: r.id.toString(), name: r.name.toString() })
|
||||
let optionReligion: DataOption[] = []
|
||||
data.religions.map((r: any) => {
|
||||
optionReligion.push({ id: r.id.toString(), name: r.name.toString() })
|
||||
})
|
||||
relationshipOptions.value = optionRelationship
|
||||
religionOptions.value = optionReligion
|
||||
|
||||
let optionProvince: DataOption[] = []
|
||||
data.provinces.map((r: any) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue