no message
This commit is contained in:
parent
dc05b4740c
commit
cf343f7b8f
19 changed files with 2595 additions and 2416 deletions
|
|
@ -753,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);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -874,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