diff --git a/src/modules/06_retirement/components/ExitInterview/exitMain.vue b/src/modules/06_retirement/components/ExitInterview/exitMain.vue
index eb2a63ba1..50135ce82 100644
--- a/src/modules/06_retirement/components/ExitInterview/exitMain.vue
+++ b/src/modules/06_retirement/components/ExitInterview/exitMain.vue
@@ -2,17 +2,17 @@
import { ref, onMounted } from "vue";
import { useQuasar, QForm } from "quasar";
import { useRouter } from "vue-router";
-import { useCounterMixin } from "@/stores/mixin";
+
import http from "@/plugins/http";
import config from "@/app.config";
+import { useCounterMixin } from "@/stores/mixin";
+import { checkPermission } from "@/utils/permissions";
-/**Import type */
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/exitInterview";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
-import DialogHeader from "@/components/DialogHeader.vue";
-import { checkPermission } from "@/utils/permissions";
+import DialogHeader from "@/components/DialogHeader.vue";
/** use */
const $q = useQuasar(); //ใช้ noti quasar
@@ -157,16 +157,8 @@ const modal = ref
(false);
const filterKeyword = ref("");
const filterRef = ref(null);
-/** HOOK */
-onMounted(async () => {
- await fecthlist();
- if (columns.value) {
- visibleColumns.value = columns.value.map((r: any) => r.name);
- }
-});
-
//นำข้อมูลจาก API มาแสดง
-const fecthlist = async () => {
+async function fecthlist() {
showLoader();
await http
.get(config.API.listExitInterview())
@@ -202,10 +194,10 @@ const fecthlist = async () => {
.finally(() => {
hideLoader();
});
-};
+}
//กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก
-const saveAppoint = async () => {
+async function saveAppoint() {
await myForm.value!.validate().then(async (result: boolean) => {
if (result) {
dialogConfirm($q, async () => {
@@ -229,13 +221,13 @@ const saveAppoint = async () => {
});
}
});
-};
+}
/**
* ฟังก์ชั่น validate DATE ไทย
* @param thaiDate วันที่ไทย
*/
-const validationDate = (thaiDate: string | null) => {
+function validationDate(thaiDate: string | null) {
if (thaiDate && daterow.value) {
let a = convertThaiDateToNumeric(thaiDate);
let b = daterow.value;
@@ -243,10 +235,10 @@ const validationDate = (thaiDate: string | null) => {
return a > b;
}
}
-};
+}
//แปลงเดือนจากตัวเลขเป็นภาษาอ่าน
-const convertThaiDateToNumeric = (thaiDate: string) => {
+function convertThaiDateToNumeric(thaiDate: string) {
const parts = thaiDate.split(" ");
if (parts.length !== 3) return null;
const [day, month, year] = parts;
@@ -267,22 +259,31 @@ const convertThaiDateToNumeric = (thaiDate: string) => {
if (!(month in monthMap)) return null;
const numericDate = `${year}${monthMap[month]}${day}`;
return numericDate;
-};
+}
/**
* modal Setting
*/
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
-const resetFilter = () => {
+function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
-};
-const openModalCalendar = (rows: any) => {
+}
+
+function openModalCalendar(rows: any) {
openModal();
dateBreak.value = null;
id.value = rows.id;
daterow.value = convertThaiDateToNumeric(rows.datetext);
-};
+}
+
+/** HOOK */
+onMounted(async () => {
+ await fecthlist();
+ if (columns.value) {
+ visibleColumns.value = columns.value.map((r: any) => r.name);
+ }
+});
@@ -445,9 +446,7 @@ const openModalCalendar = (rows: any) => {
- {{
- props.row.appointDate ? props.row.appointDate : "-"
- }}
+ {{ props.row.appointDate ? props.row.appointDate : "-" }}
{{ props.row.datetext ? props.row.datetext : "-" }}
diff --git a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue
index 37f26baec..f1310c278 100644
--- a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue
+++ b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue
@@ -2,15 +2,17 @@
import { onMounted, reactive, ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
-import { useCounterMixin } from "@/stores/mixin";
+
import http from "@/plugins/http";
import config from "@/app.config";
import { tokenParsed } from "@/plugins/auth";
+import { useCounterMixin } from "@/stores/mixin";
/**import type*/
import type {
OptionQuestions,
OptionQuestions2,
+ QuestionDesc,
} from "@/modules/06_retirement/interface/request/Main";
import type { QForm } from "quasar";
@@ -80,18 +82,29 @@ const haveJobReason = ref("");
const futureWorkReason = ref("");
const adjustOther = ref("");
-/** HOOK */
-onMounted(async () => {
- const user = await tokenParsed();
- if (user) {
- roleAdmin.value = await user.role.includes("placement1");
- }
- await getData();
- await fecthquestion();
+// เรียกคำถามแบบสอบถาม
+const questionDesc = reactive({
+ question1Desc: "",
+ question2Desc: "",
+ question3Desc: "",
+ question4Desc: "",
+ question5Desc: "",
+ question6Desc: "",
+ question7Desc: "",
+ question8Desc: "",
+ question9Desc: "",
+ question10Desc: "",
});
+const question1Answer = ref([]);
+const question2Answer = ref([]);
+const question3Answer = ref([]);
+const question4Answer = ref([]);
+const question7Answer = ref([]);
+const question8Answer = ref([]);
+const question9Answer = ref([]);
//นำข้อมูลมาแสดง
-const getData = async () => {
+async function getData() {
showLoader();
await http
.get(config.API.ExitInterviewByid(dataId))
@@ -133,29 +146,8 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
-};
-// เรียกคำถามแบบสอบถาม
-const questionDesc = reactive([
- {
- question1Desc: "",
- question2Desc: "",
- question3Desc: "",
- question4Desc: "",
- question5Desc: "",
- question6Desc: "",
- question7Desc: "",
- question8Desc: "",
- question9Desc: "",
- question10Desc: "",
- },
-]);
-const question1Answer = ref([]);
-const question2Answer = ref([]);
-const question3Answer = ref([]);
-const question4Answer = ref([]);
-const question7Answer = ref([]);
-const question8Answer = ref([]);
-const question9Answer = ref([]);
+}
+
async function fecthquestion() {
showLoader();
await http
@@ -164,8 +156,8 @@ async function fecthquestion() {
const data = await result.data.result;
// คำถามแบบสอบถามหลัก
for (let i = 1; i <= 10; i++) {
- questionDesc[`question${i}Desc`] =
- `${i}.` + " " + data[`question${i}Desc`];
+ const key = `question${i}Desc` as keyof QuestionDesc;
+ questionDesc[key] = `${i}.` + " " + data[key];
}
// คำถามแบบสอบถามย่อย
const Answer1 = data.question1Answer.map((e: any, index: number) => ({
@@ -227,17 +219,11 @@ async function fecthquestion() {
hideLoader();
});
}
-//รวมคะเเนน
-watch(score, () => {
- scoreTotal.value = score.reduce((accumulator, object) => {
- return accumulator + Number(object.score);
- }, 0);
-});
/**
* บันทึกให้คะเเนน
*/
-const saveClick = () => {
+function saveClick() {
if (
comment.value === "" ||
score[0].score === "" ||
@@ -256,12 +242,12 @@ const saveClick = () => {
} else {
dialogConfirm($q, () => putData());
}
-};
+}
/**
* ส่งคะเเนนผ่าน API
*/
-const putData = () => {
+function putData() {
const body = {
score1: Number(score[0].score),
score2: Number(score[1].score),
@@ -289,7 +275,24 @@ const putData = () => {
.finally(() => {
hideLoader();
});
-};
+}
+
+//รวมคะเเนน
+watch(score, () => {
+ scoreTotal.value = score.reduce((accumulator, object) => {
+ return accumulator + Number(object.score);
+ }, 0);
+});
+
+/** HOOK */
+onMounted(async () => {
+ const user = await tokenParsed();
+ if (user) {
+ roleAdmin.value = await user.role.includes("placement1");
+ }
+ await getData();
+ await fecthquestion();
+});
diff --git a/src/modules/06_retirement/components/Expulsion/DialogSendToCommand.vue b/src/modules/06_retirement/components/Expulsion/DialogSendToCommand.vue
index f7cddd7dc..4cbba1fcd 100644
--- a/src/modules/06_retirement/components/Expulsion/DialogSendToCommand.vue
+++ b/src/modules/06_retirement/components/Expulsion/DialogSendToCommand.vue
@@ -1,12 +1,15 @@
diff --git a/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue b/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue
index ebabc108c..574170e0d 100644
--- a/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue
+++ b/src/modules/06_retirement/components/Expulsion/expulsionRegistry.vue
@@ -2,19 +2,20 @@
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
-import { useCounterMixin } from "@/stores/mixin";
-import CurrencyInput from "@/components/CurruncyInput.vue";
+
import http from "@/plugins/http";
import config from "@/app.config";
+import { useCounterMixin } from "@/stores/mixin";
+
import { tokenParsed } from "@/plugins/auth";
/**Import Type */
import type { QForm } from "quasar";
import type { ResponseDataDetail } from "@/modules/06_retirement/interface/response/expulsion";
-import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
-const modalPersonal = ref(false);
-const personId = ref("");
+import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
+import CurrencyInput from "@/components/CurruncyInput.vue";
+
/** Use */
const $q = useQuasar();
const route = useRoute();
@@ -30,6 +31,9 @@ const {
dialogConfirm,
} = mixin;
+const modalPersonal = ref(false);
+const personId = ref("");
+
/**ตัวแปร */
const myForm = ref(null);
const roleAdmin = ref(false);
@@ -61,19 +65,10 @@ const responseData = ref({
fullname: "",
});
-/**Hook */
-onMounted(async () => {
- const user = await tokenParsed();
- if (user) {
- roleAdmin.value = await user.role.includes("placement1");
- }
- await getData();
-});
-
/**
* นำข้อมูลมาจาก API
*/
-const getData = async () => {
+async function getData() {
showLoader();
await http
.get(config.API.expulsionByid(dataId))
@@ -115,18 +110,18 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
-};
+}
/**ฟังก์ชั่นcancel */
-const clickCancel = async () => {
+async function clickCancel() {
await getData();
edit.value = false;
-};
+}
/**
* Functionบันทึก
*/
-const conditionSave = async () => {
+async function conditionSave() {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
@@ -141,9 +136,9 @@ const conditionSave = async () => {
}
});
}
-};
+}
//Save จาก Api
-const saveData = async () => {
+async function saveData() {
const body = {
organization: organization.value,
reason: reason.value,
@@ -168,18 +163,18 @@ const saveData = async () => {
await getData();
hideLoader();
});
-};
+}
/**
* Function เพิ่ม Class เวลา Edit
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
*/
-const getClass = (val: boolean) => {
+function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
-};
+}
function onclickViewinfo(id: string) {
modalPersonal.value = true;
@@ -189,6 +184,15 @@ function onclickViewinfo(id: string) {
function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
+
+/**Hook */
+onMounted(async () => {
+ const user = await tokenParsed();
+ if (user) {
+ roleAdmin.value = await user.role.includes("placement1");
+ }
+ await getData();
+});
@@ -377,20 +381,6 @@ function updatemodalPersonal(modal: boolean) {
-
(false);
const retireld = ref();
const type = ref();
-const filter = ref("");
/** คอลัมน์ */
const columns = ref([
@@ -76,22 +76,7 @@ const columns = ref([
align: "left",
},
]);
-const rows = ref([]);
-
-watch(modal, () => {
- if (modal.value === true) {
- retireld.value = props.retireld;
- formPagePersonList.page = 1;
- formPagePersonList.keyword = "";
- if (props.dataProfile) {
- if (props.dataProfile.type === "OFFICER") {
- type.value = "officer";
- } else type.value = "all";
- }
-
- fecthProfile();
- }
-});
+const rows = ref([]);
function findOrgChildName(obj: any) {
if (obj) {
@@ -134,7 +119,7 @@ const maxPage = ref(1);
const totalList = ref(0);
// fecth profile
-const fecthProfile = async () => {
+async function fecthProfile() {
showLoader();
if (props?.dataProfile?.type === "OFFICER") {
formPagePersonList.keyword =
@@ -200,10 +185,10 @@ const fecthProfile = async () => {
hideLoader();
});
}
-};
+}
// ยืนยันการเพิ่มราชชื่อ
-const clickAdd = (props: any) => {
+function clickAdd(props: any) {
if (retireld.value == undefined) {
retireld.value = retireld_params;
}
@@ -227,17 +212,22 @@ const clickAdd = (props: any) => {
"ยืนยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่ ?"
);
-};
+}
+
// update retireld
-const updateListData = (retireld: string, pId: string) => {
+function updateListData(retireld: string, pId: string) {
props.UpdateListId(retireld, pId);
-};
+}
function updatePageSize(newPagination: any) {
formPagePersonList.page = 1;
formPagePersonList.pageSize = newPagination.rowsPerPage;
}
+function closeDialog() {
+ modal.value = false;
+}
+
watch(
() => formPagePersonList.pageSize,
() => {
@@ -245,9 +235,20 @@ watch(
}
);
-function closeDialog() {
- modal.value = false;
-}
+watch(modal, () => {
+ if (modal.value === true) {
+ retireld.value = props.retireld;
+ formPagePersonList.page = 1;
+ formPagePersonList.keyword = "";
+ if (props.dataProfile) {
+ if (props.dataProfile.type === "OFFICER") {
+ type.value = "officer";
+ } else type.value = "all";
+ }
+
+ fecthProfile();
+ }
+});
@@ -357,18 +358,6 @@ function closeDialog() {
-
diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue
index 0a69855a2..8bd8075be 100644
--- a/src/modules/06_retirement/components/ListRetirement/TableList.vue
+++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue
@@ -9,6 +9,8 @@ import config from "@/app.config";
import genReport from "@/plugins/genreport";
import { useCounterMixin } from "@/stores/mixin";
+import type { RetirementList } from "@/modules/06_retirement/interface/index/Main";
+
import DialogHeader from "@/components/DialogHeader.vue";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
@@ -55,7 +57,7 @@ const dataProfile = ref
diff --git a/src/modules/06_retirement/components/ListRetirement/popupAdd.vue b/src/modules/06_retirement/components/ListRetirement/popupAdd.vue
index dd2b76c7e..07ed97229 100644
--- a/src/modules/06_retirement/components/ListRetirement/popupAdd.vue
+++ b/src/modules/06_retirement/components/ListRetirement/popupAdd.vue
@@ -1,10 +1,13 @@
([]);
+const pagination = ref({
+ sortBy: "createdAt",
+ descending: true,
+ page: 1,
+ rowsPerPage: 10,
+});
const columns = ref([
{
name: "no",
@@ -74,16 +74,6 @@ const columns = ref([
return name;
},
},
-
- // {
- // name: "positionExecutive",
- // align: "left",
- // label: "ตำแหน่งทางการบริหาร",
- // sortable: true,
- // field: "positionExecutive",
- // headerStyle: "font-size: 14px",
- // style: "font-size: 14px",
- // },
{
name: "org",
align: "left",
@@ -120,13 +110,8 @@ const visibleColumns = ref([
"createdAt",
]);
-/**Hook */
-onMounted(() => {
- fectListDecased();
-});
-
/**เรียกข้อมูลจาก APi */
-const fectListDecased = async () => {
+async function fectListDecased() {
showLoader();
await http
.get(config.API.listDeceased())
@@ -140,25 +125,24 @@ const fectListDecased = async () => {
.finally(() => {
hideLoader();
});
-};
+}
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
const filterKeyword = ref("");
const filterRef = ref(null);
-const resetFilter = () => {
+function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
-};
+}
/** Setting Pagination */
-const nextPage = (id: string) => {
+function nextPage(id: string) {
router.push("/retirement/deceased/" + id);
-};
-const pagination = ref({
- sortBy: "createdAt",
- descending: true,
- page: 1,
- rowsPerPage: 10,
+}
+
+/**Hook */
+onMounted(() => {
+ fectListDecased();
});
diff --git a/src/modules/06_retirement/components/resign/DetailByidDeceased.vue b/src/modules/06_retirement/components/resign/DetailByidDeceased.vue
index ebac6c8a4..6796c754e 100644
--- a/src/modules/06_retirement/components/resign/DetailByidDeceased.vue
+++ b/src/modules/06_retirement/components/resign/DetailByidDeceased.vue
@@ -1,22 +1,18 @@
diff --git a/src/modules/06_retirement/components/resign/DetailDeceased.vue b/src/modules/06_retirement/components/resign/DetailDeceased.vue
index 4220a9374..52fe82e93 100644
--- a/src/modules/06_retirement/components/resign/DetailDeceased.vue
+++ b/src/modules/06_retirement/components/resign/DetailDeceased.vue
@@ -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();
const dataProfile = ref();
-/** 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();
+});
diff --git a/src/modules/06_retirement/components/resign/DialogSendToCommand.vue b/src/modules/06_retirement/components/resign/DialogSendToCommand.vue
index f49e1da0f..9a0acc294 100644
--- a/src/modules/06_retirement/components/resign/DialogSendToCommand.vue
+++ b/src/modules/06_retirement/components/resign/DialogSendToCommand.vue
@@ -1,21 +1,39 @@
diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue
index 56f3df272..829a7c020 100644
--- a/src/modules/06_retirement/components/resign/ResignByid.vue
+++ b/src/modules/06_retirement/components/resign/ResignByid.vue
@@ -1,15 +1,17 @@
diff --git a/src/modules/06_retirement/components/resign/ResignOrder.vue b/src/modules/06_retirement/components/resign/ResignOrder.vue
index fc9be4c48..ede34b49a 100644
--- a/src/modules/06_retirement/components/resign/ResignOrder.vue
+++ b/src/modules/06_retirement/components/resign/ResignOrder.vue
@@ -1,12 +1,15 @@
คำสั่งลาออก
diff --git a/src/modules/06_retirement/interface/index/Main.ts b/src/modules/06_retirement/interface/index/Main.ts
index 1164a1f4b..fecf092dd 100644
--- a/src/modules/06_retirement/interface/index/Main.ts
+++ b/src/modules/06_retirement/interface/index/Main.ts
@@ -1,4 +1,48 @@
interface Pagination {
rowsPerPage: number;
}
-export type { Pagination };
+
+interface RetirementList {
+ id: string;
+ profileId: string;
+ order: number;
+ prefix: string;
+ firstName: string;
+ lastName: string;
+ name: string;
+ organization: string | null;
+ position: string;
+ positionNumber: string | null;
+ positionType: string;
+ positionLevel: string;
+ reason: string;
+ remove: string;
+ root: string | null;
+ rootId: string | null;
+ child1: string | null;
+ child1Id: string | null;
+ child2: string | null;
+ child2Id: string | null;
+ child3: string | null;
+ child3Id: string | null;
+ child4: string | null;
+ child4Id: string | null;
+}
+
+interface PersonData {
+ id: string;
+ prefix: string;
+ firstName: string;
+ lastName: string;
+ fullname: string;
+ position: string;
+ level: string;
+ organizationOrganization: string;
+}
+
+interface RoundData {
+ id: string;
+ round: string;
+}
+
+export type { Pagination, RetirementList, PersonData, RoundData };
diff --git a/src/modules/06_retirement/interface/request/Main.ts b/src/modules/06_retirement/interface/request/Main.ts
index 39687933d..d0c05ec40 100644
--- a/src/modules/06_retirement/interface/request/Main.ts
+++ b/src/modules/06_retirement/interface/request/Main.ts
@@ -7,4 +7,17 @@ interface OptionQuestions2 {
value: boolean;
}
-export type { OptionQuestions, OptionQuestions2 };
+interface QuestionDesc {
+ question1Desc: string;
+ question2Desc: string;
+ question3Desc: string;
+ question4Desc: string;
+ question5Desc: string;
+ question6Desc: string;
+ question7Desc: string;
+ question8Desc: string;
+ question9Desc: string;
+ question10Desc: string;
+}
+
+export type { OptionQuestions, OptionQuestions2,QuestionDesc };
diff --git a/src/modules/06_retirement/interface/response/Main.ts b/src/modules/06_retirement/interface/response/Main.ts
index 11d5d5dbc..374c4b665 100644
--- a/src/modules/06_retirement/interface/response/Main.ts
+++ b/src/modules/06_retirement/interface/response/Main.ts
@@ -51,6 +51,7 @@ interface CheckBoxType {
label: string;
value: string;
}
+
export type {
resMain,
ResponseItems,
diff --git a/src/modules/06_retirement/interface/response/expulsion.ts b/src/modules/06_retirement/interface/response/expulsion.ts
index c9fdd727e..e92d11b98 100644
--- a/src/modules/06_retirement/interface/response/expulsion.ts
+++ b/src/modules/06_retirement/interface/response/expulsion.ts
@@ -26,4 +26,21 @@ interface TypeFile {
pathName: string;
}
-export type { ResponseData, TypeFile };
+interface ResponseDataDetail {
+ personId: string;
+ avataPath: string;
+ createdAt: Date;
+ date: Date;
+ id: string;
+ organization: string;
+ organizationPositionOld: string;
+ positionLevelOld: string;
+ positionNumberOld: string;
+ positionTypeOld: string;
+ reason: string;
+ salary: number;
+ status: string;
+ fullname: string;
+}
+
+export type { ResponseData, TypeFile,ResponseDataDetail };
diff --git a/src/modules/06_retirement/router.ts b/src/modules/06_retirement/router.ts
index d0b9aa944..d1ce08838 100644
--- a/src/modules/06_retirement/router.ts
+++ b/src/modules/06_retirement/router.ts
@@ -7,8 +7,6 @@ const Listretirement = () =>
import("@/modules/06_retirement/components/ListRetirement/TableList.vue");
const ListretirementDetail = () =>
import("@/modules/06_retirement/components/ListRetirement/TableList.vue");
-// const resignOrder = () =>
-// import("@/modules/06_retirement/components/resign/ResignOrder.vue");
const resign = () =>
import("@/modules/06_retirement/components/resign/Resign.vue");
const resignByid = () =>
@@ -25,17 +23,6 @@ const outDetail = () =>
import("@/modules/06_retirement/components/DismissOrder/outRegistry.vue");
const outDetailOnly = () =>
import("@/modules/06_retirement/components/DismissOrder/outRegistry.vue");
-// const dischargedMain = () =>
-// import("@/modules/06_retirement/components/Discharged/dischargedMain.vue");
-// const dischargedDetails = () =>
-// import(
-// "@/modules/06_retirement/components/Discharged/dischargedRegistry.vue"
-// );
-// const expulsionMain = () =>
-// import("@/modules/06_retirement/components/Expulsion/expulsionMain.vue");
-
-// const expulsionDetails = () =>
-// import("@/modules/06_retirement/components/Expulsion/expulsionRegistry.vue");
const exitInterviewMain = () =>
import("@/modules/06_retirement/components/ExitInterview/exitMain.vue");
const exitInterviewDetails = () =>
diff --git a/src/modules/06_retirement/views/Main.vue b/src/modules/06_retirement/views/Main.vue
index 771ff190c..6e6a1f1ea 100644
--- a/src/modules/06_retirement/views/Main.vue
+++ b/src/modules/06_retirement/views/Main.vue
@@ -3,31 +3,41 @@ import { onMounted, ref, useAttrs, reactive, watch } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
+import { storeToRefs } from "pinia";
+
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStoreRetirement } from "@/modules/06_retirement/storeRetirement";
-import type { resMain } from "@/modules/06_retirement/interface/response/Main";
-import { storeToRefs } from "pinia";
-import popupAdd from "../components/ListRetirement/popupAdd.vue";
-
import { checkPermission } from "@/utils/permissions";
-const useStoreRetire = useDataStoreRetirement();
-const { clickTab } = useStoreRetire;
-const { tab, type } = storeToRefs(useDataStoreRetirement());
-const mixin = useCounterMixin();
-const { messageError, date2Thai, showLoader, hideLoader, dialogConfirm } =
- mixin;
-const router = useRouter();
-const $q = useQuasar(); //ใช้ noti quasar
+import type { resMain } from "@/modules/06_retirement/interface/response/Main";
-const fiscalyear = ref();
+import popupAdd from "@/modules/06_retirement/components/ListRetirement/popupAdd.vue";
+
+const $q = useQuasar(); //ใช้ noti quasar
+const router = useRouter();
+const mixin = useCounterMixin();
+const useStoreRetire = useDataStoreRetirement();
+const { tab, type } = storeToRefs(useDataStoreRetirement());
+const { clickTab } = useStoreRetire;
+const { messageError, date2Thai, showLoader, hideLoader } = mixin;
+
+const fiscalyear = ref(); // ปี
const yearOptionsFilter = ref({
yearOptions: [],
});
const actionOption = ref([]);
+const attrs = ref(useAttrs());
+const paging = ref(true);
+const pagination = ref({
+ sortBy: "",
+ descending: false,
+ page: 1,
+ rowsPerPage: 10,
+});
+
const visibleColumns = ref([
"no",
"signDate",
@@ -85,20 +95,10 @@ const currentYear = new Date().getFullYear();
const rows = ref([]);
const yearOptions = ref([{ id: "", year: "ทั้งหมด" }]);
-onMounted(async () => {
- await fetchRetirement(type.value, currentYear);
- // fiscalyear.value = currentYear + 543
- // await fetchRetirement(type.value, currentYear);
-});
// หาปีปัจจุบัน
-const filteryear = () => {
- // yearOptions.value.push({ id: currentYear, name: currentYear + 543 });
- // yearOptionsFilter.value = [{ id: currentYear, name: currentYear + 543 }];
- // yearOptionsFilter.value.push({ id: currentYear, name: currentYear + 543 });
- fetchRetirement(type.value, currentYear);
-};
+
// ประกาศเกษียณอายุราชการ
-const fetchRetirement = async (type: string, year: any) => {
+async function fetchRetirement(type: string, year: any) {
showLoader();
await http
.get(config.API.retirement(type, year))
@@ -155,57 +155,58 @@ const fetchRetirement = async (type: string, year: any) => {
.finally(() => {
hideLoader();
});
-};
+}
const checkjson = ref();
// เช็คสถานะ document ของประกาศเกษียณอายุราชการ
-const checkststus = (data: any) => {
+function checkststus(data: any) {
let jsonfasle = data.find((e: any) => e.document == false);
if (jsonfasle) {
checkjson.value = true;
} else checkjson.value = false;
-};
+}
// ค้นหาในตาราง
const filterKeyword = ref("");
const filterRef = ref(null);
-const resetFilter = () => {
+
+/** reset ฟิลเตอร์ */
+function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
-};
-const attrs = ref(useAttrs());
+}
-const paging = ref(true);
-const pagination = ref({
- sortBy: "",
- descending: false,
- page: 1,
- rowsPerPage: 10,
-});
-const filterSelector = (val: any, update: Function) => {
+/**
+ * ฟังชั่นฟิลเตอร์ input
+ * @param val input
+ * @param update Function quasar
+ */
+function filterSelector(val: any, update: Function) {
update(() => {
yearOptions.value = yearOptionsFilter.value.filter(
(v: any) => v.year.indexOf(val) > -1
);
});
-};
+}
-const paginationLabel = (start: string, end: string, total: string) => {
- if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
- else return start + "-" + end + " ใน " + total;
-};
-const nextPage = (prop: any) => {
+/**
+ * ไปหน้าแก้ไขรายละเอียด
+ * @param prop ข้อมูล
+ */
+function nextPage(prop: any) {
router.push(`/retirement/${prop.id}`);
-};
-const nextPageDetail = (prop: any) => {
- router.push(`/retirement-detail/${prop.id}`);
-};
+}
-watch(type, () => {
- fetchRetirement(type.value, currentYear);
-});
-//เปลี่ยนสถานะ
-const typeReportChangeName = (val: string) => {
+/**
+ * ไปหน้ารายละเอียด
+ * @param prop ข้อมูล
+ */
+function nextPageDetail(prop: any) {
+ router.push(`/retirement-detail/${prop.id}`);
+}
+
+/** แปลง status เป็น text */
+function typeReportChangeName(val: string) {
switch (val) {
case "EDIT":
return "ประกาศแก้ไขเกษียณ";
@@ -216,7 +217,15 @@ const typeReportChangeName = (val: string) => {
default:
return "ประกาศข้อมูลเกษียณ";
}
-};
+}
+
+watch(type, () => {
+ fetchRetirement(type.value, currentYear);
+});
+
+onMounted(async () => {
+ await fetchRetirement(type.value, currentYear);
+});
@@ -345,7 +354,6 @@ const typeReportChangeName = (val: string) => {
class="custom-header-table"
v-bind="attrs"
:visible-columns="visibleColumns"
- :pagination-label="paginationLabel"
v-model:pagination="pagination"
>