From 8a6d34a02fedb399e2cdb4982f7c7e6c4943d60b Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 14 Mar 2025 17:01:50 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20ui=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/01_compete/CompeteReport.vue | 449 ++++--- .../05_placement/views/09_reportMain.vue | 713 ++++++----- src/modules/06_retirement/views/07_report.vue | 894 ++++++++------ .../07_insignia/views/06_ReportMain.vue | 752 +++++++----- src/modules/09_leave/views/06_ReportMain.vue | 1048 ++++++++++------- .../components/9_DisciplineReport/Main.vue | 858 ++++++++------ src/modules/14_KPI/views/report.vue | 620 ++++++---- .../21_report/views/03_reportDevelopment.vue | 552 +++++---- .../21_report/views/04_reportEvaluate.vue | 586 +++++---- .../21_report/views/05_reportSalary.vue | 773 +++++++----- 10 files changed, 4166 insertions(+), 3079 deletions(-) diff --git a/src/modules/03_recruiting/views/01_compete/CompeteReport.vue b/src/modules/03_recruiting/views/01_compete/CompeteReport.vue index 6218ae136..2749a1866 100644 --- a/src/modules/03_recruiting/views/01_compete/CompeteReport.vue +++ b/src/modules/03_recruiting/views/01_compete/CompeteReport.vue @@ -10,6 +10,8 @@ import { checkPermission } from "@/utils/permissions"; import { useCounterMixin } from "@/stores/mixin"; import type { DataOption } from "@/modules/09_leave/interface/index/Main"; + +import LoadView from "@/components/LoadView.vue"; import genReportXLSX from "@/plugins/genreportxlsx"; /** use*/ const isReport = ref(true); @@ -17,6 +19,8 @@ const mixin = useCounterMixin(); const $q = useQuasar(); const { showLoader, hideLoader, date2Thai, dateToISO, messageError } = mixin; +const isLoadPDF = ref(false); + const year = ref(new Date().getFullYear()); const reportSelect = ref({ @@ -45,9 +49,9 @@ const detailReport = ref(); * @param endDate วันสิ้นสุด */ async function getReportRecruit() { + isLoadPDF.value = true; pdfSrc.value = undefined; page.value = 1; - showLoader(); await http .get( config.API.reportRecruit(reportSelect.value.id) + @@ -63,7 +67,7 @@ async function getReportRecruit() { messageError($q, err); }) .finally(() => { - hideLoader(); + isLoadPDF.value = false; }); } @@ -134,200 +138,275 @@ function filterFnOptions(val: any, update: Function) { ); }); } + +function clearFilter() { + reportSelect.value = { + id: "", + name: "", + }; + detailReport.value = undefined; + year.value = new Date().getFullYear(); + pdfSrc.value = undefined; + detailReport.value = undefined; +} diff --git a/src/modules/05_placement/views/09_reportMain.vue b/src/modules/05_placement/views/09_reportMain.vue index 6b3e03296..541261971 100644 --- a/src/modules/05_placement/views/09_reportMain.vue +++ b/src/modules/05_placement/views/09_reportMain.vue @@ -17,6 +17,10 @@ import LoadView from "@/components/LoadView.vue"; import genReportXLSX from "@/plugins/genreportxlsx"; /** use*/ +const expandedModal = ref(false); +const org = ref(""); +const isLoadStructureTree = ref(true); + const $q = useQuasar(); const route = useRoute(); const { fetchStructureTree } = useStructureTree(); @@ -78,21 +82,27 @@ const node = ref([]); const expanded = ref([]); async function fetchDataTree() { - node.value = await fetchStructureTree(route.meta.Key as string, true); + try { + isLoadStructureTree.value = true; + node.value = await fetchStructureTree(route.meta.Key as string, true); + } catch (err) { + messageError($q, err); + } finally { + isLoadStructureTree.value = false; + } } function onUpdateYear(val: number) { dateStart.value = new Date(val - 1, 9, 1); dateEnd.value = new Date(val, 8, 30); - - reportType.value && fetchDataReport(); } -function onSelectedNode(id: string, level: number, orgDnaId: string) { - nodeId.value = id; - nodeLevel.value = level; - orgTreeDnaId.value = orgDnaId; - reportType.value && fetchDataReport(); +function onSelectedNode(data: any) { + org.value = data.orgName; + nodeId.value = data.orgTreeId; + nodeLevel.value = data.orgLevel; + orgTreeDnaId.value = data.orgTreeDnaId; + expandedModal.value = false; } function fetchDataReport() { @@ -175,6 +185,20 @@ function backPage() { } } +function clearFilter() { + org.value = ""; + nodeId.value = ""; + nodeLevel.value = 0; + orgTreeDnaId.value = ""; + reportType.value = undefined; + detailReport.value = undefined; + pdfSrc.value = undefined; + + year.value = new Date().getFullYear(); + dateStart.value = new Date(year.value - 1, 9, 1); + dateEnd.value = new Date(year.value + 1, 8, 30); +} + onMounted(() => { fetchDataTree(); }); @@ -185,308 +209,380 @@ onMounted(() => { รายงานบรรจุ แต่งตั้ง ย้าย โอน -
- -
-
- - - - - - -
- -
- -
-
- - - - - -
- -
- - - - - -
-
- - - - - -
+ +
+
+ +
+ +
+ +
- -
+
+
- - - - - -
- - - -
- -
- - - + + + + + + +
+
+ + + + + +
- - - - - - - - - - - - -
-
+ +
+
+ - diff --git a/src/modules/06_retirement/views/07_report.vue b/src/modules/06_retirement/views/07_report.vue index 79e7103a4..de4fcb3f8 100644 --- a/src/modules/06_retirement/views/07_report.vue +++ b/src/modules/06_retirement/views/07_report.vue @@ -43,6 +43,12 @@ const optionReport = ref([ name: "จำนวนลูกจ้างประจำ กทม. ที่พ้นจากราชการ", }, ]); + +const expandedModal = ref(false); +const org = ref(""); + +const isLoadStructureTree = ref(true); + const filterType = ref("MONTH"); const filterTypeOption = ref([ { id: "MONTH", name: "รายเดือน" }, @@ -76,8 +82,16 @@ const nodeLevel = ref(0); const node = ref([]); const expanded = ref([]); +/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/ async function fetchDataTree() { - node.value = await fetchStructureTree(route.meta.Key as string, true); + try { + isLoadStructureTree.value = true; + node.value = await fetchStructureTree(route.meta.Key as string, true); + } catch (err) { + messageError($q, err); + } finally { + isLoadStructureTree.value = false; + } } function onUpdateFilter() { @@ -97,14 +111,13 @@ function onUpdateFilter() { default: break; } - - fetchDataReport(); } -function onSelectedNode(id: string, level: number) { - nodeId.value = id; - nodeLevel.value = level; - fetchDataReport(); +function onSelectedNode(data: any) { + nodeId.value = data.orgTreeId; + nodeLevel.value = data.orgLevel; + org.value = data.orgName; + expandedModal.value = false; } function fetchDataReport() { @@ -186,6 +199,28 @@ function monthYearThai(val: DataDateMonthObject) { else return monthYear2Thai(val.month, val.year); } +function clearFilter() { + nodeId.value = ""; + nodeLevel.value = 0; + org.value = ""; + detailReport.value = undefined; + pdfSrc.value = undefined; + reportType.value = ""; + + filterType.value = "MONTH"; + year.value = new Date().getFullYear(); + dateMonth.value = { + month: new Date().getMonth(), + year: new Date().getFullYear(), + }; + dateStart.value = new Date( + dateMonth.value.year, + dateMonth.value.month + 1 - 1, + 1 + ); + dateEnd.value = new Date(dateMonth.value.year, dateMonth.value.month + 1, 0); +} + onMounted(() => { fetchDataTree(); }); @@ -196,391 +231,472 @@ onMounted(() => { รายงานพ้นจากราชการ -
- -
-
- - - - - - - - - - - ไฟล์ .pdf - - - - ไฟล์ .xlsx - - - - -
- -
- -
-
- - -
-
- - - - - -
- -
- - - - - -
- -
- - - - - -
-
- - - - - -
+ + ไฟล์ .xlsx + + + +
-
-
+
+
- - - - - -
- - - -
- -
- - - + + + + + + +
+
+ + + + + +
-
- - - - - - - - - - -
-
- + + + + - diff --git a/src/modules/07_insignia/views/06_ReportMain.vue b/src/modules/07_insignia/views/06_ReportMain.vue index 96f06eacd..0b95585ca 100644 --- a/src/modules/07_insignia/views/06_ReportMain.vue +++ b/src/modules/07_insignia/views/06_ReportMain.vue @@ -26,6 +26,10 @@ const route = useRoute(); const { fetchStructureTree } = useStructureTree(); const { messageError, showLoader, hideLoader } = useCounterMixin(); +const expandedModal = ref(false); +const org = ref(""); +const isLoadStructureTree = ref(true); + const employeeClass = ref("officer"); const employeeClassOption = ref([ { id: "officer", name: "ข้าราชการ กทม. สามัญ" }, @@ -85,8 +89,16 @@ const pdfSrc = ref(); const isLoadPDF = ref(false); +/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/ async function fetchDataTree() { - node.value = await fetchStructureTree(route.meta.Key as string, true); + try { + isLoadStructureTree.value = true; + node.value = await fetchStructureTree(route.meta.Key as string, true); + } catch (err) { + messageError($q, err); + } finally { + isLoadStructureTree.value = false; + } } /** ฟังก์ชันคึงข้อมูลรอบการเสนอขอ*/ @@ -156,10 +168,11 @@ function filterSelector(val: string, update: Function, name: string) { * @param id id หน่วยงาน * @param level ระดับหน่วยงาน */ -function onSelectedNode(id: string, level: number) { - nodeId.value = id; - nodeLevel.value = level; - onUpdateFilter(); +function onSelectedNode(data: any) { + nodeId.value = data.orgTreeDnaId; + nodeLevel.value = data.orgLevel; + org.value = data.orgName; + expandedModal.value = false; } const detailReport = ref(); @@ -310,6 +323,18 @@ function downloadReport(type: string, download: "docx" | "" | "xlsx" = "") { } } +function clearFilter() { + detailReport.value = undefined; + pdfSrc.value = undefined; + employeeClass.value = "officer"; + roundId.value = ""; + roundId2.value = ""; + typeReport.value = ""; + org.value = ""; + nodeId.value = ""; + nodeLevel.value = 0; +} + onMounted(async () => { await Promise.all([fetchDataTree(), fecthlistRound(), fecthlistRound2()]); }); @@ -319,333 +344,399 @@ onMounted(async () => {
รายงานเครื่องราชอิสริยาภรณ์
- -
- -
-
- - - - - - - - - - - ไฟล์ .pdf - - - - ไฟล์ .docx - - - - ไฟล์ .xlsx - - - - -
- -
- -
-
- -
- -
- - - - - - - -
+ +
+
+ +
+
+ +
- -
+ +
+ + + + + + ไฟล์ .pdf + + + + ไฟล์ .docx + + + + ไฟล์ .xlsx + + + + +
+
+
- - - - -
- - - -
- -
- - + + + +
- - - - - - - - - - - - -
-
+ +
+
+ - diff --git a/src/modules/09_leave/views/06_ReportMain.vue b/src/modules/09_leave/views/06_ReportMain.vue index 955932719..c7d3475c9 100644 --- a/src/modules/09_leave/views/06_ReportMain.vue +++ b/src/modules/09_leave/views/06_ReportMain.vue @@ -8,10 +8,11 @@ import { useRoute } from "vue-router"; import { checkPermission } from "@/utils/permissions"; import { useCounterMixin } from "@/stores/mixin"; import { useStructureTree } from "@/stores/structureTree"; +import { useMenuDataStore } from "@/stores/menuList"; + import genReportXLSX from "@/plugins/genreportxlsx"; import http from "@/plugins/http"; import config from "@/app.config"; - import type { DataStructureTree } from "@/interface/main"; import type { DataOption, @@ -19,10 +20,18 @@ import type { } from "@/modules/09_leave/interface/index/Main"; import LoadView from "@/components/LoadView.vue"; +import type { DataRoles } from "@/interface/response/main"; + +const expandedModal = ref(false); +const org = ref(""); + +const isLoadStructureTree = ref(true); /** use*/ const $q = useQuasar(); const route = useRoute(); +const storeMenu = useMenuDataStore(); + const { fetchStructureTree } = useStructureTree(); const { date2Thai, dateToISO, messageError, monthYear2Thai } = useCounterMixin(); @@ -37,7 +46,8 @@ const dateMonth = ref({ }); const typeReport = ref(""); -const optionReport = ref([ +const optionReport = ref([]); +const optionReportMain = ref([ { id: "1", name: "รายงานการลางานตามประเภทการลา" }, { id: "2", @@ -73,7 +83,14 @@ const expanded = ref([]); /** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/ async function fetchDataTree() { - node.value = await fetchStructureTree(route.meta.Key as string, true); + try { + isLoadStructureTree.value = true; + node.value = await fetchStructureTree(route.meta.Key as string, true); + } catch (err) { + messageError($q, err); + } finally { + isLoadStructureTree.value = false; + } } /** @@ -81,9 +98,11 @@ async function fetchDataTree() { * @param id id หน่วยงาน * @param level node ของหน่วงงานที่เลือก */ -function onSelectedNode(id: string, level: number) { - nodeId.value = id; - nodeLevel.value = level; +function onSelectedNode(data: any) { + org.value = data.orgName; + nodeId.value = data.orgTreeId; + nodeLevel.value = data.orgLevel; + expandedModal.value = false; updateLeaveday(); } @@ -96,6 +115,10 @@ async function updateLeaveday() { case "FULL": dateStart.value = new Date(year.value - 1, 9, 1); dateEnd.value = new Date(year.value, 8, 30); + dateMonth.value = { + month: new Date().getMonth(), + year: new Date().getFullYear(), + }; break; case "MONTH": @@ -109,11 +132,19 @@ async function updateLeaveday() { case "FIRSTHAFT": dateStart.value = new Date(year.value - 1, 9, 1); dateEnd.value = new Date(year.value, 2, 31); + dateMonth.value = { + month: new Date().getMonth(), + year: new Date().getFullYear(), + }; break; case "SECONDHAFT": dateStart.value = new Date(year.value, 3, 1); dateEnd.value = new Date(year.value, 8, 30); + dateMonth.value = { + month: new Date().getMonth(), + year: new Date().getFullYear(), + }; break; default: @@ -123,19 +154,6 @@ async function updateLeaveday() { if (!nodeId.value || !typeReport.value) { return false; } - - isReport.value = false; - isLoadPDF.value = true; - pdfSrc.value = undefined; - page.value = 1; - - //เรียกฟังก์ชัน fetchLeaveday - fetchLeaveday( - employeeClass.value, - yearType.value, - dateStart.value, - dateEnd.value - ); } /** @@ -233,6 +251,53 @@ function monthYearThai(val: DataDateMonthObject) { else return monthYear2Thai(val.month, val.year); } +/** + * ฟังก์ชั่นค้นหาข้อมูลของ Option Filter + * @param val คำที่ค้นหา + * @param update Function + * @param typeOp ประเภทของ Select + */ +function filterOption(val: string, update: any, typeOp: string) { + update(() => { + const needle = val.toLowerCase(); + if (typeOp == "typeReport") { + optionReport.value = optionReportMain.value.filter( + (v: any) => v.name.toLowerCase().indexOf(needle) > -1 + ); + } + }); +} + +function clearData() { + nodeId.value = ""; + nodeLevel.value = 0; + org.value = ""; + typeReport.value = ""; + yearType.value = "FULL"; + pdfSrc.value = undefined; + detailReport.value = undefined; + + year.value = new Date().getFullYear(); + dateMonth.value = { + month: new Date().getMonth(), + year: new Date().getFullYear(), + }; +} + +function onSearch() { + isReport.value = false; + isLoadPDF.value = true; + pdfSrc.value = undefined; + page.value = 1; + updateLeaveday(); + fetchLeaveday( + employeeClass.value, + yearType.value, + dateStart.value, + dateEnd.value + ); +} + onMounted(() => { fetchDataTree(); }); @@ -241,443 +306,518 @@ onMounted(() => { - diff --git a/src/modules/11_discipline/components/9_DisciplineReport/Main.vue b/src/modules/11_discipline/components/9_DisciplineReport/Main.vue index 690da6ad0..27a734d8b 100644 --- a/src/modules/11_discipline/components/9_DisciplineReport/Main.vue +++ b/src/modules/11_discipline/components/9_DisciplineReport/Main.vue @@ -29,6 +29,10 @@ const route = useRoute(); const { fetchStructureTree } = useStructureTree(); const { messageError, showLoader, hideLoader } = useCounterMixin(); +const expandedModal = ref(false); +const org = ref(""); +const isLoadStructureTree = ref(true); + const year = ref(new Date().getFullYear()); const employeeClass = ref("officer"); const employeeClassOption = ref([ @@ -104,13 +108,21 @@ const detailReport = ref(); const fileBlob = ref(); async function fetchDataTree() { - node.value = await fetchStructureTree(route.meta.Key as string, true); + try { + isLoadStructureTree.value = true; + node.value = await fetchStructureTree(route.meta.Key as string, true); + } catch (err) { + messageError($q, err); + } finally { + isLoadStructureTree.value = false; + } } -function onSelectedNode(id: string, level: number) { - nodeId.value = id; - nodeLevel.value = level; - onUpdateFilter(); +function onSelectedNode(data: any) { + nodeId.value = data.orgTreeId; + nodeLevel.value = data.orgLevel; + org.value = data.orgName; + expandedModal.value = false; } /** @@ -142,7 +154,7 @@ async function onUpdateFilter() { .post(config.API.disciplineReportByType(employeeClass.value), body) .then(async (res) => { const data = res.data.result; - // detailReport.value = data; + detailReport.value = data; data && (await genReportPreview(data)); }) .catch(async (e) => { @@ -264,6 +276,22 @@ function updateLevel(val: string) { } } } + +function clearFilter() { + year.value = new Date().getFullYear(); + offenseDetail.value = "ALL"; + disciplinaryFaultLevel.value = "ALL"; + status.value = "ALL"; + posType.value = ""; + posLevel.value = ""; + + pdfSrc.value = undefined; + detailReport.value = undefined; + org.value = ""; + nodeId.value = ""; + nodeLevel.value = 0; +} + onMounted(async () => { await Promise.all([fetchDataTree(), getType()]); }); @@ -272,383 +300,453 @@ onMounted(async () => {