รายการเลื่อนค่าจ้างลูกจ้างประจำ => download Report

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-21 15:15:12 +07:00
parent 63b1c0d32e
commit a7a76c6d3f

View file

@ -30,6 +30,9 @@ const { messageError, showLoader, hideLoader } = useCounterMixin();
/** props*/ /** props*/
const props = defineProps({ const props = defineProps({
periodLatest: { type: Object as () => DataPeriodLatest, require: true }, periodLatest: { type: Object as () => DataPeriodLatest, require: true },
rootId: { type: String, require: true },
periodId: { type: String, require: true },
roundFilter: { type: Object, require: true },
}); });
const total = ref<number>(); const total = ref<number>();
@ -269,17 +272,17 @@ function fetchDataPeriod(id: string) {
} }
/**function เปลี่ยนกลุ่ม*/ /**function เปลี่ยนกลุ่ม*/
function changeTabGroup() { // function changeTabGroup() {
formFilter.page = 1; // formFilter.page = 1;
formFilter.pageSize = 10; // formFilter.pageSize = 10;
formFilter.keyword = ""; // formFilter.keyword = "";
store.tabType = "PENDING"; // store.tabType = "PENDING";
props.periodLatest && // props.periodLatest &&
store.fetchPeriodLatest(props?.periodLatest, store.tabGroup); // store.fetchPeriodLatest(props?.periodLatest, store.tabGroup);
store.groupId && fetchDataQuota(store.groupId); // store.groupId && fetchDataQuota(store.groupId);
store.groupId && fetchDataPeriod(store.groupId); // store.groupId && fetchDataPeriod(store.groupId);
splitterModel.value = store.roundMainCode === "APR" ? 13 : 16; // splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
} // }
/**function เปลี่ยนขั้น*/ /**function เปลี่ยนขั้น*/
function changeTabType() { function changeTabType() {
@ -296,20 +299,53 @@ function fetchDataPeriodNew() {
} }
function onClickDownload(data: DataOption) { function onClickDownload(data: DataOption) {
console.log(data); showLoader();
// showLoader(); if (data.id === "emp-08") {
// http const formData = {
// .get(config.API.salaryReportByid(salaryId.value)) type: "HAFT",
// .then((res) => { startDate:
// const dataList = res.data.result; props?.roundFilter?.shortCode === "APR"
// genReportXLSX(dataList, ""); ? `${props?.roundFilter?.year - 1}-10-01`
// }) : `${props?.roundFilter?.year}-04-01`,
// .catch((e) => { endDate:
// messageError($q, e); props?.roundFilter?.shortCode === "APR"
// }) ? `${props?.roundFilter?.year}-03-31`
// .finally(() => { : `${props?.roundFilter?.year}-09-30`,
// hideLoader(); };
// }); http
.post(config.API.leaveReportLeaveday("employee"), formData)
.then((res) => {
const dataList = res.data.result;
genReportXLSX(dataList, data.name);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
} else {
if (props.rootId && props.periodId) {
http
.get(
config.API.salaryReportListsByid(
data.id,
props.rootId,
props.periodId
)
)
.then((res) => {
const dataList = res.data.result;
genReportXLSX(dataList, data.name);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
}
} }
const modalDialogInfoCriteria = ref<boolean>(false); const modalDialogInfoCriteria = ref<boolean>(false);