diff --git a/src/api/00_dashboard/api.message.ts b/src/api/00_dashboard/api.message.ts index 75902df05..a157d61fb 100644 --- a/src/api/00_dashboard/api.message.ts +++ b/src/api/00_dashboard/api.message.ts @@ -8,4 +8,6 @@ const message = `${env.API_PLACEMENT_URI}/message`; 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/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index 4443f49b7..861afdfbd 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 != "xx/2566" ? 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) => { - + - +
- +
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) => { 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() +}) } 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)" >