updated retirement field
This commit is contained in:
parent
48ef8c19a6
commit
332a35569e
22 changed files with 172 additions and 192 deletions
|
|
@ -183,12 +183,66 @@ async function fetchProfile(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
const reasonStatus = ref<boolean>(false);
|
||||
const leaveReason = ref<string>("");
|
||||
const reasonOptions = ref<DataOption[]>([
|
||||
{
|
||||
id: "RETIRE",
|
||||
name: "เกษียณอายุราชการ",
|
||||
},
|
||||
{
|
||||
id: "RESIGN",
|
||||
name: "ลาออก",
|
||||
},
|
||||
{
|
||||
id: "TRANSFER",
|
||||
name: "ให้โอน",
|
||||
},
|
||||
{
|
||||
id: "DEATH",
|
||||
name: "ถึงแก่กรรม",
|
||||
},
|
||||
{
|
||||
id: "LAYOFF",
|
||||
name: "ให้ออก",
|
||||
},
|
||||
{
|
||||
id: "DISCHARGE",
|
||||
name: "ปลดออก",
|
||||
},
|
||||
{
|
||||
id: "DISMISS",
|
||||
name: "ไล่ออก",
|
||||
},
|
||||
{
|
||||
id: "OTHER",
|
||||
name: "อื่นๆ",
|
||||
},
|
||||
]);
|
||||
|
||||
async function fetchDataPersonal() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.registryNewByProfileId(profileId.value, empType.value))
|
||||
.then((res) => {
|
||||
formDetail.value = res.data.result;
|
||||
|
||||
if (res.data.result.leaveReason) {
|
||||
// เหตุผลพ้นจากราชการต่อท้ายชื่อ
|
||||
const reason = reasonOptions.value.filter(
|
||||
(r: DataOption) => r.id == res.data.result.leaveReason
|
||||
);
|
||||
if (reason.length > 0) {
|
||||
leaveReason.value = ` (พ้นจากราชการด้วยสาเหตุ: ${reason[0].name})`;
|
||||
} else if (
|
||||
res.data.result.leaveReason !== null &&
|
||||
res.data.result.leaveReason !== ""
|
||||
) {
|
||||
leaveReason.value = ` (พ้นจากราชการด้วยสาเหตุ: ${res.data.result.leaveReason})`;
|
||||
}
|
||||
reasonStatus.value = reason.length > 0 ? true : false;
|
||||
}
|
||||
|
||||
fileName.value = res.data.result.avatarName;
|
||||
if (formDetail.value?.avatarName) {
|
||||
fetchProfile(profileId.value);
|
||||
|
|
@ -593,7 +647,7 @@ onMounted(async () => {
|
|||
v-if="formDetail && formDetail.firstName && formDetail.lastName"
|
||||
>
|
||||
{{
|
||||
`${formDetail?.prefix}${formDetail?.firstName} ${formDetail?.lastName}`
|
||||
`${formDetail?.prefix}${formDetail?.firstName} ${formDetail?.lastName} ${leaveReason}`
|
||||
}}
|
||||
</h2>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue