ทะเบียนประวัติ => ข้อมูลการพ้นจากราชการ
This commit is contained in:
parent
6003547e78
commit
737fa3a5b6
4 changed files with 85 additions and 27 deletions
|
|
@ -1,39 +1,55 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import type { DataLeave } from "@/modules/04_registryPerson/interface/index/leave";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const storeRegistry = useRegistryNewDataStore();
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
date2Thai,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
} = mixin;
|
||||
const { date2Thai } = mixin;
|
||||
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
const profileId = ref<string>(route.params.id.toString()); //id profile
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
leaveDate: null,
|
||||
leaveType: "",
|
||||
leaveReason: "",
|
||||
leaveCommandNo: "",
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const data = ref<{ date: Date; type: string; reson: string; document: string }>(
|
||||
{
|
||||
date: new Date(),
|
||||
type: "ออกจากราชการ",
|
||||
reson: "พ้นจากราชการด้วยสาเหตุ : ออกจากราชการ",
|
||||
document: "test",
|
||||
const data = ref<DataLeave>({
|
||||
date: null,
|
||||
type: "",
|
||||
reson: "",
|
||||
document: "",
|
||||
});
|
||||
|
||||
watch(modal, (val) => {
|
||||
if (val) {
|
||||
data.value = {
|
||||
date: props.data?.leaveDate,
|
||||
type: storeRegistry.convertTypeRetired(props.data?.leaveType),
|
||||
reson: props.data?.leaveReason,
|
||||
document: props.data?.leaveCommandNo,
|
||||
};
|
||||
} else {
|
||||
data.value = {
|
||||
date: null,
|
||||
type: "",
|
||||
reson: "",
|
||||
document: "",
|
||||
};
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -53,6 +53,13 @@ interface MyObjectRef {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface DataLeave {
|
||||
date: Date | null;
|
||||
type: string;
|
||||
reson: string;
|
||||
document: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
DetailData,
|
||||
FormFilter,
|
||||
|
|
@ -60,4 +67,5 @@ export type {
|
|||
DataOption,
|
||||
ResponseTotalObject,
|
||||
MyObjectRef,
|
||||
DataLeave,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -81,6 +81,34 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
|
|||
node: "เลือกหน่วยงาน",
|
||||
});
|
||||
|
||||
function convertTypeRetired(val: string) {
|
||||
const newVal = val?.toLocaleUpperCase();
|
||||
switch (newVal) {
|
||||
case "RETIRE":
|
||||
return "เกษียณ ";
|
||||
case "RETIRE_RESIGN":
|
||||
return "ลาออก ";
|
||||
case "RETIRE_DECEASED":
|
||||
return "ถึงแก่กรรม ";
|
||||
case "RETIRE_OUT":
|
||||
return "ให้ออกจากราชการ ";
|
||||
case "DISCIPLINE_RESULT_REMOVE":
|
||||
return "ปลดออกจากราชการ ";
|
||||
case "DISCIPLINE_RESULT_DISMISS":
|
||||
return "ไล่ออกจากราชการ ";
|
||||
case "DISCIPLINE_SUSPEND":
|
||||
return "ถูกพักจากราชการ ";
|
||||
case "PROBATION_REPORT":
|
||||
return "ไม่ผ่านทดลองงาน ";
|
||||
case "PLACEMENT_TRANSFER":
|
||||
return "โอนออก ";
|
||||
case "RETIRE_RESIGN_EMP":
|
||||
return "ให้ออกจากราชการ(ลูกจ้าง) ";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
fetchType,
|
||||
fetchLevel,
|
||||
|
|
@ -96,5 +124,6 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
|
|||
isLeave,
|
||||
tabs,
|
||||
tabsManu,
|
||||
convertTypeRetired,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -354,8 +354,7 @@ async function fetchDataPersonal() {
|
|||
await http
|
||||
.get(config.API.registryNewByProfileId(profileId.value, empType.value))
|
||||
.then(async (res) => {
|
||||
formDetail.value = res.data.result;
|
||||
|
||||
formDetail.value = await res.data.result;
|
||||
storeRegistry.isLeave = res.data.result.isLeave;
|
||||
|
||||
if (res.data.result.leaveReason) {
|
||||
|
|
@ -514,7 +513,13 @@ function outPost() {
|
|||
await http
|
||||
.post(config.API.retirementOut, formData)
|
||||
.then(async () => {
|
||||
await router.push(`${empType.value === "-employee" ? `/retirementEmployee`:`/retirement/dismiss-order`}`);
|
||||
await router.push(
|
||||
`${
|
||||
empType.value === "-employee"
|
||||
? `/retirementEmployee`
|
||||
: `/retirement/dismiss-order`
|
||||
}`
|
||||
);
|
||||
await success($q, "ดำเนินการสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -1186,7 +1191,7 @@ onMounted(async () => {
|
|||
</q-dialog>
|
||||
|
||||
<!-- Dialog ข้อมูลการพ้นจากราชการ -->
|
||||
<DialogRetired v-model:modal="modalDialogRetired" />
|
||||
<DialogRetired v-model:modal="modalDialogRetired" :data="formDetail" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue