รายละเอียดทะเบียนประวัติลูกจ้าง
This commit is contained in:
parent
bdc7ab8df3
commit
1e02f42b58
26 changed files with 2419 additions and 1031 deletions
|
|
@ -459,7 +459,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[]>([]);
|
||||
|
|
@ -751,36 +753,38 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileTrainId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
topic: e.topic,
|
||||
yearly: e.yearly,
|
||||
place: e.place,
|
||||
duration: e.duration,
|
||||
department: e.department,
|
||||
numberOrder: e.numberOrder,
|
||||
dateOrder: e.dateOrder,
|
||||
startDate: new Date(e.startDate),
|
||||
endDate: new Date(e.endDate),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileTrainId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
topic: e.topic,
|
||||
yearly: e.yearly,
|
||||
place: e.place,
|
||||
duration: e.duration,
|
||||
department: e.department,
|
||||
numberOrder: e.numberOrder,
|
||||
dateOrder: e.dateOrder,
|
||||
startDate: new Date(e.startDate),
|
||||
endDate: new Date(e.endDate),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -872,31 +876,33 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileTrainId(profileId.value), {
|
||||
id: id.value,
|
||||
name: name.value,
|
||||
topic: topic.value,
|
||||
yearly: yearly.value,
|
||||
place: place.value,
|
||||
duration: duration.value,
|
||||
department: department.value,
|
||||
numberOrder: numberOrder.value,
|
||||
dateOrder: dateOrder.value,
|
||||
startDate: dateToISO(startDate.value),
|
||||
endDate: dateToISO(endDate.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileTrainId(profileId.value), {
|
||||
id: id.value,
|
||||
name: name.value,
|
||||
topic: topic.value,
|
||||
yearly: yearly.value,
|
||||
place: place.value,
|
||||
duration: duration.value,
|
||||
department: department.value,
|
||||
numberOrder: numberOrder.value,
|
||||
dateOrder: dateOrder.value,
|
||||
startDate: dateToISO(startDate.value),
|
||||
endDate: dateToISO(endDate.value),
|
||||
})
|
||||
.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