details.vue 11 KB

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