Merge branch 'nice_dev' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-20 11:32:06 +07:00
commit 8af904dcd2
2 changed files with 39 additions and 7 deletions

View file

@ -33,6 +33,7 @@ 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>();
@ -228,9 +229,9 @@ function fetchDataQuota(id: string) {
.get(config.API.salaryListPeriodQuota(id))
.then((res) => {
const data = res.data.result;
store.remaining = data.remaining;
store.statusQuota = data.status
store.statusQuota = data.status;
itemsCard.value[0].total = data.total;
itemsCard.value[1].total = data.fifteenPercent;
itemsCard.value[2].total = data.chosen;
@ -308,12 +309,20 @@ function fetchDataPeriodNew() {
}
function onClickDownload(data: DataOption) {
if (props.rootId && props.periodId) {
showLoader();
if (data.id === "gov1-06" || data.id === "gov2-06") {
const formData = {
type: "HAFT",
startDate:
data.id === "gov1-06"
? `${props?.roundFilter?.year - 1}-10-01`
: `${props?.roundFilter?.year}-04-01`,
endDate:
data.id === "gov1-06"
? `${props?.roundFilter?.year}-03-31`
: `${props?.roundFilter?.year}-09-30`,
};
http
.get(
config.API.salaryReportListsByid(data.id, props.rootId, props.periodId)
)
.post(config.API.leaveReportLeaveday("officer"), formData)
.then((res) => {
const dataList = res.data.result;
genReportXLSX(dataList, data.name);
@ -324,6 +333,28 @@ function onClickDownload(data: DataOption) {
.finally(() => {
hideLoader();
});
} else {
if (props.rootId && props.periodId) {
showLoader();
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();
});
}
}
}

View file

@ -428,6 +428,7 @@ onMounted(async () => {
:periodLatest="periodLatest"
:periodId="roundFilter.id"
:rootId="agencyFilter"
:roundFilter="roundFilter"
/>
<q-card v-else class="q-pa-sm">
<div class="q-pa-sm">