รายละเอียดการประเมินผลการปฏิบัติราชการระดับบุคคล
This commit is contained in:
parent
0bfdcd73e7
commit
71c1dedd7b
4 changed files with 54 additions and 68 deletions
|
|
@ -21,7 +21,7 @@ const dataListCriteria = ref<ListCriteria[]>([]);
|
|||
const modalCriteria = ref<boolean>(false);
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const { messageError } = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader } = useCounterMixin();
|
||||
const store = useKpiDataStore();
|
||||
|
||||
const evaluationId = ref<string>(route.params.id.toString());
|
||||
|
|
@ -42,11 +42,11 @@ const resultPlanned = ref<number>(0);
|
|||
const resultRole = ref<number>(0);
|
||||
const resultAssigned = ref<number>(0);
|
||||
|
||||
function fetchListPlanned() {
|
||||
http
|
||||
async function fetchListPlanned() {
|
||||
await http
|
||||
.get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
const newRow = data.map((e: any) => ({
|
||||
...e,
|
||||
evaluationResults: (e.point / 5) * e.weight,
|
||||
|
|
@ -78,11 +78,11 @@ function fetchListPlanned() {
|
|||
});
|
||||
}
|
||||
|
||||
function fetchListRole() {
|
||||
http
|
||||
async function fetchListRole() {
|
||||
await http
|
||||
.get(config.API.kpiAchievement("role") + `?id=${evaluationId.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
const newRow = data.map((e: any) => ({
|
||||
...e,
|
||||
evaluationResults: (e.point / 5) * e.weight,
|
||||
|
|
@ -108,11 +108,11 @@ function fetchListRole() {
|
|||
});
|
||||
}
|
||||
|
||||
function fetchAssigned() {
|
||||
http
|
||||
async function fetchAssigned() {
|
||||
await http
|
||||
.get(config.API.kpiAchievement("special") + `?id=${evaluationId.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
const newRow = data.map((e: any) => ({
|
||||
...e,
|
||||
evaluationResults: (e.point / 5) * e.weight,
|
||||
|
|
@ -146,11 +146,11 @@ function fetchAssigned() {
|
|||
});
|
||||
}
|
||||
|
||||
function getCriteria() {
|
||||
http
|
||||
async function getCriteria() {
|
||||
await http
|
||||
.get(config.API.KpiEvaluationInfo)
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.data;
|
||||
dataListCriteria.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -206,12 +206,17 @@ watch(
|
|||
);
|
||||
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
await Promise.all([
|
||||
getCriteria(),
|
||||
fetchListPlanned(),
|
||||
fetchListRole(),
|
||||
fetchAssigned(),
|
||||
]);
|
||||
]).finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -54,10 +54,9 @@ function onSubmit() {
|
|||
timeEvaluator: developmentPeriod.value,
|
||||
reasonEvaluator: evaluatorComment.value,
|
||||
})
|
||||
.then((res) => {
|
||||
.then(async () => {
|
||||
await Promise.all([fetchEvaluation(), getData()]);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
fetchEvaluation();
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -79,10 +78,9 @@ function onSubmitCommander() {
|
|||
isReason: superiorCommentCheck.value == "true" ? true : false,
|
||||
reason: superiorComment.value,
|
||||
})
|
||||
.then((res) => {
|
||||
.then(async () => {
|
||||
await Promise.all([fetchEvaluation(), getData()]);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
fetchEvaluation();
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -93,6 +91,7 @@ function onSubmitCommander() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onSubmitCommanderHigh() {
|
||||
if (additionalSuperiorCheck.value == "") {
|
||||
dialogMessageNotify($q, "กรุณาเลือกความคิดเห็น");
|
||||
|
|
@ -104,10 +103,9 @@ function onSubmitCommanderHigh() {
|
|||
isReason: additionalSuperiorCheck.value == "true" ? true : false,
|
||||
reason: additionalSuperiorComment.value,
|
||||
})
|
||||
.then((res) => {
|
||||
.then(async () => {
|
||||
await Promise.all([fetchEvaluation(), getData()]);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
fetchEvaluation();
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -157,16 +155,15 @@ async function fetchEvaluation() {
|
|||
}
|
||||
|
||||
function userOpen() {
|
||||
http.get(config.API.openPoint(id.value)).then(async (res) => {
|
||||
// success($q, "เปิดการประเมินสำเร็จ");
|
||||
});
|
||||
http.get(config.API.openPoint(id.value)).then(async () => {});
|
||||
}
|
||||
|
||||
function getData() {
|
||||
http
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.kpiSendToGet(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
title.value = data.topicEvaluator;
|
||||
developmentMethod.value = data.developEvaluator;
|
||||
developmentPeriod.value = data.timeEvaluator;
|
||||
|
|
@ -175,9 +172,7 @@ function getData() {
|
|||
data.isReasonCommander != null
|
||||
? data.isReasonCommander.toString()
|
||||
: null;
|
||||
|
||||
superiorComment.value = data.reasonCommander;
|
||||
|
||||
additionalSuperiorCheck.value =
|
||||
data.isReasonCommanderHigh != null
|
||||
? data.isReasonCommanderHigh.toString()
|
||||
|
|
@ -194,16 +189,13 @@ function getData() {
|
|||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
showLoader();
|
||||
Promise.all([fetchEvaluation(), getData()]).finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 3000);
|
||||
});
|
||||
onMounted(async () => {
|
||||
await Promise.all([fetchEvaluation(), getData()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ function onSubmit() {
|
|||
}
|
||||
|
||||
async function getOrgOp() {
|
||||
http
|
||||
await http
|
||||
.get(config.API.Kpiorg + `/${store.dataProfile.profileId}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
|
@ -202,8 +202,7 @@ async function getOrgOp() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
});
|
||||
}
|
||||
|
||||
function filterOption(val: any, update: Function, refData: string) {
|
||||
|
|
@ -240,19 +239,13 @@ async function getProfile() {
|
|||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
store.dataProfile = await data;
|
||||
setTimeout(() => {
|
||||
store.checkStep();
|
||||
}, 1000);
|
||||
store.checkStep();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
}
|
||||
|
||||
async function getAll() {
|
||||
await fetchEvaluation();
|
||||
}
|
||||
|
||||
function sendToEvaluatore() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -337,6 +330,7 @@ function requireEdit() {
|
|||
function openGovernment() {
|
||||
modalGovernment.value = true;
|
||||
}
|
||||
|
||||
function openStatus() {
|
||||
router.push(`/probation-detail/${store.dataEvaluation.profileId}`);
|
||||
}
|
||||
|
|
@ -350,7 +344,7 @@ function sendToEvauator() {
|
|||
id: [store.dataEvaluation.id],
|
||||
})
|
||||
.then(async () => {
|
||||
await getAll();
|
||||
await fetchEvaluation();
|
||||
store.tabMain = "3";
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -369,7 +363,7 @@ function goToSummary() {
|
|||
showLoader();
|
||||
http
|
||||
.get(config.API.sendToSummary(store.dataEvaluation.id))
|
||||
.then(async (res) => {
|
||||
.then(async () => {
|
||||
await fetchEvaluation();
|
||||
store.tabMain = "4";
|
||||
store.tabOpen = 4;
|
||||
|
|
@ -435,8 +429,8 @@ async function fetchProfileEvaluator(id: string) {
|
|||
}
|
||||
|
||||
onMounted(async () => {
|
||||
store.isUpdate = await false;
|
||||
await getAll();
|
||||
store.isUpdate = false;
|
||||
await fetchEvaluation();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
|
|
|||
|
|
@ -243,7 +243,6 @@ onMounted(async () => {
|
|||
}
|
||||
await fetchmsgNoread();
|
||||
|
||||
// await getDataNotification(1, "NOMAL");
|
||||
myEventHandler(null, false);
|
||||
window.addEventListener("resize", (e: any) => {
|
||||
myEventHandler(e, true);
|
||||
|
|
@ -328,14 +327,10 @@ const tagClick = (tag: string) => {
|
|||
const hash = `#${tag}`;
|
||||
const items = document.getElementById(tag);
|
||||
const offset = Math.max(0, items == null ? 0 : items.offsetTop - 84);
|
||||
// router.replace({ hash });
|
||||
|
||||
if (route.hash !== hash) {
|
||||
const check = activeBtn();
|
||||
if (check) {
|
||||
// router.replace({ hash, position: { x: 0, y: 0 } });
|
||||
// router.replace({ hash }).then(() => {
|
||||
// setVerticalScrollPosition(window, offset, 300);
|
||||
// });
|
||||
drawerR.value = !drawerR.value;
|
||||
setVerticalScrollPosition(window, offset, 300);
|
||||
} else {
|
||||
|
|
@ -498,8 +493,8 @@ const handleButtonClick = () => {
|
|||
/**
|
||||
* function fetch รายการเมนูทั้งหมด
|
||||
*/
|
||||
function fetchSys() {
|
||||
http
|
||||
async function fetchSys() {
|
||||
await http
|
||||
.get(config.API.orgPermissions)
|
||||
.then((res) => {
|
||||
storeMenu.fetchListMenu(res.data.result);
|
||||
|
|
@ -512,8 +507,8 @@ function fetchSys() {
|
|||
/**
|
||||
* function fetch รายการเมนูทั้งหมด
|
||||
*/
|
||||
function fetchPermissionsSys() {
|
||||
http
|
||||
async function fetchPermissionsSys() {
|
||||
await http
|
||||
.get(config.API.orgPermissionsSys)
|
||||
.then((res) => {
|
||||
storeMenu.fetchDataPermission(res.data.result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue