comment LeaveHistory
This commit is contained in:
parent
6db51b1343
commit
f13832667c
2 changed files with 24 additions and 7 deletions
|
|
@ -76,10 +76,10 @@ const leaveTypeCode = ref<string>("");
|
||||||
const profileId = ref<string>("");
|
const profileId = ref<string>("");
|
||||||
const rowId = ref<string>("");
|
const rowId = ref<string>("");
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
leaveTypeId: "",
|
leaveTypeId: "", //ประเภทการลา
|
||||||
leaveYear: new Date().getFullYear(),
|
leaveYear: new Date().getFullYear(), //ปี
|
||||||
leaveDays: "",
|
leaveDays: "", //วันลาที่ยกมา
|
||||||
leaveDaysUsed: "",
|
leaveDaysUsed: "", //วันลาที่ใช้ไป
|
||||||
});
|
});
|
||||||
const leaveTypeOptions = ref<DataLeaveType[]>([]);
|
const leaveTypeOptions = ref<DataLeaveType[]>([]);
|
||||||
const leaveTypeOptionsMain = ref<DataLeaveType[]>([]);
|
const leaveTypeOptionsMain = ref<DataLeaveType[]>([]);
|
||||||
|
|
@ -141,6 +141,10 @@ async function fetchDataPerson() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันกำหนดค่าของ formData เมื่อมีการแก้ไขข้อมูล
|
||||||
|
* @param data ข้อมูลที่ต้องการแก้ไข
|
||||||
|
*/
|
||||||
async function defineDataLeaveBeginning(data: DataLeaveBeginning) {
|
async function defineDataLeaveBeginning(data: DataLeaveBeginning) {
|
||||||
profileId.value = data.profileId;
|
profileId.value = data.profileId;
|
||||||
rowId.value = data.id;
|
rowId.value = data.id;
|
||||||
|
|
@ -235,6 +239,7 @@ function classInput(val: boolean) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Hook*/
|
||||||
watch(
|
watch(
|
||||||
() => formFilter.pageSize,
|
() => formFilter.pageSize,
|
||||||
() => {
|
() => {
|
||||||
|
|
|
||||||
|
|
@ -97,9 +97,9 @@ const visibleColumns = ref<string[]>([
|
||||||
"leaveDaysUsed",
|
"leaveDaysUsed",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const modalDialogForm = ref<boolean>(false);
|
const modalDialogForm = ref<boolean>(false); //modal Dialog บันทึกข้อมูลการลาย้อนหลัง
|
||||||
const isStatusEdit = ref<boolean>(false);
|
const isStatusEdit = ref<boolean>(false); //สถานะการแก้ไข
|
||||||
const rowData = ref<DataLeaveBeginning>();
|
const rowData = ref<DataLeaveBeginning>(); //ข้อมูลรายการที่ต้องการ
|
||||||
|
|
||||||
/** ฟังก์ชันเรียกข้อมูลประเภทการลา*/
|
/** ฟังก์ชันเรียกข้อมูลประเภทการลา*/
|
||||||
async function fetchLeaveType() {
|
async function fetchLeaveType() {
|
||||||
|
|
@ -114,6 +114,7 @@ async function fetchLeaveType() {
|
||||||
leaveTypeOptions.value = leaveTypeData.value;
|
leaveTypeOptions.value = leaveTypeData.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันเรียกข้อมูลรายการลาย้อนหลัง*/
|
||||||
async function fetchDataLeaveBeginning() {
|
async function fetchDataLeaveBeginning() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveBeginning + `/list`, {
|
.post(config.API.leaveBeginning + `/list`, {
|
||||||
|
|
@ -147,6 +148,11 @@ async function onSearchData(newSearch: boolean = true) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันเปิด Dialog form บันทึกข้อมูลย้อนหลัง
|
||||||
|
* @param isEdit สถานะก่ารแก้ไข
|
||||||
|
* @param data ข้อมูลที่ต้องการแก้ไข
|
||||||
|
*/
|
||||||
function onOpenDialogForm(
|
function onOpenDialogForm(
|
||||||
isEdit: boolean,
|
isEdit: boolean,
|
||||||
data: DataLeaveBeginning = {} as DataLeaveBeginning
|
data: DataLeaveBeginning = {} as DataLeaveBeginning
|
||||||
|
|
@ -169,6 +175,10 @@ function filterOptionFn(val: string, update: Function) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันยืนยันการลบรายการการลาย้อนหัง
|
||||||
|
* @param id รายการที่ต้องการลบ
|
||||||
|
*/
|
||||||
function onDeleteLeaveBeginning(id: string) {
|
function onDeleteLeaveBeginning(id: string) {
|
||||||
dialogRemove($q, async () => {
|
dialogRemove($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -195,12 +205,14 @@ function updatePagination(newPagination: DataPagination) {
|
||||||
formFilter.pageSize = newPagination.rowsPerPage;
|
formFilter.pageSize = newPagination.rowsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Hook*/
|
||||||
watch(
|
watch(
|
||||||
() => formFilter.pageSize,
|
() => formFilter.pageSize,
|
||||||
() => {
|
() => {
|
||||||
onSearchData(true);
|
onSearchData(true);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue