no message
This commit is contained in:
parent
dc05b4740c
commit
cf343f7b8f
19 changed files with 2595 additions and 2416 deletions
|
|
@ -717,33 +717,35 @@ onMounted(async () => {
|
|||
|
||||
const fetchData = async () => {
|
||||
rows.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
typeLeave: e.typeLeave,
|
||||
dateStartLeave: new Date(e.dateStartLeave),
|
||||
dateEndLeave: new Date(e.dateEndLeave),
|
||||
numLeave: e.numLeave,
|
||||
sumLeave: e.sumLeave,
|
||||
totalLeave: e.totalLeave,
|
||||
status: e.status,
|
||||
reason: e.reason,
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
if (profileId.value) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
data.map((e: ResponseObject) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
typeLeave: e.typeLeave,
|
||||
dateStartLeave: new Date(e.dateStartLeave),
|
||||
dateEndLeave: new Date(e.dateEndLeave),
|
||||
numLeave: e.numLeave,
|
||||
sumLeave: e.sumLeave,
|
||||
totalLeave: e.totalLeave,
|
||||
status: e.status,
|
||||
reason: e.reason,
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||
|
|
@ -966,28 +968,30 @@ const clickSave = async () => {
|
|||
const saveData = async () => {
|
||||
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
|
||||
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileLeaveId(profileId.value), {
|
||||
dateStartLeave: dateToISO(dateRange.value[0]),
|
||||
dateEndLeave: dateToISO(dateRange.value[1]),
|
||||
numLeave: numLeave.value,
|
||||
sumLeave: numUsedLeave.value,
|
||||
totalLeave: sum,
|
||||
status: statLeave.value,
|
||||
reason: reason.value,
|
||||
typeLeaveId: typeLeave.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
if (profileId.value) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.profileLeaveId(profileId.value), {
|
||||
dateStartLeave: dateToISO(dateRange.value[0]),
|
||||
dateEndLeave: dateToISO(dateRange.value[1]),
|
||||
numLeave: numLeave.value,
|
||||
sumLeave: numUsedLeave.value,
|
||||
totalLeave: sum,
|
||||
status: statLeave.value,
|
||||
reason: reason.value,
|
||||
typeLeaveId: typeLeave.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// /**
|
||||
|
|
@ -1187,27 +1191,29 @@ const addData = async () => {
|
|||
*/
|
||||
const clickTotal = async () => {
|
||||
rowsTotal.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveTotalId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
data.map((e: ResponseTotalObject) => {
|
||||
rowsTotal.value.push({
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
totalLeave: e.totalLeave,
|
||||
limitLeave: e.limitLeave,
|
||||
remainLeave: e.remainLeave,
|
||||
typeLeave: e.typeLeave,
|
||||
if (profileId.value) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileLeaveTotalId(profileId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
data.map((e: ResponseTotalObject) => {
|
||||
rowsTotal.value.push({
|
||||
typeLeaveId: e.typeLeaveId,
|
||||
totalLeave: e.totalLeave,
|
||||
limitLeave: e.limitLeave,
|
||||
remainLeave: e.remainLeave,
|
||||
typeLeave: e.typeLeave,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// /**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue