placement ==> ปรับ API
This commit is contained in:
parent
ac53080cec
commit
b808db1c73
5 changed files with 29 additions and 16 deletions
|
|
@ -101,6 +101,7 @@ export default {
|
|||
|
||||
//
|
||||
orgCheckAvatar: (id: string) => `${orgProfile}/avatar/profileId/${id}`,
|
||||
orgCheckAvatarCard: (path: string) => `${organization}/${path}`, //noPernission
|
||||
|
||||
changePosition: `${organization}/placement/change-position`,
|
||||
changePositionById: `${organization}/placement/change-position/profile-all`,
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ export default {
|
|||
`${registryNew}${type}/government/${id}`,
|
||||
profileNewGovernmentHistory: (id: string, type: string) =>
|
||||
`${registryNew}${type}/government/history/${id}`,
|
||||
profileNewGovernmentCard: (id: string, type: string) =>
|
||||
`${registryNew}${type}/government/admin/${id}`, // noPermission
|
||||
|
||||
//การลา
|
||||
profileNewLeave: (type: string) => `${registryNew}${type}/leave`,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,11 @@ function fetchDataProfile(data: DataProfile) {
|
|||
}
|
||||
|
||||
function fetchCheckAvatar(id: string) {
|
||||
http.get(config.API.orgCheckAvatar(id)).then((res) => {
|
||||
const path =
|
||||
props.type === "employee"
|
||||
? `profile-employee/avatar/profileEmployeeId-admin/${id}`
|
||||
: `profile/avatar/profileId-admin/${id}`;
|
||||
http.get(config.API.orgCheckAvatarCard(path)).then((res) => {
|
||||
const data = res.data.result;
|
||||
if (data.avatarName) {
|
||||
fetchProfile(id, data.avatarName);
|
||||
|
|
@ -101,10 +105,10 @@ function onclickViewinfo() {
|
|||
|
||||
watch(
|
||||
() => props.data,
|
||||
() => {
|
||||
const dataMain = props.data as DataProfile;
|
||||
async () => {
|
||||
const dataMain = (await props.data) as DataProfile;
|
||||
profileId.value = dataMain.profileId;
|
||||
fetchDataProfile(dataMain);
|
||||
await fetchDataProfile(dataMain);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useQuasar } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { checkPermissionGet } from "@/utils/permissions";
|
||||
|
||||
/** importType*/
|
||||
import type { PersonalImformation } from "@/components/information/interface/response/Information";
|
||||
|
|
@ -101,8 +102,8 @@ async function fetchInformation(id: string) {
|
|||
`${empType.value == "employee" ? `-${empType.value}` : ""}`
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
imformation.prefix = data.prefix ? data.prefix : "-";
|
||||
imformation.citizenId = data.citizenId ? data.citizenId : "-";
|
||||
imformation.firstName = data.firstName ? data.firstName : "-";
|
||||
|
|
@ -115,7 +116,7 @@ async function fetchInformation(id: string) {
|
|||
|
||||
avatar.position = data.position ? data.position : "-";
|
||||
if (data.avatarName) {
|
||||
fetchProfile(data.id as string, data.avatarName);
|
||||
await fetchProfile(data.id as string, data.avatarName);
|
||||
} else {
|
||||
avatar.avatar = "";
|
||||
}
|
||||
|
|
@ -136,13 +137,13 @@ async function fetchProfileGov(id: string) {
|
|||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.profileNewGovernmentById(
|
||||
config.API.profileNewGovernmentCard(
|
||||
id,
|
||||
`${empType.value == "employee" ? `-${empType.value}` : ""}`
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
goverment.oc = data.org !== "" ? data.org : "-";
|
||||
goverment.posNo = data.posMasterNo !== "" ? data.posMasterNo : "-";
|
||||
goverment.position = data.position !== "" ? data.position : "-";
|
||||
|
|
@ -183,8 +184,10 @@ watch(
|
|||
? "employee"
|
||||
: "officer";
|
||||
|
||||
fetchInformation(props.id);
|
||||
fetchProfileGov(props.id);
|
||||
await Promise.all([
|
||||
fetchInformation(props.id),
|
||||
fetchProfileGov(props.id),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -197,14 +200,10 @@ watch(modal, (newValue) => {
|
|||
});
|
||||
|
||||
async function fetchProfile(id: string, avatarName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
|
||||
.then(async (res) => {
|
||||
avatar.avatar = await res.data.downloadUrl;
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
@ -259,6 +258,11 @@ async function fetchProfile(id: string, avatarName: string) {
|
|||
</div>
|
||||
<div class="q-mt-md">
|
||||
<q-btn
|
||||
v-if="
|
||||
empType === 'employee'
|
||||
? checkPermissionGet('SYS_REGISTRY_EMP')
|
||||
: checkPermissionGet('SYS_REGISTRY_OFFICER')
|
||||
"
|
||||
class="bg-white"
|
||||
outline
|
||||
rounded
|
||||
|
|
|
|||
|
|
@ -325,7 +325,9 @@ onMounted(async () => {
|
|||
/>
|
||||
รายละเอียดการขอโอนของ{{ responseData.fullname }}
|
||||
</div>
|
||||
|
||||
<CardProfile :data="dataProfile as DataProfile" />
|
||||
|
||||
<!-- <q-card bordered class="row col-12 text-dark">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-subtitle2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue