item.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. <v-btn v-if="val.status === '1'" size="small" color="warning" @click="handleToReport(val)">实习报告</v-btn>
  46. <v-btn v-if="val.evaluate && !val.certificate" size="small" class="ml-3" color="primary" @click.stop="handlePreview(val)">实习证书</v-btn>
  47. <v-menu v-else-if="val.evaluate && val.certificate" open-on-hover>
  48. <template v-slot:activator="{ props }">
  49. <v-btn color="primary" size="small" class="ml-3" v-bind="props">实习证书</v-btn>
  50. </template>
  51. <v-list>
  52. <v-list-item v-for="(item, index) in menuList" :key="index" @click="item.change(val)">
  53. <template v-slot:prepend>
  54. <v-icon :icon="item.icon"></v-icon>
  55. </template>
  56. <v-list-item-title>{{ item.title }}</v-list-item-title>
  57. </v-list-item>
  58. </v-list>
  59. </v-menu>
  60. <v-btn v-if="val.recommendationLetter" @click.stop="handleDownLoadRecommendationLetter(val)" size="small" class="ml-3" color="#00897B" prepend-icon="mdi-download">企业推荐信</v-btn>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script setup>
  67. defineOptions({ name: 'PersonalCenterStudentInternshipCompanyItem' })
  68. import { ref } from 'vue'
  69. import { useRouter } from 'vue-router'
  70. import { formatName } from '@/utils/getText'
  71. import { jumpToEnterpriseDetail } from '@/utils/position'
  72. import { timesTampChange } from '@/utils/date'
  73. import { getBlob, saveAs } from '@/utils'
  74. const emit = defineEmits(['preview'])
  75. const props = defineProps({
  76. items: {
  77. type: Array,
  78. default: () => []
  79. }
  80. })
  81. const router = useRouter()
  82. const desc = ['industryName', 'scaleName']
  83. // 实习证书预览
  84. const handlePreview = (item) => {
  85. emit('preview', item)
  86. }
  87. // 实习证书附件下载
  88. const handleDownLoadCertificate = (val) => {
  89. getBlob(val.certificate).then(blob => {
  90. saveAs(blob, `${formatName(val.enterprise.anotherName || val.enterprise.name)} - 实习证书附件`)
  91. })
  92. }
  93. const menuList = ref([
  94. { title: '证书预览', icon: 'mdi-eye-outline', change: handlePreview },
  95. { title: '附件下载', icon: 'mdi-download', change: handleDownLoadCertificate }
  96. ])
  97. // 职位详情
  98. const handleToPositionDetails = (item) => {
  99. if (item.job.status === '1') return
  100. let path = `/recruit/personal/position/details/${item.job.id}`
  101. if (item.cvRel?.jobFairId) path += `?jobFairId=${item.cvRel.jobFairId}`
  102. router.push(path)
  103. }
  104. // 实习报告
  105. const handleToReport = (val) => {
  106. console.log(val, 'report')
  107. router.push(`/recruit/personal/personalCenter/student/internshipReport?id=${val.enterprise.id}`)
  108. }
  109. // 企业推荐信下载
  110. const handleDownLoadRecommendationLetter = (val) => {
  111. getBlob(val.recommendationLetter).then(blob => {
  112. saveAs(blob, `${formatName(val.enterprise.anotherName || val.enterprise.name)} - 推荐信`)
  113. })
  114. }
  115. </script>
  116. <style scoped lang="scss">
  117. .position-item {
  118. background-color: #fff;
  119. border-radius: 12px;
  120. &:hover {
  121. box-shadow: 0px 3px 5px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 5px 8px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 1px 14px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12)) !important;
  122. }
  123. .info-header {
  124. height: 48px;
  125. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  126. border-radius: 12px;
  127. .img-box {
  128. padding: 12px 24px;
  129. .name {
  130. color: var(--color-222);
  131. font-weight: 400;
  132. font-size: 13px;
  133. .gray {
  134. color: var(--color-666);
  135. }
  136. }
  137. }
  138. .header-btn {
  139. padding: 10px 10px 0 0;
  140. float: right;
  141. .v-btn {
  142. z-index: 1;
  143. }
  144. }
  145. }
  146. .info-content {
  147. display: flex;
  148. padding: 16px 24px;
  149. justify-content: space-between;
  150. .job-info {
  151. width: 430px;
  152. min-width: 430px;
  153. max-width: 430px;
  154. font-weight: 500;
  155. font-size: 16px;
  156. .job-name {
  157. width: 100%;
  158. height: 22px;
  159. line-height: 22px;
  160. color: #0E100F;
  161. margin-bottom: 12px;
  162. }
  163. .job-other {
  164. color: var(--v-error-base);
  165. height: 22px;
  166. line-height: 22px;
  167. }
  168. }
  169. .company-info {
  170. display: flex;
  171. align-items: center
  172. }
  173. .interview-info {
  174. color: var(--color-333);
  175. font-size: 15px;
  176. }
  177. }
  178. }
  179. .info-name:hover {
  180. color: var(--v-primary-base);
  181. }
  182. </style>