From d2f28ad2f80e62544df82e7913f7dc5eb709d991 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 28 Aug 2023 16:38:04 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20tab=20?= =?UTF-8?q?=20=E0=B8=A2=E0=B8=B7=E0=B8=A1=E0=B8=84=E0=B8=B7=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/4_Allocate/Main.vue | 5 +- .../07_insignia/components/5_Borrow/Main.vue | 302 +++++++++--------- src/modules/07_insignia/storeAllocate.ts | 5 +- 3 files changed, 155 insertions(+), 157 deletions(-) diff --git a/src/modules/07_insignia/components/4_Allocate/Main.vue b/src/modules/07_insignia/components/4_Allocate/Main.vue index ad2a6704d..470a4cba8 100644 --- a/src/modules/07_insignia/components/4_Allocate/Main.vue +++ b/src/modules/07_insignia/components/4_Allocate/Main.vue @@ -82,7 +82,7 @@ const fecthInsignia = async () => { }) .finally(async () => { insigniaOp.value = await DataStore.insigniaOp.filter( - (x: any) => x.type == tab.value + (x: any) => x.type == tab.value || x.type === "" ); }); }; @@ -159,8 +159,9 @@ const columns = ref([ }, ]); watch(tab, () => { + console.log(DataStore.insigniaOp); insigniaOp.value = DataStore.insigniaOp.filter( - (x: any) => x.type == tab.value + (x: any) => x.type == tab.value || x.type === "" ); DataStore.insignia = ""; fecthlistInsignia(); diff --git a/src/modules/07_insignia/components/5_Borrow/Main.vue b/src/modules/07_insignia/components/5_Borrow/Main.vue index 4077f71b1..752fd205d 100644 --- a/src/modules/07_insignia/components/5_Borrow/Main.vue +++ b/src/modules/07_insignia/components/5_Borrow/Main.vue @@ -46,24 +46,32 @@ const fecthRound = async () => { .get(config.API.noteround()) .then((res) => { let data = res.data.result; - selectRoundAllOption.value = [{ - name: "ทั้งหมด", - id: "00000000-0000-0000-0000-000000000000", - year: 0, - }] + selectRoundAllOption.value = [ + { + name: "ทั้งหมด", + id: "00000000-0000-0000-0000-000000000000", + year: 0, + }, + ]; data.map((e: any) => { - selectRoundOption.value = [...selectRoundOption.value, { - name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), - id: e.id, - year: e.year - }] + selectRoundOption.value = [ + ...selectRoundOption.value, + { + name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), + id: e.id, + year: e.year, + }, + ]; - selectRoundAllOption.value = [...selectRoundAllOption.value, { - name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), - id: e.id, - year: e.year - }] + selectRoundAllOption.value = [ + ...selectRoundAllOption.value, + { + name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), + id: e.id, + year: e.year, + }, + ]; }); selectRound.value = data[0].id; roundYear.value = data[0].year; @@ -83,9 +91,12 @@ const fecthInsignia = async () => { }) .catch((err) => { console.log(err); - }).finally(async () => { - insigniaList.value = await DataStore.insigniaOp.filter((x: any) => x.type == tab.value || x.type == '') }) + .finally(async () => { + insigniaList.value = await DataStore.insigniaOp.filter( + (x: any) => x.type == tab.value || x.type == "" + ); + }); }; const fecthInsigniaType = async () => { @@ -276,14 +287,19 @@ const columns = ref([ ]); watch(tab, async () => { - insigniaList.value = await DataStore.insigniaOp.filter((x: any) => x.type == tab.value || x.type == '') - DataStore.insignia = '' + insigniaList.value = await DataStore.insigniaOp.filter( + (x: any) => x.type == tab.value || x.type == "" + ); + DataStore.insignia = ""; fecthlistInsignia(); }); -const selectorInsignia = async() => { +const selectorInsignia = async () => { const dataCopy = await DataStore.listInsignia; - rows.value = DataStore.insignia != '' ? dataCopy.filter((x:any)=>x.requestInsigniaId == DataStore.insignia): dataCopy + rows.value = + DataStore.insignia != "" + ? dataCopy.filter((x: any) => x.requestInsigniaId == DataStore.insignia) + : dataCopy; }; // const selectorRound = (round: string) => { @@ -294,10 +310,12 @@ const rows = ref([]); const fecthlistInsignia = async () => { showLoader(); await http - .get(config.API.insigniaManageBorrowList(Number(roundYear.value), tab.value)) + .get( + config.API.insigniaManageBorrowList(Number(roundYear.value), tab.value) + ) .then(async (res) => { - await DataStore.fetchlistinsignia(res.data.result) - rows.value = DataStore.rows + await DataStore.fetchlistinsignia(res.data.result); + rows.value = DataStore.rows; }) .catch((err) => { console.log(err); @@ -317,7 +335,7 @@ const close = () => { const closeAndFecth = () => { modal.value = false; - fecthlistInsignia() + fecthlistInsignia(); }; const addData = () => { @@ -329,7 +347,6 @@ const editData = (id: any) => { profileId.value = id; action.value = "editData"; modal.value = true; - }; const resetFilter = () => { @@ -344,18 +361,27 @@ const resetFilter = () => { ยืม-คืนเครื่องราชฯ - +
-
- - -
-
-
+ + +
- +
- + เพิ่ม
@@ -379,31 +425,68 @@ const resetFilter = () => {
- + - +
- - +
+
+
-
-
- -
- - เพิ่ม - -
- - - -
- - - - - - -
-
- - - - -
- -
-
- -
- - เพิ่ม - -
- - -
- - - - - - -
-
- - - - -
-
- -
- - +