รายละเอียดการประเมินผลการปฏิบัติราชการระดับบุคคล

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-30 14:08:58 +07:00
parent 0bfdcd73e7
commit 71c1dedd7b
4 changed files with 54 additions and 68 deletions

View file

@ -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>

View file

@ -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>