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

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

@ -30,6 +30,8 @@ const {
hideLoader,
success,
dialogRemove,
findOrgName,
findPosMasterNo,
} = mixin;
const visibleColumns = ref<string[]>([
@ -73,7 +75,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -91,7 +93,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ระดับ",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -181,8 +183,13 @@ const getData = async () => {
id: item.id,
fullname: `${item.prefix}${item.firstName} ${item.lastName}`,
position: item.position,
posNo: item.posNo,
positionLevel: item.positionLevel,
posNo: findPosMasterNo(item),
positionLevel:
item.posTypeName == null && item.posLevelName == null
? "-"
: (item.posTypeName != null ? item.posTypeName : "") +
" " +
(item.posLevelName != null ? ` (${item.posLevelName})` : ""),
createdAt: date2Thai(item.createdAt),
organization: item.organization,
reason: item.reason,
@ -323,7 +330,7 @@ onMounted(async () => {
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.position }}
{{ props.row.position ?? "-" }}
</q-td>
<q-td
key="positionLevel"

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>