fix(checkin-report): resolve preview display issue for typeReport 4

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-04-01 11:33:33 +07:00
parent 514de15f09
commit a6018507c9

View file

@ -269,6 +269,7 @@ async function fetchLeaveday(
* @param data อมลบญชนลา
*/
async function fetchDocumentTemplate(data: any) {
if (typeReport.value === 4) return;
await axios
.post(`${config.API.reportTemplate}/xlsx`, data, {
headers: {
@ -352,7 +353,7 @@ function clearData() {
};
}
function onSearch() {
async function onSearch() {
isReport.value = false;
isLoadPDF.value = true;
pdfSrc.value = undefined;
@ -467,6 +468,19 @@ const reportName = () => {
return reportNameVal + employeeClassName;
};
async function handleDownload() {
updateLeaveday();
await fetchLeaveday(
employeeClass.value,
typeReport.value == 3 || typeReport.value == 4
? leaveType.value
: yearType.value,
dateStart.value,
dateEnd.value
);
await genReportXLSX(detailReport.value, `${reportName()}`);
}
onMounted(() => {
fetchDataTree();
});
@ -512,7 +526,11 @@ onMounted(() => {
round
color="primary"
icon="download"
v-if="checkPermission($route)?.attrIsGet && typeReport !== 3"
v-if="
checkPermission($route)?.attrIsGet &&
typeReport !== 3 &&
typeReport !== 4
"
>
<q-menu>
<q-list style="min-width: 150px">
@ -547,8 +565,11 @@ onMounted(() => {
round
color="primary"
icon="download"
v-if="checkPermission($route)?.attrIsGet && typeReport == 3"
@click="getReport()"
v-if="
checkPermission($route)?.attrIsGet &&
(typeReport == 3 || typeReport == 4)
"
@click="typeReport == 3 ? getReport() : handleDownload()"
>
</q-btn>
</div>
@ -957,7 +978,7 @@ onMounted(() => {
<q-separator />
<q-card-actions align="right">
<q-btn
v-if="typeReport !== 3"
v-if="typeReport !== 3 && typeReport !== 4"
dense
class="q-px-md"
label="ค้นหา"
@ -976,7 +997,7 @@ onMounted(() => {
</div>
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
<q-splitter
v-if="typeReport !== 3"
v-if="typeReport !== 3 && typeReport !== 4"
disable
v-model="splitterModel"
horizontal