รายการเลื่อนค่าจ้างลูกจ้างประจำ => download Report
This commit is contained in:
parent
63b1c0d32e
commit
a7a76c6d3f
1 changed files with 61 additions and 25 deletions
|
|
@ -30,6 +30,9 @@ const { messageError, showLoader, hideLoader } = useCounterMixin();
|
|||
/** props*/
|
||||
const props = defineProps({
|
||||
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>();
|
||||
|
|
@ -269,17 +272,17 @@ function fetchDataPeriod(id: string) {
|
|||
}
|
||||
|
||||
/**function เปลี่ยนกลุ่ม*/
|
||||
function changeTabGroup() {
|
||||
formFilter.page = 1;
|
||||
formFilter.pageSize = 10;
|
||||
formFilter.keyword = "";
|
||||
store.tabType = "PENDING";
|
||||
props.periodLatest &&
|
||||
store.fetchPeriodLatest(props?.periodLatest, store.tabGroup);
|
||||
store.groupId && fetchDataQuota(store.groupId);
|
||||
store.groupId && fetchDataPeriod(store.groupId);
|
||||
splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
|
||||
}
|
||||
// function changeTabGroup() {
|
||||
// formFilter.page = 1;
|
||||
// formFilter.pageSize = 10;
|
||||
// formFilter.keyword = "";
|
||||
// store.tabType = "PENDING";
|
||||
// props.periodLatest &&
|
||||
// store.fetchPeriodLatest(props?.periodLatest, store.tabGroup);
|
||||
// store.groupId && fetchDataQuota(store.groupId);
|
||||
// store.groupId && fetchDataPeriod(store.groupId);
|
||||
// splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
|
||||
// }
|
||||
|
||||
/**function เปลี่ยนขั้น*/
|
||||
function changeTabType() {
|
||||
|
|
@ -296,20 +299,53 @@ function fetchDataPeriodNew() {
|
|||
}
|
||||
|
||||
function onClickDownload(data: DataOption) {
|
||||
console.log(data);
|
||||
// showLoader();
|
||||
// http
|
||||
// .get(config.API.salaryReportByid(salaryId.value))
|
||||
// .then((res) => {
|
||||
// const dataList = res.data.result;
|
||||
// genReportXLSX(dataList, "อัตราเงินเดือน");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
showLoader();
|
||||
if (data.id === "emp-08") {
|
||||
const formData = {
|
||||
type: "HAFT",
|
||||
startDate:
|
||||
props?.roundFilter?.shortCode === "APR"
|
||||
? `${props?.roundFilter?.year - 1}-10-01`
|
||||
: `${props?.roundFilter?.year}-04-01`,
|
||||
endDate:
|
||||
props?.roundFilter?.shortCode === "APR"
|
||||
? `${props?.roundFilter?.year}-03-31`
|
||||
: `${props?.roundFilter?.year}-09-30`,
|
||||
};
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue