From 01cbfe624594502515b66018a8d823d8f1270d49 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 14 Nov 2023 09:20:30 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20code=20?= =?UTF-8?q?=E0=B9=81=E0=B8=A5=E0=B8=B0=20=E0=B8=9B=E0=B8=B8=E0=B8=A1=20del?= =?UTF-8?q?ete=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9B?= =?UTF-8?q?=E0=B8=8F=E0=B8=B4=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=87?= =?UTF-8?q?=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/2_Manage/StatCard.vue | 9 +- .../07_insignia/components/2_Manage/Tab1.vue | 397 ++++++++++-------- .../07_insignia/components/2_Manage/Tab2.vue | 331 ++++++++------- .../07_insignia/components/2_Manage/Tab3.vue | 156 ++++--- .../07_insignia/components/2_Manage/Tab4.vue | 66 ++- .../components/2_Manage/downloadFile.vue | 28 +- .../components/2_Manage/listManage.vue | 165 +++++--- .../components/3_result/DialogForm.vue | 116 +++-- .../components/3_result/Dialogbody.vue | 72 +++- .../components/3_result/fileUpload.vue | 184 +++++--- .../07_insignia/interface/index/Main.ts | 34 +- src/modules/07_insignia/store.ts | 93 ++-- src/modules/07_insignia/storeAllocate.ts | 104 +++-- src/modules/07_insignia/storeBrrow.ts | 145 +++++-- src/modules/07_insignia/storeResult.ts | 170 +++++--- src/modules/07_insignia/views/ResultPage.vue | 366 ++++++++-------- src/modules/09_leave/views/RoundMain.vue | 12 +- 17 files changed, 1452 insertions(+), 996 deletions(-) diff --git a/src/modules/07_insignia/components/2_Manage/StatCard.vue b/src/modules/07_insignia/components/2_Manage/StatCard.vue index c5c0e1e0b..5b0283228 100644 --- a/src/modules/07_insignia/components/2_Manage/StatCard.vue +++ b/src/modules/07_insignia/components/2_Manage/StatCard.vue @@ -1,9 +1,14 @@ - { :filter="filterKeyword2" row-key="fullname" class="custom-header-table" - :pagination-label="paginationLabel2" v-model:pagination="pagination2" > - - +
diff --git a/src/modules/07_insignia/components/2_Manage/Tab2.vue b/src/modules/07_insignia/components/2_Manage/Tab2.vue index 18527764f..fa33249f2 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab2.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab2.vue @@ -1,15 +1,22 @@ + + + - - - + > + + +
- { dense class="custom-header-table" :visible-columns="visibleColumns" - :pagination-label="paginationLabel" v-model:pagination="pagination" > - - + import { onMounted, ref, watch, reactive } from "vue"; import { useQuasar } from "quasar"; -import type { QTableProps } from "quasar"; -import { useInsigniaDataStore } from "@/modules/07_insignia/store"; import { useRouter } from "vue-router"; -import DialogInformation from "@/components/Dialogs/Information.vue"; -import { useroleUserDataStore } from "@/stores/roleUser"; +/** import Type*/ +import type { QTableProps } from "quasar"; + +/** import components*/ +import DialogInformation from "@/components/Dialogs/Information.vue"; + +/** import Stores */ +import { useInsigniaDataStore } from "@/modules/07_insignia/store"; +import { useroleUserDataStore } from "@/stores/roleUser"; +/** useStore*/ +const DataStore = useInsigniaDataStore(); const roleDataStore = useroleUserDataStore(); const { adminRole } = roleDataStore; const router = useRouter(); -const DataStore = useInsigniaDataStore(); + const props = defineProps({ tab: { type: String, @@ -31,19 +38,8 @@ const employeeClassOps = ref(DataStore.employeeClassOps); const filterOrganizationOP = ref([]); const organization = ref("1"); const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]); -const visibleColumns = ref([ - "no", - "citizenId", - "name", - "employeeType", - "position", - "level", - "salary", - "insigniaType", - "insigniaSend", - "insigniaLevel", -]); -// หัวตาราง + +/** หัวตาราง*/ const columns = ref([ { name: "no", @@ -145,26 +141,21 @@ const columns = ref([ style: "font-size: 14px", }, ]); -onMounted(async () => { - organizationOptions.value = DataStore.optionsTypeOc; - // organization.value = await (DataStore.agency != null - // ? DataStore.agency - // : DataStore.typeOc); - organization.value = await DataStore.typeOc; - if (organization.value !== "" || organization.value !== undefined) { - if (props.fecthInsigniaByOc) { - await props.fecthInsigniaByOc( - props.roundId, - organization.value, - "officer", - props.tab - ); - DataStore.mainTab = props.tab; - } - } - filterOrganizationOP.value = organizationOptions.value; -}); -const changtypeOc = async () => { +const visibleColumns = ref([ + "no", + "citizenId", + "name", + "employeeType", + "position", + "level", + "salary", + "insigniaType", + "insigniaSend", + "insigniaLevel", +]); + +/** function เลือกหน่วยงาน */ +async function changtypeOc() { if (props.fecthInsigniaByOc) { await props.fecthInsigniaByOc( props.roundId, @@ -174,11 +165,17 @@ const changtypeOc = async () => { ); } DataStore.typeOc = organization.value; -}; -const nextPage = (id: string) => { - router.push(`/registry/${id}`); -}; +} +/** + * function redirect ทะเบียนประวัติิ + * @param id profileId + */ +function nextPage(id: string) { + router.push(`/registry/${id}`); +} + +/** ข้อมูล Table*/ const filterKeyword = ref(""); const filterRef = ref(null); const resetFilter = () => { @@ -191,24 +188,33 @@ const pagination = ref({ page: 1, rowsPerPage: 10, }); -const paging = ref(true); -const paginationLabel = (start: number, end: number, total: number) => { - if (paging.value == true) return " " + start + "-" + end + " ใน " + total; - else return start + "-" + end + " ใน " + total; -}; +/** หมายเหตุ*/ const dialogNote = ref(false); const note = ref(""); const noteTitle = ref(""); -const showNote = (row: any) => { +/** + * function openPopup แสดง หมายเหตุ + * @param row รายละเอียดข้อมูล + */ +function showNote(row: any) { note.value = row.requestNote; noteTitle.value = "เหตุผลการลบออก " + " " + row.name; dialogNote.value = true; -}; -const closeReson = () => { +} + +/** function closePopup หมายเหตุ*/ +function closeReson() { dialogNote.value = false; -}; -const filterSelector = (val: any, update: Function, name: any) => { +} + +/** + * function ค้นหาข้อมูลใน option + * @param val คำค้นหา + * @param update funtion + * @param name ชื่อ selec + */ +function filterSelector(val: any, update: Function, name: any) { update(() => { const needle = val.toLowerCase(); if (name === "typeinsigniaOptions") { @@ -227,8 +233,13 @@ const filterSelector = (val: any, update: Function, name: any) => { ); } }); -}; -const clearInsigniaFilters = (name: string) => { +} + +/** + * function clearfilter เครื่องราช + * @param name ชื่อ selec + */ +function clearInsigniaFilters(name: string) { if (name === "typeinsigniaOptions") { DataStore.typeinsignia = "all"; typeinsigniaOptions.value = DataStore.typeinsigniaOptions; @@ -236,7 +247,25 @@ const clearInsigniaFilters = (name: string) => { DataStore.employeeClass = "all"; employeeClassOps.value = DataStore.employeeClassOps; } -}; +} + +/** Hook*/ +onMounted(async () => { + organizationOptions.value = DataStore.optionsTypeOc; + organization.value = await DataStore.typeOc; + if (organization.value !== "" || organization.value !== undefined) { + if (props.fecthInsigniaByOc) { + await props.fecthInsigniaByOc( + props.roundId, + organization.value, + "officer", + props.tab + ); + DataStore.mainTab = props.tab; + } + } + filterOrganizationOP.value = organizationOptions.value; +});