reportidperson
This commit is contained in:
parent
546902909b
commit
067a32f436
3 changed files with 62 additions and 261 deletions
|
|
@ -35,6 +35,9 @@ const appointTopic = ref<AppointTopicMain>();
|
|||
const appointOp = ref<AppointTopicMain[]>([]);
|
||||
const appointAll = ref<AppointTopicMain[]>([]);
|
||||
|
||||
const reportPersonId = ref<AppointTopic[]>([]);
|
||||
const reportPersonIdOp = ref<AppointTopic[]>([]);
|
||||
|
||||
const fullname = ref<string>();
|
||||
const date_start = ref<Date>();
|
||||
const date_finish = ref<any>();
|
||||
|
|
@ -549,6 +552,7 @@ function putDataEdit(id: string) {
|
|||
});
|
||||
}
|
||||
const data = {
|
||||
reportPersonId: reportPersonId.value ? reportPersonId.value : "",
|
||||
appointId: appointTopic.value ? appointTopic.value.id : "",
|
||||
fullname: fullname.value,
|
||||
position: position.value,
|
||||
|
|
@ -682,6 +686,7 @@ function putData(id: string) {
|
|||
});
|
||||
}
|
||||
const data = {
|
||||
reportPersonId: reportPersonId.value ? reportPersonId.value : "",
|
||||
appointId: appointTopic.value ? appointTopic.value.id : "",
|
||||
personalId: GUID,
|
||||
fullname: fullname.value,
|
||||
|
|
@ -755,7 +760,7 @@ async function getAssign() {
|
|||
isEdit.value = false;
|
||||
const data = res.data.data;
|
||||
fullname.value = data.profile.name;
|
||||
appointTopic.value = data.assign.appointId
|
||||
appointTopic.value = data.assign.appointId;
|
||||
position.value = data.profile.positionName;
|
||||
date_start.value = data.assign.date_start;
|
||||
date_finish.value = data.assign.date_finish;
|
||||
|
|
@ -978,6 +983,16 @@ async function getAppoint(id: string) {
|
|||
function updateAppointMent() {
|
||||
if (appointTopic.value) {
|
||||
const data = appointTopic.value.directors;
|
||||
const dataPerson = data.map((dataPerson: AppointTopic) => ({
|
||||
...dataPerson,
|
||||
name: `${dataPerson.name} (${dataPerson.position}${
|
||||
dataPerson.positionLevel && dataPerson.positionType
|
||||
? ", " + dataPerson.positionType + ": " + dataPerson.positionLevel
|
||||
: ""
|
||||
})`,
|
||||
}));
|
||||
|
||||
reportPersonIdOp.value = dataPerson;
|
||||
|
||||
const dataFindChairman = data.find(
|
||||
(item: AppointTopic) => item.role === "chairman"
|
||||
|
|
@ -987,10 +1002,10 @@ function updateAppointMent() {
|
|||
);
|
||||
const dataFindCaretaker1 = data.filter(
|
||||
(item: AppointTopic) => item.role === "caregiver"
|
||||
)[0];
|
||||
)[0];
|
||||
const dataFindCaretaker2 = data.filter(
|
||||
(item: AppointTopic) => item.role === "caregiver"
|
||||
)[1];
|
||||
)[1];
|
||||
|
||||
const createChairmanObject = (dataPerson: AppointTopic) => ({
|
||||
id: dataPerson.id,
|
||||
|
|
@ -1145,26 +1160,51 @@ onMounted(async () => {
|
|||
<div class="col-12 text-dark">
|
||||
<div class="row col-12">
|
||||
<div class="row col-12 q-gutter-lg">
|
||||
<div class="col-12 row">
|
||||
<div class="col-6 q-mb-sm">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
label="เลือกคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ"
|
||||
bg-color="white"
|
||||
:rules="[(val:string) => !!val || 'กรุณาเลือกคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ']"
|
||||
hide-bottom-space
|
||||
:options="appointOp"
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="!isEdit && routeName !== 'probationWorkAdd'"
|
||||
borderless
|
||||
option-label="topic"
|
||||
option-value="id"
|
||||
v-model="appointTopic"
|
||||
map-options
|
||||
@update:model-value="updateAppointMent"
|
||||
></q-select>
|
||||
<div class="col-12">
|
||||
<div class="row q-col-gutter-sm q-mb-sm">
|
||||
<div class="col-6">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
label="เลือกคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ"
|
||||
bg-color="white"
|
||||
:rules="[(val:string) => !!val || 'กรุณาเลือกคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ']"
|
||||
hide-bottom-space
|
||||
:options="appointOp"
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="!isEdit && routeName !== 'probationWorkAdd'"
|
||||
borderless
|
||||
option-label="topic"
|
||||
option-value="id"
|
||||
v-model="appointTopic"
|
||||
map-options
|
||||
@update:model-value="updateAppointMent"
|
||||
></q-select>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-select
|
||||
:readonly="
|
||||
!isEdit &&
|
||||
appointTopic?.id !== ''
|
||||
"
|
||||
outlined
|
||||
dense
|
||||
label="ผู้บันทึกแบบประเมินผล (คณะกรรมการ)"
|
||||
bg-color="white"
|
||||
:rules="[(val:string) => !!val || 'กรุณาเลือกผู้บันทึกแบบประเมินผล (คณะกรรมการ)']"
|
||||
hide-bottom-space
|
||||
:options="reportPersonIdOp"
|
||||
class="col-xs-12 col-sm-6"
|
||||
borderless
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="reportPersonId"
|
||||
map-options
|
||||
emit-value
|
||||
></q-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 text-top0 items-center">
|
||||
<q-avatar class="bg-grey-2 q-mr-sm" size="28px">1</q-avatar>
|
||||
ผู้ทดลองปฏิบัติหน้าที่ราชการ
|
||||
|
|
|
|||
|
|
@ -41,9 +41,6 @@ const TabsTemplate3 = defineAsyncComponent(
|
|||
const SummaryScore = defineAsyncComponent(
|
||||
() => import("@/modules/05_placement/components/probation/SummaryScore.vue")
|
||||
);
|
||||
const SummarySurvey = defineAsyncComponent(
|
||||
() => import("@/modules/05_placement/components/probation/SummarySurvey.vue")
|
||||
);
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
|
@ -211,18 +208,6 @@ onMounted(() => {
|
|||
>
|
||||
<q-item-section> ผลการประเมินการ ฯ </q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
active-class="text-primary bg-teal-1 text-weight-medium"
|
||||
clickable
|
||||
class="q-py-sm"
|
||||
dense
|
||||
v-ripple
|
||||
:active="activeTab == 'tab7'"
|
||||
@click="changeTab('tab7')"
|
||||
>
|
||||
<q-item-section> แบบสํารวจ<br />ความคิดเห็น </q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-scroll-area>
|
||||
</q-drawer>
|
||||
|
|
@ -261,10 +246,6 @@ onMounted(() => {
|
|||
<q-tab-panel name="tab6">
|
||||
<SummaryScore />
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="tab7">
|
||||
<SummarySurvey />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-layout>
|
||||
</q-page-container>
|
||||
|
|
|
|||
|
|
@ -1,220 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { QForm, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import criterion from "@/modules/05_placement/components/probation/Criterion.vue";
|
||||
import type { ListDataText } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
const optionText = ref<ListDataText[]>([
|
||||
{ value: "1", label: "ต่ำกว่าความคาดหวังมาก (1)" },
|
||||
{ value: "2", label: "ต่ำกว่าความคาดหวังค่อนข้างมาก (2)" },
|
||||
{ value: "3", label: "เป็นไปตามความคาดหวัง (3)" },
|
||||
{ value: "4", label: "สูงว่าความคาดหวังค่อนข้างมาก (4)" },
|
||||
{ value: "5", label: "สูงกว่าความคาดหวังมาก (5)" },
|
||||
]);
|
||||
|
||||
const $q = useQuasar();
|
||||
const myForm = ref<QForm>();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const { messageError, success, dialogConfirm, showLoader, hideLoader } = mixin;
|
||||
const route = useRoute();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "probationFormDetail");
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const status = ref<boolean>(true);
|
||||
|
||||
const answer1 = ref<string>("");
|
||||
const answer2 = ref<string>("");
|
||||
const answer3 = ref<number>(0);
|
||||
|
||||
const classBordered = ref<string>("");
|
||||
|
||||
/** ดึง ข้อมูลแบบสำรวจ */
|
||||
async function getSurveyData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.summarySurveyDetail(assignId.value))
|
||||
.then(async (res: any) => {
|
||||
const data = await res.data.data;
|
||||
if (data !== null) {
|
||||
answer1.value = data.answer1;
|
||||
answer2.value = data.answer2;
|
||||
answer3.value = data.answer3;
|
||||
status.value = false;
|
||||
}
|
||||
hideLoader();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
}
|
||||
|
||||
/** save ข้อมูล */
|
||||
async function save() {
|
||||
await myForm.value!.validate().then((result: boolean) => {
|
||||
if (result && answer3.value !== 0) {
|
||||
const data = {
|
||||
answer1: answer1.value,
|
||||
answer2: answer2.value,
|
||||
answer3: answer3.value,
|
||||
};
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.summarySurveyDetail(assignId.value), data)
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
getSurveyData();
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
} else if (answer3.value == 0) {
|
||||
classBordered.value = "border_custom";
|
||||
}
|
||||
});
|
||||
}
|
||||
/** ถ้าเป็น 0 ใส่ class */
|
||||
watch(answer3, () => {
|
||||
if (answer3.value == 0) {
|
||||
classBordered.value = "border_custom";
|
||||
} else classBordered.value = "";
|
||||
});
|
||||
|
||||
/** get ค่า เมื่อโหลดหน้า */
|
||||
onMounted(() => {
|
||||
getSurveyData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-form ref="myForm" class="q-pa-md">
|
||||
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
|
||||
<div>แบบสํารวจความคิดเห็นการทดลองปฏิบัติหน้าที่ราชการ</div>
|
||||
</div>
|
||||
<div class="col-12 row">
|
||||
<div class="col-12 text-top0 items-center">
|
||||
<q-avatar class="bg-grey-2 q-mr-sm" size="28px">1</q-avatar>
|
||||
คุณคิดเห็นอย่างไรกับการทดลองปฏิบัติหน้าที่ราชการ?
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
label="ความคิดเห็น"
|
||||
class="bg-white"
|
||||
dense
|
||||
borderless
|
||||
outlined
|
||||
v-model="answer1"
|
||||
type="textarea"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกความคิดเห็น'}`]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 row q-mt-md">
|
||||
<div class="col-12 text-top0 items-center">
|
||||
<q-avatar class="bg-grey-2 q-mr-sm" size="28px">2</q-avatar>
|
||||
ปัญหาและอุปสรรคที่พบระหว่างการทดลองปฏิบัติหน้าที่ราชการ
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="!status || checkRoutePermisson"
|
||||
label="ความคิดเห็น"
|
||||
class="bg-white"
|
||||
dense
|
||||
borderless
|
||||
outlined
|
||||
v-model="answer2"
|
||||
type="textarea"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกความคิดเห็น'}`]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :class="`col-12 row q-mt-md ${classBordered}`">
|
||||
<div class="text-top0 items-center">
|
||||
<q-avatar class="bg-grey-2 q-mr-sm" size="28px">3</q-avatar>
|
||||
ความพึงพอใจกับการทดลองปฏิบัติหน้าที่ราชการของคุณอยู่ในระดับใด
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn-group outline>
|
||||
<q-btn
|
||||
v-for="(item, index) in 5"
|
||||
:disable="!status || checkRoutePermisson"
|
||||
:class="answer3 == item && 'active'"
|
||||
outline
|
||||
color="grey-6"
|
||||
:label="item"
|
||||
@click="answer3 = item"
|
||||
>
|
||||
<q-tooltip>
|
||||
<div class="text-body2">
|
||||
<span>{{ optionText[index].label }}</span>
|
||||
</div>
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn-group>
|
||||
</div>
|
||||
<div class="col-12 q-mt-md">
|
||||
<q-separator size="3px" color="grey-2" />
|
||||
</div>
|
||||
<criterion />
|
||||
</q-form>
|
||||
<!-- <Footer /> -->
|
||||
<div class="row col-12" v-if="!checkRoutePermisson">
|
||||
<q-space />
|
||||
<q-btn label="บันทึก" color="secondary" @click="save" v-if="status" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.text-top2 {
|
||||
font-weight: 500;
|
||||
padding-bottom: 8px;
|
||||
color: rgb(70, 68, 68);
|
||||
}
|
||||
|
||||
.text-top0 {
|
||||
font-weight: 600;
|
||||
padding-bottom: 8px;
|
||||
color: rgb(70, 68, 68);
|
||||
}
|
||||
|
||||
.q-rating__icon {
|
||||
text-shadow: transparent !important;
|
||||
}
|
||||
|
||||
.q-card {
|
||||
box-shadow: 0px 0px 0px 0px !important;
|
||||
}
|
||||
|
||||
.border_custom {
|
||||
border: 2px solid #c10015;
|
||||
border-radius: 5px;
|
||||
color: #c10015;
|
||||
padding: 10px;
|
||||
}
|
||||
.q-btn-group--outline > .q-btn-item:not(:last-child):before {
|
||||
border-right: 1px solid #c4c4c4;
|
||||
}
|
||||
.q-btn-group--outline > .q-btn-item.active {
|
||||
color: #2196f3 !important;
|
||||
background-color: #cde6fb !important;
|
||||
}
|
||||
.q-btn-group--outline > .q-btn-item + .q-btn-item.active:before {
|
||||
border-left: 1px solid #2196f3 !important;
|
||||
background-color: #cde6fb;
|
||||
}
|
||||
.q-btn-group--outline > .q-btn-item.active:not(:last-child):before {
|
||||
border: 1px solid #2196f3;
|
||||
background-color: #cde6fb;
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue