From 7f47b78067dae62fa6b515733f145e8718eaaeef Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Sep 2023 11:23:02 +0700 Subject: [PATCH 1/4] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=20filter=20=E0=B8=A2=E0=B8=B7=E0=B8=A1=E0=B8=84?= =?UTF-8?q?=E0=B8=B7=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/07_insignia/storeBrrow.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/07_insignia/storeBrrow.ts b/src/modules/07_insignia/storeBrrow.ts index 0e2588c01..5b7b56d24 100644 --- a/src/modules/07_insignia/storeBrrow.ts +++ b/src/modules/07_insignia/storeBrrow.ts @@ -58,6 +58,8 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => { })); rows.value = list listInsignia.value = list + console.log(listInsignia.value); + searchDatatable(insignia.value, employeeClass.value) } const searchDatatable = (type: string, employeeClass: string) => { @@ -70,7 +72,10 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => { } else if (type == '' && employeeClass !== "all") { rows.value = listInsignia.value.filter((e: any) => e.profileType == employeeClass ) + } else if (type === '' && employeeClass === "all") { + rows.value = listInsignia.value } + } const status = (val: string) => { From 7c957419aeb3aadf7c564dda12e0054faa2397da Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Mon, 11 Sep 2023 12:13:24 +0700 Subject: [PATCH 2/4] =?UTF-8?q?=E0=B8=95=E0=B9=88=E0=B8=AD=20api=20delete?= =?UTF-8?q?=20notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/00_dashboard/api.message.ts | 1 + src/views/MainLayout.vue | 30 +++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/api/00_dashboard/api.message.ts b/src/api/00_dashboard/api.message.ts index 75902df05..e25ce5aff 100644 --- a/src/api/00_dashboard/api.message.ts +++ b/src/api/00_dashboard/api.message.ts @@ -8,4 +8,5 @@ const message = `${env.API_PLACEMENT_URI}/message`; export default { msgNotificate: `${message}/my-notifications`, msgInbox: `${message}/my-inboxes`, + msgId: (id: string) => `${message}/my-notifications/${id}`, }; diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index b0f11fb8f..b874856d6 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -39,6 +39,7 @@ const { const DataStore = useroleUserDataStore(); const { fetchroleUser } = DataStore; +const id = ref(""); const $q = useQuasar(); const { tabData, loader } = storeToRefs(store); const { changeTab } = store; @@ -405,19 +406,20 @@ if (keycloak.tokenParsed != null) { } const deleteData = async (id: string) => { - await http; - // .delete(config.API.copyOrderId(id)) - // .then((res) => { - // // const data = res.data.result; - // // console.log(res); - // success($q, "ลบข้อมูลสำเร็จ"); - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(async () => { - // // hideLoader(); - // }); + console.log("delete=", id); + showLoader(); + await http + .delete(config.API.msgId(id)) + .then((res) => { + success($q, "ลบข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + getDataNotification(); + hideLoader(); + }); }; const clickDelete = (id: string) => { @@ -509,7 +511,7 @@ const clickDelete = (id: string) => { dense icon="mdi-close" class="mybtn q-mx-xs" - @click="clickDelete" + @click="clickDelete(n.id)" > From 5cba196dd23e1eba9bd3c9b142f95fe3ad15da93 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 11 Sep 2023 13:27:49 +0700 Subject: [PATCH 3/4] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=20=E0=B8=9F=E0=B8=B4=E0=B8=A5=E0=B9=80=E0=B8=95?= =?UTF-8?q?=E0=B8=AD=E0=B8=A3=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/MainProbation.vue | 234 +++++++++++++++--- 1 file changed, 201 insertions(+), 33 deletions(-) diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index 458cb4532..68e75c611 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -169,6 +169,36 @@ const probationlist = ref([]); onMounted(async () => { getpersonalList(); }); +const fillter = ref(0); +const Opfillter = ref([{ id: 0, value: "ทั้งหมด" }]); +const fillterStatus = ref([]); +const ProbationMainFilter = () => { + const useStatus = new Set(); + fillterStatus.value.forEach((item: any) => { + const ID = item.probation_status; + const title = statusProbationMain(Number(item.probation_status)); + if (ID !== null && !useStatus.has(ID)) { + Opfillter.value.push({ + id: ID, + value: title, + }); + useStatus.add(ID); + } + }); + Opfillter.value.sort((a: any, b: any) => a.id - b.id); +}; +const dataUpdate = ref([]); +const updateRows = (body: any) => { + console.log(body.value); + if (body.value !== "ทั้งหมด") { + const filteredRows = dataUpdate.value.filter( + (item: any) => item.probation_status === body.value + ); + rows.value = filteredRows; + } else { + rows.value = dataUpdate.value; + } +}; const getpersonalList = async () => { showLoader(); @@ -176,6 +206,11 @@ const getpersonalList = async () => { .get(config.API.probationPersonalList()) .then((res) => { const data = res.data.data; + fillterStatus.value = data; + console.log( + "🚀 ~ file: MainProbation.vue:193 ~ .then ~ fillterStatus:", + fillterStatus + ); rows.value = data.map((item: FormMainProbation) => ({ personal_id: item.personal_id, name: item.name, @@ -188,8 +223,10 @@ const getpersonalList = async () => { order_number: item.order_number, probation_status: statusProbationMain(Number(item.probation_status)), })); + dataUpdate.value = rows.value; + ProbationMainFilter(); }) - .catch(() => { }) + .catch(() => {}) .finally(() => { hideLoader(); }); @@ -208,7 +245,7 @@ const fecthlistPersonal = async () => { .catch((e) => { messageError($q, e); }) - .finally(() => { }); + .finally(() => {}); }; const fecthlistProbation = async (id: string, data: any) => { try { @@ -226,6 +263,7 @@ const fecthlistProbation = async (id: string, data: any) => { hideLoader(); } }; + const findlist = async (id: string) => { let data = [ { criteriaType: "is_retire", criteriaValue: "false" }, @@ -354,29 +392,92 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
-
- - เพิ่มผู้ทดลองปฏิบัติหน้าที่ราชการ - +
+
+ + + เพิ่มผู้ทดลองปฏิบัติหน้าที่ราชการ + +
- - + - +
- +
@@ -446,23 +558,55 @@ const paginationLabel2 = (start: string, end: string, total: string) => { - + - +
- +
From 33db8e63dc6ebd33c83bfdff32a9008a30da3046 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 11 Sep 2023 13:41:36 +0700 Subject: [PATCH 4/4] =?UTF-8?q?API=20=E0=B8=A5=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/00_dashboard/api.message.ts | 1 + src/views/Dashboard.vue | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/api/00_dashboard/api.message.ts b/src/api/00_dashboard/api.message.ts index e25ce5aff..a157d61fb 100644 --- a/src/api/00_dashboard/api.message.ts +++ b/src/api/00_dashboard/api.message.ts @@ -9,4 +9,5 @@ export default { msgNotificate: `${message}/my-notifications`, msgInbox: `${message}/my-inboxes`, msgId: (id: string) => `${message}/my-notifications/${id}`, + msgInboxDelete:(id:string) => `${message}/my-inboxes/${id}`, }; diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 917097a25..6f573b28d 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -124,20 +124,19 @@ const deleteData = (id:string) => { //รอ api ลบ const removeData = async (id:string) => { console.log("delete=",id) - -// showLoader(); -// await http -// .delete(config.API.) -// .then((res) => { -// success($q, "ลบข้อมูลสำเร็จ"); -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// getData() -// hideLoader() -// }) + showLoader(); +await http +.delete(config.API.msgInboxDelete(id)) +.then((res) => { + success($q, "ลบข้อมูลสำเร็จ"); +}) +.catch((e) => { + messageError($q, e); +}) +.finally(() => { + getData() + hideLoader() +}) }