KPI ปรับตาม user
This commit is contained in:
parent
65cc0d0816
commit
3744b3e0d8
4 changed files with 724 additions and 90 deletions
|
|
@ -62,7 +62,7 @@ const isReadonly = <boolean>(route.name === "KPIEditEvaluator" ? true : false);
|
|||
const store = useKpiDataStore();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
|
||||
const { showLoader, hideLoader, messageError, dialogConfirm, success ,findOrgName} = mixin;
|
||||
|
||||
const evaluatorIdOp = ref<DataOption[]>([]);
|
||||
const commanderIdOp = ref<DataOption[]>([]);
|
||||
|
|
@ -403,7 +403,8 @@ function openGovernment() {
|
|||
modalGovernment.value = true;
|
||||
}
|
||||
function openStatus() {
|
||||
modalStatus.value = true;
|
||||
router.push(`/probation-detail/${store.dataEvaluation.profileId}`);
|
||||
// modalStatus.value = true;
|
||||
}
|
||||
|
||||
function sendToEvauator() {
|
||||
|
|
@ -451,6 +452,49 @@ function goToSummary() {
|
|||
);
|
||||
}
|
||||
|
||||
const modalEvaluatorDetail = ref<boolean>(false);
|
||||
const topic = ref<string>("");
|
||||
function viewEvaluatorDetail(profileId: string, type: string) {
|
||||
modalEvaluatorDetail.value = true;
|
||||
topic.value =
|
||||
type == "evaluator"
|
||||
? "ข้อมูลของผู้ประเมิน"
|
||||
: type == "commander"
|
||||
? "ข้อมูลของผู้บังคับบัญชาเหนือขึ้นไป"
|
||||
: "ข้อมูลของผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง";
|
||||
fetchProfileEvaluator(profileId);
|
||||
}
|
||||
|
||||
const evaluator = ref<any>({
|
||||
fullName: "",
|
||||
position: "",
|
||||
avartar: "",
|
||||
posTypeName: "",
|
||||
posLevelName: "",
|
||||
org: "",
|
||||
});
|
||||
async function fetchProfileEvaluator(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profilePosition + `/${id}`)
|
||||
.then((res) => {
|
||||
console.log(res.data.result);
|
||||
const data = res.data.result;
|
||||
evaluator.value.fullName =
|
||||
data.prefix + data.firstName + " " + data.lastName;
|
||||
evaluator.value.position = data.position;
|
||||
evaluator.value.posTypeName = data.posTypeName;
|
||||
evaluator.value.posLevelName = data.posLevelName;
|
||||
evaluator.value.org = findOrgName(data);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
store.isUpdate = await false;
|
||||
|
|
@ -883,103 +927,155 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="column q-gutter-sm">
|
||||
<q-select
|
||||
:readonly="
|
||||
!(
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
)
|
||||
"
|
||||
v-model="evaluatorId"
|
||||
outlined
|
||||
label="ผู้ประเมิน"
|
||||
dense
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="evaluatorIdOp"
|
||||
class="inputgreen"
|
||||
map-options
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:rules="[ (val:string) => !!val ||
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<q-select
|
||||
:readonly="
|
||||
!(
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
)
|
||||
"
|
||||
v-model="evaluatorId"
|
||||
outlined
|
||||
label="ผู้ประเมิน"
|
||||
dense
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="evaluatorIdOp"
|
||||
class="inputgreen"
|
||||
map-options
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:rules="[ (val:string) => !!val ||
|
||||
`${'กรุณาเลือกผู้ประเมิน'}`, ]"
|
||||
use-input
|
||||
@filter="(inputValue:any,
|
||||
use-input
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterOption(inputValue, doneFn,'evaluatorIdOp'
|
||||
) "
|
||||
/>
|
||||
<q-select
|
||||
:readonly="
|
||||
!(
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
)
|
||||
"
|
||||
v-model="commanderId"
|
||||
outlined
|
||||
label="ผู้บังคับบัญชาเหนือขึ้นไป"
|
||||
dense
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="commanderIdOp"
|
||||
map-options
|
||||
class="inputgreen"
|
||||
use-input
|
||||
@filter="(inputValue:any,
|
||||
/>
|
||||
</div>
|
||||
<div class="col-2 q-pa-sm text-right">
|
||||
<q-icon
|
||||
v-if="evaluatorId"
|
||||
name="mdi-eye"
|
||||
size="sm"
|
||||
color="info"
|
||||
class="cursor-pointer"
|
||||
@click="viewEvaluatorDetail(evaluatorId.id, 'evaluator')"
|
||||
>
|
||||
<q-tooltip>ดูข้อมูลผู้ประเมิน</q-tooltip>
|
||||
</q-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<q-select
|
||||
:readonly="
|
||||
!(
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
)
|
||||
"
|
||||
v-model="commanderId"
|
||||
outlined
|
||||
label="ผู้บังคับบัญชาเหนือขึ้นไป"
|
||||
dense
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="commanderIdOp"
|
||||
map-options
|
||||
class="inputgreen"
|
||||
use-input
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterOption(inputValue, doneFn,'commanderIdOp'
|
||||
) "
|
||||
>
|
||||
<template
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER' &&
|
||||
commanderId
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
>
|
||||
<template
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER' &&
|
||||
commanderId
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="commanderId = null"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-2 q-pa-sm text-right">
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="commanderId = null"
|
||||
v-if="commanderId"
|
||||
name="mdi-eye"
|
||||
size="sm"
|
||||
color="info"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-select
|
||||
:readonly="
|
||||
!(
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
)
|
||||
"
|
||||
v-model="commanderHighId"
|
||||
outlined
|
||||
label="ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง"
|
||||
dense
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="commanderHighOp"
|
||||
map-options
|
||||
use-input
|
||||
class="inputgreen"
|
||||
@filter="(inputValue:any,
|
||||
@click="viewEvaluatorDetail(commanderId.id, 'commander')"
|
||||
>
|
||||
<q-tooltip>ดูข้อมูลผู้บังคับบัญชาเหนือขึ้นไป</q-tooltip>
|
||||
</q-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<q-select
|
||||
:readonly="
|
||||
!(
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER'
|
||||
)
|
||||
"
|
||||
v-model="commanderHighId"
|
||||
outlined
|
||||
label="ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง"
|
||||
dense
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="commanderHighOp"
|
||||
map-options
|
||||
use-input
|
||||
class="inputgreen"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterOption(inputValue, doneFn,'commanderHighOp'
|
||||
) "
|
||||
>
|
||||
<template
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER' &&
|
||||
commanderHighId
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
>
|
||||
<template
|
||||
v-if="
|
||||
store.dataEvaluation.evaluationStatus === 'NEW' &&
|
||||
store.rolePerson === 'USER' &&
|
||||
commanderHighId
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="commanderHighId = null"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-2 q-pa-sm text-right">
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="commanderHighId = null"
|
||||
v-if="commanderHighId"
|
||||
name="mdi-eye"
|
||||
size="sm"
|
||||
color="info"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
@click="
|
||||
viewEvaluatorDetail(commanderHighId.id, 'commanderHigh')
|
||||
"
|
||||
>
|
||||
<q-tooltip
|
||||
>ดูข้อมูลผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง</q-tooltip
|
||||
>
|
||||
</q-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
|
|
@ -999,6 +1095,67 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalEvaluatorDetail" persistent>
|
||||
<q-card style="width: 700px; max-width: 80vw; min-height: 40vh">
|
||||
<DialogHeader
|
||||
:tittle="topic"
|
||||
:close="() => (modalEvaluatorDetail = false)"
|
||||
/>
|
||||
<q-separator />
|
||||
|
||||
<q-card>
|
||||
<div class="q-pa-md">
|
||||
<span class="text-teal text-weight-bold text-body2">{{
|
||||
evaluator.fullName
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<q-card-section class="q-pa-md">
|
||||
<div class="row">
|
||||
<div class="col-12 column justify-center no-wrap">
|
||||
<div class="row text-grey-6">
|
||||
<div class="col-3">ตำแหน่งในสายงาน</div>
|
||||
<div class="col-3">ตำแหน่งประเภท</div>
|
||||
<div class="col-3">ตำแหน่งทางการบริหาร</div>
|
||||
<div class="col-3">สังกัด</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
{{ evaluator.position ? evaluator.position : "-" }}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
{{ evaluator.posTypeName ? evaluator.posTypeName : "-" }}
|
||||
{{
|
||||
evaluator.posLevelName
|
||||
? ` (${evaluator.posLevelName})`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
{{
|
||||
evaluator.posExecutiveName
|
||||
? evaluator.posExecutiveName
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
{{ evaluator.org ? evaluator.org : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-mt-md text-grey-6">
|
||||
<div class="col-12">รักษาการในตำแหน่ง/การรักษาราชการแทน</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">-</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- <q-dialog v-model="modalScore" persistent>
|
||||
<q-card bordered style="width: 50vh">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmitScore">
|
||||
|
|
@ -1076,10 +1233,12 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
</q-dialog> -->
|
||||
<DialogGovernment v-model:modal="modalGovernment" />
|
||||
<DialogStatus
|
||||
|
||||
|
||||
<!-- <DialogStatus
|
||||
v-model:modal="modalStatus"
|
||||
v-model:is-probation="store.dataProfile.isProbation"
|
||||
/>
|
||||
/> -->
|
||||
</template>
|
||||
<style>
|
||||
.bg-toolbar {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue