ประเมินผล

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

@ -4,6 +4,7 @@ import { useQuasar } from "quasar";
import evaluationFunctions from "@/modules/06_evaluate/stores/evaluationFunction";
import type {
FormSpec,
FormCommand,
FormCommandRef,
} from "@/modules/06_evaluate/interface/evalute";
@ -33,28 +34,45 @@ const mixin = useCounterMixin();
const $q = useQuasar();
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
const { fetchCheckStatus, saveEvaluation } = evaluationFunctions;
const { fetchCheckStatus, saveEvaluation, nextPrapare, nextCheckDoc } =
evaluationFunctions;
const props = defineProps({
title: {
type: String,
},
});
const externalLink =
"https://accreditation.ocsc.go.th/accreditation/search/curriculum";
const formCommand = reactive<FormCommand>({
elementaryFullName: "",
elementaryPosition: "",
abovelevelFullname: "",
abovelevelPosition: "",
const formSpec = reactive<FormSpec>({
isEducationalQft: false, //
isGovermantServiceHtr: false, //
isOperatingExp: false, //
isMinPeriodOfTenure: false, //
isHaveSpecificQft: false, //
isHaveProLicense: false, //
isHaveMinPeriodOrHoldPos: false, //
});
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 formCommand = reactive<FormCommand>({
commanderFullname: "",
commanderPosition: "",
commanderAboveFullname: "",
commanderAbovePosition: "",
});
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 formCommandRef: FormCommandRef = {
elementaryFullName: elementaryFullNameRef,
elementaryPosition: elementaryPositonRef,
abovelevelFullname: abovelevelFullnameRef,
abovelevelPosition: abovelevelPositionRef,
commanderFullname: commanderFullnameRef,
commanderPosition: commanderPositionRef,
commanderAboveFullname: commanderAboveFullnameRef,
commanderAbovePosition: commanderAbovePositionRef,
};
async function onCilckNextStep() {
@ -90,16 +108,13 @@ async function onCilckNextStep() {
"ยืนยันการดำเนินการ",
"ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?"
);
// functionCreateDoc?.();
// store.step < 9 &&
}
function onCilckprPeviousStep() {
store.step > 1 &&
async function onCilckprPeviousStep(type: string) {
store.step < 9 &&
dialogConfirm(
$q,
() => {
async () => {
store.step--;
},
"ยืนยันการย้อนกลับ",
@ -107,16 +122,41 @@ function onCilckprPeviousStep() {
);
}
function updateformCommand(val: any, ref: any) {
formCommand.elementaryFullName = val.elementaryFullName;
formCommand.elementaryPosition = val.elementaryPosition;
formCommand.abovelevelFullname = val.abovelevelFullname;
formCommand.abovelevelPosition = val.abovelevelPosition;
async function saveStep1() {
saveEvaluation(formSpec);
}
elementaryFullNameRef.value = ref.elementaryFullNameRef;
elementaryPositonRef.value = ref.elementaryPositonRef;
abovelevelFullnameRef.value = ref.abovelevelFullnameRef;
abovelevelPositionRef.value = ref.abovelevelPositionRef;
async function updateCheckSpec(data: FormSpec) {
formSpec.isEducationalQft = data.isEducationalQft;
formSpec.isGovermantServiceHtr = data.isGovermantServiceHtr;
formSpec.isOperatingExp = data.isOperatingExp;
formSpec.isMinPeriodOfTenure = data.isMinPeriodOfTenure;
formSpec.isHaveSpecificQft = data.isHaveSpecificQft;
formSpec.isHaveProLicense = data.isHaveProLicense;
formSpec.isHaveMinPeriodOrHoldPos = data.isHaveMinPeriodOrHoldPos;
}
async function saveStep2() {
dialogConfirm(
$q,
() => {
nextPrapare("approve", formCommand);
},
"ยืนยันการดำเนินการ",
"ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?"
);
}
function updateformCommand(val: any, ref: any) {
formCommand.commanderFullname = val.commanderFullname;
formCommand.commanderPosition = val.commanderPosition;
formCommand.commanderAboveFullname = val.commanderAboveFullname;
formCommand.commanderAbovePosition = val.commanderAbovePosition;
commanderFullnameRef.value = ref.commanderFullnameRef;
commanderPositionRef.value = ref.commanderPositionRef;
commanderAboveFullnameRef.value = ref.commanderAboveFullnameRef;
commanderAbovePositionRef.value = ref.commanderAbovePositionRef;
}
async function validateStep2() {
@ -137,21 +177,8 @@ async function validateStep2() {
}
}
async function saveStep1() {
saveEvaluation("test");
}
async function saveStep2() {
dialogConfirm(
$q,
() => {
store.step++;
},
"ยืนยันการดำเนินการ",
"ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?"
);
}
async function saveStep3() {
console.log("Save 3");
nextCheckDoc("approve");
}
async function saveStep4() {
console.log("Save 4");
@ -198,7 +225,7 @@ onMounted(async () => {
<template>
<div class="row q-col-gutter-md">
<div class="col-xs-12 col-sm-3">
<div class="toptitle">ประเมนชำนาญการ</div>
<div class="toptitle">{{ props.title }}</div>
<Stepper />
<div class="text-center">
@ -216,7 +243,7 @@ onMounted(async () => {
<div class="col-12 row">
<div class="col-9">
<div class="toptitle">
{{ store.step }}.{{ store.titel[store.step - 1] }}
{{ store.step }}.{{ store.title[store.step - 1] }}
</div>
</div>
<div class="col-3 text-right">
@ -233,7 +260,7 @@ onMounted(async () => {
</div>
</div>
<div class="row q-col-gutter-md col-12">
<div class="row q-col-gutter-md col-12" v-if="store.showLoadStatus">
<div
:class="
store.step === 2 ||
@ -248,8 +275,16 @@ onMounted(async () => {
>
<q-card flat bordered class="col-12 q-pa-md">
<q-card-section>
<Step1 v-if="store.step === 1" />
<Step2 v-if="store.step === 2" @update:form="updateformCommand" />
<Step1
v-if="store.step === 1"
@update:spec="updateCheckSpec"
:evaluateId="store.evaluateId"
/>
<Step2
v-if="store.step === 2"
@update:form="updateformCommand"
:evaluateId="store.evaluateId"
/>
<Step3 v-if="store.step === 3" />
<Step4 v-if="store.step === 4" />
<Step5 v-if="store.step === 5" />
@ -273,15 +308,16 @@ onMounted(async () => {
</div>
</div>
<div class="q-mt-md q-gutter-md" align="right">
<q-btn
<!-- <q-btn
v-if="store.step !== 1"
unelevated
outline
label="ย้อนกลับ"
color="public"
@click="onCilckprPeviousStep"
/>
@click="onCilckprPeviousStep('reject')"
/> -->
<q-btn
v-if="store.step !== 4"
unelevated
label="ดำเนินการต่อ"
color="public"