From 136a17ce8c4454e38eb59204e9f910f3aa1bb2ff Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 9 Jun 2026 09:42:11 +0700 Subject: [PATCH 01/49] refactor(appoint-promote): add profileId to /pos/placement/search payload --- src/components/Dialogs/DialogOrgSelect.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dialogs/DialogOrgSelect.vue b/src/components/Dialogs/DialogOrgSelect.vue index 15a41eac6..c5ca51415 100644 --- a/src/components/Dialogs/DialogOrgSelect.vue +++ b/src/components/Dialogs/DialogOrgSelect.vue @@ -263,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 @@ -520,7 +521,6 @@ function onSubmit() { positionExecutiveField: selectedPos.value[0].positionExecutiveField, //ด้านทางการบริหาร positionArea: selectedPos.value[0].positionArea, //ด้าน/สาขา }; - console.log(body); await props.onSubmit?.(body); close(); From 7d1bfd33ff0a67a1606d2be99bab12258bc48037 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 9 Jun 2026 17:39:55 +0700 Subject: [PATCH 02/49] fix: normalizeTreeData --- src/stores/structureTree.ts | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/stores/structureTree.ts b/src/stores/structureTree.ts index d509f637c..3d8e4dd72 100644 --- a/src/stores/structureTree.ts +++ b/src/stores/structureTree.ts @@ -13,6 +13,27 @@ import type { const { showLoader, hideLoader } = useCounterMixin(); +/** + * ฟังก์ชันแปลงข้อมูลโครงสร้างให้มี children array สำหรับทุกโหนด + * เพื่อป้องกันปัญหา q-tree เมื่อ children เป็น undefined + */ +function normalizeTreeData(nodes: DataStructureTree[]): DataStructureTree[] { + return nodes.map((node) => { + // Set children to [] for orgLevel: 4, otherwise recurse if children exist + const normalizedChildren = + node.orgLevel === 4 + ? [] + : node.children + ? normalizeTreeData(node.children) + : node.children; + + return { + ...node, + children: normalizedChildren, + }; + }); +} + export const useStructureTree = defineStore("structureTree", () => { const activeId = ref(""); const dataStore = ref<{ [key: string]: DataStructureTree[] }>({}); @@ -27,11 +48,11 @@ export const useStructureTree = defineStore("structureTree", () => { */ async function fetchStructureTree(sysKey: string, isLoad: boolean = false) { if (dataStore.value[sysKey]) { - return dataStore.value[sysKey] || []; + return normalizeTreeData(dataStore.value[sysKey]) || []; } else { activeId.value === "" && (await fetchActive()); const data = await fetchData(sysKey, isLoad); - return data || []; + return normalizeTreeData(data || []); } } From a8920b4473d6ca5687b49b6a2d4bc5f298b452d6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 10 Jun 2026 10:59:06 +0700 Subject: [PATCH 03/49] feat(changeName): change Rank --- .../02_NameChangeHistory.vue | 68 ++++++++++++++++++- .../interface/request/Main.ts | 1 + 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue index cbe7f361e..a4c9efd6b 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue @@ -59,6 +59,7 @@ const changeNameData = reactive({ profileId: profileId.value, prefixId: "", // id คำนำหน้า prefix: "", // คำนำหน้า + rank: "", // ยศ firstName: "", // ชื่อ lastName: "", // นามสกุล status: "", // สถานะ @@ -69,11 +70,13 @@ const selection = ref([]); // ตัวเลือก const prefixChange = ref(""); // เปลี่ยนคำนำหน้า const firstNameChange = ref(""); // เปลียนชื่อ const lastNameChange = ref(""); // เปลี่ยนนามสกุล +const rankChange = ref(""); // เปลี่ยนยศ const profileInfo = ref(); // ข้อมูล Profile const statusOption = ref([ "เปลี่ยนคำนำหน้าชื่อ", + "เปลี่ยนยศ", "เปลี่ยนชื่อ", "เปลี่ยนนามสกุล", "เปลี่ยนชื่อ-นามสกุล", @@ -84,6 +87,7 @@ const statusOption = ref([ const statusOptionFilter = ref([ "เปลี่ยนคำนำหน้าชื่อ", "เปลี่ยนชื่อ", + "เปลี่ยนยศ", "เปลี่ยนนามสกุล", "เปลี่ยนชื่อ-นามสกุล", "เปลี่ยนคำนำหน้าชื่อ และชื่อ", @@ -107,6 +111,17 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "rank", + align: "left", + label: "ยศ", + sortable: true, + field: "rank", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "firstName", align: "left", @@ -156,6 +171,7 @@ const columns = ref([ ]); const visibleColumns = ref([ "prefix", + "rank", "firstName", "lastName", "lastUpdateFullName", @@ -215,6 +231,7 @@ function onSubmit() { firstName: changeNameData.firstName, lastName: changeNameData.lastName, status: changeNameData.status, + rank: changeNameData.rank, documentId: changeNameData.documentId, }) .then(async (res) => { @@ -346,6 +363,14 @@ function filterSelector(val: string, update: Function, refData: string) { ); }); break; + + case "rankOps": + update(() => { + store.Ops.rankOps = store.OpsFilter.rankOps.filter( + (v: DataOption) => v.name.indexOf(val) > -1 + ); + }); + break; default: break; } @@ -390,12 +415,14 @@ watch( changeNameData.prefix, changeNameData.firstName, changeNameData.lastName, + changeNameData.rank, ], () => { submitDisable.value = changeNameData.prefix === prefixChange.value && changeNameData.firstName === firstNameChange.value && - changeNameData.lastName === lastNameChange.value; + changeNameData.lastName === lastNameChange.value && + changeNameData.rank === rankChange.value; } ); @@ -411,6 +438,9 @@ watch( if (!selection.value.includes("lastname")) { changeNameData.lastName = lastNameChange.value; } + if (!selection.value.includes("rank")) { + changeNameData.rank = rankChange.value; + } } ); /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ @@ -445,12 +475,14 @@ onMounted(async () => { icon="add" @click=" () => { - changeNameData.prefix = profileInfo?.prefixMain; + changeNameData.prefix = profileInfo?.prefix; changeNameData.firstName = profileInfo?.firstName; changeNameData.lastName = profileInfo?.lastName; + changeNameData.rank = profileInfo?.rank; prefixChange = changeNameData.prefix; firstNameChange = changeNameData.firstName; lastNameChange = changeNameData.lastName; + rankChange = changeNameData.rank; changeNameData.status = ''; dialogStatus = 'create'; submitDisable = true; @@ -563,12 +595,17 @@ onMounted(async () => {
-
+
+ { ) " />
+
+ +
Date: Wed, 10 Jun 2026 16:32:07 +0700 Subject: [PATCH 04/49] refactor(recruiting): add rootDnaId to disable and compete API payloads --- .../03_recruiting/interface/request/Period.ts | 2 ++ src/modules/03_recruiting/router.ts | 10 +++++----- .../03_recruiting/views/01_compete/PeriodAdd.vue | 4 ++++ .../views/02_qualify/DisablePeriod.vue | 16 ++++++++++++---- .../views/02_qualify/DisablePeriodAdd.vue | 4 ++++ 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/modules/03_recruiting/interface/request/Period.ts b/src/modules/03_recruiting/interface/request/Period.ts index aab6d13ad..420d0f7b8 100644 --- a/src/modules/03_recruiting/interface/request/Period.ts +++ b/src/modules/03_recruiting/interface/request/Period.ts @@ -45,6 +45,7 @@ interface RequestPeriodCompete { order: number; year: number; announcementDate: string | null; + rootDnaId: string; } interface RequestPeriodDisable { @@ -63,6 +64,7 @@ interface RequestPeriodDisable { round: number; year: number; announcementDate: string | null; + rootDnaId: string; } interface RequestPosition { diff --git a/src/modules/03_recruiting/router.ts b/src/modules/03_recruiting/router.ts index 06debb646..da4cdf93d 100644 --- a/src/modules/03_recruiting/router.ts +++ b/src/modules/03_recruiting/router.ts @@ -232,7 +232,7 @@ export default [ component: PeriodDisable, meta: { Auth: true, - Key: "SYS_EXAM_SELECT_LISTNAME", + Key: "SYS_EXAM_SELECT_PERIOD_DIS", Role: "STAFF", }, }, @@ -242,7 +242,7 @@ export default [ component: PeriodDisableAdd, meta: { Auth: true, - Key: "SYS_EXAM_SELECT_LISTNAME", + Key: "SYS_EXAM_SELECT_PERIOD_DIS", Role: "STAFF", }, }, @@ -252,7 +252,7 @@ export default [ component: PeriodDisableAdd, meta: { Auth: true, - Key: "SYS_EXAM_SELECT_LISTNAME", + Key: "SYS_EXAM_SELECT_PERIOD_DIS", Role: "STAFF", }, }, @@ -262,7 +262,7 @@ export default [ component: MainDisableDetail, meta: { Auth: true, - Key: "SYS_EXAM_SELECT_LISTNAME", + Key: "SYS_EXAM_SELECT_PERIOD_DIS", Role: "STAFF", }, }, @@ -272,7 +272,7 @@ export default [ component: MainDisableEx, meta: { Auth: true, - Key: "SYS_EXAM_SELECT_LISTNAME", + Key: "SYS_EXAM_SELECT_PERIOD_DIS", Role: "STAFF", }, }, diff --git a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue index 8cab7895c..4a3b9fcea 100644 --- a/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue +++ b/src/modules/03_recruiting/views/01_compete/PeriodAdd.vue @@ -2,11 +2,13 @@ import { onMounted, ref, watch, computed } from "vue"; import { useQuasar, QForm } from "quasar"; import { useRouter, useRoute } from "vue-router"; +import { storeToRefs } from "pinia"; import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { calculateFiscalYear } from "@/utils/function"; +import { usePositionKeycloakStore } from "@/stores/positionKeycloak"; import type { RequestPeriodCompete } from "@/modules/03_recruiting/interface/request/Period"; import type { @@ -16,6 +18,7 @@ import type { const $q = useQuasar(); // show dialog const mixin = useCounterMixin(); +const { dataPositionKeycloak } = storeToRefs(usePositionKeycloakStore()); const router = useRouter(); const route = useRoute(); const { @@ -253,6 +256,7 @@ function sendData() { year: yearly.value, announcementDate: dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null, + rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined, }; return valueData; } diff --git a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue index d23684dea..ef2177df7 100644 --- a/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue +++ b/src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue @@ -309,8 +309,8 @@ async function fetchData(actionType?: string) { if (data.length > 0) { data.map((r: ResponseRecruitPeriod) => { if (r.score != null) { - r.scoreCount = r.score.scoreCount; - r.scoreImportDate = r.score.importDate; + r.scoreCount = r.score.scoreCount ? r.score.scoreCount : 0; + r.scoreImportDate = r.score.importDate ? r.score.importDate : "-"; } result.push(r); }); @@ -715,7 +715,11 @@ onMounted(async () => { นำเข้าไฟล์ผลคะแนนสอบ
- {{ props.row.score.scoreCount.toLocaleString() }} + {{ + props.row.score + ? props.row.score.scoreCount.toLocaleString() + : "-" + }} { นำเข้าไฟล์ผลการสอบ (บัญชีรายชื่อ)
- {{ props.row.score.resultCount.toLocaleString() }} + {{ + props.row.score + ? props.row.score.resultCount.toLocaleString() + : "-" + }} Date: Thu, 11 Jun 2026 14:02:11 +0700 Subject: [PATCH 05/49] feat(resign): add commandType C-PM-48 --- .../02_resign/DialogSendToCommand.vue | 62 ++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) 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( } ); +