diff --git a/src/modules/01_exam/components/ExamPayment.vue b/src/modules/01_exam/components/ExamPayment.vue index 7cd7284..85a313e 100644 --- a/src/modules/01_exam/components/ExamPayment.vue +++ b/src/modules/01_exam/components/ExamPayment.vue @@ -86,11 +86,31 @@
หลักฐานชำระเงิน
- + @update:model-value=" + (val) => { + file = val[0] + } + " + /> --> + + + @@ -106,7 +126,9 @@ โอนเงินผ่านทางเครื่อง ATM / เคาน์เตอร์ธนาคาร - อนุมัติทันทีหลังชำระ + อนุมัติหลังแจ้งการโอนภายใน 24 ชั่วโมง + +
หลักฐานชำระเงิน
+
+ + + + + - - -
ธนาคารกรุงไทย
-
สอดบัตร ATM กดรหัสและเลือกรายการ
- + @@ -207,6 +271,8 @@ const route = useRoute() const examId = ref(route.params.id.toString()) const positionId = ref(route.params.positionId.toString()) const bank = ref([]) +const filePayment = ref([]) +const fileDataUpload = ref() onMounted(async () => { await fetchPaymentExam() @@ -236,17 +302,29 @@ const fetchPaymentExam = async () => { } const clickPayment = async () => { - loader.value = true - await http - .put(config.API.candidatePayment(examId.value, positionId.value)) - .then(() => { - success($q, 'ส่งหลักฐานชำระเงินสำเร็จ') - }) - .catch(() => {}) - .finally(async () => { - loader.value = false - props.fetchStep() + 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) + loader.value = true + await http + .put(config.API.candidatePayment(examId.value, positionId.value), formData) + .then(() => { + success($q, 'ส่งหลักฐานชำระเงินสำเร็จ') + }) + .catch(() => {}) + .finally(async () => { + loader.value = false + props.fetchStep() + filePayment.value = [] + }) + } else { + modalError($q, 'ไม่สามารถอัพโหลดไฟล์ได้', 'กรุณาเลือกไฟล์ที่ต้องการอัพโหลด') + } } const getClass = (val: string) => { @@ -279,6 +357,8 @@ const message = (val: string) => { return 'ตรวจสอบเเล้ว' case 'done': return 'ตรวจสอบเเล้ว' + case 'waiver': + return 'สละสิทธิ์สอบ' default: return 'รออัปโหลดหลักฐานชำระเงิน' } diff --git a/src/modules/01_exam/views/ExamDetail.vue b/src/modules/01_exam/views/ExamDetail.vue index 66efe32..339bf6b 100644 --- a/src/modules/01_exam/views/ExamDetail.vue +++ b/src/modules/01_exam/views/ExamDetail.vue @@ -29,6 +29,7 @@ :name="3" title="ชำระค่าธรรมเนียม" :icon="stepRaw >= 3 ? (stepRaw == 3 ? 'mdi-pencil' : 'mdi-check-bold') : 'mdi-receipt'" + v-if="stepPayment" > @@ -80,6 +81,7 @@ const positionId = ref(route.params.positionId.toString()) const loader = ref(false) const status = ref('register') const modalConsend = ref(false) +const stepPayment = ref(true) onMounted(async () => { // stepRaw.value = 3 @@ -96,6 +98,14 @@ const candidateCheck = async () => { const data = res.data.result store.consend = data.consend const positionExam = data.positionExam + stepPayment.value = data.bank + // console.log('qwe') + // console.log(positionId.value != '00000000-0000-0000-0000-000000000000') + // console.log(positionId.value) + // console.log(positionExam) + // console.log(positionExam.id) + // console.log(data.status != 'register') + // console.log(data.status != 'rejectRegister') if ( positionId.value != '00000000-0000-0000-0000-000000000000' && positionExam.id != positionId.value && @@ -134,8 +144,8 @@ const fetchStep = async () => { stepRaw.value = 2 step.value = 2 } else if (data == 'checkRegister') { - stepRaw.value = 3 - step.value = 3 + stepRaw.value = 2 + step.value = 2 } else if (data == 'payment') { stepRaw.value = 3 step.value = 3 diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index 7158c92..dbbd8c4 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -384,6 +384,8 @@ export const useCounterMixin = defineStore('mixin', () => { return 'รอเจ้าหน้าที่สรุปคะแนนสอบ' case 'done': return 'สอบคัดเลือกสำเร็จ' + case 'waiver': + return 'สละสิทธิ์สอบ' default: return '-' } diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index f1daf81..706b6e3 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -106,7 +106,7 @@ const fetchStatus = async () => { - + {{ statusCandidate(status) }}