From c03bcb39284fc7cd504dbc4a673600ceb6b7cb57 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 20 Feb 2025 17:31:15 +0700 Subject: [PATCH] fixing registry --- .../components/TableView.vue | 106 +++++++++--------- src/modules/04_registryPerson/store.ts | 32 +++--- .../04_registryPerson/views/detailView.vue | 18 ++- .../04_registryPerson/views/listView.vue | 25 +++-- 4 files changed, 95 insertions(+), 86 deletions(-) diff --git a/src/modules/04_registryPerson/components/TableView.vue b/src/modules/04_registryPerson/components/TableView.vue index b7c7d91aa..9a737e39e 100644 --- a/src/modules/04_registryPerson/components/TableView.vue +++ b/src/modules/04_registryPerson/components/TableView.vue @@ -215,17 +215,17 @@ function redirectToPagePetition() { } } -function onGovernment() { - modalReport.value = true; -} +// function onGovernment() { +// modalReport.value = true; +// } -function closeDialog() { - modalReport.value = false; - rangeAge.value = { - min: 18, - max: 60, - }; -} +// function closeDialog() { +// modalReport.value = false; +// rangeAge.value = { +// min: 18, +// max: 60, +// }; +// } async function getReport() { loadingBtn.value = true; @@ -250,46 +250,46 @@ async function getReport() { }); } -/** - * function เรียกไฟล์ XLSX - * @param data ข้อมูลรายงานสถิติการลา - */ -async function genReportXLSX(data: any) { - await axios - .post(`${config.API.reportTemplate}/xlsx`, data, { - headers: { - accept: - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "content-Type": "application/json", - }, - responseType: "blob", - }) - .then(async (res) => { - const blob = new Blob([res.data]); - await downloadReport(blob, "xlsx"); - }) - .catch(async (e) => { - messageError($q, JSON.parse(await e.response.data.text())); - }); -} +// /** +// * function เรียกไฟล์ XLSX +// * @param data ข้อมูลรายงานสถิติการลา +// */ +// async function genReportXLSX(data: any) { +// await axios +// .post(`${config.API.reportTemplate}/xlsx`, data, { +// headers: { +// accept: +// "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", +// "content-Type": "application/json", +// }, +// responseType: "blob", +// }) +// .then(async (res) => { +// const blob = new Blob([res.data]); +// await downloadReport(blob, "xlsx"); +// }) +// .catch(async (e) => { +// messageError($q, JSON.parse(await e.response.data.text())); +// }); +// } -/** - * - * @param data ข้อมูลรายงานสถิติการลา - * @param type นามสกุลไฟล์ - */ -async function downloadReport(data: any, type: string) { - const link = document.createElement("a"); - var fileName = - empType.value == "officer" - ? "รายงานสถิติข้อมูลข้าราชการ กทม. สามัญ" - : "รายงานสถิติข้อมูลลูกจ้างประจำ กทม."; - link.href = window.URL.createObjectURL(new Blob([data])); - link.setAttribute("download", `${fileName}.${type}`); - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); -} +// /** +// * +// * @param data ข้อมูลรายงานสถิติการลา +// * @param type นามสกุลไฟล์ +// */ +// async function downloadReport(data: any, type: string) { +// const link = document.createElement("a"); +// var fileName = +// empType.value == "officer" +// ? "รายงานสถิติข้อมูลข้าราชการ กทม. สามัญ" +// : "รายงานสถิติข้อมูลลูกจ้างประจำ กทม."; +// link.href = window.URL.createObjectURL(new Blob([data])); +// link.setAttribute("download", `${fileName}.${type}`); +// document.body.appendChild(link); +// link.click(); +// document.body.removeChild(link); +// } /** * ดูการเปลี่ยนแปลงของ formFilter.value.pageSize @@ -334,7 +334,7 @@ watch( พบข้อมูลทั้งหมด {{ total.toLocaleString() }} รายการ -
+ - + /> -->
diff --git a/src/modules/04_registryPerson/store.ts b/src/modules/04_registryPerson/store.ts index d513b7680..cff49bb8e 100644 --- a/src/modules/04_registryPerson/store.ts +++ b/src/modules/04_registryPerson/store.ts @@ -90,27 +90,31 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => { const newVal = val?.toLocaleUpperCase(); switch (newVal) { case "RETIRE": - return "เกษียณ "; + return "เกษียณ"; case "RETIRE_RESIGN": - return "ลาออก "; + return "ลาออกจากราชการ"; case "RETIRE_DECEASED": return "ถึงแก่กรรม "; case "RETIRE_OUT": - return "ให้ออกจากราชการ "; + return "ให้ออกจากราชการ"; case "DISCIPLINE_RESULT_REMOVE": - return "ปลดออกจากราชการ "; + return "ปลดออกจากราชการ"; case "DISCIPLINE_RESULT_DISMISS": - return "ไล่ออกจากราชการ "; + return "ไล่ออกจากราชการ"; case "DISCIPLINE_SUSPEND": - return "ถูกพักจากราชการ "; + return "ถูกพักจากราชการ"; case "PROBATION_REPORT": - return "ไม่ผ่านทดลองงาน "; + return "ผลการทดลองฯ ต่ำกว่ามาตรฐานที่กำหนด"; case "PLACEMENT_TRANSFER": - return "โอนออก "; + return "โอนออก"; case "RETIRE_RESIGN_EMP": - return "ลาออก(ลูกจ้าง)"; + return "ลาออกจากราชการ"; case "RETIRE_OUT_EMP": - return "ให้ออกจากราชการ(ลูกจ้าง)"; + return "ให้ออกจากราชการ"; + case "DISCIPLINE_SUSPEND": + return "พักจากราชการ"; + case "DISCIPLINE_TEMP_SUSPEND": + return "ให้ออกจากราชการไว้ก่อน"; default: return ""; } @@ -118,19 +122,21 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => { const retireTypeOps = ref([ { id: "RETIRE", name: "เกษียณ" }, - { id: "RETIRE_RESIGN", name: "ลาออก" }, { id: "RETIRE_DECEASED", name: "ถึงแก่กรรม" }, + { id: "RETIRE_RESIGN", name: "ลาออกจากราชการ" }, { id: "RETIRE_OUT", name: "ให้ออกจากราชการ" }, { id: "DISCIPLINE_RESULT_REMOVE", name: "ปลดออกจากราชการ" }, { id: "DISCIPLINE_RESULT_DISMISS", name: "ไล่ออกจากราชการ" }, { id: "DISCIPLINE_SUSPEND", name: "ถูกพักจากราชการ" }, - { id: "PROBATION_REPORT", name: "ไม่ผ่านทดลองงาน" }, + { id: "PROBATION_REPORT", name: "ผลการทดลองฯ ต่ำกว่ามาตรฐานที่กำหนด" }, + { id: "PLACEMENT_TRANSFER", name: "โอนออก" }, + { id: "DISCIPLINE_TEMP_SUSPEND", name: "ให้ออกจากราชการไว้ก่อน" }, ]); const retireTypeEmpOps = ref([ { id: "RETIRE", name: "เกษียณ" }, - { id: "RETIRE_RESIGN_EMP", name: "ลาออก" }, { id: "RETIRE_DECEASED", name: "ถึงแก่กรรม" }, + { id: "RETIRE_RESIGN_EMP", name: "ลาออกจากราชการ" }, { id: "RETIRE_OUT_EMP", name: "ให้ออกจากราชการ" }, ]); diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index e5c04cad3..fffea41c2 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -109,11 +109,9 @@ const baseItemsMenu = ref([ const itemsMenu = computed(() => { if ( - leaveReason.value === - "(พ้นจากราชการด้วยสาเหตุ : ได้รับโทษทางวินัย ให้ออกจากราชการไว้ก่อน)" || - leaveReason.value === "(พ้นจากราชการด้วยสาเหตุ : ลาออกจากราชการ)" || - leaveReason.value === - "(พ้นจากราชการด้วยสาเหตุ : ได้รับโทษทางวินัย พักจากราชการ)" + leaveType.value === "DISCIPLINE_TEMP_SUSPEND" || + leaveType.value === "RETIRE_RESIGN" || + leaveType.value === "DISCIPLINE_SUSPEND" ) { return ( baseItemsMenu.value?.filter( @@ -357,6 +355,7 @@ const reasonOptions = ref([ }, ]); +const leaveType = ref(""); /** ฟังก์ชันดึงข้อมูลส่วนต้ว*/ async function fetchDataPersonal() { showLoader(); @@ -366,6 +365,7 @@ async function fetchDataPersonal() { formDetail.value = await res.data.result; storeRegistry.citizenId = res.data.result.citizenId; storeRegistry.isLeave = res.data.result.isLeave; + leaveType.value = res.data.result.leaveType; if (res.data.result.leaveReason) { // เหตุผลพ้นจากราชการต่อท้ายชื่อ @@ -792,11 +792,9 @@ onMounted(async () => { 'SYS_DISMISS', 'SYS_PLACEMENT_OTHER', ])) || - leaveReason === - '(พ้นจากราชการด้วยสาเหตุ : ได้รับโทษทางวินัย ให้ออกจากราชการไว้ก่อน)' || - leaveReason === '(พ้นจากราชการด้วยสาเหตุ : ลาออกจากราชการ)' || - leaveReason === - '(พ้นจากราชการด้วยสาเหตุ : ได้รับโทษทางวินัย พักจากราชการ)' + leaveType === 'DISCIPLINE_TEMP_SUSPEND' || + leaveType === 'RETIRE_RESIGN' || + leaveType === 'DISCIPLINE_SUSPEND' " size="md" rounded diff --git a/src/modules/04_registryPerson/views/listView.vue b/src/modules/04_registryPerson/views/listView.vue index 40b5cba2f..8ecd04468 100644 --- a/src/modules/04_registryPerson/views/listView.vue +++ b/src/modules/04_registryPerson/views/listView.vue @@ -401,7 +401,7 @@ onMounted(async () => {
- ค้นหาข้อมูลทะเบียนประวัติ {{ store.formFilter.dateAppoint }} + ค้นหาข้อมูลทะเบียนประวัติ {{ empType === "officer" ? "ข้าราชการ กทม. สามัญ" : "ลูกจ้างประจำ กทม." }} @@ -536,7 +536,7 @@ onMounted(async () => { - + { label="ทดลองปฏิบัติหน้าที่ราชการ" @update:model-value="getSearch" /> + + + - { {{ store.labelOption.retireType !== "ทั้งหมด" ? store.labelOption.retireType - : `ประเภทการพ้นจากราชการ${store.labelOption.retireType}` + : `ประเภท${store.labelOption.retireType}` }} { + + +