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