บรรจุ => ปรับ รายการช่วยราชการ,รายการส่งตัวกลับ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-01 17:44:16 +07:00
parent e9e618ad41
commit 7e4c274bc0
6 changed files with 98 additions and 38 deletions

View file

@ -12,7 +12,7 @@ import config from "@/app.config";
import type { QForm } from "quasar";
import type { ResponseData } from "@/modules/05_placement/interface/response/officer";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
const modalPersonal = ref<boolean>(false);
const personalId = ref<string>("");
@ -67,10 +67,10 @@ const getData = async () => {
prefix.value = data.prefix;
firstName.value = data.firstName;
lastName.value = data.lastName;
avatar.value = data.avatar ?? "";
position.value = data.position;
position.value = data.position ?? "-";
posNo.value = data.posNo;
positionLevel.value = data.positionLevel;
positionLevel.value = `${data.posTypeName}(${data.posLevelName})`;
createdAt.value = data.createdAt;
organization.value = data.organization;
reason.value = data.reason;
@ -82,6 +82,7 @@ const getData = async () => {
positionNumberOld.value = data.positionNumberOld;
organizationPositionOld.value = data.organizationPositionOld;
dateRepatriation.value = data.dateRepatriation;
fetchProfile(data.profileId);
})
.catch((e) => {
messageError($q, e);
@ -91,6 +92,27 @@ const getData = async () => {
});
};
function fetchProfile(id: string) {
showLoader();
http
.get(
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
)
.then(async (res) => {
avatar.value = res.data.downloadUrl;
})
.catch((e) => {
if (e.response.data.message === "ไม่พบไฟล์ในระบบ") {
avatar.value = "";
} else {
messageError($q, e);
}
})
.finally(() => {
hideLoader();
});
}
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
@ -200,15 +222,15 @@ onMounted(async () => {
<div class="col-12 q-pl-md">
<div class="col-12 text-top">ตำแหนงในสายงาน</div>
<div class="col-12 text-detail">
{{ positionTypeOld }}
{{ position }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">ระด</div>
<div class="col-12 text-top">ประเภทตำแหน</div>
<div class="col-12 text-detail">
{{ positionLevelOld }}
{{ positionLevel }}
</div>
</div>
</div>
@ -216,7 +238,7 @@ onMounted(async () => {
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail">
{{ organizationPositionOld }}
{{ organization }}
</div>
</div>
</div>