Merge branch 'develop' into devTee

# Conflicts:
#	src/modules/08_KPI/components/Tab/Topic/02_Competency.vue
This commit is contained in:
STW_TTTY\stwtt 2024-05-14 15:50:10 +07:00
commit f5ed387f35
8 changed files with 292 additions and 215 deletions

View file

@ -21,6 +21,14 @@ const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
type: Number, type: Number,
default: 0, default: 0,
}); });
const indicatorWeight1Total = defineModel("indicatorWeight1Total", {
type: Number,
default: 0,
});
const indicatorWeight2Total = defineModel("indicatorWeight2Total", {
type: Number,
default: 0,
});
const dataListCriteria = ref<ListCriteria[]>([]); const dataListCriteria = ref<ListCriteria[]>([]);
const modalCriteria = ref<boolean>(false); const modalCriteria = ref<boolean>(false);
@ -72,6 +80,8 @@ function fetchListPlanned() {
); );
weightPlanned.value = weight; weightPlanned.value = weight;
indicatorWeight1Total.value = Number(weight);
store.indicatorScoreVal = result;
totalResults1.value = totalResults1.value =
(result * store.dataEvaluation.plannedPoint) / weight; (result * store.dataEvaluation.plannedPoint) / weight;
@ -104,6 +114,7 @@ function fetchListRole() {
); );
weightRole.value = weight; weightRole.value = weight;
indicatorWeight1Total.value = Number(weight);
totalResults2.value = totalResults2.value =
(result * store.dataEvaluation.rolePoint) / weight; (result * store.dataEvaluation.rolePoint) / weight;
@ -168,6 +179,13 @@ function getCriteria() {
}); });
} }
const isShowScore = computed(() => {
return (
store.tabOpen === 3 &&
store.dataEvaluation.evaluationStatus === "EVALUATING"
);
});
watch( watch(
[weightPlanned, weightRole, weightAssigned], [weightPlanned, weightRole, weightAssigned],
([newA, newB, newC], [prevA, prevB, prevC]) => { ([newA, newB, newC], [prevA, prevB, prevC]) => {
@ -219,39 +237,43 @@ onMounted(() => {
:total="totalResults1" :total="totalResults1"
/> />
<q-table <div v-if="isShowScore">
flat <q-table
dense flat
bordered dense
:rows="[ bordered
{ :rows="[
name: 'รวมผลการประเมิน (ร้อยละ)', {
value: store.excusiveIndicator1PercentVal, name: 'รวมผลการประเมิน (ร้อยละ)',
}, value: store.excusiveIndicator1PercentVal,
{ },
name: 'ผลการประเมินมิติที่ 1 (คะแนน)', {
value: store.excusiveIndicator1ScoreVal, name: 'ผลการประเมินมิติที่ 1 (คะแนน)',
}, value: store.excusiveIndicator1ScoreVal,
]" },
:columns="[ ]"
{ :columns="[
name: 'name', {
field: 'name', name: 'name',
label: 'name', field: 'name',
style: 'font-size: 14px', label: 'name',
}, style: 'font-size: 14px',
{ },
name: 'value', {
field: 'value', name: 'value',
label: 'value', field: 'value',
style: 'font-size: 14px; font-weight: bold', label: 'value',
}, style: 'font-size: 14px; font-weight: bold',
]" },
row-key="name" ]"
hide-header row-key="name"
hide-bottom hide-header
class="q-mt-xs q-mb-md" hide-bottom
/> class="q-mt-xs q-mb-md"
/>
</div>
<div v-else class="q-mt-md"></div>
<Work <Work
v-model:data="rows_03" v-model:data="rows_03"
@ -261,50 +283,52 @@ onMounted(() => {
:total="totalResults3" :total="totalResults3"
/> />
<q-table <div v-if="isShowScore">
flat <q-table
dense flat
bordered dense
:rows="[ bordered
{ :rows="[
name: 'รวมผลการประเมิน (ร้อยละ)', {
value: store.excusiveIndicator2PercentVal, name: 'รวมผลการประเมิน (ร้อยละ)',
}, value: store.excusiveIndicator2PercentVal,
{ },
name: 'ผลการประเมินมิติที่ 2 (คะแนน)', {
value: store.excusiveIndicator2ScoreVal, name: 'ผลการประเมินมิติที่ 2 (คะแนน)',
}, value: store.excusiveIndicator2ScoreVal,
]" },
:columns="[ ]"
{ :columns="[
name: 'name', {
field: 'name', name: 'name',
label: 'name', field: 'name',
style: 'font-size: 14px', label: 'name',
}, style: 'font-size: 14px',
{ },
name: 'value', {
field: 'value', name: 'value',
label: 'value', field: 'value',
style: 'font-size: 14px; font-weight: bold', label: 'value',
}, style: 'font-size: 14px; font-weight: bold',
]" },
row-key="name" ]"
hide-header row-key="name"
hide-bottom hide-header
class="q-mt-xs q-mb-md" hide-bottom
/> class="q-mt-xs q-mb-md"
/>
<div class="row text-body2 text-weight-bold"> <div class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center"> <div class="col-12 text-center row justify-center">
<span <span
>สรปผลการประเมนผลสมฤทธของงาน ( 1 + 2) >สรปผลการประเมนผลสมฤทธของงาน ( 1 + 2)
(คะแนนเต (คะแนนเต
{{ store.excusiveIndicatorScore }} {{ store.excusiveIndicatorScore }}
คะแนน)</span คะแนน)</span
> >
<div class="text-primary q-pl-md"> <div class="text-primary q-pl-md">
{{ store.indicatorScoreVal }} {{ store.indicatorScoreVal }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -333,45 +357,47 @@ onMounted(() => {
:total="totalResults3" :total="totalResults3"
/> />
<q-table <div v-if="isShowScore">
flat <q-table
dense flat
bordered dense
:rows="[ bordered
{ :rows="[
name: 'รวมผลการประเมิน (ร้อยละ)', {
value: store.indicatorPercentVal, name: 'รวมผลการประเมิน (ร้อยละ)',
}, value: store.indicatorPercentVal,
]" },
:columns="[ ]"
{ :columns="[
name: 'name', {
field: 'name', name: 'name',
label: 'name', field: 'name',
style: 'font-size: 14px', label: 'name',
}, style: 'font-size: 14px',
{ },
name: 'value', {
field: 'value', name: 'value',
label: 'value', field: 'value',
style: 'font-size: 14px; font-weight: bold', label: 'value',
}, style: 'font-size: 14px; font-weight: bold',
]" },
row-key="name" ]"
hide-header row-key="name"
hide-bottom hide-header
class="q-mt-xs q-mb-md" hide-bottom
/> class="q-mt-xs q-mb-md"
/>
<div class="row text-body2 text-weight-bold"> <div class="row text-body2 text-weight-bold">
<div class="col-12 text-center row justify-center"> <div class="col-12 text-center row justify-center">
<span <span
>สรปผลการประเมนผลสมฤทธของงาน (คะแนนเต >สรปผลการประเมนผลสมฤทธของงาน (คะแนนเต
{{ store.indicatorScore }} {{ store.indicatorScore }}
คะแนน)</span คะแนน)</span
> >
<div class="text-primary q-pl-md"> <div class="text-primary q-pl-md">
{{ store.indicatorScoreVal }} {{ store.indicatorScoreVal }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -398,6 +424,7 @@ onMounted(() => {
<Competency v-model:dataListCriteria="dataListCriteria" /> <Competency v-model:dataListCriteria="dataListCriteria" />
<q-table <q-table
v-if="isShowScore"
flat flat
dense dense
bordered bordered
@ -434,59 +461,61 @@ onMounted(() => {
<div v-if="!store.dataProfile.posExecutiveName"> <div v-if="!store.dataProfile.posExecutiveName">
<Develop /> <Develop />
<q-table <div v-if="isShowScore">
flat <q-table
dense flat
bordered dense
:rows="[ bordered
{ :rows="[
name: `ผลการประเมินการพัฒนาตนเอง (คะแนนเต็ม ${store.devScore} คะแนน)`, {
value: store.devScoreVal, name: `ผลการประเมินการพัฒนาตนเอง (คะแนนเต็ม ${store.devScore} คะแนน)`,
}, value: store.devScoreVal,
]" },
:columns="[ ]"
{ :columns="[
name: 'name', {
field: 'name', name: 'name',
label: 'name', field: 'name',
style: 'font-size: 14px', label: 'name',
}, style: 'font-size: 14px',
{ },
name: 'value', {
field: 'value', name: 'value',
label: 'value', field: 'value',
style: 'font-size: 14px; font-weight: bold', label: 'value',
}, style: 'font-size: 14px; font-weight: bold',
]" },
row-key="name" ]"
hide-header row-key="name"
hide-bottom hide-header
class="q-mt-xs q-mb-md" hide-bottom
/> class="q-mt-xs q-mb-md"
</div> />
</div>
<div <div
v-if="!store.dataProfile.posExecutiveName" v-if="isShowScore && !store.dataProfile.posExecutiveName"
class="row text-body2 text-weight-bold" class="row text-body2 text-weight-bold"
> >
<div class="col-12 text-center row justify-center"> <div class="col-12 text-center row justify-center">
<span <span
>สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ+การพฒนาตนเอง) >สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ+การพฒนาตนเอง)
(คะแนนเต {{ store.competencyDevScore }} คะแนน)</span (คะแนนเต {{ store.competencyDevScore }} คะแนน)</span
> >
<div class="text-primary q-pl-md"> <div class="text-primary q-pl-md">
{{ store.competencyDevScoreVal }} {{ store.competencyDevScoreVal }}
</div>
</div> </div>
</div> </div>
</div> <div v-else class="row text-body2 text-weight-bold">
<div v-else class="row text-body2 text-weight-bold"> <div class="col-12 text-center row justify-center">
<div class="col-12 text-center row justify-center"> <span
<span >สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ) (คะแนนเต
>สรปผลการประเมนพฤตกรรมการปฏราชการ (สมรรถนะ) (คะแนนเต {{ store.competencyScore }} คะแนน)</span
{{ store.competencyScore }} คะแนน)</span >
> <div class="text-primary q-pl-md">
<div class="text-primary q-pl-md"> {{ store.competencyScoreVal }}
{{ store.competencyScoreVal }} </div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -15,6 +15,14 @@ const indicatorWeightTotal = defineModel("indicatorWeightTotal", {
type: Number, type: Number,
default: 0, default: 0,
}); });
const indicatorWeight1Total = defineModel("indicatorWeight1Total", {
type: Number,
default: 0,
});
const indicatorWeight2Total = defineModel("indicatorWeight2Total", {
type: Number,
default: 0,
});
const itemsTab = ref<any>([ const itemsTab = ref<any>([
{ {
@ -102,6 +110,8 @@ const splitterModel = ref<number>(12);
<Assessment <Assessment
v-if="store.tabMain === '1'" v-if="store.tabMain === '1'"
v-model:indicatorWeightTotal="indicatorWeightTotal" v-model:indicatorWeightTotal="indicatorWeightTotal"
v-model:indicatorWeight1Total="indicatorWeight1Total"
v-model:indicatorWeight2Total="indicatorWeight2Total"
/> />
<Assessment v-if="store.tabMain === '2'" :type="'evaluator'" /> <Assessment v-if="store.tabMain === '2'" :type="'evaluator'" />
<Assessment v-if="store.tabMain === '3'" :type="'commander'" /> <Assessment v-if="store.tabMain === '3'" :type="'commander'" />

View file

@ -357,36 +357,42 @@ watch(
</div> </div>
</q-td> </q-td>
<td> <td>
<!-- <div v-if="store.dataEvaluation.evaluationStatus == 'APPROVE'"> --> <div
<q-btn v-if="
flat store.dataEvaluation.evaluationStatus == 'APPROVE' &&
round store.tabMain === '2'
icon="mdi-developer-board" "
color="blue-6"
size="12px"
dense
@click="openPopupProgress(props.row.id)"
> >
<q-tooltip>รายงานความกาวหน</q-tooltip> <q-btn
</q-btn> flat
<q-btn round
flat icon="mdi-developer-board"
round color="blue-6"
icon="warning" size="12px"
color="red-5" dense
size="12px" @click="openPopupProgress(props.row.id)"
dense >
main="problem" <q-tooltip>รายงานความกาวหน</q-tooltip>
@click="openPopupProblem(props.row.id)" </q-btn>
> <q-btn
<q-tooltip>รายงานปญหา</q-tooltip> flat
</q-btn> round
<!-- </div> --> icon="warning"
color="red-5"
size="12px"
dense
main="problem"
@click="openPopupProblem(props.row.id)"
>
<q-tooltip>รายงานปญหา</q-tooltip>
</q-btn>
</div>
<div <div
v-if=" v-if="
store.dataEvaluation.evaluationStatus === 'NEW' && store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER' store.rolePerson === 'USER' &&
store.tabMain === '1'
" "
> >
<q-btn <q-btn

View file

@ -290,14 +290,7 @@ onMounted(() => {
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
<q-th <q-th auto-width />
auto-width
v-if="
store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER'
"
/>
<q-th auto-width/>
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
@ -359,8 +352,13 @@ onMounted(() => {
{{ col.value }} {{ col.value }}
</div> </div>
</q-td> </q-td>
<q-td auto-width> <q-td>
<div v-if="store.dataEvaluation.evaluationStatus == 'APPROVE'"> <div
v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2'
"
>
<q-btn <q-btn
flat flat
round round
@ -389,7 +387,8 @@ onMounted(() => {
<div <div
v-if=" v-if="
store.dataEvaluation.evaluationStatus === 'NEW' && store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER' store.rolePerson === 'USER' &&
store.tabMain === '1'
" "
> >
<q-btn <q-btn

View file

@ -287,7 +287,12 @@ onMounted(() => {
</div> </div>
</q-td> </q-td>
<q-td> <q-td>
<div v-if="store.dataEvaluation.evaluationStatus == 'APPROVE'"> <div
v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '1'
"
>
<q-btn <q-btn
flat flat
round round
@ -316,7 +321,8 @@ onMounted(() => {
<div <div
v-if=" v-if="
store.dataEvaluation.evaluationStatus === 'NEW' && store.dataEvaluation.evaluationStatus === 'NEW' &&
store.rolePerson === 'USER' store.rolePerson === 'USER' &&
store.tabMain === '2'
" "
> >
<q-btn <q-btn

View file

@ -273,15 +273,36 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
rolePerson.value = role; rolePerson.value = role;
switch (dataEvaluation.value.evaluationStatus) { switch (dataEvaluation.value.evaluationStatus) {
case "NEW" || "NEW_EVALUATOR" || "NEW_COMMANDER" || "NEW_COMMANDER_HIGH": case "NEW":
tabOpen.value = 1;
break;
case "NEW_EVALUATOR":
tabOpen.value = 1;
break;
case "NEW_COMMANDER":
tabOpen.value = 1;
break;
case "NEW_COMMANDER_HIGH":
tabOpen.value = 1; tabOpen.value = 1;
break; break;
case "APPROVE": case "APPROVE":
tabOpen.value = 2; tabOpen.value = 2;
break; break;
default: case "EVALUATING":
tabOpen.value = 3; tabOpen.value = 3;
break; break;
case "EVALUATING_EVALUATOR":
tabOpen.value = 3;
break;
case "EVALUATING_COMMANDER":
tabOpen.value = 3;
break;
case "EVALUATING_COMMANDER_HIGH":
tabOpen.value = 3;
break;
default:
tabOpen.value = 1;
break;
} }
} }

View file

@ -346,6 +346,8 @@ function requireEdit() {
} }
const indicatorWeightTotal = ref<number>(0); const indicatorWeightTotal = ref<number>(0);
const indicatorWeight1Total = ref<number>(0);
const indicatorWeight2Total = ref<number>(0);
onMounted(async () => { onMounted(async () => {
showLoader(); showLoader();
await getAll(); await getAll();
@ -400,9 +402,12 @@ onMounted(async () => {
<div class="q-gutter-x-sm"> <div class="q-gutter-x-sm">
<span <span
v-if=" v-if="
store.dataProfile.posExecutiveName == null && (store.dataProfile.posExecutiveName == null &&
indicatorWeightTotal > 0 && indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100 indicatorWeightTotal != 100) ||
(store.dataEvaluation.evaluatorId != null &&
indicatorWeight1Total != 100 &&
indicatorWeight2Total != 20)
" "
class="text-red" class="text-red"
>*ำหน(อยละ) ผลสมฤทธของงานไมกตอง</span >*ำหน(อยละ) ผลสมฤทธของงานไมกตอง</span
@ -413,9 +418,12 @@ onMounted(async () => {
store.dataEvaluation.evaluationStatus == 'NEW' store.dataEvaluation.evaluationStatus == 'NEW'
" "
:disabled=" :disabled="
store.dataEvaluation.evaluatorId == null || (store.dataProfile.posExecutiveName == null &&
(indicatorWeightTotal > 0 && indicatorWeightTotal > 0 &&
indicatorWeightTotal != 100) indicatorWeightTotal != 100) ||
(store.dataEvaluation.evaluatorId != null &&
indicatorWeight1Total != 100 &&
indicatorWeight2Total != 20)
" "
unelevated unelevated
round round
@ -558,6 +566,8 @@ onMounted(async () => {
v-model:indicatorScore="indicatorScore" v-model:indicatorScore="indicatorScore"
v-model:competencyScore="competencyScore" v-model:competencyScore="competencyScore"
v-model:indicatorWeightTotal="indicatorWeightTotal" v-model:indicatorWeightTotal="indicatorWeightTotal"
v-model:indicatorWeight1Total="indicatorWeight1Total"
v-model:indicatorWeight2Total="indicatorWeight2Total"
/> />
</q-card> </q-card>
</div> </div>

View file

@ -305,11 +305,7 @@ onMounted(async () => {
narrow-indicator narrow-indicator
> >
<q-tab name="1" label="รายการทั้งหมด" @click="onChangTab" /> <q-tab name="1" label="รายการทั้งหมด" @click="onChangTab" />
<q-tab <q-tab name="2" label="รออนุมัติข้อตกลง" @click="onChangTab" />
name="2"
label="อนุมัติเพื่อเริ่มประเมิน"
@click="onChangTab"
/>
<q-tab <q-tab
name="3" name="3"
label="รออนุมัติแก้ไขข้อตกลง" label="รออนุมัติแก้ไขข้อตกลง"