From a9732db31f33b34cc75c155f5a9c7050ecdcee30 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 30 May 2024 17:05:07 +0700 Subject: [PATCH] updated retire --- src/components/Dialogs/PopupPersonalNew.vue | 16 +- src/interface/request/main/main.ts | 8 - .../components/ListRetirement/TableList.vue | 182 ++++++++---------- 3 files changed, 94 insertions(+), 112 deletions(-) diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index 70a35f1b9..09a6572da 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -20,9 +20,9 @@ const router = useRouter(); const $q = useQuasar(); const retireDate = ref(); const { showLoader, hideLoader, messageError, date2Thai } = mixin; -const empType = ref( - route.name !== "appoint-employee-detail" ? "" : "-employee" -); + +const isEmployee = defineModel("isEmployee", { type: String }); +const empType = ref(""); /** props*/ const props = defineProps({ id: { @@ -165,6 +165,12 @@ watch( modal.value = props.modal ? props.modal : false; if (modal.value) { if (props.id) { + empType.value = + route.name === "appoint-employee-detail" || + isEmployee.value == "EMPLOYEE" + ? "-employee" + : ""; + fetchInformation(props.id); fetchProfileGov(props.id); } @@ -196,8 +202,8 @@ async function fetchProfile(id: string, avatarName: string) { ทะเบียนประวัติ + >ทะเบียนประวัติ + ([ }, ], }, - { - key: 3, - icon: "mdi-account-badge", - activeIcon: "groups", - label: "จัดการผู้ใช้งานและสิทธิ์", - role: "user_role", - path: "manageUser", - }, { key: 3, icon: "o_groups", diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 35f03950e..41e81252c 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -10,6 +10,8 @@ import config from "@/app.config"; import DialogHeader from "@/components/DialogHeader.vue"; import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; +import { format } from "path"; +import type { substitute } from "esri/intl"; const modalPersonal = ref(false); const personId = ref(""); @@ -27,6 +29,7 @@ const { dialogRemove, date2Thai, dateToISO, + findOrgName, } = mixin; const myForm = ref(null); @@ -56,15 +59,15 @@ const visibleColumns = ref([ "order", "name", "organizationOrganization", - "positionEmployeePosition", - "positionEmployeeLevel", - "positionEmployeeGroup", - "organizationAgency", - "organizationGovernmentAgency", + "position", + "positionType", + // "organizationAgency", + // "organizationGovernmentAgency", "positionNumber", "govGroup", "govOffice", - "bureau", + "organization", + // "bureau", ]); /** Hook */ @@ -100,28 +103,26 @@ const fecthlistprofile = async (id: string) => { profileId: e.profileId, order: e.order, name: e.fullName, - organizationOrganization: e.organizationOrganization, - positionEmployeePosition: - res.data.result.type == "OFFICER" - ? e.positionType - : e.positionEmployeePosition, - positionEmployeeLevel: - res.data.result.type == "OFFICER" - ? e.positionExecutive != null - ? e.positionExecutive - : "-" - : e.positionEmployeeLevel, - positionNumber: - res.data.result.type == "OFFICER" ? e.posNo : e.posNoEmployee, - positionEmployeeGroup: - res.data.result.type == "OFFICER" - ? e.position - : e.positionEmployeeGroup, - organizationAgency: e.organizationAgency, - organizationGovernmentAgency: e.organizationGovernmentAgency, - bureau: e.oc, + organization: e.root, + position: e.position, + positionNumber: e.posNo, + positionType: e.positionType, + positionLevel: e.positionLevel, + // organizationAgency: e.organizationAgency, + // organizationGovernmentAgency: e.organizationGovernmentAgency, + // bureau: e.oc, reason: e.reason, remove: e.remove, + root: e.root, + rootId: e.rootId, + child1: e.child1, + child1Id: e.child1Id, + child2: e.child2, + child2Id: e.child2Id, + child3: e.child3, + child3Id: e.child3Id, + child4: e.child4, + child4Id: e.child4Id, })); if (statusReport.value == false) { fecthCheck(retireld.value); @@ -152,48 +153,22 @@ const fecthlistprofile = async (id: string) => { style: "font-size: 14px", }, { - name: "organizationOrganization", + name: "position", align: "left", - label: "สังกัด", - title: "สังกัด", - field: "organizationOrganization", + label: "ตำแหน่ง", + title: "ตำแหน่ง", + subtitle: employeeType.value == "OFFICER" ? "ในสายงาน" : "", + field: "position", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "positionEmployeeGroup", + name: "positionType", align: "left", - label: - employeeType.value == "OFFICER" - ? "ตำแหน่ง (ในสายงาน/ระดับ)" - : "กลุ่มงาน", - title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "กลุ่มงาน", - subtitle: employeeType.value == "OFFICER" ? "ในสายงาน/ระดับ" : "", - field: "positionEmployeeGroup", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionEmployeePosition", - align: "left", - label: - employeeType.value == "OFFICER" ? "ตำแหน่ง (ประเภท)" : "ตำแหน่ง", - title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "ตำแหน่ง", - subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "", - field: "positionEmployeePosition", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionEmployeeLevel", - align: "left", - label: - employeeType.value == "OFFICER" - ? "ตำแหน่ง (ทางการบริหาร)" - : "ระดับชั้น", - title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "ระดับชั้น", - subtitle: employeeType.value == "OFFICER" ? "ทางการบริหาร" : "", - field: "positionEmployeeLevel", + label: "ตำแหน่ง", + title: "ตำแหน่ง", + subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "กลุ่มงาน", + field: "positionType", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -208,34 +183,37 @@ const fecthlistprofile = async (id: string) => { headerStyle: "font-size: 14px", style: "font-size: 14px", }, + // { + // name: "organizationAgency", + // align: "left", + // label: "ส่วนราชการ (ระดับฝ่าย/กลุ่มงาน/ส่วน)", + // title: "ส่วนราชการ", + // subtitle: "ระดับฝ่าย/กลุ่มงาน/ส่วน", + // field: "organizationAgency", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, + // { + // name: "organizationGovernmentAgency", + // align: "left", + // label: "ส่วนราชการ (ระดับสถาบัน/สำนักงาน/กอง)", + // title: "ส่วนราชการ", + // subtitle: "ระดับสถาบัน/สำนักงาน/กอง", + // field: "organizationGovernmentAgency", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, { - name: "organizationAgency", + name: "organization", align: "left", - label: "ส่วนราชการ (ระดับฝ่าย/กลุ่มงาน/ส่วน)", - title: "ส่วนราชการ", - subtitle: "ระดับฝ่าย/กลุ่มงาน/ส่วน", - field: "organizationAgency", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "organizationGovernmentAgency", - align: "left", - label: "ส่วนราชการ (ระดับสถาบัน/สำนักงาน/กอง)", - title: "ส่วนราชการ", - subtitle: "ระดับสถาบัน/สำนักงาน/กอง", - field: "organizationGovernmentAgency", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "bureau", - align: "left", - label: "หน่วยงาน", - title: "หน่วยงาน", - field: "bureau", + label: "สังกัด", + title: "สังกัด", + field: "organization", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val: any, row: any) { + return findOrgName(row); + }, }, ]; @@ -653,34 +631,39 @@ function updatemodalPersonal(modal: boolean) { > {{ props.row.order }} {{ props.row.name }} - {{ props.row.organizationOrganization }} - {{ - props.row.positionEmployeeGroup - }} - {{ - props.row.positionEmployeePosition - }} - {{ - props.row.positionEmployeeLevel + > --> + {{ + props.row.position }} + {{ props.row.positionType ? props.row.positionType : "-" }} + {{ + props.row.positionLevel + ? " (" + props.row.positionLevel + ")" + : "" + }} + {{ props.row.positionNumber }} - {{ + + {{ + props.row.organization }} - {{ +