diff --git a/src/modules/01_exam/components/ExamFinished.vue b/src/modules/01_exam/components/ExamFinished.vue index 81e53f9..8dae2b9 100644 --- a/src/modules/01_exam/components/ExamFinished.vue +++ b/src/modules/01_exam/components/ExamFinished.vue @@ -81,8 +81,16 @@ + @@ -119,6 +127,7 @@ const examNumber = ref('') const citizenId = ref('') const examSeat = ref('') const point = ref('') +const avatar = ref('') onMounted(async () => { await fetchStatus() @@ -135,6 +144,7 @@ const fetchStatus = async () => { citizenId.value = data.citizenId examSeat.value = data.seatNumber point.value = data.point + avatar.value = data.avatar }) .catch(() => { // acceptTermOfUse.value = false diff --git a/src/modules/01_exam/components/ExamPayment.vue b/src/modules/01_exam/components/ExamPayment.vue index 4e78d08..a0cfeb0 100644 --- a/src/modules/01_exam/components/ExamPayment.vue +++ b/src/modules/01_exam/components/ExamPayment.vue @@ -182,17 +182,14 @@
หลักฐานชำระเงิน
- - + @@ -251,7 +248,6 @@ const mixin = useCounterMixin() //เรียกฟังก์ชันกล const { success, modalError } = mixin const rejectMessage = ref('') const img = ref('') -const fileData = ref() const loader = ref(false) const route = useRoute() const examId = ref(route.params.id.toString()) @@ -259,21 +255,12 @@ const positionId = ref(route.params.positionId.toString()) const bank = ref([]) const fee = ref() const filePayment = ref([]) -const fileDataUpload = ref() onMounted(async () => { await fetchPaymentExam() await fetchData() }) -const uploadImg = (file: any) => { - fileData.value = null - // img.value = - // 'https://s359.kapook.com/r/600/auto/pagebuilder/ba154685-db18-4ac7-b318-a4a2b15b9d4c.jpg' - img.value = - 'https://www.bangkokbank.com/-/media/feature/page-content/bbl-corporate/image-carousel-slides/digital-banking/bualuang-mbanking/how-to-use/payment/others/7_en.png' -} - const fetchPaymentExam = async () => { loader.value = true await http @@ -306,13 +293,8 @@ const fetchData = async () => { const clickPayment = async () => { if (filePayment.value.length > 0) { - const blob = filePayment.value.slice(0, filePayment.value[0].size) - const newFile = new File(blob, filePayment.value[0].name, { - type: filePayment.value[0].type - }) - fileDataUpload.value = newFile const formData = new FormData() - formData.append('', fileDataUpload.value) + formData.append('', filePayment.value[0]) loader.value = true await http .put(config.API.candidatePayment(examId.value, positionId.value), formData) @@ -330,65 +312,14 @@ const clickPayment = async () => { } } -const downloadBillPayment = () => { - window.open( - 'https://s3.frappet.com/bma-recruit/%E0%B9%83%E0%B8%9A%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B9%80%E0%B8%87%E0%B8%B4%E0%B8%99.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=XYM5279XMEH7PWU0HX7W%2F20230409%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230409T141409Z&X-Amz-Expires=604800&X-Amz-Security-Token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJYWU01Mjc5WE1FSDdQV1UwSFg3VyIsImV4cCI6MzYwMDAwMDAwMDAwMCwicG9saWN5IjoiY29uc29sZUFkbWluIn0.-zazJEG9fdsNDqP9x20--Id8fZz02SbAJPifcjIWrXaudwfSym0zfB3iCVaFKy5fHH9u1NLcq6RIjrloozO8JA&X-Amz-SignedHeaders=host&versionId=null&X-Amz-Signature=11c2d786029e2153cd89154654b84d12f5d0eae2d9b0e6d8e3189c4097e3eb15' - ) +const uploadImage = async (e: any) => { + filePayment.value = e } -const getClass = (val: string) => { - switch (val) { - case 'checkPayment': - return 'bg-yellow-3' - case 'rejectPayment': - return 'bg-red-2' - case 'checkSeat': - return 'bg-light-green-3' - case 'checkPoint': - return 'bg-light-green-3' - case 'done': - return 'bg-light-green-3' - default: - return 'bg-light-blue-1' - } -} -const message = (val: string) => { - switch (val) { - case 'checkRegister': - return 'รอการตรวจสอบข้อมูลสมัคร' - case 'checkPayment': - return 'รอการตรวจสอบหลักฐานการชำระเงิน' - case 'rejectPayment': - return 'หลักฐานการชำระเงินผิดพลาด' - case 'checkSeat': - return 'ตรวจสอบเเล้ว' - case 'checkPoint': - return 'ตรวจสอบเเล้ว' - case 'done': - return 'ตรวจสอบเเล้ว' - case 'waiver': - return 'สละสิทธิ์สอบ' - default: - return 'รออัปโหลดหลักฐานชำระเงิน' - } -} -const getFontColor = (val: string) => { - switch (val) { - case 'checkRegister': - return 'text-blue' - case 'checkPayment': - return 'text-orange' - case 'rejectPayment': - return 'text-red-12' - case 'checkSeat': - return 'text-green' - case 'checkPoint': - return 'text-green' - case 'done': - return 'text-green' - default: - return 'text-blue' - } +const downloadBillPayment = () => { + window.open( + 'https://s3.frappet.com/bma-recruit/%E0%B9%83%E0%B8%9A%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B9%80%E0%B8%87%E0%B8%B4%E0%B8%99.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=V0TKBKKQ2OV5YZVEUQJS%2F20230420%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230420T032557Z&X-Amz-Expires=604800&X-Amz-Security-Token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJWMFRLQktLUTJPVjVZWlZFVVFKUyIsImV4cCI6MzYwMDAwMDAwMDAwMCwicG9saWN5IjoiY29uc29sZUFkbWluIn0.gkdVQGNzcczXj9MgKIkpr7zyl84ycTWJgdEsCAFQcbGh5O1dyG79UFnmb04s6MiMiQs9zuKDpB8YZu4YDF9tBw&X-Amz-SignedHeaders=host&versionId=null&X-Amz-Signature=b59c8af76859716785678b933bb55c8afa7936110a64d95a7b85431e31442c2e' + ) } diff --git a/src/modules/01_exam/components/Form/Education.vue b/src/modules/01_exam/components/Form/Education.vue index 3320986..96a7e50 100644 --- a/src/modules/01_exam/components/Form/Education.vue +++ b/src/modules/01_exam/components/Form/Education.vue @@ -305,8 +305,8 @@ const fetchData = async () => { data.map((r: ResponseObject) => { rows.value.push({ ...r, - educationLevelId: r.educationLevel.id, - educationLevel: r.educationLevel.name, + educationLevelId: r.educationLevelId, + educationLevel: r.educationLevelName, duration: [r.durationStart, r.durationEnd] }) }) @@ -465,7 +465,7 @@ const saveData = async () => { durationEnd: dateToISO(new Date(duration.value[1])) }) .then(() => { - success($q, 'บันทึกข้อมูลร่างสำเร็จ') + success($q, 'บันทึกข้อมูลสำเร็จ') }) .catch(() => { // modalError.value = true @@ -487,7 +487,7 @@ const saveData = async () => { const editData = async () => { loader.value = true await http - .put(config.API.candidateEducation(id.value,""), { + .put(config.API.candidateEducation(id.value, ''), { educationLevelId: educationLevelId.value, major: major.value, scores: scores.value, @@ -496,7 +496,7 @@ const editData = async () => { durationEnd: dateToISO(new Date(duration.value[1])) }) .then(() => { - success($q, 'บันทึกข้อมูลร่างสำเร็จ') + success($q, 'บันทึกข้อมูลสำเร็จ') }) .catch(() => { // modalError.value = true diff --git a/src/modules/01_exam/components/Form/Information.vue b/src/modules/01_exam/components/Form/Information.vue index 0f05c63..b832edc 100644 --- a/src/modules/01_exam/components/Form/Information.vue +++ b/src/modules/01_exam/components/Form/Information.vue @@ -324,9 +324,9 @@
- + - บันทึกรูป - + -->
{ }) } -const clickProfile = async () => { - if (fileProfile.value.length > 0) { - const blob = fileProfile.value.slice(0, fileProfile.value[0].size) - const newFile = new File(blob, fileProfile.value[0].name, { - type: fileProfile.value[0].type - }) - fileDataUpload.value = newFile +// const clickProfile = async () => { +// if (fileProfile.value.length > 0) { +// const blob = fileProfile.value.slice(0, fileProfile.value[0].size) +// const newFile = new File(blob, fileProfile.value[0].name, { +// type: fileProfile.value[0].type +// }) +// fileDataUpload.value = newFile +// const formData = new FormData() +// formData.append('', fileDataUpload.value) +// loader.value = true +// await http +// .put(config.API.candidateProfile(examId.value, positionId.value), formData) +// .then(() => { +// success($q, 'อัพโหลดรูปสำเร็จ') +// }) +// .catch(() => {}) +// .finally(async () => { +// loader.value = false +// await fetchData() +// await fetchImgData() +// fileProfile.value = [] +// }) +// } else { +// modalError($q, 'ไม่สามารถอัพโหลดไฟล์ได้', 'กรุณาเลือกไฟล์ที่ต้องการอัพโหลด') +// } +// } + +const uploadImage = async (e: any) => { + let input = e.target.files + if (input.length > 0) { const formData = new FormData() - formData.append('', fileDataUpload.value) - loader.value = true + formData.append('', input[0]) + // loaderPage(true); await http .put(config.API.candidateProfile(examId.value, positionId.value), formData) - .then(() => { - success($q, 'ส่งหลักฐานชำระเงินสำเร็จ') + .then((res) => { + success($q, 'อัพโหลดรูปสำเร็จ') }) - .catch(() => {}) + .catch((e) => {}) .finally(async () => { loader.value = false await fetchData() await fetchImgData() fileProfile.value = [] }) - } else { - modalError($q, 'ไม่สามารถอัพโหลดไฟล์ได้', 'กรุณาเลือกไฟล์ที่ต้องการอัพโหลด') + return } } diff --git a/src/modules/01_exam/interface/response/Education.ts b/src/modules/01_exam/interface/response/Education.ts index 0236497..dd5f1e9 100644 --- a/src/modules/01_exam/interface/response/Education.ts +++ b/src/modules/01_exam/interface/response/Education.ts @@ -5,6 +5,8 @@ interface ResponseObject { id: string name: string } + educationLevelId: string + educationLevelName: string major: string scores: number | null name: string