comment LeaveHistory

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-04-28 09:29:35 +07:00
parent 6db51b1343
commit f13832667c
2 changed files with 24 additions and 7 deletions

View file

@ -97,9 +97,9 @@ const visibleColumns = ref<string[]>([
"leaveDaysUsed",
]);
const modalDialogForm = ref<boolean>(false);
const isStatusEdit = ref<boolean>(false);
const rowData = ref<DataLeaveBeginning>();
const modalDialogForm = ref<boolean>(false); //modal Dialog
const isStatusEdit = ref<boolean>(false); //
const rowData = ref<DataLeaveBeginning>(); //
/** ฟังก์ชันเรียกข้อมูลประเภทการลา*/
async function fetchLeaveType() {
@ -114,6 +114,7 @@ async function fetchLeaveType() {
leaveTypeOptions.value = leaveTypeData.value;
}
/** ฟังก์ชันเรียกข้อมูลรายการลาย้อนหลัง*/
async function fetchDataLeaveBeginning() {
await http
.post(config.API.leaveBeginning + `/list`, {
@ -147,6 +148,11 @@ async function onSearchData(newSearch: boolean = true) {
}
}
/**
* งกนเป Dialog form นทกขอมลยอนหล
* @param isEdit สถานะการแกไข
* @param data อมลทองการแกไข
*/
function onOpenDialogForm(
isEdit: boolean,
data: DataLeaveBeginning = {} as DataLeaveBeginning
@ -169,6 +175,10 @@ function filterOptionFn(val: string, update: Function) {
});
}
/**
* งกนยนยนการลบรายการการลายอนห
* @param id รายการทองการลบ
*/
function onDeleteLeaveBeginning(id: string) {
dialogRemove($q, async () => {
showLoader();
@ -195,12 +205,14 @@ function updatePagination(newPagination: DataPagination) {
formFilter.pageSize = newPagination.rowsPerPage;
}
/** Hook*/
watch(
() => formFilter.pageSize,
() => {
onSearchData(true);
}
);
onMounted(async () => {
try {
showLoader();