details.vue 10 KB

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