Merge branch 'warunee-dev' into develop

This commit is contained in:
Warunee Tamkoo 2023-10-10 12:03:59 +07:00
commit b65ce3b713
4 changed files with 134 additions and 44 deletions

View file

@ -250,12 +250,12 @@ const menuList = readonly<any[]>([
path: "appoint-promote",
role: "placement",
},
// {
// key: 6.8,
// label: "รายการแต่งตั้งลูกจ้างประจำ",
// path: "appoint-employee",
// role: "placement",
// },
{
key: 6.8,
label: "รายการแต่งตั้งลูกจ้างประจำ",
path: "appoint-employee",
role: "placement",
},
// {
// key: 6.9,
// label: "รายการย้าย",
@ -374,34 +374,34 @@ const menuList = readonly<any[]>([
},
],
},
{
key: 9,
icon: "mdi-calendar",
activeIcon: "mdi-calendar",
label: "การลา",
path: "leave",
role: "coin",
children: [
{
key: 9.1,
label: "รายการลงเวลาปฏิบัติงาน",
path: "/work-list",
role: "coin",
},
{
key: 9.2,
label: "รายการลา",
path: "/leave-list",
role: "coin",
},
{
key: 9.3,
label: "รายงานสถิติ",
path: "/statistics-report",
role: "coin",
},
],
},
// {
// key: 9,
// icon: "mdi-calendar",
// activeIcon: "mdi-calendar",
// label: "การลา",
// path: "leave",
// role: "coin",
// children: [
// {
// key: 9.1,
// label: "รายการลงเวลาปฏิบัติงาน",
// path: "/work-list",
// role: "coin",
// },
// {
// key: 9.2,
// label: "รายการลา",
// path: "/leave-list",
// role: "coin",
// },
// {
// key: 9.3,
// label: "รายงานสถิติ",
// path: "/statistics-report",
// role: "coin",
// },
// ],
// },
]);
const tabList = readonly<tabType[]>([

View file

@ -153,16 +153,18 @@
</div>
</div>
<q-space />
<q-btn
round
flat
color="blue"
icon="mdi-file-document"
v-if="
profileType == 'officer' ||
(profileType == 'employee' && employeeClass == 'perm')
"
round
flat
:color="reasonStatus ? 'primary' : 'pink-5'"
:icon="
reasonStatus ? 'mdi-home-import-outline' : 'mdi-home-export-outline'
"
>
<q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 160px">
@ -219,7 +221,6 @@
clickable
v-close-popup
@click="clickPassaway"
v-if="profileType == 'officer'"
>
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section>
@ -275,7 +276,8 @@
<!-- <q-tooltip>งรายช</q-tooltip> -->
</q-btn>
<q-btn
<!-- ดไปเพราะทำสวนของพนราชการแล -->
<!-- <q-btn
round
flat
:color="reasonStatus ? 'primary' : 'pink-5'"
@ -287,7 +289,7 @@
<q-tooltip>{{
reasonStatus ? "การกลับเข้ารับราชการ" : "การออกจากราชการ"
}}</q-tooltip>
</q-btn>
</q-btn> -->
<q-btn icon="mdi-file-eye-outline" round color="primary" flat>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip>

View file

@ -11,7 +11,7 @@ import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
import type { TypeFile } from "@/modules/06_retirement/interface/response/Main";
import type { TypeFile, rowFile } from "@/modules/06_retirement/interface/response/Main";
import type { QTableProps } from "quasar";
const $q = useQuasar();
@ -331,6 +331,42 @@ const statusOrder = (val: boolean) => {
return "อนุมัติการลาออก";
}
};
//
const rowsFileDownload = ref<rowFile[]>([
{
fileName:
"แบบฟอร์มหนังสือขอลาออกจากราชการ",
pathName: "",
}
]);
const fileDownload = async (type: string, fileName: string) => {
showLoader();
await http
.get(config.API.reportResignList(type, id.value), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(res, `${fileName}.${type}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
@ -527,6 +563,53 @@ const statusOrder = (val: boolean) => {
</d-table>
</div>
</q-card>
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">เอกสารดาวนโหลด</div>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12">
<d-table
:rows="rowsFileDownload"
:columns="columns"
row-key="fileName"
hide-header
hide-bottom
>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td key="fileName" :props="props">
{{ props.row.fileName }}
</q-td>
<q-td key="btnMicrosoft" :props="props">
<q-btn
flat
dense
round
color="red"
icon="picture_as_pdf"
@click="fileDownload('pdf', props.row.fileName)"
>
<q-tooltip>ไฟล PDF</q-tooltip>
</q-btn>
<q-btn
flat
dense
round
color="blue"
icon="mdi-file-word"
@click="fileDownload('docx', props.row.fileName)"
>
<q-tooltip>ไฟล WORD</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-card>
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">

View file

@ -35,4 +35,9 @@ interface TypeFile {
pathName: string;
}
export type { resMain, ResponseItems, TypeFile };
interface rowFile {
fileName: string
pathName: string
}
export type { resMain, ResponseItems, TypeFile, rowFile };