From 3b4df7e4c61c8152f7f81204b8c0fc960a893d32 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 26 Apr 2023 23:02:24 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=95=E0=B9=88=E0=B8=ADapi=E0=B9=82?= =?UTF-8?q?=E0=B8=AB=E0=B8=A5=E0=B8=94=E0=B9=83=E0=B8=9A=E0=B8=8A=E0=B8=B3?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/exam/api.candidate.ts | 3 ++- .../01_exam/components/ExamFinished.vue | 20 +++++++++++-------- .../01_exam/components/ExamPayment.vue | 14 +++++++++---- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/api/exam/api.candidate.ts b/src/api/exam/api.candidate.ts index b3b8f8c..3d87e38 100644 --- a/src/api/exam/api.candidate.ts +++ b/src/api/exam/api.candidate.ts @@ -34,5 +34,6 @@ export default { `${periodExam}position/${examId}/${positionId}`, periodExamPayment: (examId: string) => `${periodExam}payment/${examId}`, candidateCard: (examId: string, positionId: string) => `${candidate}card/${examId}/${positionId}`, - candidate + candidate, + candidateBill: (examId: string, positionId: string) => `${candidate}bill/${examId}/${positionId}` } diff --git a/src/modules/01_exam/components/ExamFinished.vue b/src/modules/01_exam/components/ExamFinished.vue index 9f1d5aa..524dffd 100644 --- a/src/modules/01_exam/components/ExamFinished.vue +++ b/src/modules/01_exam/components/ExamFinished.vue @@ -167,12 +167,12 @@ const fullName = ref('') const examNumber = ref('') const citizenId = ref('') const examSeat = ref('') -const scoreBFull = ref(0) -const scoreB = ref(0) -const scoreCFull = ref(0) -const scoreC = ref(0) -const scoreSumFull = ref(0) -const scoreSum = ref(0) +const scoreBFull = ref(null) +const scoreB = ref(null) +const scoreCFull = ref(null) +const scoreC = ref(null) +const scoreSumFull = ref(null) +const scoreSum = ref(null) const examResultinscore = ref('') const avatar = ref('') @@ -194,8 +194,12 @@ const fetchStatus = async () => { scoreB.value = data.pointB scoreCFull.value = data.pointTotalC scoreC.value = data.pointC - scoreSumFull.value = parseInt(data.pointB) + parseInt(data.pointC) - scoreSum.value = parseInt(data.pointB) + parseInt(data.pointC) + scoreSumFull.value = + data.pointTotalB == null || data.pointTotalC + ? null + : parseInt(data.pointTotalB) + parseInt(data.pointTotalC) + scoreSum.value = + data.pointB == null || data.pointC ? null : parseInt(data.pointB) + parseInt(data.pointC) scoreC.value = data.pointC examResultinscore.value = data.pass avatar.value = data.avatar diff --git a/src/modules/01_exam/components/ExamPayment.vue b/src/modules/01_exam/components/ExamPayment.vue index 28cf55b..a079495 100644 --- a/src/modules/01_exam/components/ExamPayment.vue +++ b/src/modules/01_exam/components/ExamPayment.vue @@ -342,10 +342,16 @@ const uploadImage = async (file: any) => { } } -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' - ) +const downloadBillPayment = async () => { + loader.value = true + await http + .get(config.API.candidateBill(examId.value, positionId.value)) + .then((res) => { + const data = res.data.result + window.open(data) + }) + .catch(() => {}) + .finally(async () => {}) }