ประเมินบุคคล

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-27 15:18:23 +07:00
parent d980946ccc
commit 1435b9b004
9 changed files with 232 additions and 59 deletions

View file

@ -282,12 +282,10 @@ async function saveStep1() {
assessments: [...formDetail.value.assessments],
};
fetchCheckStatus();
await http
.post(config.API.evaluationCheckspec(), form)
.then((res) => {
console.log(res);
.then(() => {
fetchCheckStatus();
})
.catch((err) => {
messageError($q, err);
@ -562,22 +560,24 @@ onMounted(async () => {
class="col-xs-12 col-sm-7 row"
v-if="store.step === 1 || store.step === 3 || store.step === 7"
>
<q-card flat bordered class="col-12">
<q-card-section>
<ViewStep1
v-if="store.step === 1"
@update:formDeital="updateFormDetail"
:data="formDataStep1"
/>
<ViewStep3
v-if="store.step === 3 && pdfSrc"
:pdfSrc="pdfSrc"
/>
<ViewStep7
v-if="store.step === 7 && pdfSrc"
:pdfSrc="pdfSrc"
/> </q-card-section
></q-card>
<!-- <q-card flat bordered class="col-12"> -->
<div class="col-12">
<ViewStep1
v-if="store.step === 1"
@update:formDeital="updateFormDetail"
:data="formDataStep1"
/>
<ViewStep3
v-if="store.step === 3 && pdfSrc"
:pdfSrc="pdfSrc"
/>
<ViewStep7
v-if="store.step === 7 && pdfSrc"
:pdfSrc="pdfSrc"
/>
</div>
<!-- </q-card> -->
</div>
</div>
<div class="q-mt-md q-gutter-md" align="right">

View file

@ -29,6 +29,9 @@ const evaluateId = ref<string>(route.params.id.toString());
/** emit */
const emit = defineEmits(["update:form"]);
const performance = ref<string>("");
const performanceOwner = ref<string>("");
/** form ผู้เซ็นเอกสาร*/
const formCommand = reactive<FormCommand>({
commanderFullname: "",
@ -48,6 +51,8 @@ const fileEvaluation3Ref = ref<object | null>(null);
const fileEvaluation4Ref = ref<object | null>(null);
const fileEvaluation5Ref = ref<object | null>(null);
const fileEvaluation6Ref = ref<object | null>(null);
const performanceRef = ref<object | null>(null);
const performanceOwnerRef = ref<object | null>(null);
/**
* function updateFormref
@ -371,6 +376,51 @@ onMounted(async () => {
<template>
<div class="row q-col-gutter-md">
<!-- ผลงาน -->
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">ผลงาน</div>
<div class="col-12"><q-separator /></div>
<div class="row">
<div class="col-12 q-pa-sm">
<div class="row q-col-gutter-md col-12">
<div class="col-xs-12 col-sm-12 row">
<!-- <div class="text-weight-medium q-py-sm">
งคบบญชาชนต
</div> -->
<div class="row col-12 q-col-gutter-md q-pa-sm">
<q-input
:readonly="store.currentStep != 2"
ref="performanceRef"
dense
class="col-xs-12 col-sm-6"
outlined
label="ชื่อผลงาน"
v-model="performance"
@update:model-value="updateInput(formCommand)"
:rules="[(val) => !!val || `${'กรุณากรอกชื่อผลงาน'}`]"
lazy-rules
/>
<q-input
:readonly="store.currentStep != 2"
ref="performanceOwnerRef"
class="col-xs-12 col-sm-6"
dense
outlined
v-model="performanceOwner"
@update:model-value="updateInput(formCommand)"
label="เจ้าของผลงาน"
:rules="[(val) => !!val || `${'กรุณากรอกเจ้าของผลงาน'}`]"
lazy-rules
/>
</div>
</div>
</div>
</div>
</div>
</q-card>
</div>
<!-- แบบพจารณาคณสมบคคล -->
<div class="col-6" v-if="store.currentStep === 2">
<q-card bordered style="border: 1px solid #d6dee1">

View file

@ -26,6 +26,9 @@ const emit = defineEmits(["update:form"]);
const fileEvaluation1 = ref<any>();
const pdfSrc = ref<any>();
const performance = ref<string>("");
const performanceOwner = ref<string>("");
const formCommand = reactive<FormCommand>({
commanderFullname: "",
commanderPosition: "",
@ -197,6 +200,51 @@ onMounted(() => {
</div>
</q-banner>
</div>
<!-- ผลงาน -->
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">ผลงาน</div>
<div class="col-12"><q-separator /></div>
<div class="row">
<div class="col-12 q-pa-sm">
<div class="row q-col-gutter-md col-12">
<div class="col-xs-12 col-sm-12 row">
<!-- <div class="text-weight-medium q-py-sm">
งคบบญชาชนต
</div> -->
<div class="row col-12 q-col-gutter-md q-pa-sm">
<q-input
:readonly="store.currentStep != 2"
ref="performanceRef"
dense
class="col-xs-12 col-sm-6"
outlined
label="ชื่อผลงาน"
v-model="performance"
@update:model-value="updateInput(formCommand)"
:rules="[(val) => !!val || `${'กรุณากรอกชื่อผลงาน'}`]"
lazy-rules
/>
<q-input
:readonly="store.currentStep != 2"
ref="performanceOwnerRef"
class="col-xs-12 col-sm-6"
dense
outlined
v-model="performanceOwner"
@update:model-value="updateInput(formCommand)"
label="เจ้าของผลงาน"
:rules="[(val) => !!val || `${'กรุณากรอกเจ้าของผลงาน'}`]"
lazy-rules
/>
</div>
</div>
</div>
</div>
</div>
</q-card>
</div>
<div class="col-6" v-if="store.currentStep === 6">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">

View file

@ -63,35 +63,35 @@ async function onClickDowloadFile(
await genReport(body, fileName);
}
const directorList = ref<any>();
const meetingList = ref<any>();
// const directorList = ref<any>();
// const meetingList = ref<any>();
async function fetchDirector() {
showLoader();
evaluateId.value &&
(await http
.get(config.API.evaluationDirectorMeetring(evaluateId.value))
.then((res) => {
const directors = res.data.result.directors;
const meetings = res.data.result.meetings;
directorList.value = directors.map((e: any) => ({
fullName: `${e.prefix}${e.firstName} ${e.lastName}`,
position: e.position ?? "-",
email: e.email ?? "-",
phone: e.phone ?? "-",
}));
meetingList.value = meetings.map((e: any) => ({
fullName: `${e.Prefix}${e.FirstName} ${e.LastName}`,
dateMeeting: `${date2Thai(e.dateStart)} - ${date2Thai(e.dateEnd)}`,
result: e.result ?? "-",
duration: e.duration ?? "-",
}));
})
.catch((err) => {})
.finally(() => {
hideLoader();
}));
}
// async function fetchDirector() {
// showLoader();
// evaluateId.value &&
// (await http
// .get(config.API.evaluationDirectorMeetring(evaluateId.value))
// .then((res) => {
// const directors = res.data.result.directors;
// const meetings = res.data.result.meetings;
// directorList.value = directors.map((e: any) => ({
// fullName: `${e.prefix}${e.firstName} ${e.lastName}`,
// position: e.position ?? "-",
// email: e.email ?? "-",
// phone: e.phone ?? "-",
// }));
// meetingList.value = meetings.map((e: any) => ({
// fullName: `${e.Prefix}${e.FirstName} ${e.LastName}`,
// dateMeeting: `${date2Thai(e.dateStart)} - ${date2Thai(e.dateEnd)}`,
// result: e.result ?? "-",
// duration: e.duration ?? "-",
// }));
// })
// .catch((err) => {})
// .finally(() => {
// hideLoader();
// }));
// }
async function fetchPathUpload(
volume: string,
@ -161,7 +161,7 @@ function checkDoc() {
}
onMounted(async () => {
await fetchDirector();
// await fetchDirector();
checkDoc();
});
</script>
@ -179,7 +179,7 @@ onMounted(async () => {
/>
</div>
<div class="col-12">
<!-- <div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">
<q-card class="col-12 items-center">
<q-tabs
@ -207,7 +207,7 @@ onMounted(async () => {
</q-tab-panels>
</q-card>
</q-card>
</div>
</div> -->
<div class="col-12">
<q-card bordered style="border: 1px solid #d6dee1">

View file

@ -76,6 +76,11 @@ const columns = ref<QTableProps["columns"]>([
const row = ref<any>();
async function fetchListHistory(id: string) {
const thaiOptions: Intl.DateTimeFormatOptions = {
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
};
showLoader();
await http
.get(config.API.evaluationHistory(id))
@ -84,9 +89,13 @@ async function fetchListHistory(id: string) {
const list = data.map((e: any) => ({
step: e.step,
lastUpdateFullName: e.lastUpdateFullName,
lastUpdatedAt: date2Thai(e.lastUpdatedAt),
lastUpdatedAt: `${date2Thai(e.lastUpdatedAt)} เวลา ${new Date(
e.lastUpdatedAt
).toLocaleTimeString("th-TH", thaiOptions)} .`,
}));
row.value = list;
console.log(row.value);
})
.catch((err) => {})
.finally(() => {

View file

@ -21,7 +21,7 @@ const props = defineProps({
:rows="props.row"
dense
:rows-per-page-options="[10, 25, 50, 100]"
style="width: 625px"
style="width: 610px"
>
<template v-slot:header="props">
<q-tr :props="props">

View file

@ -12,6 +12,9 @@ const props = defineProps({
pdfSrc: {
type: String,
},
type: {
type: String,
},
});
const loadPDF = ref<boolean>(false);
@ -62,10 +65,10 @@ function backPage() {
<q-splitter
v-model="splitterModel"
horizontal
style="
height: 50vh;
border: 1px solid rgb(210, 210, 210);
border-radius: 5px;
:style="
props.type !== 'popup'
? 'height: 50vh; border: 1px solid rgb(210, 210, 210);border-radius: 5px;'
: 'border: 1px solid rgb(210, 210, 210);border-radius: 5px;'
"
before-class="overflow-hidden disable"
separator-class="bg-white disabled"

View file

@ -1,4 +1,6 @@
<script setup lang="ts">
import { ref } from "vue";
import DialogHeader from "@/components/DialogHeader.vue";
import ViewPDF from "@/modules/06_evaluate/components/viewstep/viewPDF.vue";
import { useEvaluateStore } from "@/modules/06_evaluate/store";
@ -8,12 +10,27 @@ const props = defineProps({
},
});
const modalPerview = ref<boolean>(false);
const store = useEvaluateStore();
</script>
<template>
<div class="col-12 row">
<q-space />
<q-btn flat round color="primary" icon="download">
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
flat
round
color="primary"
icon="mdi-fullscreen"
@click="modalPerview = true"
><q-tooltip>เตมจอ</q-tooltip></q-btn
>
</div>
<q-tab-panels v-model="store.tabPanels" animated swipeable vertical>
<q-tab-panel name="1">
<ViewPDF :pdfSrc="props.pdfSrc" />
@ -36,6 +53,22 @@ const store = useEvaluateStore();
<ViewPDF :pdfSrc="props.pdfSrc" />
</q-tab-panel>
</q-tab-panels>
<q-dialog v-model="modalPerview" full-width fullHeight>
<q-card>
<q-card-section>
<DialogHeader :close="() => (modalPerview = false)" />
</q-card-section>
<q-card-section class="q-pt-none">
<ViewPDF :pdfSrc="props.pdfSrc" :type="'popup'" />
</q-card-section>
</q-card>
</q-dialog>
</template>
<style scoped></style>
<style scoped>
.q-tab-panel {
padding: 0px;
}
</style>

View file

@ -1,4 +1,7 @@
<script setup lang="ts">
import { ref } from "vue";
import DialogHeader from "@/components/DialogHeader.vue";
import ViewPDF from "@/modules/06_evaluate/components/viewstep/viewPDF.vue";
const props = defineProps({
@ -6,10 +9,37 @@ const props = defineProps({
type: String,
},
});
const modalPerview = ref<boolean>(false);
</script>
<template>
<div class="col-12 row">
<q-space />
<q-btn flat round color="primary" icon="download">
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn
flat
round
color="primary"
icon="mdi-fullscreen"
@click="modalPerview = true"
><q-tooltip>เตมจอ</q-tooltip></q-btn
>
</div>
<ViewPDF :pdfSrc="props.pdfSrc" />
<q-dialog v-model="modalPerview" full-width fullHeight>
<q-card>
<q-card-section>
<DialogHeader :close="() => (modalPerview = false)" />
</q-card-section>
<q-card-section class="q-pt-none">
<ViewPDF :pdfSrc="props.pdfSrc" :type="'popup'" />
</q-card-section>
</q-card>
</q-dialog>
</template>
<style scoped></style>