From 2fe87c00c6da15c202ff164208e84289b0299d4d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 29 Sep 2023 09:50:13 +0700 Subject: [PATCH] =?UTF-8?q?downloadFile=20=E0=B8=88=E0=B8=B1=E0=B8=94?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=84=E0=B8=B3=E0=B8=82=E0=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_insignia/components/2_Manage/listManage.vue | 13 +++++++++++++ src/modules/07_insignia/store.ts | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/modules/07_insignia/components/2_Manage/listManage.vue b/src/modules/07_insignia/components/2_Manage/listManage.vue index 5e888eb7d..09298ca28 100644 --- a/src/modules/07_insignia/components/2_Manage/listManage.vue +++ b/src/modules/07_insignia/components/2_Manage/listManage.vue @@ -40,6 +40,7 @@ const modalPopupBackToEdit = ref(false); //model แก้ไข onMounted(async () => { tab.value = DataStore.mainTab; await fecthlistRound(); + DataStore.dataInsigniaType.length === 0 && (await fecthInsignia()); }); //เรียกรอบการเสนอขอพระราชทานเครื่อง @@ -123,6 +124,18 @@ const fecthType = async () => { messageError($q, err); }); }; +// เรียกประเภทเครื่องราช +const fecthInsignia = async () => { + await http + .get(config.API.insignia) + .then((res) => { + let data = res.data.result; + DataStore.fetchInsigniaType(data); + }) + .catch((err) => { + messageError($q, err); + }); +}; //เลือกรอบการแสดง const changround = async () => { diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts index 982c425ac..9f1dc5269 100644 --- a/src/modules/07_insignia/store.ts +++ b/src/modules/07_insignia/store.ts @@ -37,6 +37,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => { { id: '44', title: 'บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ' } ]) const mainTab = ref("pending"); + const dataInsigniaType = ref([]) // เรียกราชชื่อการเสนอขอ const fetchData = async (data: any) => { if (data !== null) { @@ -124,6 +125,10 @@ export const useInsigniaDataStore = defineStore("insignia", () => { rows.value = listinsignia.value; } }; + // ประเภทเครื่องราช + function fetchInsigniaType(data: any) { + dataInsigniaType.value = data + } // ประเภทลูกจ้าง const profileType = (val: string) => { @@ -167,11 +172,13 @@ export const useInsigniaDataStore = defineStore("insignia", () => { employeeClass, employeeClassOps, fetchDataInsignia, + fetchInsigniaType, isLock, requestId, roleUser, requestStatus, optionReport, - convertStatus + convertStatus, + dataInsigniaType, }; });