updated kpi

This commit is contained in:
Warunee Tamkoo 2024-05-16 16:15:57 +07:00
parent bb19640c98
commit 6c03e24518
8 changed files with 114 additions and 46 deletions

View file

@ -72,7 +72,7 @@ function onClickApprove(type: string = "") {
? "DONE" ? "DONE"
: store.tabMainevaluator === "4" : store.tabMainevaluator === "4"
? "EVALUATING" ? "EVALUATING"
: store.tabMainevaluator === "5" : store.tabMainevaluator === "5" || store.tabMainevaluator === "6"
? type ? type
: undefined, : undefined,
id: userIds, id: userIds,

View file

@ -169,11 +169,7 @@ function getCriteria() {
} }
const isShowScore = computed(() => { const isShowScore = computed(() => {
return ( return store.tabOpen === 3 && store.tabMain === "3";
store.tabOpen === 3 &&
store.tabMain === "3" &&
store.dataEvaluation.evaluationStatus === "EVALUATING"
);
}); });
watch( watch(

View file

@ -275,7 +275,7 @@ watch(
<template v-slot:before> <template v-slot:before>
<div class="q-pa-sm"> <div class="q-pa-sm">
<q-btn <q-btn
v-if="store.rolePerson" v-if="store.rolePerson === 'USER'"
icon="add" icon="add"
color="teal" color="teal"
flat flat

View file

@ -222,6 +222,7 @@ watch(
<template v-slot:before> <template v-slot:before>
<div class="q-pa-sm"> <div class="q-pa-sm">
<q-btn <q-btn
v-if="store.rolePerson === 'USER'"
icon="add" icon="add"
color="teal" color="teal"
flat flat

View file

@ -300,6 +300,9 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
case "EVALUATING_COMMANDER_HIGH": case "EVALUATING_COMMANDER_HIGH":
tabOpen.value = 3; tabOpen.value = 3;
break; break;
case "COMPLETE":
tabOpen.value = 3;
break;
default: default:
tabOpen.value = 1; tabOpen.value = 1;
break; break;

View file

@ -57,7 +57,7 @@ const router = useRouter();
async function fetchEvaluation() { async function fetchEvaluation() {
await http await http
.get(config.API.kpiEvaluation + `/${id.value}`) .get(config.API.kpiEvaluation + `/${id.value}`)
.then(async(res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
store.dataEvaluation = await data; store.dataEvaluation = await data;
@ -442,19 +442,20 @@ onMounted(async () => {
<q-tooltip>แกไขคะแนนเต</q-tooltip> <q-tooltip>แกไขคะแนนเต</q-tooltip>
</q-btn> --> </q-btn> -->
<q-btn <q-btn
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
"
unelevated unelevated
round round
icon="edit" icon="mdi-account"
color="grey-2" color="grey-2"
text-color="edit" text-color="edit"
size="md" size="md"
@click="modalEdit = true" @click="modalEdit = true"
> >
<q-tooltip>แกไขผประเม</q-tooltip> <q-tooltip>{{
store.dataEvaluation.evaluationStatus === "NEW" &&
store.rolePerson === "USER"
? "แก้ไขผู้ประเมิน"
: "ข้อมูลผู้ประเมิน"
}}</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
unelevated unelevated
@ -538,7 +539,7 @@ onMounted(async () => {
: ( : (
store.excusiveIndicator1ScoreVal + store.excusiveIndicator1ScoreVal +
store.excusiveIndicator2ScoreVal + store.excusiveIndicator2ScoreVal +
store.competencyScore store.competencyScoreVal
).toFixed(2) ).toFixed(2)
}} }}
</span> </span>
@ -560,11 +561,25 @@ onMounted(async () => {
<q-dialog v-model="modalEdit" persistent> <q-dialog v-model="modalEdit" persistent>
<q-card bordered style="width: 50vh"> <q-card bordered style="width: 50vh">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader tittle="แก้ไขผู้ประเมิน" :close="close" /> <DialogHeader
:tittle="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
? 'แก้ไขผู้ประเมิน'
: 'ข้อมูลผู้ประเมิน'
"
:close="close"
/>
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="column q-gutter-sm"> <div class="column q-gutter-sm">
<q-select <q-select
:readonly="
!(
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
)
"
v-model="evaluatorId" v-model="evaluatorId"
outlined outlined
label="ผู้ประเมิน" label="ผู้ประเมิน"
@ -576,16 +591,20 @@ onMounted(async () => {
map-options map-options
hide-bottom-space hide-bottom-space
lazy-rules lazy-rules
:rules="[ :rules="[ (val:string) => !!val ||
(val:string) => `${'กรุณาเลือกผู้ประเมิน'}`, ]"
!!val || `${'กรุณาเลือกผู้ประเมิน'}`,
]"
use-input use-input
@filter="(inputValue:any, @filter="(inputValue:any,
doneFn:Function) => filterOption(inputValue, doneFn,'evaluatorIdOp' doneFn:Function) => filterOption(inputValue, doneFn,'evaluatorIdOp'
) " ) "
/> />
<q-select <q-select
:readonly="
!(
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
)
"
v-model="commanderId" v-model="commanderId"
outlined outlined
label="ผู้บังคับบัญชาเหนือขึ้นไป" label="ผู้บังคับบัญชาเหนือขึ้นไป"
@ -600,7 +619,14 @@ onMounted(async () => {
doneFn:Function) => filterOption(inputValue, doneFn,'commanderIdOp' doneFn:Function) => filterOption(inputValue, doneFn,'commanderIdOp'
) " ) "
> >
<template v-if="commanderId" v-slot:append> <template
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER' &&
commanderId
"
v-slot:append
>
<q-icon <q-icon
name="cancel" name="cancel"
@click.stop.prevent="commanderId = null" @click.stop.prevent="commanderId = null"
@ -609,6 +635,12 @@ onMounted(async () => {
</template> </template>
</q-select> </q-select>
<q-select <q-select
:readonly="
!(
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
)
"
v-model="commanderHighId" v-model="commanderHighId"
outlined outlined
label="ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง" label="ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง"
@ -623,7 +655,14 @@ onMounted(async () => {
doneFn:Function) => filterOption(inputValue, doneFn,'commanderHighOp' doneFn:Function) => filterOption(inputValue, doneFn,'commanderHighOp'
) " ) "
> >
<template v-if="commanderHighId" v-slot:append> <template
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER' &&
commanderHighId
"
v-slot:append
>
<q-icon <q-icon
name="cancel" name="cancel"
@click.stop.prevent="commanderHighId = null" @click.stop.prevent="commanderHighId = null"
@ -634,7 +673,14 @@ onMounted(async () => {
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
"
align="right"
class="bg-white text-teal"
>
<q-btn label="บันทึก" color="secondary" type="submit" <q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn ><q-tooltip>นทกขอม</q-tooltip></q-btn
> >

View file

@ -201,25 +201,25 @@ function changRound() {
function redirectViewDetail(id: string) { function redirectViewDetail(id: string) {
store.tabMain = "1"; store.tabMain = "1";
store.indicatorWeightTotal = 0; // store.indicatorWeightTotal = 0;
store.indicatorWeight1Total = 0; // store.indicatorWeight1Total = 0;
store.indicatorWeight2Total = 0; // store.indicatorWeight2Total = 0;
store.indicatorPercentVal = 0; // store.indicatorPercentVal = 0;
store.indicatorScore = 0; // store.indicatorScore = 0;
store.indicatorScoreVal = 0; // store.indicatorScoreVal = 0;
store.competencyScore = 0; // store.competencyScore = 0;
store.competencyScoreVal = 0; // store.competencyScoreVal = 0;
store.devScore = 0; // store.devScore = 0;
store.devScoreVal = 0; // store.devScoreVal = 0;
store.competencyDevScore = 0; // store.competencyDevScore = 0;
store.excusiveCompetencyScore = 0; // store.excusiveCompetencyScore = 0;
store.excusiveIndicator1PercentVal = 0; // store.excusiveIndicator1PercentVal = 0;
store.excusiveIndicator1Weight = 0; // store.excusiveIndicator1Weight = 0;
store.excusiveIndicator1ScoreVal = 0; // store.excusiveIndicator1ScoreVal = 0;
store.excusiveIndicator2Weight = 0; // store.excusiveIndicator2Weight = 0;
store.excusiveIndicator2PercentVal = 0; // store.excusiveIndicator2PercentVal = 0;
store.excusiveIndicator2ScoreVal = 0; // store.excusiveIndicator2ScoreVal = 0;
store.excusiveIndicatorScore = 0; // store.excusiveIndicatorScore = 0;
router.push(`/KPI/${id}`); router.push(`/KPI/${id}`);
} }

View file

@ -134,7 +134,15 @@ function fetchList() {
: store.tabMainevaluator === "4" : store.tabMainevaluator === "4"
? "APPROVE" ? "APPROVE"
: store.tabMainevaluator === "5" : store.tabMainevaluator === "5"
? "EVALUATING" ? "EVALUATING_EVALUATOR"
: store.tabMainevaluator === "6"
? "EVALUATING_EVALUATOR"
: undefined,
evaluating:
store.tabMainevaluator === "5"
? true
: store.tabMainevaluator === "6"
? false
: undefined, : undefined,
reqedit: store.tabMainevaluator === "3" ? "NEW" : undefined, reqedit: store.tabMainevaluator === "3" ? "NEW" : undefined,
}; };
@ -316,8 +324,9 @@ onMounted(async () => {
label="อนุมัติเพื่อเริ่มประเมิน" label="อนุมัติเพื่อเริ่มประเมิน"
@click="onChangTab" @click="onChangTab"
/> />
<q-tab name="5" label="สรุปผลการประเมิน" @click="onChangTab" />
<q-tab <q-tab
name="5" name="6"
label="ตรวจสอบผลการประเมิน" label="ตรวจสอบผลการประเมิน"
@click="onChangTab" @click="onChangTab"
/> />
@ -389,6 +398,19 @@ onMounted(async () => {
:fetchList="fetchList" :fetchList="fetchList"
/> />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="6">
<TabOther
:columns="columns"
:visibleColumns="visibleColumns"
:rows="dataListMain"
:formQuery="store.formQuery"
:total="totalList"
:maxPage="maxPage"
:updatePagination="updatePagination"
:fetchList="fetchList"
/>
</q-tab-panel>
</q-tab-panels> </q-tab-panels>
</q-card> </q-card>
</div> </div>