รายละเอียดทะเบียนประวัติลูกจ้าง
This commit is contained in:
parent
bdc7ab8df3
commit
1e02f42b58
26 changed files with 2419 additions and 1031 deletions
|
|
@ -506,7 +506,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
|
|||
const filterHistory = ref<string>(""); //search data table history
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
|
@ -960,42 +962,44 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileEduId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
level: e.educationLevel,
|
||||
levelId: e.educationLevelId,
|
||||
positionPath: e.positionPath,
|
||||
positionPathId: e.positionPathId,
|
||||
institute: e.institute,
|
||||
degree: e.degree,
|
||||
field: e.field,
|
||||
gpa: e.gpa,
|
||||
country: e.country,
|
||||
duration: e.duration,
|
||||
durationYear: e.durationYear,
|
||||
other: e.other,
|
||||
fundName: e.fundName,
|
||||
finishDate: new Date(e.finishDate),
|
||||
startDate: new Date(e.startDate).getFullYear(),
|
||||
endDate: new Date(e.endDate).getFullYear(),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileEduId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
level: e.educationLevel,
|
||||
levelId: e.educationLevelId,
|
||||
positionPath: e.positionPath,
|
||||
positionPathId: e.positionPathId,
|
||||
institute: e.institute,
|
||||
degree: e.degree,
|
||||
field: e.field,
|
||||
gpa: e.gpa,
|
||||
country: e.country,
|
||||
duration: e.duration,
|
||||
durationYear: e.durationYear,
|
||||
other: e.other,
|
||||
fundName: e.fundName,
|
||||
finishDate: new Date(e.finishDate),
|
||||
startDate: new Date(e.startDate).getFullYear(),
|
||||
endDate: new Date(e.endDate).getFullYear(),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1090,43 +1094,46 @@ const clickSave = async () => {
|
|||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
|
||||
const saveData = async () => {
|
||||
// const filter = OpsFilter.value.levelOptions.filter(
|
||||
// (r: any) => r.id == levelId.value
|
||||
// );
|
||||
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
|
||||
// (r: any) => r.id == positionPathId.value
|
||||
// );
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileEduId(profileId.value), {
|
||||
id: id.value,
|
||||
// educationLevel: filter[0].name,
|
||||
educationLevelId: levelId.value,
|
||||
positionPathId: positionPathId.value,
|
||||
institute: institute.value,
|
||||
degree: degree.value,
|
||||
field: field.value,
|
||||
gpa: gpa.value,
|
||||
country: country.value,
|
||||
duration: duration.value,
|
||||
durationYear: durationYear.value,
|
||||
other: other.value,
|
||||
fundName: fundName.value,
|
||||
finishDate: dateToISO(finishDate.value),
|
||||
startDate: new Date(`${startDate.value}-01-01`),
|
||||
endDate: new Date(`${endDate.value}-01-01`),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
// const filter = OpsFilter.value.levelOptions.filter(
|
||||
// (r: any) => r.id == levelId.value
|
||||
// );
|
||||
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
|
||||
// (r: any) => r.id == positionPathId.value
|
||||
// );
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileEduId(profileId.value), {
|
||||
id: id.value,
|
||||
// educationLevel: filter[0].name,
|
||||
educationLevelId: levelId.value,
|
||||
positionPathId: positionPathId.value,
|
||||
institute: institute.value,
|
||||
degree: degree.value,
|
||||
field: field.value,
|
||||
gpa: gpa.value,
|
||||
country: country.value,
|
||||
duration: duration.value,
|
||||
durationYear: durationYear.value,
|
||||
other: other.value,
|
||||
fundName: fundName.value,
|
||||
finishDate: dateToISO(finishDate.value),
|
||||
startDate: new Date(`${startDate.value}-01-01`),
|
||||
endDate: new Date(`${endDate.value}-01-01`),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue