เพิ่ม UI รายชื่อลูกจ้างประจำ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-05-26 17:38:04 +07:00
parent 7b2047d36e
commit ce39f91e02
3 changed files with 209 additions and 2 deletions

View file

@ -30,8 +30,8 @@ interface Goverment {
positionLevel: string;
positionExecutive: string;
positionExecutiveSide: string;
dateLeave: string;
dateRetireLaw: string;
dateLeave?: string;
dateRetireLaw?: string;
}
interface GovermentEmpTemp {

View file

@ -30,6 +30,10 @@ const report_02 = () =>
const ReclaimMain = () =>
import("@/modules/07_insignia/views/07_ReclaimMain.vue");
// รายชื่อลูกจ้างประจำ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
const ManageEmpMain = () =>
import("@/modules/07_insignia/views/08_ManageEmpMain.vue");
export default [
{
path: "/insignia/round",
@ -124,4 +128,15 @@ export default [
Role: "STAFF",
},
},
{
path: "/insignia/manage-emp/list-manage",
name: "insigniaManageEmp",
component: ManageEmpMain,
meta: {
Auth: true,
Key: "SYS_INSIGNIA_MANAGE_EMP",
Role: "STAFF",
},
},
];

View file

@ -0,0 +1,192 @@
<script setup lang="ts">
import { useQuasar } from "quasar";
import { onMounted, ref } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin";
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
/** import Type*/
import type { DataStat } from "@/modules/07_insignia/interface/index/Main";
import type { ResponsePeriod } from "@/modules/07_insignia/interface/response/Main";
/**import Componrnts*/
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue"; // stat
/**use */
const $q = useQuasar(); // noti quasar
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
const { messageError, dialogConfirm, showLoader, hideLoader, success } =
useCounterMixin();
//
const isStaff = ref<boolean>(false);
const isOfficer = ref<boolean>(false);
const isDirector = ref<boolean>(false);
const isDeputy = ref<boolean>(false);
//
const stat = ref<DataStat>({
allUserUser: 0,
orgAllCount: 0,
orgNoSendCount: 0,
orgSendCount: 0,
});
//
const round = ref<string>("");
const optionRound = ref<
Array<{ id: number; year: string; name: string; period_revision: string }>
>([]);
/** ฟังก์ชันเรียกข้อมูลการเป็นเจ้าหน้าที่*/
async function fetchCheckIsofficer() {
try {
const data = await fetchDataCheckIsoffice("SYS_INSIGNIA_MANAGE_EMP");
isStaff.value = data.isStaff;
// isStaff.value = true; //
isOfficer.value = data.isOfficer;
isDirector.value = data.isDirector;
isDeputy.value = data.isDeputy;
} catch (err) {
messageError($q, err);
}
}
/** ฟังก์ชันเรียกข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์*/
async function fecthRoundData() {
await http
.get(config.API.listRoundInsignia(), { params: { path: "MANAGE" } })
.then(async (res) => {
optionRound.value = await res.data.result.map((e: ResponsePeriod) => ({
id: e.period_id,
year: e.period_year,
name: e.period_name,
period_revision: e.period_revision,
}));
//
if (optionRound.value.length !== 0) {
// DataStore.optionRound = optionRound.value;
// const lastValue = optionRound.value[0];
// await fetchListOrg(lastValue.period_revision);
// await fecthAgency(lastValue.period_revision);
// if (DataStore.roundId) {
// round.value = DataStore.roundId; //
// } else {
// round.value = lastValue.id.toString(); //
// }
// await fecthStat(round.value);
// DataStore.roundId = round.value;
// roundName.value = lastValue.name;
// loadview.value = true;
}
})
.catch((err) => {
messageError($q, err);
});
}
/** ฟังก์ชันยื่นยันการล็อกข้อมูล*/
function onConfrimIsLockData() {
dialogConfirm(
$q,
() => {},
"ยืนยันการล็อกข้อมูล",
"คุณต้องการล็อกข้อมูลใช่หรือไม่"
);
}
onMounted(async () => {
showLoader();
try {
await fetchCheckIsofficer();
if (isStaff.value || isOfficer.value || isDirector.value) {
await Promise.all([fecthRoundData()]);
}
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายชอลกจางประจำ ทธนขอพระราชทานเครองราชอสรยาภรณ
</div>
<q-card
bordered
class="row col-12 q-mt-sm"
v-if="isDirector || isOfficer || isStaff"
>
<div class="row col-12 items-center bg-grey-1">
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
<q-select
borderless
dense
v-model="round"
:options="optionRound"
map-options
emit-value
option-value="id"
option-label="name"
/>
<!-- @update:model-value="changround" -->
<q-space />
<!-- สกจ. Freez อม -->
<q-btn
v-if="isOfficer && checkPermission($route)?.attrIsUpdate"
dense
unelevated
label="ล็อกข้อมูล"
color="public"
class="q-px-md q-ml-md"
@click="onConfrimIsLockData"
>
<q-tooltip>อกขอม</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>
<div v-if="isOfficer" class="col-12 row bg-white">
<div class="fit q-px-md q-py-sm">
<div class="row col-12 q-col-gutter-sm fit">
<cardTop
:amount="stat.orgAllCount"
label="หน่วยงานทั้งหมด"
color="#016987"
/>
<cardTop
:amount="stat.orgSendCount"
label="หน่วยงานที่ส่งรายชื่อเเล้ว"
color="#02A998"
/>
<cardTop
:amount="stat.orgNoSendCount"
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
color="#2EA0FF"
/>
<cardTop
:amount="stat.allUserUser"
label="จำนวนคนที่ยื่นขอ"
color="#4154B3"
/>
</div>
</div>
</div>
</q-card>
<q-card v-else>
<div class="q-pa-md q-gutter-sm">
<q-banner inline-actions rounded class="bg-grey-1 text-center">
ไมอมลรอบการเสนอขอพระราชทานเครองราชอสรยาภรณ
</q-banner>
</div>
</q-card>
</template>
<style scoped></style>