API ประเมิน step 1-4

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-21 17:51:13 +07:00
parent d305b753bf
commit 0e5d15dc7c
12 changed files with 444 additions and 191 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, onUnmounted } from "vue";
import { useQuasar } from "quasar";
import evaluationFunctions from "@/modules/06_evaluate/stores/evaluationFunction";
@ -47,6 +47,7 @@ const props = defineProps({
const externalLink =
"https://accreditation.ocsc.go.th/accreditation/search/curriculum";
const formDetail = ref<any>();
const formSpec = reactive<FormSpec>({
isEducationalQft: false, //
isGovermantServiceHtr: false, //
@ -114,7 +115,7 @@ async function onCilckNextStep() {
$q,
() => {
functionCreateDoc?.();
store.step++;
// store.step++;
},
"ยืนยันการดำเนินการ",
"ต้องการยืนยันการดำเนินการต่อใช่หรือไม่?"
@ -134,7 +135,7 @@ async function onCilckprPeviousStep(type: string) {
}
async function saveStep1() {
saveEvaluation(formSpec);
saveEvaluation(formSpec, formDetail.value);
}
async function updateCheckSpec(data: FormSpec) {
@ -147,6 +148,10 @@ async function updateCheckSpec(data: FormSpec) {
formSpec.isHaveMinPeriodOrHoldPos = data.isHaveMinPeriodOrHoldPos;
}
function updateFormDetail(data: any) {
formDetail.value = data;
}
async function saveStep2() {
dialogConfirm(
$q,
@ -159,8 +164,6 @@ async function saveStep2() {
}
function updateformCommand(val: any, ref: any) {
console.log(ref);
formCommand.commanderFullname = val.commanderFullname;
formCommand.commanderPosition = val.commanderPosition;
formCommand.commanderAboveFullname = val.commanderAboveFullname;
@ -196,9 +199,16 @@ async function validateStep2() {
}
}
const pdfSrc = ref<any>();
async function saveStep3() {
nextCheckDoc("approve");
}
async function updateFilePDF(url: any) {
console.log(url);
pdfSrc.value = url;
}
async function saveStep4() {
console.log("Save 4");
}
@ -320,7 +330,11 @@ onMounted(async () => {
@update:form="updateformCommand"
:evaluateId="store.evaluateId"
/>
<Step3 v-if="store.step === 3" />
<Step3
v-if="store.step === 3"
@update:file="updateFilePDF"
:evaluateId="store.evaluateId"
/>
<Step4 v-if="store.step === 4" />
<Step5 v-if="store.step === 5" />
<Step6
@ -340,8 +354,11 @@ onMounted(async () => {
>
<q-card flat bordered class="col-12">
<q-card-section>
<ViewStep1 v-if="store.step === 1" />
<ViewStep3 v-if="store.step === 3" />
<ViewStep1
v-if="store.step === 1"
@update:formDeital="updateFormDetail"
/>
<ViewStep3 v-if="store.step === 3 && pdfSrc" :pdfSrc="pdfSrc" />
<ViewStep7 v-if="store.step === 7" /> </q-card-section
></q-card>
</div>