diff --git a/src/modules/01_exam/components/ExamFinished.vue b/src/modules/01_exam/components/ExamFinished.vue
index 8dae2b9..9f1d5aa 100644
--- a/src/modules/01_exam/components/ExamFinished.vue
+++ b/src/modules/01_exam/components/ExamFinished.vue
@@ -66,8 +66,49 @@
{{ examSeat }}
-
คะแนน
-
{{ point }}
+
+
ผลการสอบ
+
+
ประเภท
+
คะแนนเต็ม
+
คะแนนที่ได้
+
+
+
ภาค ข
+
+ {{ scoreBFull }}
+
+
+ {{ scoreB }}
+
+
คะแนน
+
+
ภาค ค
+
+ {{ scoreCFull }}
+
+
+ {{ scoreC }}
+
+
คะแนน
+
+
รวมทั้งหมด
+
+ {{ scoreSumFull }}
+
+
+ {{ scoreSum }}
+
+
คะแนน
+
+
ผลการสอบ
+
+ {{
+ examResultinscore
+ }}
+
+
@@ -292,12 +299,12 @@ const fetchData = async () => {
}
const clickPayment = async () => {
- if (filePayment.value.length > 0) {
+ if (img.value != null || img.value != '') {
const formData = new FormData()
formData.append('', filePayment.value[0])
loader.value = true
await http
- .put(config.API.candidatePayment(examId.value, positionId.value), formData)
+ .post(config.API.candidatePayment(examId.value, positionId.value))
.then(() => {
success($q, 'ส่งหลักฐานชำระเงินสำเร็จ')
})
@@ -308,12 +315,31 @@ const clickPayment = async () => {
filePayment.value = []
})
} else {
- modalError($q, 'ไม่สามารถอัพโหลดไฟล์ได้', 'กรุณาเลือกไฟล์ที่ต้องการอัพโหลด')
+ modalError($q, 'ไม่สามารถยืนยันการชำระเงินได้', 'กรุณาอัปโหลดเอกสารหลักฐานชำระเงิน')
}
}
-const uploadImage = async (e: any) => {
- filePayment.value = e
+const uploadImage = async (file: any) => {
+ let input = file.target.files
+ if (input.length > 0) {
+ const formData = new FormData()
+ formData.append('', input[0])
+ 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()
+ await fetchData()
+ file = []
+ })
+ } else {
+ modalError($q, 'ไม่สามารถอัพโหลดไฟล์ได้', 'กรุณาเลือกไฟล์ที่ต้องการอัพโหลด')
+ }
}
const downloadBillPayment = () => {
diff --git a/src/modules/01_exam/components/Form/Career.vue b/src/modules/01_exam/components/Form/Career.vue
index 14183ce..03343a0 100644
--- a/src/modules/01_exam/components/Form/Career.vue
+++ b/src/modules/01_exam/components/Form/Career.vue
@@ -71,6 +71,7 @@
:rules="[(val) => !!val || `${'กรุณากรอกสถานที่ทำงาน/ฝึกงาน'}`]"
:label="`${'สถานที่ทำงาน/ฝึกงาน'}`"
@update:modelValue="clickEditRow"
+ hide-bottom-space
/>
@@ -85,6 +86,7 @@
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/ลักษณะงาน'}`]"
:label="`${'ตำแหน่ง/ลักษณะงาน'}`"
@update:modelValue="clickEditRow"
+ hide-bottom-space
/>
@@ -100,6 +102,7 @@
:label="`${'เงินเดือนสุดท้ายก่อนออก'}`"
@update:modelValue="clickEditRow"
type="number"
+ hide-bottom-space
/>
@@ -127,6 +130,7 @@
lazy-rules
:borderless="!edit"
:model-value="dateThaiRange(duration)"
+ hide-bottom-space
>
@@ -384,7 +389,7 @@ const clickDeleteRow = async () => {
if (rawItem.value != null) {
loader.value = true
await http
- .delete(config.API.candidateCareer(rawItem.value.id,""))
+ .delete(config.API.candidateCareer(rawItem.value.id, ''))
.then(() => {
success($q, 'ลบข้อมูลสำเร็จ')
})
@@ -461,7 +466,7 @@ const saveData = async () => {
const editData = async () => {
loader.value = true
await http
- .put(config.API.candidateCareer(id.value,""), {
+ .put(config.API.candidateCareer(id.value, ''), {
name: location.value,
position: position.value,
salary: salary.value,
diff --git a/src/modules/01_exam/components/Form/Document.vue b/src/modules/01_exam/components/Form/Document.vue
index 873097c..c0f2235 100644
--- a/src/modules/01_exam/components/Form/Document.vue
+++ b/src/modules/01_exam/components/Form/Document.vue
@@ -9,8 +9,9 @@
"
icon="mdi-file-document"
:addData="true"
- :editOnly="true"
+ :editOnly="false"
:editData="status == 'register' || status == 'rejectRegister'"
+ :save="uploadData"
/>
@@ -35,9 +36,8 @@
class="full-width"
text-color="dark"
:max-size="10000000"
- accept=".jpg,.png,.pdf,.csv,.doc"
bordered
- label="[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]"
+ label="[ไฟล์ขนาดไม่เกิน 10MB]"
@added="fileAdd"
>
@@ -81,7 +81,7 @@
เลือกไฟล์
-
อัพโหลดไฟล์
-
+ -->
ยกเลิกการอัปโหลด
@@ -163,14 +163,16 @@ const loader = ref(false)
const edit = ref(props.status == 'register' || props.status == 'rejectRegister')
const name = ref('')
const files = ref([])
+const file = ref([])
const emit = defineEmits(['update:loader'])
onMounted(async () => {
await getData()
})
-const fileAdd = async (file: any) => {
- name.value = file[0].name
+const fileAdd = async (val: any) => {
+ name.value = val[0].name
+ file.value = val
}
const getData = async () => {
@@ -206,14 +208,15 @@ const deleteData = async (id: string) => {
})
}
-const uploadData = async (file: File[]) => {
- loader.value = true
- const blob = file.slice(0, file[0].size)
+const uploadData = async () => {
+ console.log('asdasd')
+ const blob = file.value.slice(0, file.value[0].size)
const newFile = new File(blob, name.value, {
- type: file[0].type
+ type: file.value[0].type
})
const formData = new FormData()
formData.append('', newFile)
+ loader.value = true
await http
.put(config.API.candidateUpload(examId.value, positionId.value), formData)
.then((res) => {
@@ -223,9 +226,7 @@ const uploadData = async (file: File[]) => {
.finally(async () => {
loader.value = false
name.value = ''
- setTimeout(() => {
- uploader.value.reset()
- }, 100)
+ uploader.value.reset()
await getData()
})
}
diff --git a/src/modules/01_exam/components/Form/Education.vue b/src/modules/01_exam/components/Form/Education.vue
index 96a7e50..f274de6 100644
--- a/src/modules/01_exam/components/Form/Education.vue
+++ b/src/modules/01_exam/components/Form/Education.vue
@@ -73,6 +73,7 @@
option-label="name"
:options="educationLevelOptions"
option-value="id"
+ hide-bottom-space
/>
@@ -87,6 +88,7 @@
:rules="[(val) => !!val || `${'กรุณากรอกสาขาวิชา/วิชาเอก'}`]"
:label="`${'สาขาวิชา/วิชาเอก'}`"
@update:modelValue="clickEditRow"
+ hide-bottom-space
/>
@@ -102,6 +104,7 @@
:rules="[(val) => !!val || `${'กรุณากรอกคะแนนเฉลี่ยตลอดหลักสูตร'}`]"
:label="`${'คะแนนเฉลี่ยตลอดหลักสูตร'}`"
@update:modelValue="clickEditRow"
+ hide-bottom-space
/>
@@ -116,6 +119,7 @@
:rules="[(val) => !!val || `${'กรุณากรอกชื่อสถานศึกษา'}`]"
:label="`${'ชื่อสถานศึกษา'}`"
@update:modelValue="clickEditRow"
+ hide-bottom-space
/>
@@ -143,6 +147,7 @@
lazy-rules
:borderless="!edit"
:model-value="dateThaiRange(duration)"
+ hide-bottom-space
>