diff --git a/src/api/evaluate/api.evaluate.ts b/src/api/evaluate/api.evaluate.ts index 61df36e..a07f63d 100644 --- a/src/api/evaluate/api.evaluate.ts +++ b/src/api/evaluate/api.evaluate.ts @@ -4,20 +4,25 @@ const evaluation = `${env.API_URI}/evaluation`; export default { evaluationCheckStatus: () => `${evaluation}/check-status`, + evaluationCheckStep: (id: string) => `${evaluation}/check/${id}`, 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}`, + evaluationPreparedoc: (id: string, type: string) => + `${evaluation}/prepare-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) => + evaluationPreparedocV2: (id: string) => `${evaluation}/perpare-doc-v2/${id}`, + evaluationPreparedocRejectV2: (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}`, + + /**document */ + loadPathDocument: (val: string, id: string) => + `${env.API_URI}/document/${val}/${id}`, }; diff --git a/src/modules/06_evaluate/components/Stepper.vue b/src/modules/06_evaluate/components/Stepper.vue index 81f3b12..7f339dd 100644 --- a/src/modules/06_evaluate/components/Stepper.vue +++ b/src/modules/06_evaluate/components/Stepper.vue @@ -14,13 +14,15 @@ const store = useEvaluateStore(); flat ref="stepper" :bordered="false" + header-nav > @@ -28,7 +30,8 @@ const store = useEvaluateStore(); :name="2" prefix="2" title="จัดเตรียมเอกสารเล่ม 1" - :done="store.step > 2" + :done="store.currentStep >= 2" + :disable="store.currentStep < 2" > @@ -36,7 +39,8 @@ const store = useEvaluateStore(); :name="3" prefix="3" title="ตรวจสอบเอกสารเล่ม 1" - :done="store.step > 3" + :done="store.currentStep >= 3" + :disable="store.currentStep < 3" > @@ -44,7 +48,8 @@ const store = useEvaluateStore(); :name="4" prefix="4" title="รอตรวจสอบคุณสมบัติ" - :done="store.step > 4" + :done="store.currentStep >= 4" + :disable="store.currentStep < 4" > @@ -52,7 +57,8 @@ const store = useEvaluateStore(); :name="5" prefix="5" title="ประกาศบนเว็บไซต์" - :done="store.step > 5" + :done="store.currentStep >= 5" + :disable="store.currentStep < 5" > @@ -60,7 +66,8 @@ const store = useEvaluateStore(); :name="6" prefix="6" title="จัดเตรียมเอกสารเล่ม 2" - :done="store.step > 6" + :done="store.currentStep >= 6" + :disable="store.currentStep < 6" > @@ -68,14 +75,27 @@ const store = useEvaluateStore(); :name="7" prefix="7" title="ตรวจสอบเอกสารเล่ม 2" - :done="store.step > 7" + :done="store.currentStep >= 7" + :disable="store.currentStep < 7" > - + - + diff --git a/src/modules/06_evaluate/components/Tab1.vue b/src/modules/06_evaluate/components/Tab1.vue index c0e22a9..19c9289 100644 --- a/src/modules/06_evaluate/components/Tab1.vue +++ b/src/modules/06_evaluate/components/Tab1.vue @@ -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({ - elementaryFullName: "", - elementaryPosition: "", - abovelevelFullname: "", - abovelevelPosition: "", +const formSpec = reactive({ + isEducationalQft: false, // คุณวุฒิการศึกษา + isGovermantServiceHtr: false, // ประวัติการรับราชการ + isOperatingExp: false, // ประสบการณ์ในการปฏิบัติงาน + isMinPeriodOfTenure: false, // ระยะเวลาขั้นต่ำในการดำรงตำแหน่งในสายงานที่ขอเข้ารับการคัดเลือก + isHaveSpecificQft: false, // มีคุณสมบัติตรงตามคุณสมบัติเฉพาะสำหรับตำแหน่งที่กำหนด ในมาตราฐานกำหนดตำแหน่ง + isHaveProLicense: false, // มีใบอนุญาตประกอบวิชาชีพของสายงานต่างๆ + isHaveMinPeriodOrHoldPos: false, // มีระยะเวลาขั้นต่ำในการดำรงตำแหน่งหรือเคยดำรงตำแหน่งในสายงานที่จะคัดเลือกตามคุณวุฒิของบุคคลและระดับตำแหน่งที่จะคัดเลือก }); -const elementaryFullNameRef = ref(null); -const elementaryPositonRef = ref(null); -const abovelevelFullnameRef = ref(null); -const abovelevelPositionRef = ref(null); +const formCommand = reactive({ + commanderFullname: "", + commanderPosition: "", + commanderAboveFullname: "", + commanderAbovePosition: "", +}); + +const commanderFullnameRef = ref(null); +const commanderPositionRef = ref(null); +const commanderAboveFullnameRef = ref(null); +const commanderAbovePositionRef = ref(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 () => {