Refactoring code module 06_retirement
This commit is contained in:
parent
1225254062
commit
ea921b39b0
29 changed files with 730 additions and 823 deletions
|
|
@ -2,21 +2,18 @@
|
|||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
/** importType*/
|
||||
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
||||
import type { ResDetailDeceased } from "@/modules/06_retirement/interface/response/Deceased";
|
||||
|
||||
/** importComponents*/
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
import genReport from "@/plugins/genreport";
|
||||
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
||||
import type { ResDetailDeceased } from "@/modules/06_retirement/interface/response/Deceased";
|
||||
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
|
||||
/**use*/
|
||||
const $q = useQuasar();
|
||||
|
|
@ -30,13 +27,8 @@ const detail = ref<ResDetailDeceased>();
|
|||
|
||||
const dataProfile = ref<DataProfile>();
|
||||
|
||||
/** Hook */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
//นำข้อมูลจาก API มาแสดง
|
||||
const fetchData = async () => {
|
||||
/** นำข้อมูลจาก API มาแสดง */
|
||||
async function fetchData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailDeceased(profileId.value))
|
||||
|
|
@ -52,23 +44,23 @@ const fetchData = async () => {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
//เปิดdetail ของ deceased
|
||||
const openDeceased = (id: string) => {
|
||||
/** เปิดdetail ของ deceased */
|
||||
function openDeceased(id: string) {
|
||||
router.push(`/retirement/deceased/detail/${id}`);
|
||||
};
|
||||
}
|
||||
|
||||
//ไปหน้าถัดไป
|
||||
const nextPage = (page: string) => {
|
||||
/** ไปหน้าถัดไป */
|
||||
function nextPage(page: string) {
|
||||
window.open(page, "_blank");
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่น ดาว์โหลด
|
||||
* @param type typeของรายละเอียด
|
||||
*/
|
||||
const fileDownload = async (type: string) => {
|
||||
async function fileDownload(type: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.DeceasedReport(type, profileId.value))
|
||||
|
|
@ -86,7 +78,12 @@ const fileDownload = async (type: string) => {
|
|||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
};
|
||||
}
|
||||
|
||||
/** Hook */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue