This commit is contained in:
Warunee Tamkoo 2024-06-27 12:30:40 +07:00
parent 5e8c8589cb
commit 11e5e13039
11 changed files with 118 additions and 149 deletions

View file

@ -103,11 +103,22 @@ async function getProfile() {
async function fetchProfile(id: string) {
await http
.get(
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
)
.get(config.API.orgCheckAvatar(id))
.then(async (res) => {
store.dataEvaluation.avartar = res.data.downloadUrl;
if (res.data.result.avatarName) {
http
.get(
config.API.fileByFile(
"ทะเบียนประวัติ",
"โปรไฟล์",
id,
res.data.result.avatarName
)
)
.then(async (res) => {
store.dataEvaluation.avartar = res.data.downloadUrl;
});
}
})
.catch(() => {
// profilePicture.value = avatar;
@ -119,7 +130,6 @@ function close() {
evaluatorId.value = null;
commanderId.value = null;
commanderHighId.value = null;
getAll();
}
function onSubmit() {
@ -135,8 +145,10 @@ function onSubmit() {
: null,
})
.then((res) => {
success($q, "บันทึกสำเร็จ");
fetchEvaluation();
getOrgOp();
close();
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
messageError($q, e);
@ -268,7 +280,7 @@ function sendToEvaluatore() {
})
.then((res) => {
success($q, "ส่งข้อตกลงให้ผู้ประเมินอนุมัติสำเร็จ");
close();
fetchEvaluation();
})
.catch((e) => {
messageError($q, e);
@ -295,7 +307,7 @@ function sendToEvaluateEvaluatore() {
})
.then((res) => {
success($q, "ส่งให้ผู้ประเมินรายงานผลสำเร็จของงานสำเร็จ");
close();
fetchEvaluation();
})
.catch((e) => {
messageError($q, e);
@ -346,7 +358,7 @@ function requireEdit() {
})
.then((res) => {
success($q, "ขอแก้ไขสำเร็จ");
close();
fetchEvaluation();
})
.catch((e) => {
messageError($q, e);
@ -397,8 +409,9 @@ function goToSummary() {
http
.get(config.API.sendToSummary(store.dataEvaluation.id))
.then(async (res) => {
await getAll();
await fetchEvaluation();
store.tabMain = "4";
store.tabOpen = 4;
})
.catch((e) => {
messageError($q, e);