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/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/07_insignia/views/06_ReportMain.vue b/src/modules/07_insignia/views/06_ReportMain.vue index 640edcf54..2b351733c 100644 --- a/src/modules/07_insignia/views/06_ReportMain.vue +++ b/src/modules/07_insignia/views/06_ReportMain.vue @@ -37,9 +37,25 @@ const optionReport = ref([ }, { id: "report2", - name: " บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี", + name: "บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี", + }, + { id: "report3", name: "บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ 5 ปี" }, + { + id: "report4", + name: "รายชื่อข้าราชการฯ ที่ได้รับ/ไม่ได้รับการจ่ายใบกำกับฯ", + }, + { + id: "report5", + name: "รายงานสถิติการได้รับเครื่องราชอิสริยาภรณ์ข้าราชการฯ", + }, + { + id: "report6", + name: "รายงานผลการจ่ายประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์ แยกรายหน่วยงาน", + }, + { + id: "report7", + name: "รายงานแสดงรายชื่อลูกจ้างประจำที่ได้รับ/ไมได้รับ การจ่ายใบกำกับฯ เครื่องราชอิสริยาภรณที่ได้รับพระราชทาน (ลูกจ้าง)", }, - { id: "report3", name: " บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ 5 ปี" }, ]); const roundId = ref(""); @@ -138,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())); @@ -153,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", 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" > { name: "แนบท้ายคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม (PDF)", type: "pdf", }, + + { + id: "gov-10", + name: "แบบบัญชีถือจ่าย (จ.๑๘) ของข้าราชการกรุงเทพมหานครสามัญ", + }, ]); function fetchPeriodLatest(data: DataPeriodLatest, type: string) { 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/03_reportDevelopment.vue b/src/modules/21_report/views/03_reportDevelopment.vue index 30717c94a..0ffde999c 100644 --- a/src/modules/21_report/views/03_reportDevelopment.vue +++ b/src/modules/21_report/views/03_reportDevelopment.vue @@ -24,25 +24,35 @@ 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: "รายงานสถิติข้อมูลการศึกษาต่อ การฝึกอบรม ศึกษาดูงาน ของข้าราชการกรุงเทพมหานครสามัญ", + }, +]); + 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 +71,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 +142,25 @@ onMounted(async () => {
-
- - - - - +
+
+ +
{
+ +
+ +
+ + + + + +
+
+
diff --git a/src/modules/21_report/views/05_reportSalary.vue b/src/modules/21_report/views/05_reportSalary.vue index 869d9ab47..39d75df21 100644 --- a/src/modules/21_report/views/05_reportSalary.vue +++ b/src/modules/21_report/views/05_reportSalary.vue @@ -1,7 +1,630 @@ - + - +