From 8f5b673595333a8e1b8758fa40f60f6a839d8345 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Sat, 23 Dec 2023 21:54:37 +0700 Subject: [PATCH] updated --- src/modules/06_evaluate/components/Tab1.vue | 25 +++-- .../06_evaluate/components/step/step1.vue | 18 +++- .../06_evaluate/components/step/step6.vue | 48 +++++++--- .../06_evaluate/components/step/step8.vue | 94 ++++++++----------- 4 files changed, 104 insertions(+), 81 deletions(-) diff --git a/src/modules/06_evaluate/components/Tab1.vue b/src/modules/06_evaluate/components/Tab1.vue index 3b62673..940ac49 100644 --- a/src/modules/06_evaluate/components/Tab1.vue +++ b/src/modules/06_evaluate/components/Tab1.vue @@ -108,8 +108,6 @@ async function onCilckNextStep() { ? await saveStep4 : store.step === 5 ? await saveStep5 - : store.step === 5 - ? await saveStep5 : store.step === 7 ? await saveStep7 : store.step === 8 @@ -117,6 +115,7 @@ async function onCilckNextStep() { : store.step === 9 ? await saveStep9 : null; + store.step === 2 || store.step === 6 ? validateStep2() : store.step == 3 || store.step == 7 @@ -139,17 +138,17 @@ async function onCilckNextStep() { ); } -async function onCilckprPeviousStep(type: string) { - store.step < 9 && - dialogConfirm( - $q, - async () => { - store.step--; - }, - "ยืนยันการย้อนกลับ", - "ต้องการย้อนกลับใช่หรือไม่?" - ); -} +// async function onCilckprPeviousStep(type: string) { +// store.step < 9 && +// dialogConfirm( +// $q, +// async () => { +// store.step--; +// }, +// "ยืนยันการย้อนกลับ", +// "ต้องการย้อนกลับใช่หรือไม่?" +// ); +// } async function saveStep1() { showLoader(); diff --git a/src/modules/06_evaluate/components/step/step1.vue b/src/modules/06_evaluate/components/step/step1.vue index 1742760..6f21134 100644 --- a/src/modules/06_evaluate/components/step/step1.vue +++ b/src/modules/06_evaluate/components/step/step1.vue @@ -18,7 +18,7 @@ const props = defineProps({ evaluateId: { type: String, }, - educations: Array + educations: Array, }); const modal = ref(false); @@ -62,7 +62,7 @@ async function fetchCheckSpec(id: string) { function openModal(status: boolean) { modal.value = true; - show.value = status + show.value = status; } function closeModal() { @@ -81,6 +81,7 @@ onMounted(() => { { { { { { { { - + diff --git a/src/modules/06_evaluate/components/step/step6.vue b/src/modules/06_evaluate/components/step/step6.vue index c043ad2..9bbb100 100644 --- a/src/modules/06_evaluate/components/step/step6.vue +++ b/src/modules/06_evaluate/components/step/step6.vue @@ -122,15 +122,15 @@ async function fetcheSigner(id: string) { formCommand.commanderAboveFullname = data.commanderAboveFullnameDoc2; formCommand.commanderAbovePosition = data.commanderAbovePositionDoc2; }) - .catch((err) => { - messageError($q, err); - }) + // .catch((err) => { + // messageError($q, err); + // }) .finally(() => { hideLoader(); }); } -const dateStartPrepareDoc2 = ref(date2Thai(new Date())); +// const dateStartPrepareDoc2 = ref(date2Thai(new Date())); const dateEndPrepareDoc2 = ref(date2Thai(new Date())); async function fetchCheckDate() { @@ -140,12 +140,12 @@ async function fetchCheckDate() { .then((res) => { const data = res.data.result; // dateStartPrepareDoc2.value = date2Thai(data.dateStartPrepareDoc2); - const endDate = new Date(data.dateStartAnnounce); - endDate.setDate(endDate.getDate() + 210); + const endDate = new Date(data.dateEndAnnounce); + endDate.setDate(endDate.getDate() + 180); dateEndPrepareDoc2.value = date2Thai(endDate); - dateEndPrepareDoc2.value = data.dateEndPrepareDoc2 - ? date2Thai(data.dateEndPrepareDoc2) - : dateEndPrepareDoc2.value; + // dateEndPrepareDoc2.value = data.dateEndPrepareDoc2 + // ? date2Thai(data.dateEndPrepareDoc2) + // : dateEndPrepareDoc2.value; }) .catch((err) => {})); } @@ -165,6 +165,28 @@ onMounted(async () => { emit("update:form", formCommand, ref); // props.evaluateId && (await fetchPathUpload("เล่ม 2", props.evaluateId)); }); + +const downloadUrl = ref(""); +function checkDoc() { + showLoader(); + http + .get( + config.API.loadFileDocument("เล่ม 2", store.evaluateId, "1-เอกสารเล่ม 2") + ) + .then((res: any) => { + downloadUrl.value = res.data.downloadUrl; + }) + // .catch((e) => { + // messageError($q, e); + // }) + .finally(() => { + hideLoader(); + }); +} + +onMounted(() => { + checkDoc(); +});