From 53d05ad09a93b4889b2f2a92ac26f476314451af Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 20 Jan 2025 11:32:28 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20filter=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=9A=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B6=E0=B8=81?= =?UTF-8?q?=E0=B9=80=E0=B8=A7=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B9=81=E0=B8=88?= =?UTF-8?q?=E0=B9=89=E0=B8=87=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=96=E0=B8=B6?= =?UTF-8?q?=E0=B8=87=E0=B9=81=E0=B8=81=E0=B9=88=E0=B8=81=E0=B8=A3=E0=B8=A3?= =?UTF-8?q?=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interface/response/Deceased.ts | 28 +++++++++++++ .../06_retirement/views/05_deceased.vue | 42 +++++++++++++++++-- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/src/modules/06_retirement/interface/response/Deceased.ts b/src/modules/06_retirement/interface/response/Deceased.ts index 191dd67e9..7a98298e1 100644 --- a/src/modules/06_retirement/interface/response/Deceased.ts +++ b/src/modules/06_retirement/interface/response/Deceased.ts @@ -108,6 +108,33 @@ interface TreeMain { totalRootPositionNextUse: number; totalRootPositionNextVacant: number; } + +interface ResponseDececased { + child1: string; + child1ShortName: string; + child2: string; + child2ShortName: string; + child3: string; + child3ShortName: string; + child4: string; + child4ShortName: string; + citizenId: string; + createdAt: string; + firstName: string; + id: string; + isActive: boolean; + lastName: string; + posLevelName: string; + posMasterNo: number; + posTypeName: string; + position: string; + prefix: string; + profileId: string; + profileType: string; + root: string; + rootShortName: string; +} + export type { requestSendNoti, DataCopyOrder, @@ -116,4 +143,5 @@ export type { FormActive, OrgTree, TreeMain, + ResponseDececased, }; diff --git a/src/modules/06_retirement/views/05_deceased.vue b/src/modules/06_retirement/views/05_deceased.vue index 2b47a9677..c7af1eae3 100644 --- a/src/modules/06_retirement/views/05_deceased.vue +++ b/src/modules/06_retirement/views/05_deceased.vue @@ -9,6 +9,9 @@ import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { checkPermission } from "@/utils/permissions"; +import type { DataOption } from "@/modules/06_retirement/interface/index/Main"; +import type { ResponseDececased } from "@/modules/06_retirement/interface/response/Deceased"; + /** Use */ const $q = useQuasar(); const router = useRouter(); @@ -23,8 +26,8 @@ const { } = mixin; /** คอลัมน์ */ -const rows = ref([]); -const rowsData = ref([]); +const rows = ref([]); +const rowsData = ref([]); const pagination = ref({ sortBy: "createdAt", descending: true, @@ -126,8 +129,6 @@ const columns = ref([ format: (val) => date2Thai(val), }, ]); - -/** คอลัมน์ที่แสดง */ const visibleColumns = ref([ "no", "fullname", @@ -140,6 +141,13 @@ const visibleColumns = ref([ "profileType", ]); +const employeeClass = ref(""); +const employeeClassOp = ref([ + { id: "", name: "ทั้งหมด" }, + { id: "OFFICER", name: "ขรก.กทม. สามัญ" }, + { id: "EMPLOYEE", name: "ลูกจ้างประจำ กทม." }, +]); + /**เรียกข้อมูลจาก APi */ async function fectListDecased() { showLoader(); @@ -147,6 +155,8 @@ async function fectListDecased() { .get(config.API.listDeceased()) .then((res) => { const data = res.data.result; + console.log(data); + rows.value = data; rowsData.value = data; }) @@ -172,6 +182,12 @@ function onSearch() { rowsData.value, columns.value ? columns.value : [] ); + + if (employeeClass.value) { + rows.value = rows.value.filter( + (e: ResponseDececased) => e.profileType === employeeClass.value + ); + } } /**Hook */ @@ -188,6 +204,24 @@ onMounted(() => {
+
+ + +