diff --git a/src/api/evaluate/api.evaluate.ts b/src/api/evaluate/api.evaluate.ts index 7261793..82d7a66 100644 --- a/src/api/evaluate/api.evaluate.ts +++ b/src/api/evaluate/api.evaluate.ts @@ -15,13 +15,19 @@ export default { evaluationDoc1: (id: string, type: string) => `${evaluation}/doc1/${type}/${id}`, evaluationCheckdocV1: (id: string) => `${evaluation}/check-doc-v1/${id}`, - evaluationPreparedocV2: (id: string) => `${evaluation}/perpare-doc-v2/${id}`, + evaluationPreparedocV2: (id: string) => + `${evaluation}/prepare-doc-v2/approve/${id}`, evaluationPreparedocRejectV2: (id: string) => - `${evaluation}/perpare-doc-v2/reject/${id}`, + `${evaluation}/prepare-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}`, evaluationDetail: () => `${env.API_URI}/profile/keycloak`, + evaluationSignerDoc1: (id: string) => `${evaluation}/doc1-signer/${id}`, + evaluationSignerDoc2: (id: string) => `${evaluation}/doc2-signer/${id}`, + evaluationDirectorMeetring: (id: string) => + `${evaluation}/director-meeting/${id}`, + evaluationCheckDate: (id: string) => `${evaluation}/check-date/${id}`, /**document */ loadPathDocument: (val: string, id: string) => diff --git a/src/modules/06_evaluate/components/Tab1.vue b/src/modules/06_evaluate/components/Tab1.vue index 5ef151e..83a1c03 100644 --- a/src/modules/06_evaluate/components/Tab1.vue +++ b/src/modules/06_evaluate/components/Tab1.vue @@ -35,13 +35,22 @@ const mixin = useCounterMixin(); const $q = useQuasar(); const { dialogConfirm, showLoader, hideLoader, messageError } = mixin; -const { fetchCheckStatus, saveEvaluation, nextPrapare, nextCheckDoc } = - evaluationFunctions; +const { + fetchCheckStatus, + saveEvaluation, + nextPrapare, + nextCheckDoc, + nextCheckDoc2, + nextPrepareDoc2, +} = evaluationFunctions; const props = defineProps({ title: { type: String, }, + step: { + type: Number, + }, }); const externalLink = @@ -164,6 +173,8 @@ async function saveStep2() { } function updateformCommand(val: any, ref: any) { + console.log(ref); + formCommand.commanderFullname = val.commanderFullname; formCommand.commanderPosition = val.commanderPosition; formCommand.commanderAboveFullname = val.commanderAboveFullname; @@ -193,7 +204,7 @@ async function validateStep2() { } } if (hasError.every((result) => result === true)) { - saveStep2(); + store.step === 2 ? saveStep2() : saveStep6(); } else { console.log("ไม่ผ่าน"); } @@ -204,9 +215,8 @@ async function saveStep3() { nextCheckDoc("approve"); } async function updateFilePDF(url: any) { - console.log(url); - pdfSrc.value = url; + console.log(url); } async function saveStep4() { @@ -216,10 +226,11 @@ async function saveStep5() { console.log("Save 5"); } async function saveStep6() { - console.log("Save 6"); + nextCheckDoc2(formCommand); } async function saveStep7() { - console.log("Save 7"); + console.log("777777"); + nextPrepareDoc2(); } async function saveStep8() { console.log("Save 8"); @@ -336,14 +347,18 @@ onMounted(async () => { :evaluateId="store.evaluateId" /> - + - - + + @@ -359,7 +374,10 @@ onMounted(async () => { @update:formDeital="updateFormDetail" /> - diff --git a/src/modules/06_evaluate/components/step/step2.vue b/src/modules/06_evaluate/components/step/step2.vue index 02fb27b..e054b28 100644 --- a/src/modules/06_evaluate/components/step/step2.vue +++ b/src/modules/06_evaluate/components/step/step2.vue @@ -17,7 +17,7 @@ const $q = useQuasar(); const store = useEvaluateStore(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError } = mixin; +const { showLoader, hideLoader, messageError, success } = mixin; const fullName = ref( keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : "" @@ -124,8 +124,8 @@ async function fetchPathUpload( file: any ) { const body = { - fileList: type, - replace: true, + fileList: { fileName: type, metadata: {} }, + // "1-แบบพิจารณาคุณสมบัติบุคคล", // "2-แบบแสดงรายละเอียดการเสนอผลงาน", // "3-แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล (เอกสารแบบ ก.)", @@ -162,11 +162,30 @@ async function uploadfile(uploadUrl: string, file: any) { "Content-Type": file.type, }, }) - .then((res) => { - console.log(res); + .then(() => { + success($q, "อัปโหลไฟล์สำเร็จ"); }) .catch((err) => { - console.log(err); + messageError($q, err); + }); +} + +async function fetcheSigner(id: string) { + showLoader(); + await http + .get(config.API.evaluationSignerDoc1(id)) + .then((res) => { + const data = res.data.result; + formCommand.commanderFullname = data.commanderFullname; + formCommand.commanderPosition = data.commanderPosition; + formCommand.commanderAboveFullname = data.commanderAboveFullname; + formCommand.commanderAbovePosition = data.commanderAbovePosition; + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); }); } @@ -183,6 +202,9 @@ onMounted(async () => { fileEvaluation5Ref: fileEvaluation5Ref.value, fileEvaluation6Ref: fileEvaluation6Ref.value, }; + if (store.currentStep > 2) { + fetcheSigner(store.evaluateId); + } emit("update:form", formCommand, ref); }); diff --git a/src/modules/06_evaluate/components/step/step3.vue b/src/modules/06_evaluate/components/step/step3.vue index 4cb2732..6f4439b 100644 --- a/src/modules/06_evaluate/components/step/step3.vue +++ b/src/modules/06_evaluate/components/step/step3.vue @@ -1,5 +1,5 @@