diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yaml similarity index 100% rename from .forgejo/workflows/deploy.yml rename to .forgejo/workflows/deploy.yaml diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index b30ec3ec1..d370d9b29 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -194,6 +194,7 @@ export default { `${orgProfile}${type}/profileid/position`, uploadProfile: (type: string, id: string) => `${organization}/upload/${type}-profileSalaryTemp/${id}`, + sortOrderByDate: `${orgProfile}/salaryTemp/sort-order`, workflowCommanderOperate: `${workflow}/commander/operate`, workflowCommanderSign: `${workflow}/commander/sign`, diff --git a/src/api/09_leave/api.leave.ts b/src/api/09_leave/api.leave.ts index d0229b204..ffd727de9 100644 --- a/src/api/09_leave/api.leave.ts +++ b/src/api/09_leave/api.leave.ts @@ -25,6 +25,7 @@ export default { specialTime: () => `${leave}/admin/edit`, specialTimeApprove: (id: string) => `${leave}/admin/edit/approve/${id}`, specialTimeReject: (id: string) => `${leave}/admin/edit/reject/${id}`, + specialTimeApproveLists: `${leave}/admin/edit/approve-list`, /** รายการลา*/ leaveType: () => `${leave}/type`, @@ -63,4 +64,5 @@ export default { `${leave}/report/download/time-records/${type}`, leaveTask: `${leave}/admin/leave-task/process`, + leavePendingJobs: `${leave}/pending-jobs/`, }; diff --git a/src/api/recruiting/api.period-exam.ts b/src/api/recruiting/api.period-exam.ts index bf777e193..470303286 100644 --- a/src/api/recruiting/api.period-exam.ts +++ b/src/api/recruiting/api.period-exam.ts @@ -98,6 +98,9 @@ export default { `${env.API_URI}/placement/candidate/pdf/${candidateId}`, downloadCandidateExam: (id: string) => - `${periodExam}download/candidate-exam/${id}`, + `${exam_report}candidate/candidate-new/${id}`, downloadPassExam: (id: string) => `${periodExam}download/pass-exam/${id}`, + + downloadCandidatePassExam: (id: string) => + `${exam_report}candidate/pass-new/${id}`, }; diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue index 72fe7aad0..2b90d2468 100644 --- a/src/components/CardProfile.vue +++ b/src/components/CardProfile.vue @@ -8,6 +8,7 @@ import config from "@/app.config"; import type { PropType } from "vue"; import type { FormProfile } from "@/interface/main"; import type { DataProfile } from "@/modules/05_placement/interface/index/Main"; +import avatarMain from "@/assets/avatar_user.jpg"; /** importComponents*/ import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; @@ -91,8 +92,11 @@ function fetchProfile(id: string, name: string) { if (profile.avatar === "") { http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`)) - .then(async (res) => { + .then((res) => { profile.avatar = res.data.downloadUrl; + }) + .catch(() => { + profile.avatar = avatarMain; }); } } diff --git a/src/components/DialogHeader.vue b/src/components/DialogHeader.vue index 77d936c93..19ee3f536 100644 --- a/src/components/DialogHeader.vue +++ b/src/components/DialogHeader.vue @@ -9,6 +9,8 @@ round dense @click="close" + @keydown.enter.prevent + @keydown.space.prevent style="color: #ff8080; background-color: #ffdede" /> diff --git a/src/components/Dialogs/DialogOrgSelect.vue b/src/components/Dialogs/DialogOrgSelect.vue index e3c5e4634..c5ca51415 100644 --- a/src/components/Dialogs/DialogOrgSelect.vue +++ b/src/components/Dialogs/DialogOrgSelect.vue @@ -7,6 +7,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useStructureTree } from "@/stores/structureTree"; +import { formatPosmasterNo } from "@/utils/function"; import type { QTableProps } from "quasar"; import type { @@ -262,6 +263,7 @@ async function getDataTable(id: string, level: number = 0) { posType: posType.value ? posType.value : "", isAll: isAll.value, isBlank: isBlank.value, + profileId: type.value === "MOVE" ? props.dataRows.profileId : undefined, }; await http @@ -282,12 +284,12 @@ async function getDataTable(id: string, level: number = 0) { const listPosNo: DataPositionNo[] = dataMain.map((e: PositionMain) => ({ id: e.id, isPosition: e.isPosition, - posMasterNo: - e.orgShortname + - (e.posMasterNoPrefix != null ? e.posMasterNoPrefix : "") + - " " + - e.posMasterNo + - (e.posMasterNoSuffix != null ? e.posMasterNoSuffix : ""), + posMasterNo: formatPosmasterNo( + e.orgShortname, + e.posMasterNoPrefix, + e.posMasterNo.toString(), + e.posMasterNoSuffix + ), positionName: e.positionName, posTypeName: e.posTypeName, posLevelName: e.posLevelName, @@ -512,6 +514,7 @@ function onSubmit() { posLevelId: selectedPos.value[0].posLevelId, //ชื่อตำแหน่ง posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง posExecutiveName: selectedPos.value[0].posExecutiveName, //ชื่อตำแหน่ง + posExecutiveId: selectedPos.value[0].posExecutiveId, //ชื่อตำแหน่ง reportingDate: convertDateToAPI(datePos.value), posmasterId: dataPosMaster.id, typeCommand: type.value, diff --git a/src/components/Dialogs/DialogOrgSelectEmployee.vue b/src/components/Dialogs/DialogOrgSelectEmployee.vue index b9a7b1ee5..7bd4dde9d 100644 --- a/src/components/Dialogs/DialogOrgSelectEmployee.vue +++ b/src/components/Dialogs/DialogOrgSelectEmployee.vue @@ -7,6 +7,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useStructureTree } from "@/stores/structureTree"; +import { formatPosmasterNo } from "@/utils/function"; import type { QTableProps } from "quasar"; import type { @@ -263,12 +264,12 @@ async function getDataTable(id: string, level: number = 0) { const listPosNo: DataPositionNo[] = dataMain.map((e: PositionMain) => ({ id: e.id, isPosition: e.isPosition, - posMasterNo: - e.orgShortname + - (e.posMasterNoPrefix != null ? e.posMasterNoPrefix : "") + - " " + - e.posMasterNo + - (e.posMasterNoSuffix != null ? e.posMasterNoSuffix : ""), + posMasterNo: formatPosmasterNo( + e.orgShortname, + e.posMasterNoPrefix, + e.posMasterNo.toString(), + e.posMasterNoSuffix + ), positionName: e.positionName, posTypeName: e.posTypeName, posLevelName: e.posLevelName, diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index 1b17f7efd..ffc275ee7 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -14,6 +14,7 @@ import type { GovermentEmpTemp, } from "@/components/information/interface/response/Government"; import type { Avatar } from "@/components/information/interface/response/avatar"; +import avatarMain from "@/assets/avatar_user.jpg"; /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; @@ -167,9 +168,9 @@ async function fetchInformation(id: string) { avatar.position = data.position ? data.position : "-"; //ถ้ามีรูปเรียก Function fetchProfile เรียกข้อมูลรูปโปรไฟล์ if (data.avatarName) { - await fetchProfile(data.id as string, data.avatarName); + fetchProfile(data.id as string, data.avatarName); } else { - avatar.avatar = ""; + avatar.avatar = avatarMain; } if (props.id) { @@ -260,11 +261,14 @@ async function fetchProfileGovTemp(id: string) { * @param id profileID * @param avatarName ชื่อไฟล์ */ -async function fetchProfile(id: string, avatarName: string) { - await http +function fetchProfile(id: string, avatarName: string) { + http .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) - .then(async (res) => { - avatar.avatar = await res.data.downloadUrl; + .then((res) => { + avatar.avatar = res.data.downloadUrl; + }) + .catch(() => { + avatar.avatar = avatarMain; }); } diff --git a/src/modules/02_organization/components/DialogFormAgency.vue b/src/modules/02_organization/components/DialogFormAgency.vue index 32873fc17..72b3d228c 100644 --- a/src/modules/02_organization/components/DialogFormAgency.vue +++ b/src/modules/02_organization/components/DialogFormAgency.vue @@ -89,6 +89,11 @@ const formData = reactive({ DIVISION_CODE: "", SECTION_CODE: "", JOB_CODE: "", + ROOT_CODE: "", + CHILD1_CODE: "", + CHILD2_CODE: "", + CHILD3_CODE: "", + CHILD4_CODE: "", }); /** @@ -160,6 +165,11 @@ function onSubmit() { DIVISION_CODE: formData.DIVISION_CODE, SECTION_CODE: formData.SECTION_CODE, JOB_CODE: formData.JOB_CODE, + ROOT_CODE: formData.ROOT_CODE, + CHILD1_CODE: formData.CHILD1_CODE, + CHILD2_CODE: formData.CHILD2_CODE, + CHILD3_CODE: formData.CHILD3_CODE, + CHILD4_CODE: formData.CHILD4_CODE, }; // เพิ่มข้อมูล @@ -189,18 +199,20 @@ function onSubmit() { body ) .then(async () => { - await props.fetchDataTree(store.draftId); - await props.edit?.( - props.dataNode?.orgTreeId, - type, - body, - props.dataNode?.orgRootCode - ); - await props.fetchDataTable( - props?.dataNode?.orgTreeId, - props?.dataNode?.orgLevel, - false - ); + await Promise.all([ + await props.fetchDataTree(store.draftId), + await props.edit?.( + props.dataNode?.orgTreeId, + type, + body, + props.dataNode?.orgRootCode + ), + await props.fetchDataTable( + props?.dataNode?.orgTreeId, + props?.dataNode?.orgLevel, + false + ), + ]); await success($q, "บันทึกข้อมูลสำเร็จ"); closeClear(); }) @@ -231,6 +243,11 @@ function closeClear() { formData.isCommission = false; formData.isInformation = false; formData.misId = ""; + formData.ROOT_CODE = ""; + formData.CHILD1_CODE = ""; + formData.CHILD2_CODE = ""; + formData.CHILD3_CODE = ""; + formData.CHILD4_CODE = ""; formData.DEPARTMENT_CODE = ""; formData.DIVISION_CODE = ""; formData.SECTION_CODE = ""; @@ -456,6 +473,7 @@ watch( else { props.dataNode?.orgLevel === 1 && checkOfficer(); if (props.dataNode) { + console.log(props.dataNode); formData.orgName = props.dataNode.orgTreeName; formData.orgShortName = props.dataNode.orgTreeShortName; formData.orgCode = props.dataNode.orgTreeCode; @@ -474,6 +492,11 @@ watch( formData.DIVISION_CODE = props.dataNode.DIVISION_CODE; formData.SECTION_CODE = props.dataNode.SECTION_CODE; formData.JOB_CODE = props.dataNode.JOB_CODE; + formData.ROOT_CODE = props.dataNode.ROOT_CODE; + formData.CHILD1_CODE = props.dataNode.CHILD1_CODE; + formData.CHILD2_CODE = props.dataNode.CHILD2_CODE; + formData.CHILD3_CODE = props.dataNode.CHILD3_CODE; + formData.CHILD4_CODE = props.dataNode.CHILD4_CODE; orgLevelOption.value = props.dataNode.orgTreeRank === "DEPARTMENT" ? orgLevelOptionMain.value @@ -730,6 +753,66 @@ watch( +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
({ ...item, fullname: item.firstName - ? `${item.prefix}${item.firstName} ${item.lastName}`.trim() + ? `${item.prefix || ""}${item.firstName || ""} ${ + item.lastName || "" + }`.trim() : "ว่าง", })); } @@ -275,7 +277,7 @@ watch( (store.typeOrganizational === "draft" || store.typeOrganizational === "old") ? "2 (ปัจจุบัน)" - : props.rowIndex + 1 + : props.rowIndex + 1 }}
diff --git a/src/modules/02_organization/components/DialogMovePos.vue b/src/modules/02_organization/components/DialogMovePos.vue index e19999482..1cf149379 100644 --- a/src/modules/02_organization/components/DialogMovePos.vue +++ b/src/modules/02_organization/components/DialogMovePos.vue @@ -48,7 +48,7 @@ const modal = defineModel("modal", { required: true }); let reqMaster = defineModel("reqMaster", { required: true }); const totalPage = defineModel("totalPage", { required: true }); const nodeTree = defineModel("nodeTree", { required: true }); -const columns = defineModel("columns", {}); +const columns = defineModel("columns", {}); const rows = defineModel("rows", { required: true }); const props = defineProps({ fetchDataTree: { diff --git a/src/modules/02_organization/components/DialogStructureDetail.vue b/src/modules/02_organization/components/DialogStructureDetail.vue index aaaa56ba4..7ac7e12fc 100644 --- a/src/modules/02_organization/components/DialogStructureDetail.vue +++ b/src/modules/02_organization/components/DialogStructureDetail.vue @@ -36,6 +36,11 @@ const formData = reactive({ responsibility: "", //หน้าที่ความรับผิดชอบ isCommission: "", //สำนักปลัด isDeputy: "", //สำนักงาน กก. + rootCode: "", //ROOT CODE + child1Code: "", //CHILD1 CODE + child2Code: "", //CHILD2 CODE + child3Code: "", //CHILD3 CODE + child4Code: "", //CHILD4 CODE }); /** @@ -76,6 +81,11 @@ async function fetchDetailTree(id: string, type: string) { formData.responsibility = data.responsibility ? data.responsibility : "-"; formData.isDeputy = data.isDeputy ? "ใช่" : "-"; formData.isCommission = data.isCommission ? "ใช่" : "-"; + formData.rootCode = data.ROOT_CODE ? data.ROOT_CODE : "-"; + formData.child1Code = data.CHILD1_CODE ? data.CHILD1_CODE : "-"; + formData.child2Code = data.CHILD2_CODE ? data.CHILD2_CODE : "-"; + formData.child3Code = data.CHILD3_CODE ? data.CHILD3_CODE : "-"; + formData.child4Code = data.CHILD4_CODE ? data.CHILD4_CODE : "-"; }) .catch((err) => { messageError($q, err); @@ -208,6 +218,41 @@ watch( +
+
ROOT CODE
+
+

{{ formData.rootCode }}

+
+
+ +
+
CHILD1 CODE
+
+

{{ formData.child1Code }}

+
+
+ +
+
CHILD2 CODE
+
+

{{ formData.child2Code }}

+
+
+ +
+
CHILD3 CODE
+
+

{{ formData.child3Code }}

+
+
+ +
+
CHILD4 CODE
+
+

{{ formData.child4Code }}

+
+
+
หน้าที่ความรับผิดชอบ
diff --git a/src/modules/02_organization/components/TableMain.vue b/src/modules/02_organization/components/TableMain.vue index 7d8a2756b..b307970f0 100644 --- a/src/modules/02_organization/components/TableMain.vue +++ b/src/modules/02_organization/components/TableMain.vue @@ -9,6 +9,7 @@ import { checkPermission } from "@/utils/permissions"; import { updateCurrentPage } from "@/utils/function"; import { useOrganizational } from "@/modules/02_organization/store/organizational"; import { useCounterMixin } from "@/stores/mixin"; +import { formatPosmasterNo } from "@/utils/function"; /** importType*/ import type { QTableProps } from "quasar"; @@ -205,6 +206,14 @@ const columns = ref([ sortable: false, field: "posMasterNo", headerStyle: "font-size: 14px", + format(val, row) { + return formatPosmasterNo( + row.orgShortname, + row.posMasterNoPrefix, + row.posMasterNoMain, + row.posMasterNoSuffix + ); + }, style: "font-size: 14px", }, { @@ -1124,7 +1133,7 @@ watch( { posLevelName: e.isSit ? e.profilePoslevel : e.posLevelName, posExecutiveName: e.posExecutiveName, isSit: e.isSit, + orgShortname: e.orgShortname, + posMasterNoPrefix: e.posMasterNoPrefix, + posMasterNoSuffix: e.posMasterNoSuffix, + posMasterNoMain: e.posMasterNo, + })); return newPosMaster || []; diff --git a/src/modules/03_recruiting/components/Table.vue b/src/modules/03_recruiting/components/Table.vue index b5f2877f6..6ff82cda4 100644 --- a/src/modules/03_recruiting/components/Table.vue +++ b/src/modules/03_recruiting/components/Table.vue @@ -56,6 +56,7 @@ const optionsStatus = ref([ { label: "ขาดสอบ", value: "missed_exam" }, { label: "ผ่าน", value: "pass" }, { label: "ไม่ผ่าน", value: "notpass" }, + { label: "อื่น ๆ", value: "other" }, ]); const emit = defineEmits([ diff --git a/src/modules/03_recruiting/components/TableCandidate.vue b/src/modules/03_recruiting/components/TableCandidate.vue index f5b1b2b21..d725a3bc1 100644 --- a/src/modules/03_recruiting/components/TableCandidate.vue +++ b/src/modules/03_recruiting/components/TableCandidate.vue @@ -363,37 +363,59 @@ async function downloadFileDashboard() { } async function clickPassExam() { - showLoader(); - await http - .get(config.API.downloadPassExam(examId.value)) - .then(async (res) => { - const data = res.data.result; - data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; - await genReport(data, data.reportName, "pdf"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); + try { + showLoader(); + const res = await http.get( + config.API.downloadCandidatePassExam(examId.value), + { + headers: { + "Content-Type": "application/pdf", + Accept: "application/pdf", + }, + responseType: "blob", + } + ); + const url = window.URL.createObjectURL(new Blob([res.data])); + const link = document.createElement("a"); + link.href = url; + link.setAttribute( + "download", + `Candidate_Dashboard_${dateToISO(new Date())}` + ".pdf" + ); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } } async function clickCandidateList() { - showLoader(); - await http - .get(config.API.downloadCandidateExam(examId.value)) - .then(async (res) => { - const data = res.data.result; - data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; - await genReport(data, data.reportName, "pdf"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); + try { + showLoader(); + const res = await http.get(config.API.downloadCandidateExam(examId.value), { + headers: { + "Content-Type": "application/pdf", + Accept: "application/pdf", + }, + responseType: "blob", }); + const url = window.URL.createObjectURL(new Blob([res.data])); + const link = document.createElement("a"); + link.href = url; + link.setAttribute("download", "รายชื่อผู้มีสิทธิ์สอบ" + ".pdf"); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } } async function onCheckShowExaminfo() { @@ -549,8 +571,20 @@ watch(
- - ดาวน์โหลดไฟล์ + + + {{ + attrs.rows.length !== 0 + ? "ดาวน์โหลดไฟล์" + : "ไม่มีข้อมูลผู้สอบคัดเลือก" + }}
diff --git a/src/modules/05_placement/components/PersonalList/DialogDetail.vue b/src/modules/05_placement/components/PersonalList/DialogDetail.vue index 13aa09aef..dff09ffdd 100644 --- a/src/modules/05_placement/components/PersonalList/DialogDetail.vue +++ b/src/modules/05_placement/components/PersonalList/DialogDetail.vue @@ -525,14 +525,14 @@ watch(props, () => {
ผลการสอบ
ลำดับที่สอบได้
-
จำนวนครั้งที่สมัครสอบ
+
{{ personalForm?.pass }}
{{ personalForm?.examNumber }}
-
{{ personalForm?.examRound }}
+
diff --git a/src/modules/05_placement/components/PersonalList/DialogOrders.vue b/src/modules/05_placement/components/PersonalList/DialogOrders.vue index 8ac613a5f..c7d70b924 100644 --- a/src/modules/05_placement/components/PersonalList/DialogOrders.vue +++ b/src/modules/05_placement/components/PersonalList/DialogOrders.vue @@ -242,7 +242,7 @@ watch( v.code === "C-PM-04" || v.code === "C-PM-06")) || ((status?.examTypeName === "สอบคัดเลือก" || - status?.examTypeName === "คัดเลือกคนพิการ") && + status?.examTypeName === "คัดเลือกอื่นๆ") && (v.code === "C-PM-02" || v.code === "C-PM-03" || v.code === "C-PM-04" || diff --git a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue index e54741069..ad1028738 100644 --- a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue +++ b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue @@ -165,7 +165,9 @@ async function fetchDataTable(id: string, level: number = 0) { (e) => e !== props.dataRow?.posmasterId ); - positionNo.value = posMain.filter((e: DataPositionNo) => !newUse.includes(e.id)); + positionNo.value = posMain.filter( + (e: DataPositionNo) => !newUse.includes(e.id) + ); } else { positionNo.value = posMain.filter( (e: DataPositionNo) => !positionUse.value.includes(e.id) @@ -241,6 +243,7 @@ async function onClickSubmit() { posLevelId: selectedPos.value[0].posLevelId, //ชื่อตำแหน่ง posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง posExecutiveName: selectedPos.value[0].posExecutiveName, + posExecutiveId: selectedPos.value[0].posExecutiveId, reportingDate: convertDateToAPI(datePos.value), posmasterId: dataPosMaster.id, positionExecutiveField: selectedPos.value[0].positionExecutiveField, //ด้านทางการบริหาร @@ -290,7 +293,10 @@ watch( if (modal.value) { await fetchPositionUes(); if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) { - await fetchPosFind(props?.dataRow?.node ?? 0, props?.dataRow?.nodeId ?? ""); + await fetchPosFind( + props?.dataRow?.node ?? 0, + props?.dataRow?.nodeId ?? "" + ); } else { expanded.value = []; } @@ -345,7 +351,7 @@ function onPosType() { watch( [isAll, isBlank, () => isPosition.value], ([newAll, newBlank, newPos], [oldAll, oldBlank, oldPos]) => { - const shouldFetch = (newAll !== oldAll) || (newBlank !== oldBlank); + const shouldFetch = newAll !== oldAll || newBlank !== oldBlank; const isSelectMode = newPos === "select" && oldPos !== "select"; if (shouldFetch || isSelectMode) { diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 1d43085e9..1e151ee01 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -1,5 +1,5 @@ +