fix bug kpi
This commit is contained in:
parent
1fa38897cf
commit
bb19640c98
5 changed files with 50 additions and 29 deletions
|
|
@ -225,7 +225,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="q-gutter-md q-mt-sm">
|
||||
<!-- องค์ประกอบที่ 1 -->
|
||||
<div v-if="store.dataProfile.posExecutiveName != null">
|
||||
<div v-if="store.dataEvaluation.posExecutiveName != null">
|
||||
<Work
|
||||
v-model:data="rows_01"
|
||||
:title="`มิติที่ 1 ภารกิจตามนโยบายและยุทธศาสตร์ของกรุงเทพมหานคร`"
|
||||
|
|
@ -433,7 +433,7 @@ onMounted(() => {
|
|||
:rows="[
|
||||
{
|
||||
name: `สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม ${
|
||||
!store.dataProfile.posExecutiveName
|
||||
!store.dataEvaluation.posExecutiveName
|
||||
? store.competencyScore
|
||||
: store.excusiveCompetencyScore
|
||||
} คะแนน)`,
|
||||
|
|
@ -460,7 +460,7 @@ onMounted(() => {
|
|||
class="q-mt-xs q-mb-md"
|
||||
/>
|
||||
|
||||
<div v-if="!store.dataProfile.posExecutiveName">
|
||||
<div v-if="!store.dataEvaluation.posExecutiveName">
|
||||
<Develop />
|
||||
|
||||
<div v-if="isShowScore">
|
||||
|
|
@ -498,7 +498,7 @@ onMounted(() => {
|
|||
|
||||
<div v-if="isShowScore">
|
||||
<div
|
||||
v-if="store.dataProfile.posExecutiveName == null"
|
||||
v-if="store.dataEvaluation.posExecutiveName == null"
|
||||
class="row text-body2 text-weight-bold"
|
||||
>
|
||||
<div class="col-12 text-center row justify-center">
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ function getData(type: string) {
|
|||
let weightAvg = weight / total;
|
||||
let resultAvg = result / total;
|
||||
|
||||
if (store.dataProfile.posExecutiveName != null) {
|
||||
if (store.dataEvaluation.posExecutiveName != null) {
|
||||
store.competencyScoreVal =
|
||||
weightAvg != 0
|
||||
? (resultAvg / weightAvg) * store.excusiveCompetencyScore
|
||||
|
|
|
|||
|
|
@ -130,10 +130,10 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
}
|
||||
|
||||
function checkCompetency() {
|
||||
const position = dataProfile.value.position;
|
||||
const posTypeName = dataProfile.value.posTypeName;
|
||||
const posLevelName = dataProfile.value.posLevelName;
|
||||
const executiveName = dataProfile.value.posExecutiveName;
|
||||
const position = dataEvaluation.value.position;
|
||||
const posTypeName = dataEvaluation.value.posTypeName;
|
||||
const posLevelName = dataEvaluation.value.posLevelName;
|
||||
const executiveName = dataEvaluation.value.posExecutiveName;
|
||||
|
||||
if (
|
||||
position == "ผู้ตรวจราชการกรุงเทพมหานคร" ||
|
||||
|
|
@ -189,8 +189,8 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
const defaultCompetencyCoreLevel = ref<number>();
|
||||
const defaultCompetencyGroupLevel = ref<number | null>(null);
|
||||
function checkCompetencyDefaultCompetencyLevel() {
|
||||
const posTypeName = dataProfile.value.posTypeName;
|
||||
const posLevelName = dataProfile.value.posLevelName;
|
||||
const posTypeName = dataEvaluation.value.posTypeName;
|
||||
const posLevelName = dataEvaluation.value.posLevelName;
|
||||
|
||||
switch (posTypeName + " " + posLevelName) {
|
||||
case "บริหาร สูง":
|
||||
|
|
|
|||
|
|
@ -57,12 +57,15 @@ const router = useRouter();
|
|||
async function fetchEvaluation() {
|
||||
await http
|
||||
.get(config.API.kpiEvaluation + `/${id.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.then(async(res) => {
|
||||
const data = await res.data.result;
|
||||
|
||||
store.dataEvaluation = data;
|
||||
store.dataEvaluation = await data;
|
||||
formProfile.status = store.convertStatus(data.evaluationStatus);
|
||||
formProfile.result = store.convertResults(data.evaluationResults);
|
||||
await store.checkCompetency();
|
||||
await store.checkCompetencyDefaultCompetencyLevel();
|
||||
|
||||
fetchProfile(data.profileId);
|
||||
|
||||
plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint;
|
||||
|
|
@ -85,9 +88,6 @@ function getProfile() {
|
|||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
store.dataProfile = await data;
|
||||
|
||||
await store.checkCompetency();
|
||||
await store.checkCompetencyDefaultCompetencyLevel();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -359,14 +359,9 @@ onMounted(async () => {
|
|||
}}</span>
|
||||
<q-space />
|
||||
<div class="q-gutter-x-sm">
|
||||
<!-- {{
|
||||
store.dataProfile.posExecutiveName == null &&
|
||||
store.indicatorWeightTotal != 100
|
||||
}}
|
||||
| {{ store.indicatorWeightTotal }} | -->
|
||||
<span
|
||||
v-if="
|
||||
(store.dataProfile.posExecutiveName == null &&
|
||||
(store.dataEvaluation.posExecutiveName == null &&
|
||||
store.indicatorWeightTotal != 100) ||
|
||||
(store.dataEvaluation.posExecutiveName != null &&
|
||||
(store.indicatorWeight1Total != 100 ||
|
||||
|
|
@ -381,7 +376,7 @@ onMounted(async () => {
|
|||
store.dataEvaluation.evaluationStatus == 'NEW'
|
||||
"
|
||||
:disabled="
|
||||
(store.dataProfile.posExecutiveName == null &&
|
||||
(store.dataEvaluation.posExecutiveName == null &&
|
||||
store.indicatorWeightTotal != 100) ||
|
||||
(store.dataEvaluation.posExecutiveName != null &&
|
||||
(store.indicatorWeight1Total != 100 ||
|
||||
|
|
@ -534,7 +529,7 @@ onMounted(async () => {
|
|||
<span class="text-grey-6">คะแนนประเมิน</span>
|
||||
<span class="text-weight-medium text-primary">
|
||||
{{
|
||||
store.dataProfile.posExecutiveName == null
|
||||
store.dataEvaluation.posExecutiveName == null
|
||||
? (
|
||||
store.indicatorScoreVal +
|
||||
store.competencyScoreVal +
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ const { showLoader, hideLoader, messageError, date2Thai, dialogConfirm } =
|
|||
const rows = ref<any>();
|
||||
const visibleColumns = ref<string[]>([
|
||||
"createdAt",
|
||||
"year",
|
||||
"durationKPI",
|
||||
"evaluationStatus",
|
||||
"evaluationResults",
|
||||
]);
|
||||
|
|
@ -41,6 +43,30 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => v + 543,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "durationKPI",
|
||||
align: "left",
|
||||
label: "รอบการประเมิน",
|
||||
sortable: true,
|
||||
field: "durationKPI",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => (v == "OCT" ? "ตุลาคม" : "เมษายน"),
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "evaluationStatus",
|
||||
align: "left",
|
||||
|
|
@ -219,10 +245,10 @@ function onSubmit() {
|
|||
prefix: formRound.prefix,
|
||||
firstName: formRound.firstName,
|
||||
lastName: formRound.lastName,
|
||||
// position: formRound.position,
|
||||
// posLevelName: formRound.posLevelName,
|
||||
// posTypeName: formRound.posTypeName,
|
||||
// posExecutiveName: formRound.posExecutiveName,
|
||||
position: formRound.position,
|
||||
posLevelName: formRound.posLevelName,
|
||||
posTypeName: formRound.posTypeName,
|
||||
posExecutiveName: formRound.posExecutiveName,
|
||||
|
||||
evaluatorId: formRound.evaluatorId,
|
||||
commanderId: formRound.commanderId == "" ? null : formRound.commanderId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue