แก้คะแนนเต็มระบบ kpi
This commit is contained in:
parent
bb549016fe
commit
4e1f895de2
5 changed files with 53 additions and 49 deletions
|
|
@ -9,6 +9,7 @@ import TabMain from "@/modules/14_KPI/components/detailList/TabMain.vue";
|
|||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore";
|
||||
import { time } from "console";
|
||||
|
||||
// import type { FormProfile } from "@/modules/08_KPI/interface/request/index";
|
||||
|
||||
|
|
@ -20,7 +21,8 @@ const store = useKPIDataStore();
|
|||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const indicatorScore = ref<number>(0);
|
||||
const competencyScore = ref<number>(0);
|
||||
const formProfile = reactive<any>({
|
||||
fullName: "",
|
||||
position: "",
|
||||
|
|
@ -35,7 +37,6 @@ const formProfile = reactive<any>({
|
|||
const router = useRouter();
|
||||
|
||||
function fetchEvaluation() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.kpiUserEvaluation + `/${id.value}`)
|
||||
.then((res) => {
|
||||
|
|
@ -47,14 +48,10 @@ function fetchEvaluation() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function getProfile() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profilePosition())
|
||||
.then((res) => {
|
||||
|
|
@ -69,14 +66,10 @@ function getProfile() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchProfile(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
|
||||
|
|
@ -86,16 +79,14 @@ async function fetchProfile(id: string) {
|
|||
})
|
||||
.catch(() => {
|
||||
// profilePicture.value = avatar;
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** save */
|
||||
function onSave() {}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
fetchEvaluation();
|
||||
getProfile();
|
||||
});
|
||||
|
|
@ -112,7 +103,12 @@ onMounted(() => {
|
|||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="isReadonly ? router.push(`/KPI-list`) : router.push(`/KPI`)"
|
||||
@click="
|
||||
() => {
|
||||
store.dataEvaluation = {};
|
||||
isReadonly ? router.push(`/KPI-list`) : router.push(`/KPI`);
|
||||
}
|
||||
"
|
||||
/>
|
||||
{{ id ? `รายละเอียดแบบประเมิน` : `เพิ่มแบบประเมิน` }}
|
||||
<q-space />
|
||||
|
|
@ -214,9 +210,9 @@ onMounted(() => {
|
|||
<div class="col-2">
|
||||
<div class="column">
|
||||
<span class="text-grey-6">คะแนนประเมิน</span>
|
||||
<span class="text-weight-medium text-primary">{{
|
||||
formProfile.score
|
||||
}}</span>
|
||||
<span class="text-weight-medium text-primary"
|
||||
>{{ (indicatorScore + competencyScore).toFixed(2) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -226,7 +222,10 @@ onMounted(() => {
|
|||
</q-card>
|
||||
|
||||
<q-card class="q-mt-md rounded">
|
||||
<TabMain />
|
||||
<TabMain
|
||||
v-model:indicatorScore="indicatorScore"
|
||||
v-model:competencyScore="competencyScore"
|
||||
/>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue