API evaluation
This commit is contained in:
parent
fc7b933cc6
commit
be33ef9186
7 changed files with 99 additions and 10 deletions
|
|
@ -1,3 +1,23 @@
|
||||||
import env from "../index";
|
import env from "../index";
|
||||||
|
|
||||||
export default {};
|
const evaluation = `${env.API_URI}/evaluation`;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
evaluationCheckStatus: () => `${evaluation}/check-status`,
|
||||||
|
evaluationCheckById: (id: string) => `${evaluation}/check/${id}`,
|
||||||
|
evaluationCheckspec: () => `${evaluation}/check-spec`,
|
||||||
|
evaluationCheckspecByid: (id: string) => `${evaluation}/check-spec/${id}`,
|
||||||
|
evaluationPerparedoc: (id: string, type: string) =>
|
||||||
|
`${evaluation}/perpare-doc-v1/${type}/${id}`,
|
||||||
|
evaluationCheckdoc: (id: string, type: string) =>
|
||||||
|
`${evaluation}/check-doc-v1/${type}/${id}`,
|
||||||
|
evaluationDoc1: (id: string, type: string) =>
|
||||||
|
`${evaluation}/doc1/${type}/${id}`,
|
||||||
|
evaluationCheckdocV1: (id: string) => `${evaluation}/check-doc-v1/${id}`,
|
||||||
|
evaluationPerparedocV2: (id: string) => `${evaluation}/perpare-doc-v2/${id}`,
|
||||||
|
evaluationPerparedocRejectV2: (id: string) =>
|
||||||
|
`${evaluation}/perpare-doc-v2/reject/${id}`,
|
||||||
|
evaluationWaitCheck: (id: string) => `${evaluation}/wait-check-doc-v2/${id}`,
|
||||||
|
evaluationDoc2: (id: string) => `${evaluation}/doc2/reject/${id}`,
|
||||||
|
evaluationHistory: (id: string) => `${evaluation}/step-history/${id}`,
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,20 @@ const store = useEvaluateStore();
|
||||||
>
|
>
|
||||||
</q-step>
|
</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>
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
<q-step
|
<q-step
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import evaluationFunctions from "@/modules/06_evaluate/stores/evaluationFunction";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
FormCommand,
|
FormCommand,
|
||||||
|
|
@ -29,10 +30,11 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const store = useEvaluateStore();
|
const store = useEvaluateStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm } = mixin;
|
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
|
||||||
|
const { fetchCheckStatus, saveEvaluation } = evaluationFunctions;
|
||||||
|
|
||||||
const externalLink =
|
const externalLink =
|
||||||
"https://accreditation.ocsc.go.th/accreditation/search/curriculum";
|
"https://accreditation.ocsc.go.th/accreditation/search/curriculum";
|
||||||
|
|
||||||
|
|
@ -136,7 +138,7 @@ async function validateStep2() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveStep1() {
|
async function saveStep1() {
|
||||||
console.log("Save 1");
|
saveEvaluation("test");
|
||||||
}
|
}
|
||||||
async function saveStep2() {
|
async function saveStep2() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
|
|
@ -187,8 +189,9 @@ function fetchMeeting() {
|
||||||
console.log("ประเมินชำนาญการ:meeting");
|
console.log("ประเมินชำนาญการ:meeting");
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
store.step = 1;
|
store.step = 1;
|
||||||
|
await fetchCheckStatus();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import evaluationFunctions from "@/modules/06_evaluate/stores/evaluationFunction";
|
||||||
|
|
||||||
import Stepper from "@/modules/06_evaluate/components/Stepper.vue";
|
import Stepper from "@/modules/06_evaluate/components/Stepper.vue";
|
||||||
import Step1 from "@/modules/06_evaluate/components/step/step1.vue";
|
import Step1 from "@/modules/06_evaluate/components/step/step1.vue";
|
||||||
|
|
@ -24,10 +25,11 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const store = useEvaluateStore();
|
const store = useEvaluateStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm } = mixin;
|
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
const { dialogConfirm } = mixin;
|
||||||
|
const { fetchCheckStatus, saveEvaluation } = evaluationFunctions;
|
||||||
|
|
||||||
function onCilckNextStep() {
|
function onCilckNextStep() {
|
||||||
store.step < 9 &&
|
store.step < 9 &&
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
|
|
@ -60,8 +62,9 @@ function fetchMeeting() {
|
||||||
console.log("ประเมินชำนาญการพิเศษ:meeting");
|
console.log("ประเมินชำนาญการพิเศษ:meeting");
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
store.step = 1;
|
store.step = 1;
|
||||||
|
await fetchCheckStatus();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ export const useEvaluateStore = defineStore("evaluateStore", () => {
|
||||||
|
|
||||||
const tabPanels = ref<string>("1");
|
const tabPanels = ref<string>("1");
|
||||||
|
|
||||||
|
const evaluateId = ref<string>("");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tabMenu,
|
tabMenu,
|
||||||
step,
|
step,
|
||||||
|
|
|
||||||
45
src/modules/06_evaluate/stores/evaluationFunction.ts
Normal file
45
src/modules/06_evaluate/stores/evaluationFunction.ts
Normal 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 };
|
||||||
|
|
@ -9,10 +9,16 @@ import Tab1 from "@/modules/06_evaluate/components/Tab1.vue"; // ชำนาญ
|
||||||
import Tab2 from "@/modules/06_evaluate/components/Tab2.vue"; // ชำนาญการพิเศษ
|
import Tab2 from "@/modules/06_evaluate/components/Tab2.vue"; // ชำนาญการพิเศษ
|
||||||
|
|
||||||
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
import { useEvaluateStore } from "@/modules/06_evaluate/store";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
const mixin = useCounterMixin();
|
||||||
const store = useEvaluateStore();
|
const store = useEvaluateStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
const { showLoader, hideLoader, messageError } = mixin;
|
||||||
|
|
||||||
|
onMounted(async () => {});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12 row justify-center">
|
<div class="col-12 row justify-center">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue