diff --git a/src/api/reports/api.report.ts b/src/api/reports/api.report.ts
index fbfdffce7..940e15765 100644
--- a/src/api/reports/api.report.ts
+++ b/src/api/reports/api.report.ts
@@ -7,6 +7,7 @@ const reportRetire = `${env.API_REPORT2_URI}/report/retire`;
const reportProbation = `${env.API_REPORT2_URI}/report/probation`;
const reportResign = `${env.API_REPORT2_URI}/report/resign/33`;
const reportTransfer = `${env.API_REPORT2_URI}/report/transfer`;
+const reportDeceased = `${env.API_REPORT2_URI}/report/deceased`;
export default {
reportOrderCover: (fileType: string, id: string, commandCode: string) =>
@@ -34,5 +35,12 @@ export default {
reportSurvey:(type:string, id:string) => `${reportProbation}/19/${type}/${id}`,
//filetransfer
- reportTransferFile:(no:number,type:string,id:string) => `${reportTransfer}/${no}/${type}/${id}`
+ reportTransferFile:(no:number,type:string,id:string) => `${reportTransfer}/${no}/${type}/${id}`,
+
+ DeceasedReport:(type:string,id:string) => `${reportDeceased}/36/${type}/${id}`
+
+
+
+
+
};
diff --git a/src/modules/06_retirement/components/resign/DetailByidDeceased.vue b/src/modules/06_retirement/components/resign/DetailByidDeceased.vue
new file mode 100644
index 000000000..0a149c31a
--- /dev/null
+++ b/src/modules/06_retirement/components/resign/DetailByidDeceased.vue
@@ -0,0 +1,702 @@
+
+
+
+
+
+ ส่งหนังสือเวียน
+
+
+
+
+
+ เพิ่มข้อมูล
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ col.label }}
+
+
+
+
+
+
+
+ {{ props.rowIndex + 1 }}
+
+
+ {{ props.row.idCard }}
+
+
+ {{ props.row.name }}
+
+
+ {{ props.row.position }}
+
+
+ {{ props.row.unit }}
+
+
+ updateData(props.row)"
+ >
+
+
+
+ ไม่พบข้อมูลที่ค้นหา
+
+
+
+
+
+
+
+ ลบข้อมูล
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.rowIndex + 1 }}
+
+
+
+ {{ props.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/modules/06_retirement/components/resign/DetailDeceased.vue b/src/modules/06_retirement/components/resign/DetailDeceased.vue
index 1b545e6c9..869c9e0be 100644
--- a/src/modules/06_retirement/components/resign/DetailDeceased.vue
+++ b/src/modules/06_retirement/components/resign/DetailDeceased.vue
@@ -69,6 +69,7 @@
dense
icon-right="mdi-file-pdf"
class="q-px-sm"
+ @click="fileDownload('pdf')"
/>
@@ -126,6 +128,19 @@
+
+
@@ -144,6 +159,7 @@ const route = useRoute();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
+const fullName = ref("");
const profileId = ref(route.params.id.toString());
const detail = ref([]);
@@ -156,7 +172,9 @@ const fectdata = async () => {
await http
.get(config.API.detailDeceased(profileId.value))
.then((res) => {
- detail.value = res.data.result;
+ const data = res.data.result;
+ detail.value = data;
+ fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
console.log(detail.value);
})
.catch((e) => {
@@ -171,9 +189,41 @@ const redirectToRegistry = (id: string) => {
console.log(id);
router.push(`/registry/${id}`);
};
+const openDeceased = (id:string) => {
+ router.push(`/deceased/detail/${id}`);
+}
const nextPage = (page: string) => {
window.open(page, "_blank");
};
+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);
+};
+
+const fileDownload = async (type: string) => {
+ showLoader();
+ await http
+ .get(config.API.DeceasedReport(type, profileId.value), {
+ responseType: "blob",
+ })
+ .then((res) => {
+ downloadFile(
+ res,
+ `รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName}.${type}`
+ );
+ })
+ .catch((e) => {
+ messageError($q, e);
+ })
+ .finally(() => {
+ hideLoader();
+ });
+};