details.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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 '@/utils/position'
  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. const url = '/shareJob?' + new URLSearchParams({
  160. param1: 'value1',
  161. param2: 'value2'
  162. }).toString()
  163. window.open(url, '_blank')
  164. }
  165. // 收藏&取消收藏职位
  166. const handleCollection = async () => {
  167. const api = isCollection.value ? getPersonJobUnfavorite : getPersonJobFavorite
  168. await api(isCollection.value ? id : { jobId: id })
  169. await getCollectionStatus()
  170. }
  171. const dialog = ref(false)
  172. const showResume = ref(false)
  173. // 去上传附件
  174. const handleToUpload = () => {
  175. dialog.value = false
  176. window.open('/recruit/personal/personalCenter')
  177. }
  178. // 效验是否有投递简历
  179. const resumeList = ref([])
  180. const selectResume = ref()
  181. const handleDelivery = async () => {
  182. if (delivery.value) return Snackbar.warning(t('resume.alreadyResume'))
  183. const result = await getPersonResumeCv()
  184. resumeList.value = result
  185. // 没有上传过简历的先去上传
  186. if (!result.length) {
  187. dialog.value = true
  188. return
  189. }
  190. showResume.value = true
  191. }
  192. // 简历投递
  193. const handleClose = () => {
  194. showResume.value = false
  195. selectResume.value = null
  196. }
  197. const handleSubmit = async () =>{
  198. if (!selectResume.value) return Snackbar.warning(t('resume.selectResumeToSubmit'))
  199. const obj = resumeList.value.find(e => e.id === selectResume.value)
  200. if (!obj) return Snackbar.warning(t('resume.selectedResumeNotExist'))
  201. await jobCvRelSend({ jobId: id, title: obj.title, url: obj.url })
  202. Snackbar.success(t('resume.deliverySuccess'))
  203. handleClose()
  204. deliveryCheck()
  205. }
  206. </script>
  207. <style lang="scss" scoped>
  208. .banner {
  209. background-color: #fff;
  210. padding: 18px 0 20px;
  211. }
  212. .banner-title {
  213. line-height: 40px;
  214. font-size: 28px;
  215. font-weight: 600;
  216. }
  217. .banner-title h1 {
  218. display: inline-block;
  219. color: #37576c;
  220. font-size: 28px;
  221. margin-right: 30px;
  222. margin-top: 1px;
  223. max-width: 360px;
  224. vertical-align: middle;
  225. }
  226. .button-item {
  227. min-width: 110px;
  228. height: 36px
  229. }
  230. .salary {
  231. color: var(--v-error-base);
  232. line-height: 41px;
  233. font-weight: 600;
  234. height: auto;
  235. display: inline-block;
  236. vertical-align: sub;
  237. }
  238. .refresh-time {
  239. float: right;
  240. color: var(--color-666);
  241. font-size: 14px;
  242. line-height: 66px;
  243. vertical-align: sub;
  244. }
  245. .banner-tags span {
  246. font-weight: 600;
  247. }
  248. .radius {
  249. border-radius: 8px;
  250. }
  251. .content-left {
  252. width: 810px;
  253. padding: 20px 20px;
  254. }
  255. .content-right {
  256. flex: 1;
  257. padding: 20px 20px 20px 0;
  258. }
  259. .label-text {
  260. color: #7f7a7a;
  261. font-weight: 600;
  262. }
  263. .value-text {
  264. color: #000;
  265. font-weight: 400;
  266. }
  267. .requirement {
  268. white-space: pre-wrap;
  269. word-break: break-all;
  270. line-height: 28px;
  271. color: var(--color-333);
  272. font-size: 15px;
  273. text-align: justify;
  274. letter-spacing: 0;
  275. }
  276. .contact {
  277. height: 60px;
  278. line-height: 60px;
  279. }
  280. .contact-name {
  281. font-size: 20px;
  282. font-weight: 500;
  283. color: var(--color-222);
  284. line-height: 28px;
  285. }
  286. .contact-info {
  287. font-size: 15px;
  288. color: var(--color-666);
  289. line-height: 21px;
  290. margin-top: 8px;
  291. }
  292. </style>