Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-05-08 17:11:30 +07:00
commit 69f09ac698
3 changed files with 18 additions and 22 deletions

View file

@ -4,7 +4,7 @@ import type { DataOptions } from "./interface/index/Main";
export const useKpiDataStore = defineStore("KPIDate", () => {
const tabMain = ref<string>("1");
const dataProfile = ref<any>();
const dataProfile = ref<any>(null);
const dataEvaluation = ref<any>({
plannedPoint: 0,
rolePoint: 0,

View file

@ -97,11 +97,6 @@ function getProfile() {
store.dataProfile = data;
store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel();
formProfile.fullName = `${data.prefix}${data.firstName} ${data.lastName}`;
formProfile.position = data.position;
formProfile.type = data.posTypeName;
formProfile.level = data.posLevelName;
})
.catch((e) => {
messageError($q, e);
@ -117,7 +112,7 @@ async function fetchProfile(id: string) {
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
)
.then(async (res) => {
formProfile.avartar = res.data.downloadUrl;
store.dataProfile.avartar = res.data.downloadUrl;
})
.catch(() => {
// profilePicture.value = avatar;
@ -264,9 +259,7 @@ function onSubmitScore() {
})
.then(async (res) => {
await fetchEvaluation();
await getProfile();
await getOrgOp();
await success($q, "บันทึกสำเร็จ");
success($q, "บันทึกสำเร็จ");
modalScore.value = false;
})
.catch((e) => {
@ -288,7 +281,7 @@ async function clearScore() {
async function getAll() {
await fetchEvaluation();
await getProfile();
await (store.dataProfile === null ? getProfile() : "");
await getOrgOp();
}
@ -330,7 +323,7 @@ onMounted(async () => {
style="left: 2%; top: 50%; transform: translateY(-50%)"
>
<q-avatar size="95px">
<q-img :src="formProfile.avartar" />
<q-img :src="store.dataProfile.avartar" />
</q-avatar>
</div>
<div class="row col-12">
@ -338,7 +331,7 @@ onMounted(async () => {
<div class="col-12" style="padding-left: 12%">
<div class="row col-12 items-center">
<span class="text-h6 text-weight-medium text-primary">{{
formProfile.fullName ? formProfile.fullName : "-"
`${store.dataProfile.prefix}${store.dataProfile.firstName} ${store.dataProfile.lastName}`
}}</span>
<q-space />
<div class="q-gutter-x-sm">
@ -398,7 +391,7 @@ onMounted(async () => {
<div class="column">
<span class="text-grey-6">ตำแหนงในสายงาน</span>
<span class="text-weight-medium text-dark">{{
formProfile.position
store.dataProfile.position
}}</span>
</div>
</div>
@ -406,7 +399,7 @@ onMounted(async () => {
<div class="column">
<span class="text-grey-6">ประเภทตำแหน</span>
<span class="text-weight-medium text-dark">{{
formProfile.type
store.dataProfile.posTypeName
}}</span>
</div>
</div>
@ -414,7 +407,7 @@ onMounted(async () => {
<div class="column">
<span class="text-grey-6">ระดบตำแหน</span>
<span class="text-weight-medium text-dark">{{
formProfile.level
store.dataProfile.posLevelName
}}</span>
</div>
</div>

View file

@ -213,22 +213,25 @@ function onSubmit() {
}
function getProfile() {
showLoader();
http
.get(config.API.profileBykeycloak())
.get(config.API.profilePosition())
.then((res) => {
const data = res.data.result;
formRound.profileId = data.id;
store.dataProfile = data;
store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel();
formRound.profileId = data.profileId;
formRound.prefix = data.prefix;
formRound.firstName = data.firstName;
formRound.lastName = data.lastName;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
// .finally(() => {
// hideLoader();
// });
}
function checkClosed() {