From 22836149256ef07fd72ef4bf07cd584d40d96899 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 11 Feb 2025 17:08:35 +0700 Subject: [PATCH 1/6] report salary --- src/interface/main.ts | 2 + src/modules/21_report/interface/Main.ts | 19 +- .../21_report/views/05_reportSalary.vue | 626 +++++++++++++++++- 3 files changed, 639 insertions(+), 8 deletions(-) diff --git a/src/interface/main.ts b/src/interface/main.ts index 3d13a40da..f252ca4e8 100644 --- a/src/interface/main.ts +++ b/src/interface/main.ts @@ -52,6 +52,8 @@ interface DataStructureTree { totalRootPositionNextUse: number; totalRootPositionNextVacant: number; children: DataStructureTree[]; + orgRootCode: string; + orgRootShortName: string; } interface DataStrategy { diff --git a/src/modules/21_report/interface/Main.ts b/src/modules/21_report/interface/Main.ts index ef1950aad..bb4059f08 100644 --- a/src/modules/21_report/interface/Main.ts +++ b/src/modules/21_report/interface/Main.ts @@ -72,12 +72,18 @@ interface ProbationReportType { evaluate_date: Date; } -interface FileType{ - path:string - pathname:string - fileName:string - title:string +interface FileType { + path: string; + pathname: string; + fileName: string; + title: string; } + +interface DataOption { + id: string; + name: string; +} + export type { ListDataText, DataSurvey, @@ -85,5 +91,6 @@ export type { AppointTopicMain, AppointTopic, ProbationReportType, - FileType + FileType, + DataOption, }; diff --git a/src/modules/21_report/views/05_reportSalary.vue b/src/modules/21_report/views/05_reportSalary.vue index 869d9ab47..8b4b69cac 100644 --- a/src/modules/21_report/views/05_reportSalary.vue +++ b/src/modules/21_report/views/05_reportSalary.vue @@ -1,7 +1,629 @@ - + - + From 0b1ec1f0a08bdcbca5176b4ff903f62585d0fc5b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 11 Feb 2025 17:53:53 +0700 Subject: [PATCH 2/6] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99?= =?UTF-8?q?=E0=B8=A7=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/07_insignia/views/06_ReportMain.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/07_insignia/views/06_ReportMain.vue b/src/modules/07_insignia/views/06_ReportMain.vue index 640edcf54..a8b7f354a 100644 --- a/src/modules/07_insignia/views/06_ReportMain.vue +++ b/src/modules/07_insignia/views/06_ReportMain.vue @@ -37,9 +37,21 @@ const optionReport = ref([ }, { id: "report2", - name: " บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี", + name: "บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี", + }, + { id: "report3", name: "บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ 5 ปี" }, + { + id: "report4", + name: "รายชื่อข้าราชการฯ ที่ได้รับ/ไม่ได้รับการจ่ายใบกำกับฯ", + }, + { + id: "report5", + name: "รายงานสถิติการได้รับเครื่องราชอิสริยาภรณ์ข้าราชการฯ", + }, + { + id: "report6", + name: "รายงานผลการจ่ายประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์ แยกรายหน่วยงาน", }, - { id: "report3", name: " บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ 5 ปี" }, ]); const roundId = ref(""); From 95d744f2b93a075a602113fc25fe5b1e057dc674 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 11 Feb 2025 18:22:42 +0700 Subject: [PATCH 3/6] =?UTF-8?q?fix=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87?= =?UTF-8?q?=E0=B8=B2=E0=B8=99=E0=B8=A7=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/9_DisciplineReport/Main.vue | 87 ++++++++++++------- 1 file changed, 55 insertions(+), 32 deletions(-) diff --git a/src/modules/11_discipline/components/9_DisciplineReport/Main.vue b/src/modules/11_discipline/components/9_DisciplineReport/Main.vue index 29c105fea..e5a00f728 100644 --- a/src/modules/11_discipline/components/9_DisciplineReport/Main.vue +++ b/src/modules/11_discipline/components/9_DisciplineReport/Main.vue @@ -121,30 +121,36 @@ function onSelectedNode(id: string, level: number) { async function onUpdateFilter() { isLoadPDF.value = true; pdfSrc.value = undefined; - - const body = { - nodeId: nodeId.value, - node: nodeLevel.value, - year: year.value, - offenseDetail: offenseDetail.value, - disciplinaryFaultLevel: disciplinaryFaultLevel.value, - status: status.value, - posType: posType.value ? posType.value : null, - posLevel: posLevel.value ? posLevel.value : null, - }; - await http - .post(config.API.disciplineReportByType(employeeClass.value), body) - .then(async (res) => { - const data = res.data.result; - detailReport.value = data; - data && (await genReportPreview(data)); - }) - .catch(async (e) => { - messageError($q, JSON.parse(await e.response.data.text())); - }) - .finally(() => { - isLoadPDF.value = false; - }); + if (nodeId) { + const body = { + nodeId: nodeId.value, + node: nodeLevel.value, + year: year.value, + offenseDetail: offenseDetail.value, + disciplinaryFaultLevel: disciplinaryFaultLevel.value, + status: status.value, + posType: posType.value + ? posTypeOp.value.find((e: any) => e.id === posType.value)?.posTypeName + : null, + posLevel: posLevel.value + ? posLevelOp.value.find((e: any) => e.id === posLevel.value) + ?.posLevelName + : null, + }; + await http + .post(config.API.disciplineReportByType(employeeClass.value), body) + .then(async (res) => { + const data = res.data.result; + detailReport.value = data; + data && (await genReportPreview(data)); + }) + .catch(async (e) => { + messageError($q, JSON.parse(await e.response.data.text())); + }) + .finally(() => { + isLoadPDF.value = false; + }); + } } /** @@ -195,14 +201,21 @@ function backPage() { } } -function downloadReport(type: string) {} - /** * ฟังก์เรียกข้อมูลรายการประเภทตำแหน่ง */ async function getType() { + posType.value = ""; + posLevel.value = ""; + posTypeMainOp.value = []; + posTypeOp.value = []; + posLevelOp.value = []; + const apiPath = + employeeClass.value === "officer" + ? config.API.orgPosType + : config.API.orgEmployeeType; await http - .get(config.API.orgPosType) + .get(apiPath) .then(async (res) => { posTypeMainOp.value = await res.data.result; }) @@ -226,7 +239,7 @@ function filterOption(val: string, update: any, typeOp: string) { ); } else if (typeOp == "level") { posLevelOp.value = posLevelMainOp.value.filter( - (v: any) => v.posLevelName.toLowerCase().indexOf(needle) > -1 + (v: any) => v.posLevelName.toString().toLowerCase().indexOf(needle) > -1 ); } }); @@ -234,10 +247,20 @@ function filterOption(val: string, update: any, typeOp: string) { function updateLevel(val: string) { if (val) { - const listData = posTypeMainOp.value.find( + const listData: any = posTypeMainOp.value.find( (item: PosType) => item.id == val ); - posLevelMainOp.value = listData ? listData.posLevels : []; + console.log(listData); + if (employeeClass.value === "officer") { + posLevelMainOp.value = listData ? listData.posLevels : []; + } else { + posLevelMainOp.value = listData + ? listData.posLevels.map((e: any) => ({ + ...e, + posLevelName: `${listData?.posTypeShortName} ${e.posLevelName}`, + })) + : []; + } } } onMounted(async () => { @@ -263,15 +286,15 @@ onMounted(async () => { option-label="name" option-value="id" style="width: 230px" - @update:model-value="onUpdateFilter" + @update:model-value="getType" > Date: Tue, 11 Feb 2025 18:58:33 +0700 Subject: [PATCH 4/6] fix report --- src/api/15_development/api.development.ts | 4 +- .../07_insignia/views/06_ReportMain.vue | 4 + .../13_salary/store/SalaryListsStore.ts | 5 + .../21_report/views/03_reportDevelopment.vue | 148 ++++++++++++------ .../21_report/views/05_reportSalary.vue | 1 + 5 files changed, 113 insertions(+), 49 deletions(-) diff --git a/src/api/15_development/api.development.ts b/src/api/15_development/api.development.ts index 7d0960b58..99845f6a7 100644 --- a/src/api/15_development/api.development.ts +++ b/src/api/15_development/api.development.ts @@ -34,6 +34,7 @@ export default { /** download File */ developmentReportMain: () => `${developmentReport}/main`, + developmentReport: () => `${developmentReport}/`, developmentReportHistory: () => `${developmentReport}/history-officer`, developmentReportHistoryOfficer: () => `${developmentReport}/history-employee`, @@ -51,6 +52,7 @@ export default { devStrategy, /** IDP */ - developmentReQuestIDP: (id: string) => `${developmentOrg}/profile/development/registry/OFFICER/${id}`, + developmentReQuestIDP: (id: string) => + `${developmentOrg}/profile/development/registry/OFFICER/${id}`, developmentIDP: (id: string) => `${development}/main/registry/OFFICER/${id}`, }; diff --git a/src/modules/07_insignia/views/06_ReportMain.vue b/src/modules/07_insignia/views/06_ReportMain.vue index a8b7f354a..09c6c7c75 100644 --- a/src/modules/07_insignia/views/06_ReportMain.vue +++ b/src/modules/07_insignia/views/06_ReportMain.vue @@ -52,6 +52,10 @@ const optionReport = ref([ id: "report6", name: "รายงานผลการจ่ายประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์ แยกรายหน่วยงาน", }, + { + id: "report7", + name: "รายงานแสดงรายชื่อลูกจ้างประจำที่ได้รับ/ไมได้รับ การจ่ายใบกำกับฯ เครื่องราชอิสริยาภรณที่ได้รับพระราชทาน (ลูกจ้าง)", + }, ]); const roundId = ref(""); diff --git a/src/modules/13_salary/store/SalaryListsStore.ts b/src/modules/13_salary/store/SalaryListsStore.ts index 6a3d7b657..c7491fe98 100644 --- a/src/modules/13_salary/store/SalaryListsStore.ts +++ b/src/modules/13_salary/store/SalaryListsStore.ts @@ -170,6 +170,11 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { name: "แนบท้ายคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม (PDF)", type: "pdf", }, + + { + id: "gov-10", + name: "แบบบัญชีถือจ่าย (จ.๑๘) ของข้าราชการกรุงเทพมหานครสามัญ", + }, ]); function fetchPeriodLatest(data: DataPeriodLatest, type: string) { diff --git a/src/modules/21_report/views/03_reportDevelopment.vue b/src/modules/21_report/views/03_reportDevelopment.vue index 30717c94a..86264c8bc 100644 --- a/src/modules/21_report/views/03_reportDevelopment.vue +++ b/src/modules/21_report/views/03_reportDevelopment.vue @@ -24,25 +24,51 @@ const employeeClassOption = ref([ { id: "employee", name: "ลูกจ้างประจำ กทม." }, ]); +const typeReport = ref("main"); +const optionReport = ref([ + { + id: "main", + name: "โครงการ/กิจกรรมตามแผนพัฒนาทรัพยากรบุคคลของกรุงเทพมหานคร", + }, + { + id: "report3", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนการศึกษาในประเทศ", + }, + { + id: "report4", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)", + }, + { + id: "report5", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)", + }, + { + id: "report6", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญ ที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรประเภทนักบริหาร)", + }, + { + id: "report7", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ไปศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ", + }, + { + id: "report8", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนไปศึกษา", + }, + { + id: "report9", + name: "รายงานสถิติข้อมูลการฝึกอบรม ศึกษาดูงาน ของข้าราชการกรุงเทพมหานครสามัญ", + }, + { + id: "report10", + name: "รายงานสถิติข้อมูลการศึกษาต่อของข้าราชการกรุงเทพมหานครสามัญ", + }, +]); + const splitterModel = ref(14); const numOfPages = ref(0); const page = ref(1); const pdfSrc = ref(); -interface RangeAge { - min: number; - max: number; -} - -const objMarkerLabel = computed(() => { - return { 39: `ช่วงอายุ ${rangeAge.value.min}-${rangeAge.value.max} ปี` }; -}); - -const rangeAge = ref({ - min: 18, - max: 60, -}); - const detailReport = ref(); /** ไปหน้าต่อไปของรายงาน */ @@ -61,8 +87,9 @@ function backPage() { async function getReport() { loadingBtn.value = true; + pdfSrc.value = undefined; await http - .get(config.API.developmentReportMain()) + .get(config.API.developmentReport() + `${typeReport.value}`) .then(async (res) => { const data = res.data.result; detailReport.value = data; @@ -131,39 +158,25 @@ onMounted(async () => {
-
- - - - - +
+
+ +
{
+ +
+ +
+ + + + + +
+
+
diff --git a/src/modules/21_report/views/05_reportSalary.vue b/src/modules/21_report/views/05_reportSalary.vue index 8b4b69cac..960b9d5d0 100644 --- a/src/modules/21_report/views/05_reportSalary.vue +++ b/src/modules/21_report/views/05_reportSalary.vue @@ -211,6 +211,7 @@ async function fetchDataReportUnified( "gov-07", "gov-07-01", "gov-08", + "gov-10", ].includes(reportCode); const finalUrl = isGovernmentId ? `${url}/${group.value}` : url; From fddb014b4c4295a51cbee188274263a065525f42 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 11 Feb 2025 19:50:33 +0700 Subject: [PATCH 5/6] fix report development --- .../21_report/views/03_reportDevelopment.vue | 24 ++++--------------- .../21_report/views/05_reportSalary.vue | 2 +- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/modules/21_report/views/03_reportDevelopment.vue b/src/modules/21_report/views/03_reportDevelopment.vue index 86264c8bc..0ffde999c 100644 --- a/src/modules/21_report/views/03_reportDevelopment.vue +++ b/src/modules/21_report/views/03_reportDevelopment.vue @@ -32,35 +32,19 @@ const optionReport = ref([ }, { id: "report3", - name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนการศึกษาในประเทศ", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนการศึกษา", }, { id: "report4", - name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)", + name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญ ที่ส่งไปพัฒนากับหน่วยงานภายนอก", }, { id: "report5", - name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)", - }, - { - id: "report6", - name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญ ที่ส่งไปพัฒนากับหน่วยงานภายนอก (หลักสูตรประเภทนักบริหาร)", - }, - { - id: "report7", name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ไปศึกษา ฝึกอบรม ประชุม ดูงาน และปฏิบัติการวิจัย ณ ต่างประเทศ", }, { - id: "report8", - name: "รายงานข้อมูลข้าราชการกรุงเทพมหานครสามัญที่ได้รับทุนไปศึกษา", - }, - { - id: "report9", - name: "รายงานสถิติข้อมูลการฝึกอบรม ศึกษาดูงาน ของข้าราชการกรุงเทพมหานครสามัญ", - }, - { - id: "report10", - name: "รายงานสถิติข้อมูลการศึกษาต่อของข้าราชการกรุงเทพมหานครสามัญ", + id: "report6", + name: "รายงานสถิติข้อมูลการศึกษาต่อ การฝึกอบรม ศึกษาดูงาน ของข้าราชการกรุงเทพมหานครสามัญ", }, ]); diff --git a/src/modules/21_report/views/05_reportSalary.vue b/src/modules/21_report/views/05_reportSalary.vue index 960b9d5d0..39d75df21 100644 --- a/src/modules/21_report/views/05_reportSalary.vue +++ b/src/modules/21_report/views/05_reportSalary.vue @@ -153,9 +153,9 @@ function fetchReportPDF() { async function fetchDataReportUnified( reportCode: string, employeeClass: string, - type: string = "xlsx" ) { isLoadFilePdf.value = true; + pdfSrc.value = undefined const isHalfYearReport = (id: string) => ["go1", "go2", "go2-01", "emp-08", "emp2-08"].includes(id); From 4a11216b5f0bbcedba36535b6343d241e8d69986 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 12 Feb 2025 10:54:00 +0700 Subject: [PATCH 6/6] updated report url --- src/modules/07_insignia/views/06_ReportMain.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/07_insignia/views/06_ReportMain.vue b/src/modules/07_insignia/views/06_ReportMain.vue index 09c6c7c75..2b351733c 100644 --- a/src/modules/07_insignia/views/06_ReportMain.vue +++ b/src/modules/07_insignia/views/06_ReportMain.vue @@ -154,7 +154,14 @@ async function onUpdateFilter() { .then(async (res) => { const data = await res.data.result; detailReport.value = data; - await fetchDocumentTemplate(data); + const type = + typeReport.value === "report4" || + typeReport.value === "report5" || + typeReport.value === "report6" || + typeReport.value === "report7" + ? "xlsx" + : "docx"; + await fetchDocumentTemplate(data, type); }) .catch(async (e) => { messageError($q, JSON.parse(await e.response.data.text())); @@ -169,9 +176,9 @@ async function onUpdateFilter() { * function เรียกไฟล์ PDF * @param data ข้อมูลบัญชีวันลา */ -async function fetchDocumentTemplate(data: any) { +async function fetchDocumentTemplate(data: any, type: string = "docx") { await axios - .post(`${config.API.reportTemplate}/docx`, data, { + .post(`${config.API.reportTemplate}/${type}`, data, { headers: { accept: "application/pdf", "content-Type": "application/json",