แก้ kpi
This commit is contained in:
parent
4d29976a8c
commit
dfa0ef32ef
7 changed files with 185 additions and 19 deletions
|
|
@ -49,6 +49,10 @@ export default {
|
|||
kpiSendToGet: (id: string) => `${kpiEvaluation}/reason/${id}`,
|
||||
kpiSendToReason: (id: string, type: string) =>
|
||||
`${kpiEvaluation}/reason/${type}/${id}`,
|
||||
kpiSendToReasonreject: (id: string) =>
|
||||
`${kpiEvaluation}/reject-result/${id}`,
|
||||
|
||||
|
||||
kpiReqEdit: (id: string) => `${kpiEvaluation}/edit/${id}`,
|
||||
/**ประเมิน*/
|
||||
kpiAchievementDevelop: `${kpiAchievement}/development`,
|
||||
|
|
@ -68,5 +72,7 @@ export default {
|
|||
|
||||
developmentReQuestIDP: (id: string) => `${developmentOrg}/profile/development/registry/USER/${id}`,
|
||||
developmentIDP: (id: string) => `${development}/main/registry/USER/${id}`,
|
||||
|
||||
kpiReject:(id:string)=>`${kpiEvaluation}/reject-agreement/${id}`
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -15,14 +15,24 @@ import Work from "@/modules/08_KPI/components/Tab/Topic/01_Indicator.vue";
|
|||
import Competency from "@/modules/08_KPI/components/Tab/Topic/02_Competency.vue";
|
||||
import Develop from "@/modules/08_KPI/components/Tab/Topic/03_Develop.vue";
|
||||
import DialogListCriteria from "@/modules/08_KPI/components/Tab/Dialog/DialogListCriteria.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const dataListCriteria = ref<ListCriteria[]>([]);
|
||||
const modalReject = ref<boolean>(false); // ตัวแปร dialog ไม่อนุมัติตีกลับให้แก้ไข
|
||||
const reason = ref<string>(""); //ตัวแปร เหตุผลการตีกลับ
|
||||
|
||||
const modalCriteria = ref<boolean>(false);
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const { hideLoader, messageError, success, showLoader, dialogRemove } =
|
||||
useCounterMixin();
|
||||
const router = useRouter();
|
||||
const {
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
showLoader,
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
} = useCounterMixin();
|
||||
const store = useKpiDataStore();
|
||||
|
||||
const evaluationId = ref<string>(route.params.id.toString());
|
||||
|
|
@ -193,6 +203,31 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
function rejectAgreement() {
|
||||
modalReject.value = true;
|
||||
}
|
||||
|
||||
async function onSubmitReject() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.kpiReject(evaluationId.value), {
|
||||
reason: reason.value,
|
||||
actor: store.roleText(store.rolePerson),
|
||||
})
|
||||
.then((res) => {
|
||||
router.push(`/KPI-evaluator`);
|
||||
success($q, `บันทึกข้อมูลสำเร็จ`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getCriteria();
|
||||
fetchListPlanned();
|
||||
|
|
@ -209,9 +244,61 @@ onMounted(() => {
|
|||
style="height: 100vh; width: auto"
|
||||
class="bg-white row col-12 text-dark q-pa-md"
|
||||
>
|
||||
<div class="text-weight-bold text-body2">
|
||||
<span class="txt-under text-blue-6">องค์ประกอบที่ 1 </span>
|
||||
<span class="q-ml-sm"> ผลสัมฤทธิ์ของงาน</span>
|
||||
<div class="row items-center full-width">
|
||||
<div v-if="store.dataEvaluation.isReject == true && store.dataEvaluation.isReject !== null" class="col-12 q-pb-sm q-gutter-sm">
|
||||
<q-banner
|
||||
inline-actions
|
||||
bordered
|
||||
class="bg-orange-1 text-orange border-orange"
|
||||
>
|
||||
<div class="row items-center">
|
||||
<q-icon name="mdi-information-outline" size="20px" />
|
||||
<div class="column q-pl-sm">
|
||||
<span>{{
|
||||
`${
|
||||
store.dataEvaluation.actorNameReject
|
||||
? store.dataEvaluation.actorNameReject
|
||||
: ""
|
||||
} ${
|
||||
store.dataEvaluation.actorReject
|
||||
? `(${store.dataEvaluation.actorReject})`
|
||||
: ``
|
||||
}`
|
||||
}}</span>
|
||||
<span
|
||||
>เหตุผลการตีกลับ : {{ store.dataEvaluation.reasonReject }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</q-banner>
|
||||
</div>
|
||||
<span class="txt-under text-blue-6 text-weight-bold text-body2"
|
||||
>องค์ประกอบที่ 1
|
||||
</span>
|
||||
<span class="q-ml-sm text-weight-bold text-body2"> ผลสัมฤทธิ์ของงาน</span>
|
||||
<q-space />
|
||||
<q-btn
|
||||
v-if="
|
||||
store.rolePerson !== 'USER' &&
|
||||
store.tabOpen == 1 &&
|
||||
((store.dataEvaluation.evaluationStatus == 'NEW_EVALUATOR' &&
|
||||
store.rolePerson == 'EVALUATOR') ||
|
||||
(store.dataEvaluation.evaluationStatus == 'NEW_COMMANDER' &&
|
||||
store.rolePerson == 'COMMANDER') ||
|
||||
(store.dataEvaluation.evaluationStatus == 'NEW_COMMANDER_HIGH' &&
|
||||
store.rolePerson == 'COMMANDERHIGH'))
|
||||
"
|
||||
:disabled="store.dataEvaluation.evaluatorId == null"
|
||||
unelevated
|
||||
outline
|
||||
color="grey-2"
|
||||
text-color="red"
|
||||
size="md"
|
||||
label="ไม่อนุมัติตีกลับให้แก้ไข"
|
||||
@click="rejectAgreement()"
|
||||
>
|
||||
<q-tooltip>ไม่อนุมัติตีกลับให้แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="q-gutter-md q-mt-sm">
|
||||
<!-- องค์ประกอบที่ 1 -->
|
||||
|
|
@ -532,6 +619,39 @@ onMounted(() => {
|
|||
</div>
|
||||
</q-scroll-area>
|
||||
|
||||
<q-dialog persistent v-model="modalReject">
|
||||
<q-card style="width: 40vw; max-width: 80vw">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmitReject">
|
||||
<DialogHeader
|
||||
:tittle="`ไม่อนุมัติตีกลับให้แก้ไข`"
|
||||
:close="() => ((modalReject = false), (reason = ''))"
|
||||
/>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-md">
|
||||
<q-input
|
||||
v-model="reason"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
dense
|
||||
outlined
|
||||
label="เหตุผลการตีกลับ"
|
||||
hide-bottom-space
|
||||
:rules="[ (val:string) => !!val ||
|
||||
`${'กรุณาระบุเหตุผลการตีกลับ'}`, ]"
|
||||
>
|
||||
</q-input>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogListCriteria
|
||||
v-model:modal="modalCriteria"
|
||||
v-model:dataListCriteria="dataListCriteria"
|
||||
|
|
|
|||
|
|
@ -5,9 +5,10 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useKpiDataStore } from "@/modules/08_KPI/store";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
const router = useRouter();
|
||||
const store = useKpiDataStore();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -74,16 +75,30 @@ function onSubmitCommander() {
|
|||
dialogMessageNotify($q, "กรุณาเลือกความคิดเห็น");
|
||||
} else {
|
||||
dialogConfirm($q, () => {
|
||||
const url =
|
||||
superiorCommentCheck.value == "true"
|
||||
? config.API.kpiSendToReason(id.value, "commander")
|
||||
: config.API.kpiSendToReasonreject(id.value);
|
||||
const body =
|
||||
superiorCommentCheck.value == "true"
|
||||
? {
|
||||
isReason: superiorCommentCheck.value == "true" ? true : false,
|
||||
reason: superiorComment.value,
|
||||
}
|
||||
: {
|
||||
actor: store.roleText(store.rolePerson),
|
||||
reason: superiorComment.value,
|
||||
};
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.kpiSendToReason(id.value, "commander"), {
|
||||
isReason: superiorCommentCheck.value == "true" ? true : false,
|
||||
reason: superiorComment.value,
|
||||
})
|
||||
.put(url, body)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
fetchEvaluation();
|
||||
getData();
|
||||
if (superiorCommentCheck.value == "false") {
|
||||
router.push(`/KPI-evaluator`);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -99,16 +114,30 @@ function onSubmitCommanderHigh() {
|
|||
dialogMessageNotify($q, "กรุณาเลือกความคิดเห็น");
|
||||
} else {
|
||||
dialogConfirm($q, () => {
|
||||
const url =
|
||||
additionalSuperiorCheck.value == "true"
|
||||
? config.API.kpiSendToReason(id.value, "commanderHigh")
|
||||
: config.API.kpiSendToReasonreject(id.value);
|
||||
const body =
|
||||
additionalSuperiorCheck.value == "true"
|
||||
? {
|
||||
isReason: additionalSuperiorCheck.value == "true" ? true : false,
|
||||
reason: additionalSuperiorComment.value,
|
||||
}
|
||||
: {
|
||||
actor: store.roleText(store.rolePerson),
|
||||
reason: additionalSuperiorComment.value,
|
||||
};
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.kpiSendToReason(id.value, "commanderHigh"), {
|
||||
isReason: additionalSuperiorCheck.value == "true" ? true : false,
|
||||
reason: additionalSuperiorComment.value,
|
||||
})
|
||||
.put(url, body)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
fetchEvaluation();
|
||||
getData();
|
||||
if (additionalSuperiorCheck.value == "false") {
|
||||
router.push(`/KPI-evaluator`);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ const isEditStep3 = computed(() => {
|
|||
</div>
|
||||
<div class="col-auto">
|
||||
<q-btn
|
||||
v-if="isEditStep3"
|
||||
v-if="isEditStep3 && store.rolePerson !== 'USER'"
|
||||
flat
|
||||
round
|
||||
icon="mdi-clipboard-check-outline"
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ onMounted(() => {
|
|||
|
||||
<q-space />
|
||||
<q-btn
|
||||
v-if="isEditStep3"
|
||||
v-if="isEditStep3 && store.rolePerson !== 'USER'"
|
||||
flat
|
||||
round
|
||||
icon="mdi-clipboard-check-outline"
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ onMounted(() => {
|
|||
|
||||
<q-space />
|
||||
<q-btn
|
||||
v-if="isEditStep3"
|
||||
v-if="isEditStep3 && store.rolePerson !== 'USER'"
|
||||
flat
|
||||
round
|
||||
icon="mdi-clipboard-check-outline"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const mainRowData = ref<any>()
|
||||
const mainRowData = ref<any>();
|
||||
const isUpdate = ref<boolean>(false);
|
||||
const tabMainevaluator = ref<string>("1");
|
||||
const yearRound = ref<number>(new Date().getFullYear());
|
||||
|
|
@ -392,6 +392,16 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
}
|
||||
}
|
||||
|
||||
function roleText(val: string) {
|
||||
switch (val) {
|
||||
case "EVALUATOR":
|
||||
return "ผู้ประเมิน";
|
||||
case "COMMANDER":
|
||||
return "ผู้บังคับบัญชาเหนือขึ้นไป";
|
||||
case "COMMANDERHIGH":
|
||||
return "ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง";
|
||||
}
|
||||
}
|
||||
// SUMMARY GENERAL CASE
|
||||
const indicatorWeightTotal = ref<number>(0); // น้ำหนักรวมกรณีทั่วไป
|
||||
const indicatorWeight1Total = ref<number>(0); // น้ำหนักรวมมิติที่ 1 ต้องไม่เกิน 100%
|
||||
|
|
@ -516,5 +526,6 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
|
|||
mainRowData,
|
||||
resultsOptions,
|
||||
statusOptions,
|
||||
roleText
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue