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 1/8] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20tab?= =?UTF-8?q?=20=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 = () => {
- + - +
- - +
+
+
-
-
- -
- - เพิ่ม - -
- - - -
- - - - - - -
-
- - - - -
- -
-
- -
- - เพิ่ม - -
- - -
- - - - - - -
-
- - - - -
-
- -
- - + diff --git a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue index 4cf2ca7f2..6dcdc0ffb 100644 --- a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue +++ b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue @@ -1,13 +1,11 @@ \ No newline at end of file + diff --git a/src/modules/07_insignia/components/5_Borrow/Main.vue b/src/modules/07_insignia/components/5_Borrow/Main.vue index c0d72cc3f..27ebd4fd1 100644 --- a/src/modules/07_insignia/components/5_Borrow/Main.vue +++ b/src/modules/07_insignia/components/5_Borrow/Main.vue @@ -11,17 +11,9 @@ import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main" import type { QTableProps, QInput } from "quasar"; import { useQuasar } from "quasar"; -// const router = useRouter(); const DataStore = useBrrowDataStore(); const mixin = useCounterMixin(); -const { - date2Thai, - dialogConfirm, - showLoader, - hideLoader, - messageError, - success, -} = mixin; +const { showLoader, hideLoader, messageError } = mixin; const $q = useQuasar(); const tab = ref(""); @@ -31,10 +23,8 @@ const selectRoundAllOption = ref([]); const modal = ref(false); const action = ref(""); -const personId = ref(); const profileId = ref(""); const roundYear = ref(); -const insigniaListAll = ref([]); const insigniaList = ref([]); onMounted(async () => { @@ -46,8 +36,6 @@ const fecthRound = async () => { .get(config.API.noteround()) .then((res) => { let data = res.data.result; - console.log(data); - selectRoundAllOption.value = [ { name: "ทั้งหมด", @@ -73,7 +61,7 @@ const fecthRound = async () => { roundYear.value = data[0].year; }) .catch((err) => { - console.log(err); + messageError($q, err); }); }; @@ -81,7 +69,6 @@ const fecthInsignia = async () => { await http .get(config.API.insignia) .then((res) => { - // console.log(res); let data = res.data.result; DataStore.fetchDataInsignia(data); }) @@ -98,7 +85,6 @@ const fecthInsignia = async () => { const fecthInsigniaType = async () => { await http(config.API.insigniaType) .then(async (res) => { - // console.log(res); let data = res.data.result; DataStore.fetchDatainsigniaType(data); tab.value = DataStore.insigniaType[0].name; @@ -316,7 +302,6 @@ const fecthlistInsignia = async () => { rows.value = DataStore.rows; }) .catch((err) => { - console.log(err); messageError($q, err); }) .finally(() => { @@ -514,11 +499,7 @@ const resetFilter = () => { :modal="modal" :close="close" :close-and-fecth="closeAndFecth" - :round-id=" - selectRound == '00000000-0000-0000-0000-000000000000' - ? 'all' - : selectRound - " + :round-id="selectRound == '0' ? 'all' : selectRound" :action="action" :profile-id="profileId" :select-round-option="selectRoundOption" diff --git a/src/modules/07_insignia/views/ResultPage.vue b/src/modules/07_insignia/views/ResultPage.vue index beb1e5778..7c63bfe98 100644 --- a/src/modules/07_insignia/views/ResultPage.vue +++ b/src/modules/07_insignia/views/ResultPage.vue @@ -1,6 +1,5 @@