This commit is contained in:
STW_TTTY\stwtt 2024-07-12 13:22:35 +07:00
parent 82b6f07897
commit 74bd72c70c
9 changed files with 123 additions and 75 deletions

View file

@ -396,9 +396,9 @@ onMounted(() => {
bordered bordered
class="q-mt-md" class="q-mt-md"
v-if=" v-if="
store.rolePerson == 'COMMANDER' &&
evaluatorComment !== null && evaluatorComment !== null &&
store.dataEvaluation.commanderId !== null store.dataEvaluation.commanderId !== null &&
store.dataEvaluation.evaluationStatus !== 'SUMMARY'
" "
> >
<q-form greedy @submit.prevent @validation-success="onSubmitCommander"> <q-form greedy @submit.prevent @validation-success="onSubmitCommander">
@ -422,7 +422,12 @@ onMounted(() => {
'SUMMARY_COMMANDER' 'SUMMARY_COMMANDER'
" "
label="เห็นด้วยกับผลการประเมิน" label="เห็นด้วยกับผลการประเมิน"
@click="resetCommander()" @click="
store.dataEvaluation.evaluationStatus !==
'SUMMARY_COMMANDER'
? ''
: resetCommander()
"
/> />
<q-radio <q-radio
v-model="superiorCommentCheck" v-model="superiorCommentCheck"
@ -457,11 +462,17 @@ onMounted(() => {
</div> </div>
</q-card-section> </q-card-section>
<q-separator <q-separator
v-if="store.dataEvaluation.evaluationStatus == 'SUMMARY_COMMANDER'" v-if="
store.dataEvaluation.evaluationStatus == 'SUMMARY_COMMANDER' &&
store.rolePerson === 'COMMANDER'
"
/> />
<q-card-actions <q-card-actions
align="right" align="right"
v-if="store.dataEvaluation.evaluationStatus == 'SUMMARY_COMMANDER'" v-if="
store.dataEvaluation.evaluationStatus == 'SUMMARY_COMMANDER' &&
store.rolePerson === 'COMMANDER'
"
> >
<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
@ -474,8 +485,8 @@ onMounted(() => {
bordered bordered
class="q-mt-md" class="q-mt-md"
v-if=" v-if="
store.rolePerson == 'COMMANDERHIGH' && store.dataEvaluation.evaluationStatus !== 'SUMMARY' &&
superiorComment !== '' && store.dataEvaluation.evaluationStatus !== 'SUMMARY_COMMANDER' &&
store.dataEvaluation.commanderHighId !== null store.dataEvaluation.commanderHighId !== null
" "
> >
@ -504,7 +515,12 @@ onMounted(() => {
unchecked-icon="panorama_fish_eye" unchecked-icon="panorama_fish_eye"
val="true" val="true"
label="เห็นด้วยกับผลการประเมิน" label="เห็นด้วยกับผลการประเมิน"
@click="resetCommanderHigh()" @click="
store.dataEvaluation.evaluationStatus !==
'SUMMARY_COMMANDER_HIGH'
? ''
: resetCommanderHigh()
"
/> />
<q-radio <q-radio
:disable=" :disable="

View file

@ -556,8 +556,8 @@ const title = computed(() => {
<q-card bordered flat class="q-mt-sm no-shadow bg-white col-12"> <q-card bordered flat class="q-mt-sm no-shadow bg-white col-12">
<div class="row q-px-md q-py-sm items-center bg-grey-1"> <div class="row q-px-md q-py-sm items-center bg-grey-1">
<div class="col-4">ลำด/รหสตวช</div> <div class="col-5">ลำด/รหสตวช</div>
<div class="col-4">อตวช</div> <div class="col-7">อตวช</div>
</div> </div>
<q-separator /> <q-separator />
@ -574,11 +574,11 @@ const title = computed(() => {
@click="clickList(item.id)" @click="clickList(item.id)"
> >
<q-item-section class="q-pa-none"> <q-item-section class="q-pa-none">
<div class="row items-center" style="height: 50px"> <div class="row items-center full-width ">
<div class="col-4"> <div class="col-5">
{{ item.including }} {{ item.including }}
</div> </div>
<div class="col-4"> <div class="col-7">
{{ item.includingName }} {{ item.includingName }}
</div> </div>
</div> </div>
@ -964,6 +964,7 @@ const title = computed(() => {
.my-menu-link { .my-menu-link {
background: #ebf9f7 !important; background: #ebf9f7 !important;
color: #1bb19ab8 !important; color: #1bb19ab8 !important;
border: 0;
} }
.no-shadow { .no-shadow {
box-shadow: none !important; box-shadow: none !important;

View file

@ -277,12 +277,22 @@ watch(
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 85%"> <q-card class="col-12" style="width: 85%">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader :tittle="`เพิ่มสมรรถนะ`" :close="closeDialog" /> <DialogHeader
:tittle="
competencyType == 'HEAD' || competencyType == 'GROUP'
? `รายละเอียดสมรรถนะ`
: `เพิ่มสมรรถนะ`
"
:close="closeDialog"
/>
<q-separator /> <q-separator />
<q-card-section class="q-pa-none scroll" style="max-height: 80vh"> <q-card-section class="q-pa-none scroll" style="max-height: 80vh">
<div class="row"> <div class="row">
<div class="bg-grey-1 q-pa-md col-3 row lineRight"> <div
v-if="competencyType != 'HEAD' && competencyType != 'GROUP'"
class="bg-grey-1 q-pa-md col-xs-12 col-md-3 row lineRight"
>
<div class="col-12 q-col-gutter-sm fit"> <div class="col-12 q-col-gutter-sm fit">
<div class="col-12"> <div class="col-12">
<q-select <q-select
@ -362,7 +372,13 @@ watch(
</div> </div>
</div> </div>
<div class="col-9 q-pa-md q-col-gutter-sm"> <div
:class="
competencyType == 'HEAD' || competencyType == 'GROUP'
? `col-xs-12 col-md-12 q-pa-md q-col-gutter-sm`
: `col-xs-12 col-md-9 q-pa-md q-col-gutter-sm`
"
>
<span class="text-body2 text-weight-medium" <span class="text-body2 text-weight-medium"
>รายละเอยดสมรรถนะ</span >รายละเอยดสมรรถนะ</span
> >

View file

@ -655,6 +655,7 @@ watch(
.my-menu-link { .my-menu-link {
background: #ebf9f7 !important; background: #ebf9f7 !important;
color: #1bb19ab8 !important; color: #1bb19ab8 !important;
border: 0;
} }
.q-btn-group--outline > .q-btn-item:not(:last-child):before { .q-btn-group--outline > .q-btn-item:not(:last-child):before {

View file

@ -271,34 +271,40 @@ function updateSelect() {
search.value = ""; search.value = "";
} }
function getOrgOp() { function getOrgOp(check: boolean,id:string) {
http if (check == false) {
.get(config.API.Kpiorg) http
.then((res) => { .get(config.API.Kpiorg+`/${id}`)
const data = res.data.result; .then((res) => {
evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({ const data = res.data.result;
id: i.id, evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${ id: i.id,
i.lastName ? i.lastName : "" name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
}`, i.lastName ? i.lastName : ""
})); }`,
commanderIdMainOp.value = data.commander.map((i: any) => ({ }));
id: i.id, commanderIdMainOp.value = data.commander.map((i: any) => ({
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${ id: i.id,
i.lastName ? i.lastName : "" name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
}`, i.lastName ? i.lastName : ""
})); }`,
commanderHighMainOp.value = data.chairman.map((i: any) => ({ }));
id: i.id, commanderHighMainOp.value = data.chairman.map((i: any) => ({
name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${ id: i.id,
i.lastName ? i.lastName : "" name: `${i.prefix ? i.prefix : ""}${i.firstName ? i.firstName : ""} ${
}`, i.lastName ? i.lastName : ""
})); }`,
}) }));
.catch((e) => { })
messageError($q, e); .catch((e) => {
}) messageError($q, e);
.finally(() => {}); })
.finally(() => {});
} else {
evaluatorIdMainOp.value = [];
commanderIdMainOp.value = [];
commanderHighMainOp.value = [];
}
} }
function onSubmit() { function onSubmit() {
@ -346,7 +352,6 @@ watch(
(n) => { (n) => {
if (n == true) { if (n == true) {
fetchRoundOption(); fetchRoundOption();
getOrgOp();
} }
} }
); );
@ -456,6 +461,7 @@ watch(
color="primary" color="primary"
dense dense
v-model="props.selected" v-model="props.selected"
@click="getOrgOp(props.selected,props.row.id)"
/> />
</q-td> </q-td>
<q-td <q-td

View file

@ -56,8 +56,8 @@ const columns = ref<QTableProps["columns"]>([
label: "ตัวชี้วัด", label: "ตัวชี้วัด",
sortable: true, sortable: true,
field: "includingName", field: "includingName",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px;width:200px",
style: "font-size: 14px", style: "font-size: 14px;",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
@ -334,6 +334,9 @@ const isEditStep3 = computed(() => {
<div v-else-if="col.name === 'achievement'"> <div v-else-if="col.name === 'achievement'">
{{ props.row.point ? `ระดับ ${props.row.point}` : "" }} {{ props.row.point ? `ระดับ ${props.row.point}` : "" }}
</div> </div>
<div v-else-if="col.name === 'includingName'" style="width: 200px; white-space: normal;">
{{ props.row.includingName ? props.row.includingName : "-" }}
</div>
<div v-else-if="col.name === 'evaluationResults'"> <div v-else-if="col.name === 'evaluationResults'">
{{ {{
parseFloat( parseFloat(
@ -347,9 +350,10 @@ const isEditStep3 = computed(() => {
</q-td> </q-td>
<td> <td>
<div <div
v-if=" v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' && (store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2' store.tabMain === '2') ||
store.tabMain === '3'
" "
> >
<q-btn <q-btn
@ -437,8 +441,9 @@ const isEditStep3 = computed(() => {
<q-card-actions <q-card-actions
align="around" align="around"
v-if=" v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' && (store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2' store.tabMain === '2') ||
store.tabMain === '3'
" "
> >
<q-btn <q-btn

View file

@ -349,7 +349,7 @@ onMounted(() => {
<d-table <d-table
ref="table" ref="table"
:columns="columns" :columns="columns"
:rows="rows[item.id].length !== 0 ? rows[item.id]:[]" :rows="rows[item.id]?.length !== 0 ? rows[item.id]:[]"
row-key="id" row-key="id"
flat flat
bordered bordered
@ -439,9 +439,10 @@ onMounted(() => {
</q-td> </q-td>
<q-td> <q-td>
<div <div
v-if=" v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' && (store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2' store.tabMain === '2') ||
store.tabMain === '3'
" "
> >
<q-btn <q-btn
@ -463,13 +464,16 @@ onMounted(() => {
round round
:icon=" :icon="
item.id == 'HEAD' || item.id == 'GROUP' item.id == 'HEAD' || item.id == 'GROUP'
? 'edit' ? 'mdi-eye'
: 'edit' : 'edit'
" "
color="info" color="info"
@click.stop.pervent="onEdit(props.row, item.id)" @click.stop.pervent="onEdit(props.row, item.id)"
> >
<q-tooltip>แกไข </q-tooltip> <q-tooltip v-if="item.id == 'HEAD' || item.id == 'GROUP'"
>รายละเอยด</q-tooltip
>
<q-tooltip v-else>แก้ไข</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
flat flat
@ -530,8 +534,9 @@ onMounted(() => {
<q-card-actions <q-card-actions
align="around" align="around"
v-if=" v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' && (store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2' store.tabMain === '2') ||
store.tabMain === '3'
" "
> >
<q-btn <q-btn

View file

@ -309,23 +309,24 @@ onMounted(() => {
</q-td> </q-td>
<q-td> <q-td>
<div <div
v-if=" v-if="
store.dataEvaluation.evaluationStatus == 'APPROVE' && (store.dataEvaluation.evaluationStatus == 'APPROVE' &&
store.tabMain === '2' store.tabMain === '2') ||
store.tabMain === '3'
" "
> >
<q-btn <q-btn
flat flat
round round
icon="mdi-developer-board" icon="mdi-account-details"
color="blue-6" color="blue-6"
size="12px" size="12px"
dense dense
@click="openPopupProgress(props.row.id)" @click="openPopupProgress(props.row.id)"
> >
<q-tooltip>รายงานความกาวหน</q-tooltip> <q-tooltip>นทกเหตการณ/พฤตกรรม</q-tooltip>
</q-btn> </q-btn>
<q-btn <!-- <q-btn
flat flat
round round
icon="warning" icon="warning"
@ -336,7 +337,7 @@ onMounted(() => {
@click="openPopupProblem(props.row.id)" @click="openPopupProblem(props.row.id)"
> >
<q-tooltip>รายงานปญหา</q-tooltip> <q-tooltip>รายงานปญหา</q-tooltip>
</q-btn> </q-btn> -->
</div> </div>
<div v-if="isEditStep1"> <div v-if="isEditStep1">

View file

@ -143,9 +143,6 @@ async function fetchProfile(id: string) {
function close() { function close() {
modalEdit.value = false; modalEdit.value = false;
evaluatorId.value = null;
commanderId.value = null;
commanderHighId.value = null;
} }
function onSubmit() { function onSubmit() {
@ -175,10 +172,9 @@ function onSubmit() {
} }
}); });
} }
async function getOrgOp() { async function getOrgOp() {
http http
.get(config.API.Kpiorg) .get(config.API.Kpiorg+`/${store.dataProfile.profileId}`)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({ evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({
@ -294,8 +290,8 @@ async function getProfile() {
} }
async function getAll() { async function getAll() {
await fetchEvaluation(); await fetchEvaluation();
getProfile(); await getProfile();
getOrgOp(); await getOrgOp();
} }
function sendToEvaluatore() { function sendToEvaluatore() {
@ -456,7 +452,7 @@ function goToSummary() {
} }
onMounted(async () => { onMounted(async () => {
showLoader();
store.isUpdate = await false; store.isUpdate = await false;
await getAll(); await getAll();
}); });
@ -887,6 +883,7 @@ onMounted(async () => {
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="column q-gutter-sm"> <div class="column q-gutter-sm">
{{ evaluatorId }}
<q-select <q-select
:readonly=" :readonly="
!( !(