|
@@ -113,7 +113,9 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 弹窗提示去上传简历 -->
|
|
|
- <promptToUpload v-model="dialog" @handleToUpload="handleToUpload"></promptToUpload>
|
|
|
+ <!-- <promptToUpload v-model="dialog" @handleToUpload="handleToUpload"></promptToUpload> -->
|
|
|
+ <input type="file" ref="fileInput" accept=".pdf, .doc, .docx" style="display: none;" @change="handleUploadFile"/>
|
|
|
+
|
|
|
<!-- 选择简历 -->
|
|
|
<selectResumeDialog v-model="showResume" :list="resumeList" @submit="handleSubmit" @close="handleClose"></selectResumeDialog>
|
|
|
<!-- 复制分享链接 -->
|
|
@@ -149,6 +151,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 { useI18n } from '@/hooks/web/useI18n'
|
|
|
import { getPositionDetails, getSimilarPosition, getJobFavoriteCheck, getPersonJobFavorite, getPersonJobUnfavorite, jobCvRelCheckSend, jobCvRelSend } from '@/api/position'
|
|
@@ -157,7 +160,7 @@ import similarPositions from '@/components/Position/similarPositions.vue'
|
|
|
import EnterpriseInfo from '@/components/Enterprise/info.vue'
|
|
|
import Snackbar from '@/plugins/snackbar'
|
|
|
import Dialog from '@/components/CtDialog'
|
|
|
-import promptToUpload from './jobDetails/promptToUpload'
|
|
|
+// import promptToUpload from './jobDetails/promptToUpload'
|
|
|
import selectResumeDialog from './jobDetails/selectResumeDialog'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
import { prologue } from '@/hooks/web/useIM'
|
|
@@ -247,14 +250,37 @@ const handleCollection = async () => {
|
|
|
await getCollectionStatus()
|
|
|
}
|
|
|
|
|
|
-const dialog = ref(false)
|
|
|
-const showResume = ref(false)
|
|
|
-// 去上传附件
|
|
|
-const handleToUpload = () => {
|
|
|
- dialog.value = false
|
|
|
- window.open('/recruit/personal/personalCenter')
|
|
|
+// 投递简历时,若当前用户没有简历列表则弹窗上传简历以及投递
|
|
|
+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 })
|
|
|
+ setTimeout(() => {
|
|
|
+ Snackbar.success(t('resume.deliverySuccess'))
|
|
|
+ deliveryCheck()
|
|
|
+ }, 3000)
|
|
|
}
|
|
|
|
|
|
+const showResume = ref(false)
|
|
|
+const clicked = ref(false)
|
|
|
+const fileInput = ref()
|
|
|
+
|
|
|
// 效验是否有投递简历
|
|
|
const resumeList = ref([])
|
|
|
const selectResume = ref()
|
|
@@ -264,7 +290,11 @@ const handleDelivery = async () => {
|
|
|
resumeList.value = result
|
|
|
// 没有上传过简历的先去上传
|
|
|
if (!result.length) {
|
|
|
- dialog.value = true
|
|
|
+ Snackbar.warning('您还未上传过简历,请先上传简历')
|
|
|
+ if (clicked.value) return
|
|
|
+ clicked.value = true
|
|
|
+ fileInput.value.click()
|
|
|
+ clicked.value = false
|
|
|
return
|
|
|
}
|
|
|
showResume.value = true
|