ประเมินผล

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-19 17:04:39 +07:00
parent ac007dfc26
commit bdae7034e9
11 changed files with 488 additions and 125 deletions

View file

@ -1,5 +1,23 @@
<script setup lang="ts">
import { reactive } from "vue";
import { reactive, onMounted } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = mixin;
const props = defineProps({
evaluateId: {
type: String,
},
});
const emit = defineEmits(["update:spec"]);
const formData = reactive<any>({
isEducationalQft: false, //
@ -10,6 +28,35 @@ const formData = reactive<any>({
isHaveProLicense: false, //
isHaveMinPeriodOrHoldPos: false, // ]
});
async function updateValue() {
emit("update:spec", formData);
}
async function fetchCheckSpec(id: string) {
showLoader();
await http
.get(config.API.evaluationCheckspecByid(id))
.then((res) => {
const data = res.data.result;
formData.isEducationalQft = data.IsEducationalQft;
formData.isGovermantServiceHtr = data.IsGovermantServiceHtr;
formData.isOperatingExp = data.IsOperatingExp;
formData.isMinPeriodOfTenure = data.IsMinPeriodOfTenure;
formData.isHaveSpecificQft = data.IsHaveSpecificQft;
formData.isHaveProLicense = data.IsHaveProLicense;
formData.isHaveMinPeriodOrHoldPos = data.IsHaveMinPeriodOrHoldPos;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
onMounted(() => {
props.evaluateId && fetchCheckSpec(props.evaluateId);
});
</script>
<template>
@ -20,6 +67,7 @@ const formData = reactive<any>({
keep-color
color="primary"
v-model="formData.isEducationalQft"
@update:model-value="updateValue"
/>
</q-item-section>
<q-item-section>
@ -32,6 +80,7 @@ const formData = reactive<any>({
keep-color
color="primary"
v-model="formData.isGovermantServiceHtr"
@update:model-value="updateValue"
/>
</q-item-section>
<q-item-section>
@ -44,6 +93,7 @@ const formData = reactive<any>({
keep-color
color="primary"
v-model="formData.isOperatingExp"
@update:model-value="updateValue"
/>
</q-item-section>
<q-item-section>
@ -56,6 +106,7 @@ const formData = reactive<any>({
keep-color
color="primary"
v-model="formData.isMinPeriodOfTenure"
@update:model-value="updateValue"
/>
</q-item-section>
<q-item-section>
@ -70,6 +121,7 @@ const formData = reactive<any>({
keep-color
color="primary"
v-model="formData.isHaveSpecificQft"
@update:model-value="updateValue"
/>
</q-item-section>
<q-item-section>
@ -85,6 +137,7 @@ const formData = reactive<any>({
keep-color
color="primary"
v-model="formData.isHaveProLicense"
@update:model-value="updateValue"
/>
</q-item-section>
<q-item-section>
@ -101,6 +154,7 @@ const formData = reactive<any>({
keep-color
color="primary"
v-model="formData.isHaveMinPeriodOrHoldPos"
@update:model-value="updateValue"
/>
</q-item-section>
<q-item-section>

View file

@ -4,7 +4,7 @@ import keycloak from "@/plugins/keycloak";
import http from "@/plugins/http";
import config from "@/app.config";
import genReport from "@/plugins/genreport";
import { useQuasar } from "quasar";
import { useQuasar, type StringDictionary } from "quasar";
import type { FormCommand } from "@/modules/06_evaluate/interface/evalute";
@ -19,26 +19,32 @@ const fullName = ref<string>(
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
);
const props = defineProps({
evaluateId: {
type: String,
},
});
const emit = defineEmits(["update:form"]);
const formCommand = reactive<FormCommand>({
elementaryFullName: "",
elementaryPosition: "",
abovelevelFullname: "",
abovelevelPosition: "",
commanderFullname: "",
commanderPosition: "",
commanderAboveFullname: "",
commanderAbovePosition: "",
});
const elementaryFullNameRef = ref<object | null>(null);
const elementaryPositonRef = ref<object | null>(null);
const abovelevelFullnameRef = ref<object | null>(null);
const abovelevelPositionRef = ref<object | null>(null);
const commanderFullnameRef = ref<object | null>(null);
const commanderPositionRef = ref<object | null>(null);
const commanderAboveFullnameRef = ref<object | null>(null);
const commanderAbovePositionRef = ref<object | null>(null);
const updateInput = (value: any) => {
const ref = {
elementaryFullNameRef: elementaryFullNameRef.value,
elementaryPositonRef: elementaryPositonRef.value,
abovelevelFullnameRef: abovelevelFullnameRef.value,
abovelevelPositionRef: abovelevelPositionRef.value,
commanderFullnameRef: commanderFullnameRef.value,
commanderPositionRef: commanderPositionRef.value,
commanderAboveFullnameRef: commanderAboveFullnameRef.value,
commanderAbovePositionRef: commanderAbovePositionRef.value,
};
emit("update:form", value, ref);
};
@ -95,14 +101,36 @@ async function onClickDowloadFile(
await genReport(body, fileName);
}
onMounted(() => {
async function fetchPathUpload(volume: string, id: string) {
showLoader();
const body = {
fileList: [
"1-แบบพิจารณาคุณสมบัติบุคคล",
"2-แบบแสดงรายละเอียดการเสนอผลงาน",
"3-แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูล",
"4-แบบประเมินคุณลักษณะบุคคล",
"5-แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก",
"6-ผลงานที่จะส่งประเมิน",
],
};
await http
.post(config.API.loadPathDocument(volume, id), body)
.then((res) => {})
.catch((err) => {})
.finally(() => {
hideLoader();
});
}
onMounted(async () => {
const ref = {
elementaryFullNameRef: elementaryFullNameRef.value,
elementaryPositonRef: elementaryPositonRef.value,
abovelevelFullnameRef: abovelevelFullnameRef.value,
abovelevelPositionRef: abovelevelPositionRef.value,
commanderFullnameRef: commanderFullnameRef.value,
commanderPositionRef: commanderPositionRef.value,
commanderAboveFullnameRef: commanderAboveFullnameRef.value,
commanderAbovePositionRef: commanderAbovePositionRef.value,
};
emit("update:form", formCommand, ref);
props.evaluateId && (await fetchPathUpload("เล่ม 1", props.evaluateId));
});
</script>
@ -520,22 +548,22 @@ onMounted(() => {
</div>
<div class="row col-12 q-col-gutter-md q-pa-sm">
<q-input
ref="elementaryFullNameRef"
ref="commanderFullnameRef"
dense
class="col-xs-12 col-sm-6"
outlined
label="ชื่อ-นามสกุล"
v-model="formCommand.elementaryFullName"
v-model="formCommand.commanderFullname"
@update:model-value="updateInput(formCommand)"
:rules="[(val) => !!val || `${'กรุณากรอกชื่อ-นามสกุล'}`]"
lazy-rules
/>
<q-input
ref="elementaryPositonRef"
ref="commanderPositionRef"
class="col-xs-12 col-sm-6"
dense
outlined
v-model="formCommand.elementaryPosition"
v-model="formCommand.commanderPosition"
@update:model-value="updateInput(formCommand)"
label="ตำแหน่ง"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง'}`]"
@ -552,22 +580,22 @@ onMounted(() => {
</div>
<div class="row col-12 q-col-gutter-md q-pa-sm">
<q-input
ref="abovelevelFullnameRef"
ref="commanderAboveFullnameRef"
dense
class="col-xs-12 col-sm-6"
outlined
v-model="formCommand.abovelevelFullname"
v-model="formCommand.commanderAboveFullname"
label="ชื่อ-นามสกุล"
:rules="[(val) => !!val || `${'กรุณากรอกชื่อ-นามสกุล'}`]"
lazy-rules
@update:model-value="updateInput(formCommand)"
/>
<q-input
ref="abovelevelPositionRef"
ref="commanderAbovePositionRef"
class="col-xs-12 col-sm-6"
dense
outlined
v-model="formCommand.abovelevelPosition"
v-model="formCommand.commanderAbovePosition"
label="ตำแหน่ง"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง'}`]"
lazy-rules

View file

@ -48,7 +48,7 @@ function onClickViewPDF(file: any) {
<q-tooltip> ไฟลเอกสาร </q-tooltip></q-btn
>
</div>
<div class="col-xs-12 col-sm-11 row">
<div class="col-xs-12 col-sm-10 row">
<q-file
v-model="fileEvaluation1"
class="col-12"
@ -63,7 +63,7 @@ function onClickViewPDF(file: any) {
</template>
</q-file>
</div>
<div class="col-1 self-center text-center">
<div class="col-2 self-center text-center q-pl-none">
<q-btn flat round dense color="primary" icon="mdi-upload"
><q-tooltip>ปโหลดไฟล</q-tooltip></q-btn
>