From e6dcc39765d8ef42c026a5fd4c5bc1e763d5359e Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Mon, 28 Oct 2024 12:16:50 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9A=E0=B8=A3?= =?UTF-8?q?=E0=B8=A3=E0=B8=88=E0=B8=B8=E0=B9=81=E0=B8=95=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B9=89=E0=B8=87=20=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=97=E0=B8=B5?= =?UTF-8?q?=E0=B9=88=E0=B8=AA=E0=B8=AD=E0=B8=9A=E0=B8=9C=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/02_organizational/api.organization.ts | 8 +- .../components/StructureOrgMain.vue | 3 +- .../components/PersonalList/CardPosition.vue | 73 ++++++++++--------- .../PersonalList/DialogSelectOrg.vue | 45 ++++++------ .../components/PersonalList/Table.vue | 60 ++++++--------- 5 files changed, 87 insertions(+), 102 deletions(-) diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index fc5a086ed..1b78751c0 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -75,6 +75,7 @@ export default { activeOrganizationRoot: `${organization}/active/root`, activeOrganizationRootById: (id: string) => `${organization}/active/root/${id}`, + orgPosPlacementAll: `${orgPos}/placement/search-all`, /** ข้อมูลตำแหน่งลูกจ้างประจำ*/ orgEmployeePos: `${orgEmployeePos}/position`, @@ -137,11 +138,12 @@ export default { checkIsOfficer: (id: string) => `${organization}/check/child1/${id}`, checkIsDeputys: (id: string) => `${organization}/check/root/${id}`, - orgPosReport:`${orgPos}/report/draft`, - orgPosReportAct:`${orgPos}/act/report/draft`, + orgPosReport: `${orgPos}/report/draft`, + orgPosReportAct: `${orgPos}/act/report/draft`, /** * workflow */ workflow: `${workflow}/`, - workflowKeycloakSystem:(type:string)=> `${workflow}/keycloak/isofficer/${type}`, + workflowKeycloakSystem: (type: string) => + `${workflow}/keycloak/isofficer/${type}`, }; diff --git a/src/modules/02_organization/components/StructureOrgMain.vue b/src/modules/02_organization/components/StructureOrgMain.vue index 4eaf3a801..529b9f6bf 100644 --- a/src/modules/02_organization/components/StructureOrgMain.vue +++ b/src/modules/02_organization/components/StructureOrgMain.vue @@ -63,7 +63,8 @@ async function addAvatarToData(item: any) { // เพิ่ม avatar ให้กับ item const updatedItem = { ...item, - avatar: item.avatar ? await fetchProfile(item.avatar) : avatar, + // avatar: item.avatar ? await fetchProfile(item.avatar) : avatar, + avatar: avatar, // ตรวจสอบว่า item มี children หรือไม่ children: item.children ? await Promise.all(item.children.map(addAvatarToData)) diff --git a/src/modules/05_placement/components/PersonalList/CardPosition.vue b/src/modules/05_placement/components/PersonalList/CardPosition.vue index cb6074ed2..b8b976c5b 100644 --- a/src/modules/05_placement/components/PersonalList/CardPosition.vue +++ b/src/modules/05_placement/components/PersonalList/CardPosition.vue @@ -27,8 +27,8 @@ const date = defineModel("datePos", { required: true }); //วันยท const positionData = defineModel("position", { required: true }); //ข้อมูลรายการตำแหน่งเลขที่ const isAll = defineModel("isAll", { required: true }); //แสดงตำแหน่งทั้งหมด const isBlank = defineModel("isBlank", { required: true }); //แสดงเฉพาะตำแหน่งว่าง -const isPosition = defineModel("isPosition", { required: true }); -const isPositionOld = defineModel("isPositionOld", { required: true }); //แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม +const isPosition = defineModel("isPosition", { required: true }); +// const isPositionOld = defineModel("isPositionOld", { required: true }); //แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม const posType = defineModel("posType", { required: true }); //ประเภทตำแหน่ง const posLevel = defineModel("posLevel", { required: true }); //ระดับตำแหน่ง const optionPosType = defineModel("optionPosType", { @@ -37,6 +37,7 @@ const optionPosType = defineModel("optionPosType", { const optionPosLevel = defineModel("optionPosLevel", { required: true, }); +const bmaOfficer = defineModel("bmaOfficer", { required: true }); const positionRows = ref(positionData.value); @@ -219,16 +220,16 @@ async function onClickSelectPos(id: string) { } } -function onPositionOld() { - props.fetchDataTable?.(props.nodeId, props.nodeLevel); - if (isPositionOld.value == false) { - posType.value.id = ""; - posType.value.posTypeName = ""; - posType.value.posTypeRank = null; - posType.value.posLevels = []; - posLevel.value = ""; - } -} +// function onPositionOld() { +// props.fetchDataTable?.(props.nodeId, props.nodeLevel); +// if (isPositionOld.value == false) { +// posType.value.id = ""; +// posType.value.posTypeName = ""; +// posType.value.posTypeRank = null; +// posType.value.posLevels = []; +// posLevel.value = ""; +// } +// } // เช็คว่าถ้ามีการปรับ filter ระบบจะนำข้อมูลไปเช็ค filter แสดงเฉพาะตำแหน่งที่ตรงกับการสอบใหม่อีกครั้ง watch(positionData, (newVal, oldVal) => { @@ -269,18 +270,6 @@ onMounted(async () => { > แสดงเฉพาะตำแหน่งว่าง - - แสดงเฉพาะตำแหน่งที่ตรงกับการสอบ - - {
- - แสดงตำแหน่งที่ตรงกับประเภทและระดับเดิม - + แสดงเฉพาะตำแหน่งที่ตรงกับการสอบ +
-
+
+ + แสดงตำแหน่งที่ตรงกับประเภทและระดับ + +
+ +
{ >
-
+
(false); const isBlank = ref(true); -const isPosition = ref(true); -const isPositionOld = ref(false); +const isPosition = ref("exam"); +// const isPositionOld = ref(false); async function fetchDataTable(id: string, level: number = 0) { showLoader(); const body = { node: level, nodeId: id, - position: props?.dataRow?.positionCandidate, - typeCommand: props.typeCommand, - posLevel: props.dataRow?.posLevelCandidateId - ? props.dataRow?.posLevelCandidateId - : "", - posType: props.dataRow?.posTypeCandidateId - ? props.dataRow?.posTypeCandidateId - : "", + position: + isPosition.value === "exam" ? props?.dataRow?.positionCandidate : null, + posLevel: + isPosition.value === "exam" + ? props.dataRow?.posLevelCandidateId + : posLevel.value + ? posLevel.value + : null, + + posType: + isPosition.value === "exam" + ? props.dataRow?.posTypeCandidateId + : posType.value + ? posType.value.id + : null, isAll: isAll.value, isBlank: isBlank.value, - isPosition: isPosition.value, - isPositionOld: isPositionOld.value, - - positionType: posType.value ? posType.value.posTypeName : null, - positionLevel: posLevel.value ? posLevel.value : null, }; await http - .post(config.API.orgPosPlacement, body) + .post(config.API.orgPosPlacementAll, body) .then((res) => { const dataMain: PositionMaim[] = []; posMasterMain.value = res.data.result.data; @@ -236,7 +234,6 @@ async function onClickSubmit() { posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง reportingDate: datePos.value, posmasterId: dataPosMaster.id, - typeCommand: props.typeCommand, }; await http @@ -268,7 +265,7 @@ function clearData() { expanded.value = []; posType.value = null; posLevel.value = ""; - isPositionOld.value = false; + isPosition.value = "exam"; } /** callback function เมื่อมีการเปิด popup*/ @@ -351,7 +348,7 @@ watch( ); watch( - () => isPositionOld.value, + () => isPosition.value === "select", (value, oldVal) => { if (value !== oldVal) { fetchDataTable(nodeId.value, nodeLevel.value); @@ -463,7 +460,6 @@ onMounted(() => { v-model:is-all="isAll" v-model:is-blank="isBlank" v-model:is-position="isPosition" - v-model:is-position-old="isPositionOld" v-model:pos-type="posType as FormPosType" v-model:pos-level="posLevel" v-model:option-pos-type="optionPosType" @@ -472,6 +468,7 @@ onMounted(() => { :on-pos-type="onPosType" :node-id="nodeId" :node-level="nodeLevel" + :bma-officer="props.dataRow?.bmaOfficer" /> diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 82cda3075..e25955800 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -8,7 +8,6 @@ import config from "@/app.config"; import { useRoute, useRouter } from "vue-router"; import { checkPermission } from "@/utils/permissions"; import { useCounterMixin } from "@/stores/mixin"; -import { tokenParsed } from "@/plugins/auth"; import { usePlacementDataStore } from "@/modules/05_placement/store"; import avatar from "@/assets/avatar_user.jpg"; @@ -257,24 +256,24 @@ function convertContainStatus(val: string) { } } -/** - * แปลงสถานะ - * @param val type - */ -function convertTypeCommand(val: string) { - switch (val) { - case "APPOINTED": - return "บรรจุแต่งตั้ง"; - case "APPOINT": - return "แต่งตั้ง/ย้าย"; - // case "SLIP": - // return "เลื่อน"; - // case "MOVE": - // return "ย้าย"; - default: - return ""; - } -} +// /** +// * แปลงสถานะ +// * @param val type +// */ +// function convertTypeCommand(val: string) { +// switch (val) { +// case "APPOINTED": +// return "บรรจุแต่งตั้ง"; +// case "APPOINT": +// return "แต่งตั้ง/ย้าย"; +// // case "SLIP": +// // return "เลื่อน"; +// // case "MOVE": +// // return "ย้าย"; +// default: +// return ""; +// } +// } /** * แปลงสถานะการส่งรายชื่อ @@ -579,13 +578,8 @@ function editDetail( const modalDialogSelectOrg = ref(false); const typeCommand = ref(""); const dataRow = ref(); -function openAppointModal( - pid: string, - data: DataList, - typeCommandVal: "APPOINTED" | "APPOINT" | "SLIP" | "MOVE" -) { +function openAppointModal(pid: string, data: DataList) { dataRow.value = data; - typeCommand.value = typeCommandVal; modalDialogSelectOrg.value = !modalDialogSelectOrg.value; } @@ -936,13 +930,7 @@ onMounted(async () => { " clickable v-close-popup - @click=" - openAppointModal( - props.row.personalId, - props.row, - 'APPOINT' - ) - " + @click="openAppointModal(props.row.personalId, props.row)" > { " clickable v-close-popup - @click=" - openAppointModal( - props.row.personalId, - props.row, - 'APPOINTED' - ) - " + @click="openAppointModal(props.row.personalId, props.row)" >