item.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div>
  3. <div class="position-item mb-3 job-closed elevation-2" style="position: relative;"
  4. v-for="(val, i) in props.items" :key="i" @mouseenter="val.active = true" @mouseleave="val.active = false"
  5. >
  6. <!-- 职位、企业信息 -->
  7. <div class="info-content" >
  8. <div class="job-info">
  9. <div class="job-name ellipsis" :class="{'cursor-pointer': val.job.status === '0'}" v-ellipse-tooltip>
  10. <span class="mr-3" :class="{'info-name': val.job.status === '0'}" @click.stop="handleToPositionDetails(val)">{{ formatName(val.job.name) }}</span>
  11. <span v-if="val.job.status === '1'" class="font-size-14 color-error">[职位已关闭]</span>
  12. <span v-else>
  13. <span v-if="!val.job?.areaId || val.job.areaName">[{{ !val.job.areaId ? '全国' : val.job.areaName }}]</span>
  14. </span>
  15. </div>
  16. <div class="job-other">
  17. <span v-if="!val.job.payFrom && !val.job.payTo" class="salary color-primary">面议</span>
  18. <span v-else class="salary color-primary">{{ val.job.payFrom ? val.job.payFrom + '-' : ''}}{{ val.job.payTo }}{{ val.job.payName ? '/' + val.job.payName : '' }}</span>
  19. <v-chip v-if="val.job?.expName" class="mx-3" color="primary" label size="small">{{ val.job.expName }}</v-chip>
  20. <v-chip v-if="val.job?.eduName" color="primary" label size="small">{{ val.job.eduName }}</v-chip>
  21. </div>
  22. </div>
  23. <div class="company-info ml-3" style="flex: 1;">
  24. <div style="height: 50px; width: 50px;">
  25. <v-img class="entLogoImg" width="50" height="50" :src="val.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" contain></v-img>
  26. </div>
  27. <div class="ml-3">
  28. <div class="cursor-pointer info-name" v-ellipse-tooltip @click.stop="jumpToEnterpriseDetail(val.enterprise.id)">{{ formatName(val.enterprise.anotherName || val.enterprise.name) }}</div>
  29. <div class="mt-3 ellipsis color-666 font-size-13" style="max-width: 260px;">
  30. <span v-for="(k, i) in desc" :key="k">
  31. {{ val.enterprise[k] }}
  32. <span v-if="i !== desc.length - 1 && val.enterprise[k] && val.enterprise[desc[i + 1]]" class="septal-line"></span>
  33. </span>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="mx-5" style="border-bottom: 1px dashed #e0e0e0"></div>
  39. <!-- 实习范围 -->
  40. <div class="d-flex justify-space-between px-5 py-3">
  41. <div class="color-666 font-size-15">
  42. <p>实习时间:{{ timesTampChange(val.startTime, 'Y-M-D') }} 至 {{ timesTampChange(val.endTime, 'Y-M-D') }}</p>
  43. </div>
  44. <div class="text-end">
  45. <div v-if="tab !== '0'">
  46. <v-btn size="small" color="primary" @click="handleToReport(val)">实习报告</v-btn>
  47. <v-btn v-if="val.evaluate && !val.certificate" size="small" class="ml-3" color="primary" @click.stop="handlePreview(val)">实习证书</v-btn>
  48. <v-menu v-else-if="val.evaluate && val.certificate" open-on-hover>
  49. <template v-slot:activator="{ props }">
  50. <v-btn color="primary" size="small" class="ml-3" v-bind="props">实习证书</v-btn>
  51. </template>
  52. <v-list>
  53. <v-list-item v-for="(item, index) in menuList" :key="index" @click="item.change(val)">
  54. <template v-slot:prepend>
  55. <v-icon :icon="item.icon"></v-icon>
  56. </template>
  57. <v-list-item-title>{{ item.title }}</v-list-item-title>
  58. </v-list-item>
  59. </v-list>
  60. </v-menu>
  61. <v-btn
  62. v-if="val.recommendationLetter"
  63. @click.stop="handleDownLoadRecommendationLetter(val)"
  64. size="small" class="ml-3" color="#00897B"
  65. prepend-icon="mdi-download"
  66. >企业推荐信</v-btn>
  67. </div>
  68. <div v-else>
  69. <v-btn
  70. v-if="tab === '0' && !val.internshipEnterprise"
  71. color="primary" size="small"
  72. class="ml-3"
  73. @click="handleReport(val)"
  74. >上报为实习企业</v-btn>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </template>
  81. <script setup>
  82. defineOptions({ name: 'PersonalCenterStudentInternshipCompanyItem' })
  83. import { ref } from 'vue'
  84. import { useRouter } from 'vue-router'
  85. import { formatName } from '@/utils/getText'
  86. import { jumpToEnterpriseDetail } from '@/utils/position'
  87. import { timesTampChange } from '@/utils/date'
  88. import { getBlob, saveAs } from '@/utils'
  89. import Snackbar from '@/plugins/snackbar'
  90. import Confirm from '@/plugins/confirm'
  91. import { reportStudentPracticeEnterprise } from '@/api/recruit/personal/student.js'
  92. const emit = defineEmits(['preview', 'refresh'])
  93. const props = defineProps({
  94. items: {
  95. type: Array,
  96. default: () => []
  97. },
  98. tab: {
  99. type: String,
  100. default: '0'
  101. }
  102. })
  103. const router = useRouter()
  104. const desc = ['industryName', 'scaleName']
  105. // 上报为实习企业
  106. const handleReport = async (val) => {
  107. if (!val.enterpriseId || !val.jobId) return Snackbar.warning('企业或职位信息错误')
  108. Confirm('系统提示', '是否确定上报为实习企业?').then(async () => {
  109. await reportStudentPracticeEnterprise(val.enterpriseId, val.jobId)
  110. Snackbar.success('上报成功')
  111. emit('refresh')
  112. })
  113. }
  114. // 实习证书预览
  115. const handlePreview = (item) => {
  116. emit('preview', item)
  117. }
  118. // 实习证书附件下载
  119. const handleDownLoadCertificate = (val) => {
  120. getBlob(val.certificate).then(blob => {
  121. saveAs(blob, `${formatName(val.enterprise.anotherName || val.enterprise.name)} - 实习证书附件`)
  122. })
  123. }
  124. const menuList = ref([
  125. { title: '证书预览', icon: 'mdi-eye-outline', change: handlePreview },
  126. { title: '附件下载', icon: 'mdi-download', change: handleDownLoadCertificate }
  127. ])
  128. // 职位详情
  129. const handleToPositionDetails = (item) => {
  130. if (item.job.status === '1') return
  131. let path = `/recruit/personal/position/details/${item.job.id}`
  132. if (item.cvRel?.jobFairId) path += `?jobFairId=${item.cvRel.jobFairId}`
  133. router.push(path)
  134. }
  135. // 实习报告
  136. const handleToReport = (val) => {
  137. router.push(`/recruit/personal/personalCenter/student/internshipReport?id=${val.enterprise.id}`)
  138. }
  139. // 企业推荐信下载
  140. const handleDownLoadRecommendationLetter = (val) => {
  141. getBlob(val.recommendationLetter).then(blob => {
  142. saveAs(blob, `${formatName(val.enterprise.anotherName || val.enterprise.name)} - 推荐信`)
  143. })
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. .position-item {
  148. background-color: #fff;
  149. border-radius: 12px;
  150. border: 1px solid #fff;
  151. &:hover {
  152. border: 1px solid #00B760;
  153. box-shadow: 5px 9px 12px 1px rgba(0, 183, 96, 0.17) !important;
  154. }
  155. .info-header {
  156. height: 48px;
  157. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  158. border-radius: 12px;
  159. .img-box {
  160. padding: 12px 24px;
  161. .name {
  162. color: var(--color-222);
  163. font-weight: 400;
  164. font-size: 13px;
  165. .gray {
  166. color: var(--color-666);
  167. }
  168. }
  169. }
  170. .header-btn {
  171. padding: 10px 10px 0 0;
  172. float: right;
  173. .v-btn {
  174. z-index: 1;
  175. }
  176. }
  177. }
  178. .info-content {
  179. display: flex;
  180. padding: 16px 24px;
  181. justify-content: space-between;
  182. .job-info {
  183. width: 430px;
  184. min-width: 430px;
  185. max-width: 430px;
  186. font-weight: 500;
  187. font-size: 16px;
  188. .job-name {
  189. width: 100%;
  190. height: 22px;
  191. line-height: 22px;
  192. color: #0E100F;
  193. margin-bottom: 12px;
  194. }
  195. .job-other {
  196. color: var(--v-error-base);
  197. height: 22px;
  198. line-height: 22px;
  199. }
  200. }
  201. .company-info {
  202. display: flex;
  203. align-items: center
  204. }
  205. .interview-info {
  206. color: var(--color-333);
  207. font-size: 15px;
  208. }
  209. }
  210. }
  211. .info-name:hover {
  212. color: var(--v-primary-base);
  213. }
  214. </style>