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

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 modalCriteria = ref<boolean>(false);
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const { messageError } = useCounterMixin(); const { messageError, showLoader, hideLoader } = useCounterMixin();
const store = useKpiDataStore(); const store = useKpiDataStore();
const evaluationId = ref<string>(route.params.id.toString()); const evaluationId = ref<string>(route.params.id.toString());
@ -42,11 +42,11 @@ const resultPlanned = ref<number>(0);
const resultRole = ref<number>(0); const resultRole = ref<number>(0);
const resultAssigned = ref<number>(0); const resultAssigned = ref<number>(0);
function fetchListPlanned() { async function fetchListPlanned() {
http await http
.get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`) .get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`)
.then((res) => { .then(async (res) => {
const data = res.data.result; const data = await res.data.result;
const newRow = data.map((e: any) => ({ const newRow = data.map((e: any) => ({
...e, ...e,
evaluationResults: (e.point / 5) * e.weight, evaluationResults: (e.point / 5) * e.weight,
@ -78,11 +78,11 @@ function fetchListPlanned() {
}); });
} }
function fetchListRole() { async function fetchListRole() {
http await http
.get(config.API.kpiAchievement("role") + `?id=${evaluationId.value}`) .get(config.API.kpiAchievement("role") + `?id=${evaluationId.value}`)
.then((res) => { .then(async (res) => {
const data = res.data.result; const data = await res.data.result;
const newRow = data.map((e: any) => ({ const newRow = data.map((e: any) => ({
...e, ...e,
evaluationResults: (e.point / 5) * e.weight, evaluationResults: (e.point / 5) * e.weight,
@ -108,11 +108,11 @@ function fetchListRole() {
}); });
} }
function fetchAssigned() { async function fetchAssigned() {
http await http
.get(config.API.kpiAchievement("special") + `?id=${evaluationId.value}`) .get(config.API.kpiAchievement("special") + `?id=${evaluationId.value}`)
.then((res) => { .then(async (res) => {
const data = res.data.result; const data = await res.data.result;
const newRow = data.map((e: any) => ({ const newRow = data.map((e: any) => ({
...e, ...e,
evaluationResults: (e.point / 5) * e.weight, evaluationResults: (e.point / 5) * e.weight,
@ -146,11 +146,11 @@ function fetchAssigned() {
}); });
} }
function getCriteria() { async function getCriteria() {
http await http
.get(config.API.KpiEvaluationInfo) .get(config.API.KpiEvaluationInfo)
.then((res) => { .then(async (res) => {
const data = res.data.result.data; const data = await res.data.result.data;
dataListCriteria.value = data; dataListCriteria.value = data;
}) })
.catch((e) => { .catch((e) => {
@ -206,12 +206,17 @@ watch(
); );
onMounted(async () => { onMounted(async () => {
showLoader();
await Promise.all([ await Promise.all([
getCriteria(), getCriteria(),
fetchListPlanned(), fetchListPlanned(),
fetchListRole(), fetchListRole(),
fetchAssigned(), fetchAssigned(),
]); ]).finally(() => {
setTimeout(() => {
hideLoader();
}, 1000);
});
}); });
</script> </script>

View file

@ -54,10 +54,9 @@ function onSubmit() {
timeEvaluator: developmentPeriod.value, timeEvaluator: developmentPeriod.value,
reasonEvaluator: evaluatorComment.value, reasonEvaluator: evaluatorComment.value,
}) })
.then((res) => { .then(async () => {
await Promise.all([fetchEvaluation(), getData()]);
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
fetchEvaluation();
getData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -79,10 +78,9 @@ function onSubmitCommander() {
isReason: superiorCommentCheck.value == "true" ? true : false, isReason: superiorCommentCheck.value == "true" ? true : false,
reason: superiorComment.value, reason: superiorComment.value,
}) })
.then((res) => { .then(async () => {
await Promise.all([fetchEvaluation(), getData()]);
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
fetchEvaluation();
getData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -93,6 +91,7 @@ function onSubmitCommander() {
}); });
} }
} }
function onSubmitCommanderHigh() { function onSubmitCommanderHigh() {
if (additionalSuperiorCheck.value == "") { if (additionalSuperiorCheck.value == "") {
dialogMessageNotify($q, "กรุณาเลือกความคิดเห็น"); dialogMessageNotify($q, "กรุณาเลือกความคิดเห็น");
@ -104,10 +103,9 @@ function onSubmitCommanderHigh() {
isReason: additionalSuperiorCheck.value == "true" ? true : false, isReason: additionalSuperiorCheck.value == "true" ? true : false,
reason: additionalSuperiorComment.value, reason: additionalSuperiorComment.value,
}) })
.then((res) => { .then(async () => {
await Promise.all([fetchEvaluation(), getData()]);
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
fetchEvaluation();
getData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -157,16 +155,15 @@ async function fetchEvaluation() {
} }
function userOpen() { function userOpen() {
http.get(config.API.openPoint(id.value)).then(async (res) => { http.get(config.API.openPoint(id.value)).then(async () => {});
// success($q, "");
});
} }
function getData() { async function getData() {
http showLoader();
await http
.get(config.API.kpiSendToGet(id.value)) .get(config.API.kpiSendToGet(id.value))
.then((res) => { .then(async (res) => {
const data = res.data.result; const data = await res.data.result;
title.value = data.topicEvaluator; title.value = data.topicEvaluator;
developmentMethod.value = data.developEvaluator; developmentMethod.value = data.developEvaluator;
developmentPeriod.value = data.timeEvaluator; developmentPeriod.value = data.timeEvaluator;
@ -175,9 +172,7 @@ function getData() {
data.isReasonCommander != null data.isReasonCommander != null
? data.isReasonCommander.toString() ? data.isReasonCommander.toString()
: null; : null;
superiorComment.value = data.reasonCommander; superiorComment.value = data.reasonCommander;
additionalSuperiorCheck.value = additionalSuperiorCheck.value =
data.isReasonCommanderHigh != null data.isReasonCommanderHigh != null
? data.isReasonCommanderHigh.toString() ? data.isReasonCommanderHigh.toString()
@ -194,16 +189,13 @@ function getData() {
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => {}); .finally(() => {
hideLoader();
});
} }
onMounted(() => { onMounted(async () => {
showLoader(); await Promise.all([fetchEvaluation(), getData()]);
Promise.all([fetchEvaluation(), getData()]).finally(() => {
setTimeout(() => {
hideLoader();
}, 3000);
});
}); });
</script> </script>

View file

@ -164,7 +164,7 @@ function onSubmit() {
} }
async function getOrgOp() { async function getOrgOp() {
http await http
.get(config.API.Kpiorg + `/${store.dataProfile.profileId}`) .get(config.API.Kpiorg + `/${store.dataProfile.profileId}`)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
@ -202,8 +202,7 @@ async function getOrgOp() {
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) });
.finally(() => {});
} }
function filterOption(val: any, update: Function, refData: string) { function filterOption(val: any, update: Function, refData: string) {
@ -240,19 +239,13 @@ async function getProfile() {
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
store.dataProfile = await data; store.dataProfile = await data;
setTimeout(() => { store.checkStep();
store.checkStep();
}, 1000);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}); });
} }
async function getAll() {
await fetchEvaluation();
}
function sendToEvaluatore() { function sendToEvaluatore() {
dialogConfirm( dialogConfirm(
$q, $q,
@ -337,6 +330,7 @@ function requireEdit() {
function openGovernment() { function openGovernment() {
modalGovernment.value = true; modalGovernment.value = true;
} }
function openStatus() { function openStatus() {
router.push(`/probation-detail/${store.dataEvaluation.profileId}`); router.push(`/probation-detail/${store.dataEvaluation.profileId}`);
} }
@ -350,7 +344,7 @@ function sendToEvauator() {
id: [store.dataEvaluation.id], id: [store.dataEvaluation.id],
}) })
.then(async () => { .then(async () => {
await getAll(); await fetchEvaluation();
store.tabMain = "3"; store.tabMain = "3";
}) })
.catch((e) => { .catch((e) => {
@ -369,7 +363,7 @@ function goToSummary() {
showLoader(); showLoader();
http http
.get(config.API.sendToSummary(store.dataEvaluation.id)) .get(config.API.sendToSummary(store.dataEvaluation.id))
.then(async (res) => { .then(async () => {
await fetchEvaluation(); await fetchEvaluation();
store.tabMain = "4"; store.tabMain = "4";
store.tabOpen = 4; store.tabOpen = 4;
@ -435,8 +429,8 @@ async function fetchProfileEvaluator(id: string) {
} }
onMounted(async () => { onMounted(async () => {
store.isUpdate = await false; store.isUpdate = false;
await getAll(); await fetchEvaluation();
}); });
onUnmounted(() => { onUnmounted(() => {

View file

@ -243,7 +243,6 @@ onMounted(async () => {
} }
await fetchmsgNoread(); await fetchmsgNoread();
// await getDataNotification(1, "NOMAL");
myEventHandler(null, false); myEventHandler(null, false);
window.addEventListener("resize", (e: any) => { window.addEventListener("resize", (e: any) => {
myEventHandler(e, true); myEventHandler(e, true);
@ -328,14 +327,10 @@ const tagClick = (tag: string) => {
const hash = `#${tag}`; const hash = `#${tag}`;
const items = document.getElementById(tag); const items = document.getElementById(tag);
const offset = Math.max(0, items == null ? 0 : items.offsetTop - 84); const offset = Math.max(0, items == null ? 0 : items.offsetTop - 84);
// router.replace({ hash });
if (route.hash !== hash) { if (route.hash !== hash) {
const check = activeBtn(); const check = activeBtn();
if (check) { if (check) {
// router.replace({ hash, position: { x: 0, y: 0 } });
// router.replace({ hash }).then(() => {
// setVerticalScrollPosition(window, offset, 300);
// });
drawerR.value = !drawerR.value; drawerR.value = !drawerR.value;
setVerticalScrollPosition(window, offset, 300); setVerticalScrollPosition(window, offset, 300);
} else { } else {
@ -498,8 +493,8 @@ const handleButtonClick = () => {
/** /**
* function fetch รายการเมนงหมด * function fetch รายการเมนงหมด
*/ */
function fetchSys() { async function fetchSys() {
http await http
.get(config.API.orgPermissions) .get(config.API.orgPermissions)
.then((res) => { .then((res) => {
storeMenu.fetchListMenu(res.data.result); storeMenu.fetchListMenu(res.data.result);
@ -512,8 +507,8 @@ function fetchSys() {
/** /**
* function fetch รายการเมนงหมด * function fetch รายการเมนงหมด
*/ */
function fetchPermissionsSys() { async function fetchPermissionsSys() {
http await http
.get(config.API.orgPermissionsSys) .get(config.API.orgPermissionsSys)
.then((res) => { .then((res) => {
storeMenu.fetchDataPermission(res.data.result); storeMenu.fetchDataPermission(res.data.result);