updated
This commit is contained in:
parent
f453b95f32
commit
c3cc2e0aeb
7 changed files with 484 additions and 168 deletions
|
|
@ -12,6 +12,7 @@ import { useKpiDataStore } from "@/modules/08_KPI/store";
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import type { FormProfile } from "@/modules/08_KPI/interface/request/index";
|
||||
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
|
||||
import { aW } from "@fullcalendar/core/internal-common";
|
||||
|
||||
const scoreTotal = ref<boolean>(false);
|
||||
const modalScore = ref<boolean>(false);
|
||||
|
|
@ -65,8 +66,8 @@ const formProfile = reactive<FormProfile>({
|
|||
|
||||
const router = useRouter();
|
||||
|
||||
function fetchEvaluation() {
|
||||
http
|
||||
async function fetchEvaluation() {
|
||||
await http
|
||||
.get(config.API.kpiEvaluation + `/${id.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
|
@ -93,13 +94,12 @@ function fetchEvaluation() {
|
|||
function getProfile() {
|
||||
http
|
||||
.get(config.API.profilePosition())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
store.dataProfile = await data;
|
||||
|
||||
store.dataProfile = data;
|
||||
store.checkCompetency();
|
||||
store.checkCompetencyDefaultCompetencyLevel();
|
||||
store.checkStep();
|
||||
await store.checkCompetency();
|
||||
await store.checkCompetencyDefaultCompetencyLevel();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -251,27 +251,27 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
function onSubmitScore() {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.kpiScoreTotal() + `/${id.value}`, {
|
||||
plannedPoint: plannedPoint.value,
|
||||
rolePoint: rolePoint.value,
|
||||
specialPoint: specialPoint.value,
|
||||
capacityPoint: capacityPoint.value,
|
||||
})
|
||||
.then(async (res) => {
|
||||
await fetchEvaluation();
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
modalScore.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
// function onSubmitScore() {
|
||||
// showLoader();
|
||||
// http
|
||||
// .put(config.API.kpiScoreTotal() + `/${id.value}`, {
|
||||
// plannedPoint: plannedPoint.value,
|
||||
// rolePoint: rolePoint.value,
|
||||
// specialPoint: specialPoint.value,
|
||||
// capacityPoint: capacityPoint.value,
|
||||
// })
|
||||
// .then(async (res) => {
|
||||
// await fetchEvaluation();
|
||||
// success($q, "บันทึกสำเร็จ");
|
||||
// modalScore.value = false;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
// async function clearScore() {
|
||||
// modalScore.value = false;
|
||||
|
|
@ -283,8 +283,11 @@ function onSubmitScore() {
|
|||
// }
|
||||
|
||||
async function getAll() {
|
||||
await getProfile();
|
||||
await fetchEvaluation();
|
||||
await (store.dataProfile.profileId === null ? getProfile() : ""); // await getProfile();
|
||||
|
||||
await store.checkStep();
|
||||
|
||||
await getOrgOp();
|
||||
}
|
||||
|
||||
|
|
@ -397,7 +400,9 @@ onMounted(async () => {
|
|||
<div class="q-gutter-x-sm">
|
||||
<span
|
||||
v-if="
|
||||
indicatorWeightTotal > 0 && indicatorWeightTotal != 100
|
||||
store.dataProfile.posExecutiveName == null &&
|
||||
indicatorWeightTotal > 0 &&
|
||||
indicatorWeightTotal != 100
|
||||
"
|
||||
class="text-red"
|
||||
>*น้ำหนัก(ร้อยละ) ผลสัมฤทธิ์ของงานไม่ถูกต้อง</span
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue