|
@@ -79,9 +79,6 @@
|
|
|
{{ info.contact.postNameCn }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <div class="float-right">
|
|
|
- <v-chip color="primary" label>{{ $t('position.currentOnline') }}</v-chip>
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
<v-divider class="my-3"></v-divider>
|
|
|
<div>
|
|
@@ -113,7 +110,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 简历上传 -->
|
|
|
- <input type="file" ref="fileInput" accept=".pdf, .doc, .docx" style="display: none;" @change="handleUploadFile"/>
|
|
|
+ <File ref="uploadFile" @success="handleUploadResume"></File>
|
|
|
|
|
|
<!-- 选择简历 -->
|
|
|
<selectResumeDialog v-model="showResume" :list="resumeList" @submit="handleSubmit" @close="handleClose"></selectResumeDialog>
|
|
@@ -150,8 +147,7 @@ defineOptions({ name: 'position-details' })
|
|
|
import { computed, ref } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { timesTampChange } from '@/utils/date'
|
|
|
-import { uploadFile } from '@/api/common'
|
|
|
-import { getPersonResumeCv } from '@/api/recruit/personal/resume'
|
|
|
+import { getPersonResumeCv, savePersonResumeCv } from '@/api/recruit/personal/resume'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
import { getPositionDetails, getSimilarPosition, getJobFavoriteCheck, getPersonJobFavorite, getPersonJobUnfavorite, jobCvRelCheckSend, jobCvRelSend } from '@/api/position'
|
|
|
import { dealDictObjData, dealDictArrayData } from '@/utils/position'
|
|
@@ -247,26 +243,13 @@ const handleCollection = async () => {
|
|
|
}
|
|
|
|
|
|
// 投递简历时,若当前用户没有简历列表则弹窗上传简历以及投递
|
|
|
-const typeList = ['pdf', 'doc', 'docx']
|
|
|
-const handleUploadFile = async (e) => {
|
|
|
- if (!e.target.files.length) return
|
|
|
- const file = e.target.files[0]
|
|
|
- const size = file.size
|
|
|
- if (size / (1024*1024) > 10) {
|
|
|
- Snackbar.warning(t('common.fileSizeExceed'))
|
|
|
- return
|
|
|
- }
|
|
|
- const arr = file.name.split('.')
|
|
|
- if (typeList.indexOf(arr[arr.length - 1]) < 0) {
|
|
|
- Snackbar.warning(t('common.fileFormatIncorrect'))
|
|
|
- return
|
|
|
- }
|
|
|
- const formData = new FormData()
|
|
|
- formData.append('file', file)
|
|
|
- const { data } = await uploadFile(formData)
|
|
|
- if (!data) return
|
|
|
-
|
|
|
- await jobCvRelSend({ jobId: id, title: arr[0], url: data, type: info.value.hire ? 1 : 0 })
|
|
|
+const uploadFile = ref()
|
|
|
+const handleUploadResume = async (url, title) => {
|
|
|
+ if (!url || !title) return
|
|
|
+ // 简历上传
|
|
|
+ await savePersonResumeCv({ title, url })
|
|
|
+ // 简历投递
|
|
|
+ await jobCvRelSend({ jobId: id, title, url, type: info.value.hire ? 1 : 0 })
|
|
|
setTimeout(() => {
|
|
|
Snackbar.success(t('resume.deliverySuccess'))
|
|
|
deliveryCheck()
|
|
@@ -274,8 +257,6 @@ const handleUploadFile = async (e) => {
|
|
|
}
|
|
|
|
|
|
const showResume = ref(false)
|
|
|
-const clicked = ref(false)
|
|
|
-const fileInput = ref()
|
|
|
|
|
|
// 效验是否有投递简历
|
|
|
const resumeList = ref([])
|
|
@@ -287,10 +268,7 @@ const handleDelivery = async () => {
|
|
|
// 没有上传过简历的先去上传
|
|
|
if (!result.length) {
|
|
|
Snackbar.warning('您还未上传过简历,请先上传简历')
|
|
|
- if (clicked.value) return
|
|
|
- clicked.value = true
|
|
|
- fileInput.value.click()
|
|
|
- clicked.value = false
|
|
|
+ uploadFile.value.trigger()
|
|
|
return
|
|
|
}
|
|
|
showResume.value = true
|