API evaluation

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-19 10:56:51 +07:00
parent fc7b933cc6
commit be33ef9186
7 changed files with 99 additions and 10 deletions

View file

@ -24,10 +24,20 @@ const store = useEvaluateStore();
>
</q-step>
<q-step :name="2" prefix="2" title="จัดเตรียมเอกสาร" :done="store.step > 2">
<q-step
:name="2"
prefix="2"
title="จัดเตรียมเอกสารเล่ม 1"
:done="store.step > 2"
>
</q-step>
<q-step :name="3" prefix="3" title="ตรวจสอบเอกสาร" :done="store.step > 3">
<q-step
:name="3"
prefix="3"
title="ตรวจสอบเอกสารเล่ม 1"
:done="store.step > 3"
>
</q-step>
<q-step

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
import { useQuasar } from "quasar";
import evaluationFunctions from "@/modules/06_evaluate/stores/evaluationFunction";
import type {
FormCommand,
@ -29,10 +30,11 @@ import { useCounterMixin } from "@/stores/mixin";
const store = useEvaluateStore();
const mixin = useCounterMixin();
const { dialogConfirm } = mixin;
const $q = useQuasar();
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
const { fetchCheckStatus, saveEvaluation } = evaluationFunctions;
const externalLink =
"https://accreditation.ocsc.go.th/accreditation/search/curriculum";
@ -136,7 +138,7 @@ async function validateStep2() {
}
async function saveStep1() {
console.log("Save 1");
saveEvaluation("test");
}
async function saveStep2() {
dialogConfirm(
@ -187,8 +189,9 @@ function fetchMeeting() {
console.log("ประเมินชำนาญการ:meeting");
}
onMounted(() => {
onMounted(async () => {
store.step = 1;
await fetchCheckStatus();
});
</script>

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import evaluationFunctions from "@/modules/06_evaluate/stores/evaluationFunction";
import Stepper from "@/modules/06_evaluate/components/Stepper.vue";
import Step1 from "@/modules/06_evaluate/components/step/step1.vue";
@ -24,10 +25,11 @@ import { useCounterMixin } from "@/stores/mixin";
const store = useEvaluateStore();
const mixin = useCounterMixin();
const { dialogConfirm } = mixin;
const $q = useQuasar();
const { dialogConfirm } = mixin;
const { fetchCheckStatus, saveEvaluation } = evaluationFunctions;
function onCilckNextStep() {
store.step < 9 &&
dialogConfirm($q, () => {
@ -60,8 +62,9 @@ function fetchMeeting() {
console.log("ประเมินชำนาญการพิเศษ:meeting");
}
onMounted(() => {
onMounted(async () => {
store.step = 1;
await fetchCheckStatus();
});
</script>

View file

@ -18,6 +18,8 @@ export const useEvaluateStore = defineStore("evaluateStore", () => {
const tabPanels = ref<string>("1");
const evaluateId = ref<string>("");
return {
tabMenu,
step,

View file

@ -0,0 +1,45 @@
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useEvaluateStore } from "@/modules/06_evaluate/store";
const stroe = useEvaluateStore();
const mixin = useCounterMixin();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = mixin;
async function fetchCheckStatus() {
console.log(stroe.tabMenu);
showLoader();
await http
.get(config.API.evaluationCheckStatus())
.then((res) => {
console.log(res);
// stroe.tabMenu === 1 ? stroe.evaluateId = 1 : stroe.evaluateId = 2
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
async function saveEvaluation(body: any) {
console.log(body);
// try {
// showLoader();
// const res = await http.post(config.API.evaluationCheckspec(), body);
// return res;
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
}
export default { fetchCheckStatus, saveEvaluation };

View file

@ -9,10 +9,16 @@ import Tab1 from "@/modules/06_evaluate/components/Tab1.vue"; // ชำนาญ
import Tab2 from "@/modules/06_evaluate/components/Tab2.vue"; //
import { useEvaluateStore } from "@/modules/06_evaluate/store";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin();
const store = useEvaluateStore();
const router = useRouter();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = mixin;
onMounted(async () => {});
</script>
<template>
<div class="col-12 row justify-center">