Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
653cd846db
4 changed files with 79 additions and 3 deletions
|
|
@ -27,9 +27,10 @@
|
|||
v-model="defaultEducation.educationLevelExamId"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก วุฒิที่ใช้สมัครสอบ'}`]"
|
||||
:label="`${'วุฒิที่ใช้สมัครสอบ'}`"
|
||||
@update:model-value="(value) => checkInputName()"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="col-3" v-if="showEducationName">
|
||||
<q-input
|
||||
class="q-pl-sm"
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
|
|
@ -220,6 +221,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 candidateId = ref<string>(route.params.candidateId.toString());
|
||||
|
|
@ -276,6 +278,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,
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@
|
|||
week-start="0"
|
||||
:max-date="new Date()"
|
||||
:disabled="!(status == 'checkRegister' || status == 'payment')"
|
||||
@update:modelValue="selectBirthDate"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
|
|
@ -214,6 +215,7 @@
|
|||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.tel"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอก เบอร์โทร'}`,
|
||||
(val) => val.length == 10 || `${'กรุณากรอก เบอร์โทร'}`,
|
||||
(val) =>
|
||||
/^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลเบอร์โทรให้ถูกต้อง'}`,
|
||||
|
|
@ -440,7 +442,8 @@ const props = defineProps({
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, calAge, modalError, success } = mixin;
|
||||
const { date2Thai, calAge, modalError, success, notifyError, calAgeYear } =
|
||||
mixin;
|
||||
const districtOptions = ref<DataOption[]>([]);
|
||||
const route = useRoute();
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
|
|
@ -449,6 +452,7 @@ const myform = ref<any>({});
|
|||
const img = ref<string>("");
|
||||
const opNat = ref(["ไทย"]);
|
||||
const fileProfile = ref<File[]>([]);
|
||||
const registerEndDate = ref<Date>(new Date());
|
||||
|
||||
const { messageError, showLoader, hideLoader } = mixin;
|
||||
|
||||
|
|
@ -577,6 +581,21 @@ const getClass = (val: boolean) => {
|
|||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
const selectBirthDate = async () => {
|
||||
// if (defaultInformation.value.birthDate != null) {
|
||||
// if (
|
||||
// calAgeYear(defaultInformation.value.birthDate, registerEndDate.value) < 18
|
||||
// ) {
|
||||
// defaultInformation.value.birthDate = null;
|
||||
// notifyError($q, "อายุไม่ถึง18");
|
||||
// } else if (
|
||||
// calAgeYear(defaultInformation.value.birthDate, registerEndDate.value) > 60
|
||||
// ) {
|
||||
// defaultInformation.value.birthDate = null;
|
||||
// notifyError($q, "อายุเกิน60");
|
||||
// }
|
||||
// }
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-4">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
|
|
@ -124,6 +124,7 @@
|
|||
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