fixing registry

This commit is contained in:
Warunee Tamkoo 2025-02-20 17:31:15 +07:00
parent 2cd133dce9
commit c03bcb3928
4 changed files with 95 additions and 86 deletions

View file

@ -215,17 +215,17 @@ function redirectToPagePetition() {
}
}
function onGovernment() {
modalReport.value = true;
}
// function onGovernment() {
// modalReport.value = true;
// }
function closeDialog() {
modalReport.value = false;
rangeAge.value = {
min: 18,
max: 60,
};
}
// function closeDialog() {
// modalReport.value = false;
// rangeAge.value = {
// min: 18,
// max: 60,
// };
// }
async function getReport() {
loadingBtn.value = true;
@ -250,46 +250,46 @@ async function getReport() {
});
}
/**
* function เรยกไฟล XLSX
* @param data อมลรายงานสถการล
*/
async function genReportXLSX(data: any) {
await axios
.post(`${config.API.reportTemplate}/xlsx`, data, {
headers: {
accept:
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"content-Type": "application/json",
},
responseType: "blob",
})
.then(async (res) => {
const blob = new Blob([res.data]);
await downloadReport(blob, "xlsx");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
});
}
// /**
// * function XLSX
// * @param data
// */
// async function genReportXLSX(data: any) {
// await axios
// .post(`${config.API.reportTemplate}/xlsx`, data, {
// headers: {
// accept:
// "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
// "content-Type": "application/json",
// },
// responseType: "blob",
// })
// .then(async (res) => {
// const blob = new Blob([res.data]);
// await downloadReport(blob, "xlsx");
// })
// .catch(async (e) => {
// messageError($q, JSON.parse(await e.response.data.text()));
// });
// }
/**
*
* @param data อมลรายงานสถการล
* @param type นามสกลไฟ
*/
async function downloadReport(data: any, type: string) {
const link = document.createElement("a");
var fileName =
empType.value == "officer"
? "รายงานสถิติข้อมูลข้าราชการ กทม. สามัญ"
: "รายงานสถิติข้อมูลลูกจ้างประจำ กทม.";
link.href = window.URL.createObjectURL(new Blob([data]));
link.setAttribute("download", `${fileName}.${type}`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
// /**
// *
// * @param data
// * @param type
// */
// async function downloadReport(data: any, type: string) {
// const link = document.createElement("a");
// var fileName =
// empType.value == "officer"
// ? " . "
// : " .";
// link.href = window.URL.createObjectURL(new Blob([data]));
// link.setAttribute("download", `${fileName}.${type}`);
// document.body.appendChild(link);
// link.click();
// document.body.removeChild(link);
// }
/**
* การเปลยนแปลงของ formFilter.value.pageSize
@ -334,7 +334,7 @@ watch(
พบขอมลทงหมด {{ total.toLocaleString() }} รายการ
</div>
<!-- empType === "officer" ? -->
<div>
<!-- <div>
<q-btn
flat
dense
@ -348,7 +348,7 @@ watch(
}}</q-tooltip
></q-btn
>
</div>
</div> -->
<q-select
v-if="store.mode === 'table'"
v-model="visibleColumns"
@ -626,14 +626,14 @@ watch(
<q-dialog v-model="modalReport" persistent>
<q-card class="col-12" style="width: 40%">
<DialogHeader
<!-- <DialogHeader
:tittle="
empType == 'officer'
? 'รายงานสถิติข้อมูลข้าราชการ กทม. สามัญ'
: 'รายงานสถิติข้อมูลลูกจ้างประจำ กทม.'
"
:close="closeDialog"
/>
/> -->
<q-separator />
<q-card-section class="q-pa-lg">
<div class="column q-pa-sm q-gutter-y-sm">