diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 10cb37f18..7bd5d227d 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -250,12 +250,12 @@ const menuList = readonly([ 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([ }, ], }, - { - 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([ diff --git a/src/modules/04_registry/components/Profile.vue b/src/modules/04_registry/components/Profile.vue index 720a41488..48a3fe0c4 100644 --- a/src/modules/04_registry/components/Profile.vue +++ b/src/modules/04_registry/components/Profile.vue @@ -153,16 +153,18 @@ - + @@ -219,7 +221,6 @@ clickable v-close-popup @click="clickPassaway" - v-if="profileType == 'officer'" > @@ -275,7 +276,8 @@ - + ดาวน์โหลดไฟล์ diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index 1d1721279..8e0216303 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -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([ + { + 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); +};