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 e0173febc..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, @@ -519,7 +521,6 @@ function onSubmit() { positionExecutiveField: selectedPos.value[0].positionExecutiveField, //ด้านทางการบริหาร positionArea: selectedPos.value[0].positionArea, //ด้าน/สาขา }; - console.log(body); await props.onSubmit?.(body); close(); 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/probation/DialogOrder.vue b/src/modules/05_placement/components/probation/DialogOrder.vue index 2646905f0..f4a5cb2a4 100644 --- a/src/modules/05_placement/components/probation/DialogOrder.vue +++ b/src/modules/05_placement/components/probation/DialogOrder.vue @@ -264,7 +264,7 @@ watch( @@ -352,7 +352,7 @@ watch( keep-color color="primary" dense - :disable="commandType" + :disable="!commandType ? true : false" v-model="props.selected" /> diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue index 6017dcaa3..07e8a2409 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue @@ -97,6 +97,8 @@ const develop_result_option = ref([ const isCheckFile = ref(false); +const isSelectionPartfour = ref(false); + // score const score1 = computed(() => { if ( @@ -212,20 +214,21 @@ const percent_sum: any = computed(() => { }); const score4 = computed(() => { return ( - (Number(orientation.value) + - Number(self_learning.value) + - Number(training_seminar.value) + - Number(other_training.value)) / - 4 + Number(orientation.value) + + Number(self_learning.value) + + Number(training_seminar.value) + + (isSelectionPartfour.value ? Number(other_training.value) : 0) ); }); const score5 = computed(() => { - const total = + const rawTotal = (Number(orientation_percent.value) + Number(self_learning_percent.value) + Number(training_seminar_percent.value) + Number(other_training_percent.value)) / - 4; + (isSelectionPartfour.value ? 4 : 3); + + const total = Math.trunc(rawTotal); develop_result.value = total > 60 ? 1 : 0; @@ -1133,10 +1136,20 @@ onMounted(async () => {
+ 4. การอบรมอื่น ๆ ตามที่หน่วยงานกำหนด (ถ้ามี)
{
([ // footer const dateAutherise = ref(null); +const isSelectionPartfour = ref(false); + onMounted(() => { fecthAssign(assignId.value); }); @@ -239,20 +241,21 @@ const percent_sum: any = computed(() => { }); const score4 = computed(() => { return ( - (Number(orientation.value) + - Number(self_learning.value) + - Number(training_seminar.value) + - Number(other_training.value)) / - 4 + Number(orientation.value) + + Number(self_learning.value) + + Number(training_seminar.value) + + (isSelectionPartfour.value ? Number(other_training.value) : 0) ); }); const score5 = computed(() => { - const total = + const rawTotal = (Number(orientation_percent.value) + Number(self_learning_percent.value) + Number(training_seminar_percent.value) + Number(other_training_percent.value)) / - 4; + (isSelectionPartfour.value ? 4 : 3); + + const total = Math.trunc(rawTotal); develop_result.value = total > 60 ? 1 : 0; @@ -1214,10 +1217,20 @@ watch(lengthdiscipline_level, (newLength) => {
+ 4. การอบรมอื่น ๆ ตามที่หน่วยงานกำหนด (ถ้ามี)
{ outlined dense type="number" + :disable="!isSelectionPartfour" v-model="other_training_percent" :rules="[(val:number) => val <= 100 || 'ร้อยละต้องไม่เกิน 100']" hide-bottom-space diff --git a/src/modules/05_placement/store.ts b/src/modules/05_placement/store.ts index af28e52c2..2dd18e96d 100644 --- a/src/modules/05_placement/store.ts +++ b/src/modules/05_placement/store.ts @@ -10,25 +10,25 @@ import type { } from "@/modules/05_placement/interface/request/Main"; import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main"; -export const useProfileDataStore = defineStore("profilePlacenent", () => { - interface profile { - main: { columns: String[] }; - education: { columns: String[] }; - certicate: { columns: String[] }; - train: { columns: String[] }; - insignia: { columns: String[] }; - coined: { columns: String[] }; - assessment: { columns: String[] }; - salary: { columns: String[] }; - discipline: { columns: String[] }; - leave: { columns: String[] }; - talent: { columns: String[] }; - work: { columns: String[] }; - record: { columns: String[] }; - other: { columns: String[] }; - document: { columns: String[] }; - } +interface profile { + main: { columns: String[] }; + education: { columns: String[] }; + certicate: { columns: String[] }; + train: { columns: String[] }; + insignia: { columns: String[] }; + coined: { columns: String[] }; + assessment: { columns: String[] }; + salary: { columns: String[] }; + discipline: { columns: String[] }; + leave: { columns: String[] }; + talent: { columns: String[] }; + work: { columns: String[] }; + record: { columns: String[] }; + other: { columns: String[] }; + document: { columns: String[] }; +} +export const useProfileDataStore = defineStore("profilePlacenent", () => { const birthDate = ref(new Date()); const retireText = ref(null); const changeRetireText = (val: string | null) => { @@ -87,15 +87,15 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => { changeRetireText, }; }); +interface placement { + mappingPosition: { columns: String[] }; +} export const usePlacementDataStore = defineStore("placement", () => { const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const tabsMain = ref("probation"); const isOfficer = ref(null); const isStaff = ref(null); const { hideLoader } = mixin; - interface placement { - mappingPosition: { columns: String[] }; - } const placementData = ref({ mappingPosition: { columns: [] }, }); @@ -218,10 +218,10 @@ export const usePlacementDataStore = defineStore("placement", () => { isStaff, }; }); +interface placementOrder { + mappingPosition: { columns: String[] }; +} export const useOrderPlacementDataStore = defineStore("placementOrder", () => { - interface placementOrder { - mappingPosition: { columns: String[] }; - } const placementOrderData = ref({ mappingPosition: { columns: [] }, }); @@ -369,6 +369,8 @@ export const useTransferDataStore = defineStore("transferDataStore", () => { ]); const statusOp = ref(statusMainOp.value); + const statusDelete = ["REPORT", "WAITING", "DONE"]; + const statusText = (val: string) => { switch (val) { case "WAITTING": @@ -438,5 +440,6 @@ export const useTransferDataStore = defineStore("transferDataStore", () => { statusOp, statusMainOp, filterOption, + statusDelete, }; }); diff --git a/src/modules/05_placement/stores/storeSelect.ts b/src/modules/05_placement/stores/storeSelect.ts index c07f26fcb..1d98e0b40 100644 --- a/src/modules/05_placement/stores/storeSelect.ts +++ b/src/modules/05_placement/stores/storeSelect.ts @@ -1,5 +1,5 @@ import { defineStore } from "pinia"; -import { ref } from "vue"; +import { formatPosmasterNo } from "@/utils/function"; /** importType*/ import type { PositionMaim } from "@/modules/05_placement/interface/response/SelectOrg"; import type { DataPositionNo } from "@/modules/05_placement/interface/index/SelectOrg"; @@ -12,12 +12,13 @@ export const useSelectOrgStore = defineStore("selectorg", () => { const listPosNo: DataPositionNo[] = data.map((e: PositionMaim) => ({ 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/modules/05_placement/views/02_transferMain.vue b/src/modules/05_placement/views/02_transferMain.vue index efd36dc90..181222caa 100644 --- a/src/modules/05_placement/views/02_transferMain.vue +++ b/src/modules/05_placement/views/02_transferMain.vue @@ -2,7 +2,7 @@ import { ref, onMounted, computed } from "vue"; import { useQuasar } from "quasar"; -import { useRouter } from "vue-router"; +import { useRouter, useRoute } from "vue-router"; import { checkPermission, checkPermissionList, @@ -20,11 +20,19 @@ import DialogOrders from "@/modules/05_placement/components/Transfer/DialogOrder const $q = useQuasar(); const router = useRouter(); +const route = useRoute(); const mixin = useCounterMixin(); const store = useTransferDataStore(); const { statusText, filterOption } = useTransferDataStore(); -const { date2Thai, messageError, showLoader, hideLoader, onSearchDataTable } = - mixin; +const { + date2Thai, + messageError, + showLoader, + hideLoader, + onSearchDataTable, + dialogRemove, + success, +} = mixin; const modal = ref(false); //ส่งไปออกคำสั่ง const dataTransfer = ref([]); //ช่อมูลรายการขอโอน @@ -141,6 +149,15 @@ const visibleColumns = ref([ "createdAt", ]); +const isPermissionDelete = computed(() => { + return (status: string) => { + return ( + checkPermission(route)?.attrOwnership === "OWNER" && + !store.statusDelete.includes(status) + ); + }; +}); + /** ฟังก์ชันดึงข้อมูรายการขอโอน*/ async function fetchData() { showLoader(); @@ -194,6 +211,21 @@ function onSearch() { ); } +function handleDelete(id: string) { + dialogRemove($q, async () => { + try { + showLoader(); + await http.delete(config.API.transfer + `/admin/${id}`); + await fetchData(); + success($q, "ลบข้อมูลสำเร็จ"); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } + }); +} + /** * ทำงานเมื่อ Components ถูกเรียกใช้งาน * จะเรียกใช้ fetchData เพื่อดึงข้อมูลรายการขอโอน @@ -337,6 +369,18 @@ onMounted(async () => { > รายละเอียด + + + ลบข้อมูล +
diff --git a/src/modules/05_placement/views/03_receiveMain.vue b/src/modules/05_placement/views/03_receiveMain.vue index ddfa21175..2541ce000 100644 --- a/src/modules/05_placement/views/03_receiveMain.vue +++ b/src/modules/05_placement/views/03_receiveMain.vue @@ -313,7 +313,7 @@ function openDelete(id: string) { dialogRemove($q, async () => { showLoader(); await http - .delete(config.API.receiveDataId(id)) + .delete(config.API.receiveData() + `/admin/${id}`) .then(async () => { await fecthlistRecevice(); await success($q, "ลบข้อมูลสำเร็จ"); @@ -606,8 +606,10 @@ onMounted(async () => { ([ headerStyle: "font-size: 14px", style: "font-size: 14px", format(val, row) { - return findPosMasterNoOld(row); + return row.positionNumberOld ?? "-"; }, }, { @@ -236,8 +236,7 @@ function openModalOrder() { item.status == "APPROVE") && item.organizationPositionOld && item.organization && - item.dateStart && - item.dateEnd + item.dateStart ); rows2.value = row; rows2Data.value = row; diff --git a/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue b/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue index 443217e45..d83017e3f 100644 --- a/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue +++ b/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue @@ -5,10 +5,12 @@ import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useRetirementDataStore } from "@/modules/06_retirement/store/Main"; import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow"; +import { useCommandMainStore } from "@/modules/18_command/store/Main"; import type { PropType } from "vue"; import type { QTableProps } from "quasar"; import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main"; +import type { ListCommand } from "@/modules/18_command/interface/index/Main"; import DialogHeader from "@/components/DialogHeader.vue"; import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue"; @@ -16,6 +18,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom /** use */ const $q = useQuasar(); const stroe = useRetirementDataStore(); +const storeCommand = useCommandMainStore(); const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore(); const { statusText } = stroe; const selected = ref([]); @@ -47,6 +50,10 @@ const props = defineProps({ cancel: { type: Boolean, default: false }, }); +const commandType = ref(""); +const commandMainOp = ref([]); //ข้อมูลรายการคำสั่ง +const commandOp = ref([]); //ตัวเลือกคำสั่ง + //Table const filterKeyword = defineModel("filterKeyword", { required: true }); const rowsData = ref([]); @@ -169,6 +176,11 @@ const visibleColumns = ref([ ]); const modalCommand = ref(false); +const isDisable = computed(() => { + return props.mainTabs === "1" + ? selected.value.length === 0 || commandType.value === "" + : selected.value.length === 0; +}); /** popup ยืนยันส่งัว */ function saveOrder() { @@ -210,6 +222,19 @@ async function fetchCheckOfficer() { } } +/** + * ฟิลเตอร์ คำสั่ง + * @param val ค่าจาก Input + * @param update Funtion quasar + */ +function filterSelector(val: string, update: Function) { + update(() => { + commandOp.value = commandMainOp.value.filter( + (v: ListCommand) => v.name.indexOf(val) > -1 + ); + }); +} + watch( () => props.modal, async (val) => { @@ -231,6 +256,11 @@ watch( rowsData.value = data ? data : []; rowsDataMain.value = data ? data : []; + commandType.value = ""; + const dataCommandTypes = await storeCommand.getCommandTypes(); + commandMainOp.value = dataCommandTypes.filter( + (e: ListCommand) => e.code === "C-PM-17" || e.code === "C-PM-48" + ); } else { rowsData.value = []; rowsDataMain.value = []; @@ -238,6 +268,7 @@ watch( } ); +