details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <div>
  3. <div class="default-width banner px-6">
  4. <div class="banner-title">
  5. <h1 class="ellipsis">{{ info.name }}</h1>
  6. <span class="salary">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
  7. <span class="refresh-time">{{ timesTampChange(info.updateTime) }} {{ $t('common.refresh') }} <v-icon color="warning" size="20">mdi-alert-outline</v-icon></span>
  8. </div>
  9. <div class="banner-tags mt-4">
  10. <span v-for="k in desc" :key="k.mdi" class="mr-10">
  11. <v-icon color="var(--color-666)" size="20">{{ k.mdi }}</v-icon>
  12. <span class="ml-1">{{ positionInfo[k.value] }}</span>
  13. </span>
  14. </div>
  15. <div class="banner-tools my-4">
  16. <v-chip size="small" label v-for="(k, i) in info.tagList" :key="i" class="mr-1" color="primary">{{ k }}</v-chip>
  17. </div>
  18. <div class="d-flex justify-end mb-5">
  19. <div class="banner-tools-btns">
  20. <v-btn
  21. class="radius mr-2 button-item"
  22. variant="outlined"
  23. color="error"
  24. prepend-icon="mdi-share-outline"
  25. style="height: 36px;"
  26. @click="handleShare"
  27. >分享有礼</v-btn>
  28. <v-btn
  29. class="button-item radius"
  30. color="warning"
  31. variant="outlined"
  32. :prepend-icon="isCollection ? 'mdi-heart' : 'mdi-heart-outline'"
  33. @click="handleCollection"
  34. >{{ isCollection ? $t('position.cancelFavorite') : $t('position.collection') }}</v-btn>
  35. <v-btn class="button-item mx-2 radius" color="success" variant="outlined">{{ $t('position.communicate') }}</v-btn>
  36. <v-btn class="button-item radius" :disabled="delivery" color="primary" variant="outlined" @click="handleDelivery">{{ delivery ? $t('position.delivered') : $t('position.submitResume') }}</v-btn>
  37. </div>
  38. </div>
  39. <v-divider></v-divider>
  40. <div class="d-flex">
  41. <div class="content-left">
  42. <div v-if="Object.keys(info).length">
  43. <div>{{ $t('position.jobResponsibilities') }}:</div>
  44. <div class="requirement" v-html="info.content.replace(/\n/g, '</br>')"></div>
  45. <div class="mt-3">{{ $t('position.jobRequirements') }}:</div>
  46. <div class="requirement" v-html="info.requirement.replace(/\n/g, '</br>')"></div>
  47. </div>
  48. <v-divider class="my-3"></v-divider>
  49. <div class="contact" v-if="Object.keys(info).length">
  50. <div class="float-left d-flex align-center">
  51. <v-img :src="info.contact.avatar || 'https://minio.citupro.com/dev/menduner/7.png'" :width="45" style="height: 45px;"></v-img>
  52. <div class="ml-2">
  53. <div class="contact-name">{{ info.contact.name }}</div>
  54. <div class="contact-info">{{ info.enterprise.name }} · {{ info.contact.postNameCn }}</div>
  55. </div>
  56. </div>
  57. <div class="float-right">
  58. <v-chip color="primary" label>{{ $t('position.currentOnline') }}</v-chip>
  59. </div>
  60. </div>
  61. <v-divider class="my-3"></v-divider>
  62. <div>
  63. <h4>{{ $t('position.address') }}</h4>
  64. <div class="mt-1">
  65. <v-icon size="25" color="primary">mdi-map-marker</v-icon>
  66. <span style="color: var(--color-666);font-size: 15px;">{{ info.address }}</span>
  67. </div>
  68. </div>
  69. <div class="mt-3 text-center">
  70. <v-btn class="mr-2 radius button-item" color="success" variant="outlined">{{ $t('position.communicate') }}</v-btn>
  71. <v-btn class="radius button-item" :disabled="delivery" color="primary" @click="handleDelivery">{{ delivery ? $t('position.delivered') : $t('position.submitResume') }}</v-btn>
  72. </div>
  73. </div>
  74. <div class="content-right" v-if="Object.keys(info).length">
  75. <!-- 公司信息 -->
  76. <EnterpriseInfo :info="{ ...info, position: { ...positionInfo } }"></EnterpriseInfo>
  77. <!-- 相似职位 -->
  78. <similarPositions v-if="similarList.length" class="mt-3" :list="similarList" :info="info"></similarPositions>
  79. </div>
  80. </div>
  81. </div>
  82. <!-- 弹窗提示去上传简历 -->
  83. <v-dialog v-model="dialog" max-width="400" persistent>
  84. <v-card :text="$t('resume.resumeYetSubmit')" :title="$t('common.confirmTitle')">
  85. <template #prepend>
  86. <v-icon color="warning">mdi-alert-circle-outline</v-icon>
  87. </template>
  88. <template v-slot:actions>
  89. <v-spacer></v-spacer>
  90. <v-btn @click="dialog = false">{{ $t('common.cancel') }}</v-btn>
  91. <v-btn color="success" @click="handleToUpload">{{ $t('common.toUpload') }}</v-btn>
  92. </template>
  93. </v-card>
  94. </v-dialog>
  95. <!-- 选择简历 -->
  96. <Dialog :visible="showResume" :widthType="2" titleClass="text-h6" :title="$t('resume.selectResumeToSubmit')" @close="handleClose" @submit="handleSubmit">
  97. <v-radio-group v-model="selectResume">
  98. <v-radio v-for="val in resumeList" :key="val.id" :value="val.id" :label="val.title" color="primary"></v-radio>
  99. </v-radio-group>
  100. </Dialog>
  101. </div>
  102. </template>
  103. <script setup>
  104. defineOptions({ name: 'position-details' })
  105. import { ref } from 'vue'
  106. import { useRouter } from 'vue-router'
  107. import { timesTampChange } from '@/utils/date'
  108. import { getPersonResumeCv } from '@/api/resume'
  109. import { useI18n } from '@/hooks/web/useI18n'
  110. import { getPositionDetails, getSimilarPosition, getJobFavoriteCheck, getPersonJobFavorite, getPersonJobUnfavorite, jobCvRelCheckSend, jobCvRelSend } from '@/api/position'
  111. import { dealDictObjData, dealDictArrayData } from '@/views/recruit/personal/position/components/dict'
  112. import similarPositions from '@/components/Position/similarPositions.vue'
  113. import EnterpriseInfo from '@/components/Enterprise/info.vue'
  114. import Snackbar from '@/plugins/snackbar'
  115. import Dialog from '@/components/CtDialog'
  116. import { getToken } from '@/utils/auth'
  117. const { t } = useI18n()
  118. const router = useRouter()
  119. const { id } = router.currentRoute.value.params
  120. const delivery = ref(false) // 是否已投递简历
  121. // 相似职位
  122. const similarList = ref([])
  123. const getSimilarPositionList = async () => {
  124. if (!Object.keys(positionInfo).length) return
  125. const { list } = await getSimilarPosition({ pageNo: 1, pageSize: 4, positionId: positionInfo.value.positionId, expType: positionInfo.value.expType, eduType: positionInfo.value.eduType })
  126. const items = list.splice(0, 4)
  127. similarList.value = dealDictArrayData([], items)
  128. }
  129. // 职位详情
  130. const info = ref({})
  131. const positionInfo = ref({})
  132. const getPositionDetail = async () => {
  133. const data = await getPositionDetails({ id })
  134. info.value = data
  135. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
  136. getSimilarPositionList()
  137. }
  138. getPositionDetail()
  139. // 效验是否有投递过简历
  140. const deliveryCheck = async () => {
  141. const data = await jobCvRelCheckSend({ jobId: id })
  142. if (data) delivery.value = true
  143. }
  144. if (getToken()) deliveryCheck()
  145. const desc = [
  146. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  147. { mdi: 'mdi-school-outline', value: 'eduName' },
  148. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  149. ]
  150. // 效验求职者是否有收藏该职位
  151. const isCollection = ref(true)
  152. const getCollectionStatus = async () => {
  153. const data = await getJobFavoriteCheck({ jobId: id })
  154. isCollection.value = data
  155. }
  156. getCollectionStatus()
  157. // 分享有礼
  158. const handleShare = async () => {
  159. // 分享链接携带参数: 1.用户id。2.手机号。3.附件简历。4.姓名。5.职位id
  160. const url = '/shareJob?' + new URLSearchParams({
  161. jobId: id,
  162. sharedById: 'userId',
  163. sharedByName: 'name',
  164. sharedByPhone: 'phone',
  165. file: 'file',
  166. }).toString()
  167. window.open(url, '_blank')
  168. }
  169. // 收藏&取消收藏职位
  170. const handleCollection = async () => {
  171. const api = isCollection.value ? getPersonJobUnfavorite : getPersonJobFavorite
  172. await api(isCollection.value ? id : { jobId: id })
  173. await getCollectionStatus()
  174. }
  175. const dialog = ref(false)
  176. const showResume = ref(false)
  177. // 去上传附件
  178. const handleToUpload = () => {
  179. dialog.value = false
  180. window.open('/recruit/personal/personalCenter')
  181. }
  182. // 效验是否有投递简历
  183. const resumeList = ref([])
  184. const selectResume = ref()
  185. const handleDelivery = async () => {
  186. if (delivery.value) return Snackbar.warning(t('resume.alreadyResume'))
  187. const result = await getPersonResumeCv()
  188. resumeList.value = result
  189. // 没有上传过简历的先去上传
  190. if (!result.length) {
  191. dialog.value = true
  192. return
  193. }
  194. showResume.value = true
  195. }
  196. // 简历投递
  197. const handleClose = () => {
  198. showResume.value = false
  199. selectResume.value = null
  200. }
  201. const handleSubmit = async () =>{
  202. if (!selectResume.value) return Snackbar.warning(t('resume.selectResumeToSubmit'))
  203. const obj = resumeList.value.find(e => e.id === selectResume.value)
  204. if (!obj) return Snackbar.warning(t('resume.selectedResumeNotExist'))
  205. await jobCvRelSend({ jobId: id, title: obj.title, url: obj.url })
  206. Snackbar.success(t('resume.deliverySuccess'))
  207. handleClose()
  208. deliveryCheck()
  209. }
  210. </script>
  211. <style lang="scss" scoped>
  212. .banner {
  213. background-color: #fff;
  214. padding: 18px 0 20px;
  215. }
  216. .banner-title {
  217. line-height: 40px;
  218. font-size: 28px;
  219. font-weight: 600;
  220. }
  221. .banner-title h1 {
  222. display: inline-block;
  223. color: #37576c;
  224. font-size: 28px;
  225. margin-right: 30px;
  226. margin-top: 1px;
  227. max-width: 360px;
  228. vertical-align: middle;
  229. }
  230. .button-item {
  231. min-width: 110px;
  232. height: 36px
  233. }
  234. .salary {
  235. color: var(--v-error-base);
  236. line-height: 41px;
  237. font-weight: 600;
  238. height: auto;
  239. display: inline-block;
  240. vertical-align: sub;
  241. }
  242. .refresh-time {
  243. float: right;
  244. color: var(--color-666);
  245. font-size: 14px;
  246. line-height: 66px;
  247. vertical-align: sub;
  248. }
  249. .banner-tags span {
  250. font-weight: 600;
  251. }
  252. .radius {
  253. border-radius: 8px;
  254. }
  255. .content-left {
  256. width: 810px;
  257. padding: 20px 20px;
  258. }
  259. .content-right {
  260. flex: 1;
  261. padding: 20px 20px 20px 0;
  262. }
  263. .label-text {
  264. color: #7f7a7a;
  265. font-weight: 600;
  266. }
  267. .value-text {
  268. color: #000;
  269. font-weight: 400;
  270. }
  271. .requirement {
  272. white-space: pre-wrap;
  273. word-break: break-all;
  274. line-height: 28px;
  275. color: var(--color-333);
  276. font-size: 15px;
  277. text-align: justify;
  278. letter-spacing: 0;
  279. }
  280. .contact {
  281. height: 60px;
  282. line-height: 60px;
  283. }
  284. .contact-name {
  285. font-size: 20px;
  286. font-weight: 500;
  287. color: var(--color-222);
  288. line-height: 28px;
  289. }
  290. .contact-info {
  291. font-size: 15px;
  292. color: var(--color-666);
  293. line-height: 21px;
  294. margin-top: 8px;
  295. }
  296. </style>