updated retire

This commit is contained in:
Warunee Tamkoo 2024-05-30 17:05:07 +07:00
parent 4c91f54d6a
commit a9732db31f
3 changed files with 94 additions and 112 deletions

View file

@ -20,9 +20,9 @@ const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const retireDate = ref<Date>(); const retireDate = ref<Date>();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const empType = ref<string>(
route.name !== "appoint-employee-detail" ? "" : "-employee" const isEmployee = defineModel("isEmployee", { type: String });
); const empType = ref<string>("");
/** props*/ /** props*/
const props = defineProps({ const props = defineProps({
id: { id: {
@ -165,6 +165,12 @@ watch(
modal.value = props.modal ? props.modal : false; modal.value = props.modal ? props.modal : false;
if (modal.value) { if (modal.value) {
if (props.id) { if (props.id) {
empType.value =
route.name === "appoint-employee-detail" ||
isEmployee.value == "EMPLOYEE"
? "-employee"
: "";
fetchInformation(props.id); fetchInformation(props.id);
fetchProfileGov(props.id); fetchProfileGov(props.id);
} }
@ -196,8 +202,8 @@ async function fetchProfile(id: string, avatarName: string) {
<q-card style="width: 420px; overflow: visible"> <q-card style="width: 420px; overflow: visible">
<q-toolbar> <q-toolbar>
<q-toolbar-title class="text-subtitle1 text-bold" <q-toolbar-title class="text-subtitle1 text-bold"
>ทะเบยนประว</q-toolbar-title >ทะเบยนประว
> </q-toolbar-title>
<q-btn <q-btn
icon="close" icon="close"
unelevated unelevated

View file

@ -130,14 +130,6 @@ const menuList = readonly<any[]>([
}, },
], ],
}, },
{
key: 3,
icon: "mdi-account-badge",
activeIcon: "groups",
label: "จัดการผู้ใช้งานและสิทธิ์",
role: "user_role",
path: "manageUser",
},
{ {
key: 3, key: 3,
icon: "o_groups", icon: "o_groups",

View file

@ -10,6 +10,8 @@ import config from "@/app.config";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
import { format } from "path";
import type { substitute } from "esri/intl";
const modalPersonal = ref<boolean>(false); const modalPersonal = ref<boolean>(false);
const personId = ref<string>(""); const personId = ref<string>("");
@ -27,6 +29,7 @@ const {
dialogRemove, dialogRemove,
date2Thai, date2Thai,
dateToISO, dateToISO,
findOrgName,
} = mixin; } = mixin;
const myForm = ref<QForm | null>(null); const myForm = ref<QForm | null>(null);
@ -56,15 +59,15 @@ const visibleColumns = ref<string[]>([
"order", "order",
"name", "name",
"organizationOrganization", "organizationOrganization",
"positionEmployeePosition", "position",
"positionEmployeeLevel", "positionType",
"positionEmployeeGroup", // "organizationAgency",
"organizationAgency", // "organizationGovernmentAgency",
"organizationGovernmentAgency",
"positionNumber", "positionNumber",
"govGroup", "govGroup",
"govOffice", "govOffice",
"bureau", "organization",
// "bureau",
]); ]);
/** Hook */ /** Hook */
@ -100,28 +103,26 @@ const fecthlistprofile = async (id: string) => {
profileId: e.profileId, profileId: e.profileId,
order: e.order, order: e.order,
name: e.fullName, name: e.fullName,
organizationOrganization: e.organizationOrganization, organization: e.root,
positionEmployeePosition: position: e.position,
res.data.result.type == "OFFICER" positionNumber: e.posNo,
? e.positionType positionType: e.positionType,
: e.positionEmployeePosition, positionLevel: e.positionLevel,
positionEmployeeLevel: // organizationAgency: e.organizationAgency,
res.data.result.type == "OFFICER" // organizationGovernmentAgency: e.organizationGovernmentAgency,
? e.positionExecutive != null // bureau: e.oc,
? 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,
reason: e.reason, reason: e.reason,
remove: e.remove, 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) { if (statusReport.value == false) {
fecthCheck(retireld.value); fecthCheck(retireld.value);
@ -152,48 +153,22 @@ const fecthlistprofile = async (id: string) => {
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "organizationOrganization", name: "position",
align: "left", align: "left",
label: "สังกัด", label: "ตำแหน่ง",
title: "สังกัด", title: "ตำแหน่ง",
field: "organizationOrganization", subtitle: employeeType.value == "OFFICER" ? "ในสายงาน" : "",
field: "position",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "positionEmployeeGroup", name: "positionType",
align: "left", align: "left",
label: label: "ตำแหน่ง",
employeeType.value == "OFFICER" title: "ตำแหน่ง",
? "ตำแหน่ง (ในสายงาน/ระดับ)" subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "กลุ่มงาน",
: "กลุ่มงาน", field: "positionType",
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",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
@ -208,34 +183,37 @@ const fecthlistprofile = async (id: string) => {
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "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", align: "left",
label: "ส่วนราชการ (ระดับฝ่าย/กลุ่มงาน/ส่วน)", label: "สังกัด",
title: "ส่วนราชการ", title: "สังกัด",
subtitle: "ระดับฝ่าย/กลุ่มงาน/ส่วน", field: "organization",
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",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val: any, row: any) {
return findOrgName(row);
},
}, },
]; ];
@ -653,34 +631,39 @@ function updatemodalPersonal(modal: boolean) {
> >
<q-td key="order" :props="props">{{ props.row.order }} </q-td> <q-td key="order" :props="props">{{ props.row.order }} </q-td>
<q-td key="name" :props="props">{{ props.row.name }}</q-td> <q-td key="name" :props="props">{{ props.row.name }}</q-td>
<q-td <!-- <q-td
class="table_ellipsis" class="table_ellipsis"
key="organizationOrganization" key="organizationOrganization"
:props="props" :props="props"
>{{ props.row.organizationOrganization }}</q-td >{{ props.row.organizationOrganization }}</q-td
> > -->
<q-td key="positionEmployeeGroup" :props="props">{{ <q-td key="position" :props="props">{{
props.row.positionEmployeeGroup props.row.position
}}</q-td>
<q-td key="positionEmployeePosition" :props="props">{{
props.row.positionEmployeePosition
}}</q-td>
<q-td key="positionEmployeeLevel" :props="props">{{
props.row.positionEmployeeLevel
}}</q-td> }}</q-td>
<q-td key="positionType" :props="props"
>{{ props.row.positionType ? props.row.positionType : "-" }}
{{
props.row.positionLevel
? " (" + props.row.positionLevel + ")"
: ""
}}
</q-td>
<q-td key="positionNumber" :props="props">{{ <q-td key="positionNumber" :props="props">{{
props.row.positionNumber props.row.positionNumber
}}</q-td> }}</q-td>
<q-td key="organizationAgency" :props="props">{{ <!-- <q-td key="organizationAgency" :props="props">{{
props.row.organizationAgency props.row.organizationAgency
}}</q-td> }}</q-td>
<q-td key="organizationGovernmentAgency" :props="props">{{ <q-td key="organizationGovernmentAgency" :props="props">{{
props.row.organizationGovernmentAgency props.row.organizationGovernmentAgency
}}</q-td> -->
<q-td class="table_ellipsis" key="organization" :props="props">{{
props.row.organization
}}</q-td> }}</q-td>
<q-td class="table_ellipsis" key="bureau" :props="props">{{ <!-- <q-td class="table_ellipsis" key="bureau" :props="props">{{
props.row.bureau props.row.bureau
}}</q-td> }}</q-td> -->
<q-td auto-width></q-td> <q-td auto-width></q-td>
<q-td <q-td
auto-width auto-width
@ -881,6 +864,7 @@ function updatemodalPersonal(modal: boolean) {
:modal="modalPersonal" :modal="modalPersonal"
:id="personId" :id="personId"
@update:modal="updatemodalPersonal" @update:modal="updatemodalPersonal"
v-model:is-employee="employeeType"
/> />
</template> </template>