From e97c1a97f72ba847752e41a3c29cc6fec95591c8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 19 Feb 2026 10:44:52 +0700 Subject: [PATCH 1/4] feat(position-employee): copy position-employee --- .../components/DialogFormPosition.vue | 19 ++++++++++++------- .../components/DialogFormPosition.vue | 19 ++++++++++++------- .../components/TableMain.vue | 8 ++++++++ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/modules/02_organization/components/DialogFormPosition.vue b/src/modules/02_organization/components/DialogFormPosition.vue index 6fa4cf1d0..2c7a08ef4 100644 --- a/src/modules/02_organization/components/DialogFormPosition.vue +++ b/src/modules/02_organization/components/DialogFormPosition.vue @@ -1,5 +1,5 @@ + + + + diff --git a/src/modules/16_positionEmployee/components/TableMain.vue b/src/modules/16_positionEmployee/components/TableMain.vue index b9eaf4eba..765b1ca4e 100644 --- a/src/modules/16_positionEmployee/components/TableMain.vue +++ b/src/modules/16_positionEmployee/components/TableMain.vue @@ -10,9 +10,7 @@ import genreport from "@/plugins/genreportxlsx"; import config from "@/app.config"; import http from "@/plugins/http"; -/** - * importType - */ +/** importType*/ import type { QTableProps } from "quasar"; import type { ListMenu, @@ -22,10 +20,9 @@ import type { import type { FilterMaster } from "@/modules/16_positionEmployee/interface/request/organizational"; import type { PosMaster2 } from "@/modules/16_positionEmployee/interface/response/organizational"; import type { DataPosition } from "@/modules/16_positionEmployee/interface/index/organizational"; +import type { DataPositionCondition } from "@/modules/19_condition/interface/response/Main"; -/** - * importComponents - */ +/** importComponents*/ import DialogFormPosotion from "@/modules/16_positionEmployee/components/DialogFormPosition.vue"; import DialogPositionDetail from "@/modules/16_positionEmployee/components/DialogPositionDetail.vue"; import DialogSort from "@/modules/16_positionEmployee/components/DialogSortPosition.vue"; @@ -34,18 +31,15 @@ import DialogHistoryPos from "@/modules/16_positionEmployee/components/DialogHis import DialogSelectPerson from "@/modules/16_positionEmployee/components/DialogSelectPerson.vue"; import DialogSuccession from "@/modules/16_positionEmployee/components/DialogSuccession.vue"; import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; +import DialogCondition from "@/modules/16_positionEmployee/components/DialogCondition.vue"; -/** - * ues - */ +/** ues*/ const $q = useQuasar(); const store = usePositionEmp(); const { showLoader, hideLoader, messageError, success, dialogRemove } = useCounterMixin(); -/** - * prosp - */ +/** prosp*/ const nodeTree = defineModel("nodeTree", { required: true }); const orgLevel = defineModel("orgLevel", { required: true }); const treeId = defineModel("treeId", { required: true }); @@ -72,9 +66,7 @@ const props = defineProps({ }, }); -/** - * modal popup - */ +/** modal popup*/ const modalPerson = ref(false); //ตัวแปร popup ข้อมูลทะเบียนประวัติ const personalId = ref(""); //ตัวแปร id ข้อมูลทะเบียนประวัติ const dialogDetail = ref(false); // รายละเอียดตำแหน่ง @@ -84,6 +76,8 @@ const modalSort = ref(false); // จัดลำดับ const modalDialogMMove = ref(false); // ย้ายตำแหน่ง const modalDialogSuccession = ref(false); // สืบทอดตำแหน่ง const modalDialogHistoryPos = ref(false); // ประวัติตำแหน่ง +const modalCondition = ref(false); // จัดการตำแหน่งติดเงื่อนไข +const dataCondition = ref(); const rowId = ref(""); const actionType = ref(""); @@ -107,6 +101,12 @@ const listMenu = ref([ type: "COPY", color: "blue-6", }, + { + label: "จัดการตำแหน่งติดเงื่อนไข", + icon: "mdi-account-alert", + type: "CONDITION", + color: "deep-orange", + }, { label: "ลบ", icon: "delete", @@ -235,9 +235,7 @@ function onClickDelete(id: string) { }); } -/** - * fdunction จัดลำดับตำแหน่ง - */ +/** function เปิด popup จัดลำดับตำแหน่ง*/ function onClickSort() { modalSort.value = true; } @@ -280,9 +278,7 @@ function openSelectPerson(data: DataPosition[]) { dataDetailPos.value = data; } -/** - * ลบคนครอง - */ +/** function ลบคนครอง*/ function removePerson(id: string) { dialogRemove( $q, @@ -313,15 +309,14 @@ function removePerson(id: string) { /** * function openPopup สืบทอดตำแหน่ง + * @param id ที่ต้องการ */ function onClickInherit(id: string) { modalDialogSuccession.value = !modalDialogSuccession.value; rowId.value = id; } -/** - * ดึงข้อมูลสถิติจำนวนด้านบน - */ +/** ดึงข้อมูลสถิติจำนวนด้านบน*/ function getSummary() { showLoader(); http @@ -354,9 +349,13 @@ function getSummary() { }); } -/** function DownloadReport*/ +/** + * function DownloadReport + * @param val ประเภทเอกสารที่ต้องการดาวน์โหลด + * @param name ชื่อเอกสารที่ต้องการดาวน์โหลด + * + */ async function onClickDownloadReport(val: string, name: string) { - // รอ API showLoader(); await http .get(config.API.orgReport(val) + `/${treeId.value}`) @@ -379,6 +378,34 @@ const pagination = ref({ rowsPerPage: reqMaster.value.pageSize, }); +/** + * function เปิด popup จัดการตำแหน่งติดเงื่อนไข + * @param data ข้อมูลตำแหน่ง + */ +function onClickCodition(data: any) { + dataCondition.value = { + conditionReason: data.conditionReason + ? data.conditionReason.replace(/ /g, " \n") + : "", + id: data.id, + isCondition: data.isCondition, + orgShortname: data.orgShortname, + posMasterNo: Number(data.posMasterNo), + posMasterNoPrefix: data.posMasterNoPrefix, + posMasterNoSuffix: data.posMasterNoSuffix, + profilePosition: data.profilePosition, + profilePoslevel: data.profilePoslevel, + profilePostype: data.profilePostype, + positions: [], + }; + modalCondition.value = true; +} + +/** function fetchข้อมูลใหม่*/ +async function fetchDataCondition() { + props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false); +} + watch( () => modalDialogMMove.value, () => { @@ -593,6 +620,8 @@ watch( ? onClickInherit(props.row.id) : item.type === 'COPY' ? onClickPosition('COPY', props.row.id) + : item.type === 'CONDITION' + ? onClickCodition(props.row) : null " > @@ -624,7 +653,12 @@ watch( - +
{{ (reqMaster.page - 1) * Number(reqMaster.pageSize) + @@ -672,6 +706,12 @@ watch( > ดูข้อมูลในทะเบียนประวัติ + + {{ + props.row.isCondition && props.row.conditionReason + ? `\r(${props.row.conditionReason})` + : "" + }}
{{ col.value ? col.value : "-" }} @@ -758,6 +798,13 @@ watch( @update:modal="(value:any)=>{modalPerson = value}" :type="'employee'" /> + + +