แก้ เเสดงข้อมูล พ้นราชการ

This commit is contained in:
setthawutttty 2025-07-25 11:24:17 +07:00
parent 613e0b6c5f
commit b13b24e37d

View file

@ -5,6 +5,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useRouter, useRoute } from "vue-router";
import { checkPermissionGet } from "@/utils/permissions";
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
/** importType*/
import type { PersonalImformation } from "@/components/information/interface/response/Information";
@ -20,6 +21,7 @@ import { useCounterMixin } from "@/stores/mixin";
import CardPosition from "@/modules/21_report/components/CardPosition.vue";
/** use*/
const store = useRegistryNewDataStore();
const route = useRoute();
const mixin = useCounterMixin();
const router = useRouter();
@ -27,6 +29,11 @@ const $q = useQuasar();
const retireDate = ref<Date>();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const isLeave = ref<boolean>(false);
const dateLeave = ref<Date | string | null>(null);
const leaveType = ref<string>("");
const leaveReason = ref<string>("");
const leaveCommandNo = ref<string>("");
const isEmployee = defineModel("isEmployee", { type: String });
const empType = ref<string>("officer");
const checkRoute = ref<boolean>(route.name == "reportRegistry");
@ -146,6 +153,12 @@ async function fetchInformation(id: string) {
imformation.birthDate = data.birthDate ? date2Thai(data.birthDate) : "-";
imformation.age = data.birthDate ? calculateAge(data.birthDate) : "-";
imformation.gender = data.gender ?? "-";
isLeave.value = data.isLeave;
dateLeave.value = data.dateLeave ? date2Thai(data.dateLeave) : "-";
leaveType.value = store.convertTypeRetired(data.leaveType);
leaveReason.value = data.leaveReason;
leaveCommandNo.value = data.leaveCommandNo;
employeeClass.value = data.employeeClass ?? "officer";
avatar.fullname = `${data.prefix}${data.firstName} ${data.lastName}`;
@ -297,7 +310,7 @@ watch(modal, (newValue) => {
<q-card style="width: 420px; overflow: visible">
<q-toolbar>
<q-toolbar-title class="text-subtitle1 text-bold"
>ทะเบยนประว
>ทะเบยนประว{{ isLeave ? "ผู้พ้นจากราชการ" : "" }}
</q-toolbar-title>
<q-btn
icon="close"
@ -447,7 +460,41 @@ watch(modal, (newValue) => {
}}
</span>
</div>
<div v-if="isLeave" class="row q-col-gutter-sm q-pa-sm">
<div class="col-xs-6 col-md-6">
<q-input
borderless
readonly
:model-value="dateLeave ? dateLeave : '-'"
label="วันเดือนปีที่พ้นจากราชการ"
/>
</div>
<div class="col-xs-6 col-md-6">
<q-input
borderless
readonly
:model-value="leaveType ? leaveType : '-'"
label="ประเภทการพ้นจากราชการ"
/>
</div>
<div class="col-xs-6 col-md-6">
<q-input
borderless
readonly
:model-value="leaveCommandNo ? leaveCommandNo : '-'"
label="คำสั่ง/เอกสารอ้างอิง"
/>
</div>
<div class="col-xs-12 col-md-12">
<q-input
borderless
readonly
:model-value="leaveReason ? leaveReason : '-'"
label="สาเหตุ/เหตุผล"
/>
</div>
</div>
<q-separator v-if="isLeave" />
<div class="row q-pa-sm" v-if="employeeClass !== 'TEMP'">
<div class="col-xs-12 col-md-12 text-html">
<q-input