แก้บัคแสดงข้อมูลการศึกษา
This commit is contained in:
parent
afae9edf5f
commit
9b9432f779
5 changed files with 70 additions and 105 deletions
|
|
@ -81,8 +81,16 @@
|
||||||
|
|
||||||
<q-card-section class="col-4 flex flex-center">
|
<q-card-section class="col-4 flex flex-center">
|
||||||
<q-img
|
<q-img
|
||||||
|
v-if="avatar == ''"
|
||||||
class="rounded-borders"
|
class="rounded-borders"
|
||||||
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8cGVyc29ufGVufDB8fDB8fA%3D%3D&w=1000&q=80"
|
src="@/assets/avatar_user.jpg"
|
||||||
|
:ratio="1"
|
||||||
|
style="max-width: 300px; max-height: 300px"
|
||||||
|
/>
|
||||||
|
<q-img
|
||||||
|
v-else
|
||||||
|
class="rounded-borders"
|
||||||
|
:src="avatar"
|
||||||
:ratio="1"
|
:ratio="1"
|
||||||
style="max-width: 300px; max-height: 300px"
|
style="max-width: 300px; max-height: 300px"
|
||||||
/>
|
/>
|
||||||
|
|
@ -119,6 +127,7 @@ const examNumber = ref<string>('')
|
||||||
const citizenId = ref<string>('')
|
const citizenId = ref<string>('')
|
||||||
const examSeat = ref<string>('')
|
const examSeat = ref<string>('')
|
||||||
const point = ref<string>('')
|
const point = ref<string>('')
|
||||||
|
const avatar = ref<string>('')
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchStatus()
|
await fetchStatus()
|
||||||
|
|
@ -135,6 +144,7 @@ const fetchStatus = async () => {
|
||||||
citizenId.value = data.citizenId
|
citizenId.value = data.citizenId
|
||||||
examSeat.value = data.seatNumber
|
examSeat.value = data.seatNumber
|
||||||
point.value = data.point
|
point.value = data.point
|
||||||
|
avatar.value = data.avatar
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// acceptTermOfUse.value = false
|
// acceptTermOfUse.value = false
|
||||||
|
|
|
||||||
|
|
@ -182,17 +182,14 @@
|
||||||
<div class="absolute-bottom text-center">หลักฐานชำระเงิน</div>
|
<div class="absolute-bottom text-center">หลักฐานชำระเงิน</div>
|
||||||
</q-img>
|
</q-img>
|
||||||
</label>
|
</label>
|
||||||
<!-- <input
|
<input
|
||||||
id="file-upload"
|
id="file-upload"
|
||||||
type="file"
|
type="file"
|
||||||
v-if="status == 'payment' || status == 'rejectPayment'"
|
v-if="status == 'payment' || status == 'rejectPayment'"
|
||||||
@update:model-value="
|
accept="image/*"
|
||||||
(val) => {
|
@change="uploadImage"
|
||||||
file = val[0]
|
/>
|
||||||
}
|
<!-- <q-file
|
||||||
"
|
|
||||||
/> -->
|
|
||||||
<q-file
|
|
||||||
id="file-upload"
|
id="file-upload"
|
||||||
v-model="filePayment"
|
v-model="filePayment"
|
||||||
dense
|
dense
|
||||||
|
|
@ -206,7 +203,7 @@
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" />
|
<q-icon name="attach_file" />
|
||||||
</template>
|
</template>
|
||||||
</q-file>
|
</q-file> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -251,7 +248,6 @@ const mixin = useCounterMixin() //เรียกฟังก์ชันกล
|
||||||
const { success, modalError } = mixin
|
const { success, modalError } = mixin
|
||||||
const rejectMessage = ref<string>('')
|
const rejectMessage = ref<string>('')
|
||||||
const img = ref<string>('')
|
const img = ref<string>('')
|
||||||
const fileData = ref<any>()
|
|
||||||
const loader = ref<boolean>(false)
|
const loader = ref<boolean>(false)
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const examId = ref<string>(route.params.id.toString())
|
const examId = ref<string>(route.params.id.toString())
|
||||||
|
|
@ -259,21 +255,12 @@ const positionId = ref<string>(route.params.positionId.toString())
|
||||||
const bank = ref<any>([])
|
const bank = ref<any>([])
|
||||||
const fee = ref<number>()
|
const fee = ref<number>()
|
||||||
const filePayment = ref<File[]>([])
|
const filePayment = ref<File[]>([])
|
||||||
const fileDataUpload = ref<File>()
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchPaymentExam()
|
await fetchPaymentExam()
|
||||||
await fetchData()
|
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 () => {
|
const fetchPaymentExam = async () => {
|
||||||
loader.value = true
|
loader.value = true
|
||||||
await http
|
await http
|
||||||
|
|
@ -306,13 +293,8 @@ const fetchData = async () => {
|
||||||
|
|
||||||
const clickPayment = async () => {
|
const clickPayment = async () => {
|
||||||
if (filePayment.value.length > 0) {
|
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()
|
const formData = new FormData()
|
||||||
formData.append('', fileDataUpload.value)
|
formData.append('', filePayment.value[0])
|
||||||
loader.value = true
|
loader.value = true
|
||||||
await http
|
await http
|
||||||
.put(config.API.candidatePayment(examId.value, positionId.value), formData)
|
.put(config.API.candidatePayment(examId.value, positionId.value), formData)
|
||||||
|
|
@ -330,65 +312,14 @@ const clickPayment = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const downloadBillPayment = () => {
|
const uploadImage = async (e: any) => {
|
||||||
window.open(
|
filePayment.value = e
|
||||||
'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 getClass = (val: string) => {
|
const downloadBillPayment = () => {
|
||||||
switch (val) {
|
window.open(
|
||||||
case 'checkPayment':
|
'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'
|
||||||
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'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -305,8 +305,8 @@ const fetchData = async () => {
|
||||||
data.map((r: ResponseObject) => {
|
data.map((r: ResponseObject) => {
|
||||||
rows.value.push({
|
rows.value.push({
|
||||||
...r,
|
...r,
|
||||||
educationLevelId: r.educationLevel.id,
|
educationLevelId: r.educationLevelId,
|
||||||
educationLevel: r.educationLevel.name,
|
educationLevel: r.educationLevelName,
|
||||||
duration: [r.durationStart, r.durationEnd]
|
duration: [r.durationStart, r.durationEnd]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -465,7 +465,7 @@ const saveData = async () => {
|
||||||
durationEnd: dateToISO(new Date(duration.value[1]))
|
durationEnd: dateToISO(new Date(duration.value[1]))
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, 'บันทึกข้อมูลร่างสำเร็จ')
|
success($q, 'บันทึกข้อมูลสำเร็จ')
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// modalError.value = true
|
// modalError.value = true
|
||||||
|
|
@ -487,7 +487,7 @@ const saveData = async () => {
|
||||||
const editData = async () => {
|
const editData = async () => {
|
||||||
loader.value = true
|
loader.value = true
|
||||||
await http
|
await http
|
||||||
.put(config.API.candidateEducation(id.value,""), {
|
.put(config.API.candidateEducation(id.value, ''), {
|
||||||
educationLevelId: educationLevelId.value,
|
educationLevelId: educationLevelId.value,
|
||||||
major: major.value,
|
major: major.value,
|
||||||
scores: scores.value,
|
scores: scores.value,
|
||||||
|
|
@ -496,7 +496,7 @@ const editData = async () => {
|
||||||
durationEnd: dateToISO(new Date(duration.value[1]))
|
durationEnd: dateToISO(new Date(duration.value[1]))
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, 'บันทึกข้อมูลร่างสำเร็จ')
|
success($q, 'บันทึกข้อมูลสำเร็จ')
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// modalError.value = true
|
// modalError.value = true
|
||||||
|
|
|
||||||
|
|
@ -324,9 +324,9 @@
|
||||||
</div>
|
</div>
|
||||||
</q-img>
|
</q-img>
|
||||||
</label>
|
</label>
|
||||||
<!-- <input id="file-upload" type="file" /> -->
|
<input id="file-upload" type="file" accept="image/*" @change="uploadImage" />
|
||||||
</div>
|
</div>
|
||||||
<q-file
|
<!-- <q-file
|
||||||
id="file-upload"
|
id="file-upload"
|
||||||
v-model="fileProfile"
|
v-model="fileProfile"
|
||||||
dense
|
dense
|
||||||
|
|
@ -345,7 +345,7 @@
|
||||||
<q-btn outline dense color="black" icon="mdi-content-save-outline" @click="clickProfile">
|
<q-btn outline dense color="black" icon="mdi-content-save-outline" @click="clickProfile">
|
||||||
<q-tooltip content-class="bg-grey-2 text-black">บันทึกรูป</q-tooltip>
|
<q-tooltip content-class="bg-grey-2 text-black">บันทึกรูป</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-9 col-md-12">
|
<div class="col-xs-12 col-sm-9 col-md-12">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -481,30 +481,52 @@ const fetchImgData = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const clickProfile = async () => {
|
// const clickProfile = async () => {
|
||||||
if (fileProfile.value.length > 0) {
|
// if (fileProfile.value.length > 0) {
|
||||||
const blob = fileProfile.value.slice(0, fileProfile.value[0].size)
|
// const blob = fileProfile.value.slice(0, fileProfile.value[0].size)
|
||||||
const newFile = new File(blob, fileProfile.value[0].name, {
|
// const newFile = new File(blob, fileProfile.value[0].name, {
|
||||||
type: fileProfile.value[0].type
|
// type: fileProfile.value[0].type
|
||||||
})
|
// })
|
||||||
fileDataUpload.value = newFile
|
// 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()
|
const formData = new FormData()
|
||||||
formData.append('', fileDataUpload.value)
|
formData.append('', input[0])
|
||||||
loader.value = true
|
// loaderPage(true);
|
||||||
await http
|
await http
|
||||||
.put(config.API.candidateProfile(examId.value, positionId.value), formData)
|
.put(config.API.candidateProfile(examId.value, positionId.value), formData)
|
||||||
.then(() => {
|
.then((res) => {
|
||||||
success($q, 'ส่งหลักฐานชำระเงินสำเร็จ')
|
success($q, 'อัพโหลดรูปสำเร็จ')
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch((e) => {})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
loader.value = false
|
loader.value = false
|
||||||
await fetchData()
|
await fetchData()
|
||||||
await fetchImgData()
|
await fetchImgData()
|
||||||
fileProfile.value = []
|
fileProfile.value = []
|
||||||
})
|
})
|
||||||
} else {
|
return
|
||||||
modalError($q, 'ไม่สามารถอัพโหลดไฟล์ได้', 'กรุณาเลือกไฟล์ที่ต้องการอัพโหลด')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ interface ResponseObject {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
educationLevelId: string
|
||||||
|
educationLevelName: string
|
||||||
major: string
|
major: string
|
||||||
scores: number | null
|
scores: number | null
|
||||||
name: string
|
name: string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue