Merge branch 'develop' into devTee
This commit is contained in:
commit
e13f6fecb3
5 changed files with 20 additions and 10 deletions
|
|
@ -119,6 +119,12 @@ function closeDialog() {
|
||||||
clearFormData();
|
clearFormData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const calculateMaxDate = () => {
|
||||||
|
const today = new Date();
|
||||||
|
today.setFullYear(today.getFullYear() - 18);
|
||||||
|
return today;
|
||||||
|
};
|
||||||
|
|
||||||
function clearFormData() {
|
function clearFormData() {
|
||||||
formData.prefix = "";
|
formData.prefix = "";
|
||||||
formData.firstName = "";
|
formData.firstName = "";
|
||||||
|
|
@ -195,7 +201,6 @@ watch(
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:rules="[
|
:rules="[
|
||||||
(val) => {
|
(val) => {
|
||||||
console.log(val);
|
|
||||||
return val.length > 0 || 'กรุณาเลือกคำนำหน้าชื่อ';
|
return val.length > 0 || 'กรุณาเลือกคำนำหน้าชื่อ';
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
|
|
@ -265,6 +270,8 @@ watch(
|
||||||
autoApply
|
autoApply
|
||||||
borderless
|
borderless
|
||||||
week-start="0"
|
week-start="0"
|
||||||
|
:max-date="calculateMaxDate()"
|
||||||
|
:enableTimePicker="false"
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
v-model="formData.birthDate"
|
v-model="formData.birthDate"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
|
|
|
||||||
|
|
@ -267,12 +267,17 @@ async function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const calculateMaxDate = () => {
|
||||||
|
const today = new Date();
|
||||||
|
today.setFullYear(today.getFullYear() - 18);
|
||||||
|
return today;
|
||||||
|
};
|
||||||
|
|
||||||
async function editData() {
|
async function editData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.put(config.API.profileNewProfileById(id.value), {
|
.put(config.API.profileNewProfileById(id.value), {
|
||||||
...formData,
|
...formData,
|
||||||
dateRetire: store.retireDate,
|
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
|
@ -550,7 +555,9 @@ onMounted(async () => {
|
||||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||||
<datepicker
|
<datepicker
|
||||||
autoApply
|
autoApply
|
||||||
|
:max-date="calculateMaxDate()"
|
||||||
borderless
|
borderless
|
||||||
|
:enableTimePicker="false"
|
||||||
week-start="0"
|
week-start="0"
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
v-model="formData.birthDate"
|
v-model="formData.birthDate"
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,15 @@ interface RequestObject {
|
||||||
birthDate: Date | null;
|
birthDate: Date | null;
|
||||||
bloodGroup: string | null;
|
bloodGroup: string | null;
|
||||||
citizenId: string;
|
citizenId: string;
|
||||||
dateRetire: Date | null;
|
|
||||||
email: string | null;
|
email: string | null;
|
||||||
ethnicity: string | null;
|
ethnicity: string | null;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
gender: string | null;
|
gender: string | null;
|
||||||
isProbation: boolean;
|
|
||||||
keycloak: string;
|
|
||||||
lastName: string;
|
lastName: string;
|
||||||
nationality: string | null;
|
nationality: string | null;
|
||||||
phone: string | null;
|
phone: string | null;
|
||||||
posLevelId: string;
|
posLevelId: string;
|
||||||
posTypeId: string;
|
posTypeId: string;
|
||||||
position: string;
|
|
||||||
prefix: string;
|
prefix: string;
|
||||||
rank: string | null;
|
rank: string | null;
|
||||||
relationship: string | null;
|
relationship: string | null;
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,8 @@ export const useProfileDataStore = defineStore("profile", () => {
|
||||||
nationality: null,
|
nationality: null,
|
||||||
ethnicity: null,
|
ethnicity: null,
|
||||||
birthDate: null,
|
birthDate: null,
|
||||||
dateRetire: null,
|
|
||||||
isProbation: false,
|
|
||||||
keycloak: "",
|
|
||||||
phone: null,
|
phone: null,
|
||||||
email: null,
|
email: null,
|
||||||
position: "",
|
|
||||||
lastName: "",
|
lastName: "",
|
||||||
firstName: "",
|
firstName: "",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,11 @@ onMounted(() => {
|
||||||
label="ชื่อโครงการ/กิจกรรม/หลักสูตร"
|
label="ชื่อโครงการ/กิจกรรม/หลักสูตร"
|
||||||
rows="6"
|
rows="6"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
hide-bottom-space
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
!!val || `${'กรุณากรอกชื่อโครงการ/กิจกรรม/หลักสูตร'}`,
|
!!val || `${'กรุณากรอกชื่อโครงการ/กิจกรรม/หลักสูตร'}`,
|
||||||
|
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -101,6 +103,7 @@ onMounted(() => {
|
||||||
v-model="formData.reason"
|
v-model="formData.reason"
|
||||||
label="หลักการและเหตุผล"
|
label="หลักการและเหตุผล"
|
||||||
rows="6"
|
rows="6"
|
||||||
|
hide-bottom-space
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
|
|
@ -115,6 +118,7 @@ onMounted(() => {
|
||||||
v-model="formData.objective"
|
v-model="formData.objective"
|
||||||
label="วัตถุประสงค์"
|
label="วัตถุประสงค์"
|
||||||
rows="6"
|
rows="6"
|
||||||
|
hide-bottom-space
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rules="[
|
:rules="[
|
||||||
(val:string) =>
|
(val:string) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue