details.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="default-width banner px-6">
  3. <div class="banner-title" v-if="Object.keys(info).length">
  4. <div class="float-left d-flex align-center">
  5. <v-img width="60" height="60" :src="info.enterprise.logoUrl"></v-img>
  6. <div class="ml-4">
  7. <div class="contact-name">
  8. {{ info.enterprise.name }}
  9. <v-icon color="primary" size="24">mdi-shield-check</v-icon>
  10. </div>
  11. <div class="contact-info">{{ info.business.type }} · {{ info.scaleName }} · {{ info.industryName }}</div>
  12. </div>
  13. </div>
  14. <div class="float-right d-flex">
  15. <div class="tools-box text-center">
  16. <div class="tools-box-number">{{ info.jobAdvertisedCount }}</div>
  17. <div class="tools-box-text">职位在招</div>
  18. </div>
  19. <!-- 是否关注该企业 -->
  20. <v-tooltip location="bottom">
  21. <template v-slot:activator="{ props }">
  22. <v-icon v-bind="props" class="ml-5 mr-2" size="25" :color="isCollection ? 'primary' : ''" @click="handleFollow">{{ isCollection ? 'mdi-heart' : 'mdi-heart-outline' }}</v-icon>
  23. </template>
  24. <span>关注该企业</span>
  25. </v-tooltip>
  26. </div>
  27. </div>
  28. <v-divider></v-divider>
  29. <div class="mt-3">
  30. <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f3f3f3">
  31. <v-tab :value="1">公司简介</v-tab>
  32. <v-tab :value="2">在招职位({{ info.jobAdvertisedCount }})</v-tab>
  33. </v-tabs>
  34. <div class="d-flex" v-if="Object.keys(info).length">
  35. <div class="content-left">
  36. <EnterpriseIntroduction v-if="tab === 1" :info="info" />
  37. <recruitmentPositions v-else :info="info"/>
  38. </div>
  39. <div class="content-right">
  40. <div class="welfare">
  41. <h4>工作时间及福利</h4>
  42. <div class="my-3" style="color: #777;font-size: 14px;">
  43. <v-icon size="17" color="#ccc" class="mr-2">mdi-clock</v-icon>{{ info.enterprise.workTime }}
  44. </div>
  45. <div class="welfare-tags">
  46. <v-chip size="small" label v-for="(k, i) in info.enterprise.welfareList.slice(0, 6)" :key="i" class="mb-2 welfare-tags-item ellipsis" color="primary">{{ k }}</v-chip>
  47. </div>
  48. </div>
  49. <div class="welfare my-3">
  50. <h4>工商信息</h4>
  51. <div :class="['mt-2', 'business-item']" v-for="(val, index) in businessList" :key="val.value">
  52. <div>{{ val.label }}</div>
  53. <div class="business-value ellipsis">{{ info.business[val.value] }}</div>
  54. <div :class="['my-3', {'border-bottom-dashed': index === businessList.length - 1 }]"></div>
  55. </div>
  56. <div class="business-source">
  57. 数据来源:企查查
  58. </div>
  59. </div>
  60. <div class="welfare">
  61. <h4>4位经理正在招聘</h4>
  62. <div class="d-flex mt-2" v-for="(val, i) in recruitmentSpecialist" :key="i">
  63. <v-avatar>
  64. <v-img :src="val.avatar"></v-img>
  65. </v-avatar>
  66. <div class="ml-2">
  67. <div class="position-name ellipsis">{{ val.name }} · {{ val.position }}</div>
  68. <div class="desc ellipsis">{{ val.desc }}</div>
  69. </div>
  70. </div>
  71. <div class="text-center mt-3">
  72. <v-btn class="buttons" color="primary" variant="outlined">{{ $t('position.allBtn') }}</v-btn>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </template>
  80. <script setup>
  81. defineOptions({ name: 'enterprise-details'})
  82. import { ref } from 'vue'
  83. import EnterpriseIntroduction from './components/introduction.vue'
  84. import recruitmentPositions from './components/positions.vue'
  85. import { getEnterpriseDetails, getEnterpriseSubscribeCheck, getEnterpriseSubscribe, getEnterpriseUnsubscribe } from '@/api/enterprise'
  86. import { timesTampChange } from '@/utils/date'
  87. import { dealDictData } from '@/views/recruit/position/components/dict.js'
  88. const props = defineProps({
  89. id: {
  90. type: String,
  91. default: ''
  92. }
  93. })
  94. const tab = ref(1)
  95. // 企业详情
  96. const info = ref({})
  97. const getDetails = async () => {
  98. const id = Number(props.id)
  99. if (!id) return
  100. const data = await getEnterpriseDetails({ id })
  101. // 成立日期
  102. const time = timesTampChange(data.business.establishmentTime)
  103. data.business.establishmentTime = time.slice(0, 10)
  104. info.value = { ...data, ...dealDictData({}, data.enterprise) }
  105. getCollectionStatus(id)
  106. }
  107. getDetails()
  108. // 效验求职者是否关注该企业
  109. const isCollection = ref(false)
  110. const getCollectionStatus = async (id) => {
  111. const data = await getEnterpriseSubscribeCheck({ enterpriseId: id })
  112. isCollection.value = data
  113. }
  114. // 关注&取消关注企业
  115. const handleFollow = async () => {
  116. const api = isCollection.value ? getEnterpriseUnsubscribe : getEnterpriseSubscribe
  117. await api(isCollection.value ? props.id : { enterpriseId: props.id })
  118. getCollectionStatus(props.id)
  119. }
  120. // 工商信息
  121. const businessList = [
  122. { label: '企业类型:', value: 'type' },
  123. { label: '统一社会信用代码:', value: 'code' },
  124. { label: '成立日期:', value: 'establishmentTime' },
  125. { label: '注册资本:', value: 'registeredCapital' }
  126. ]
  127. // 企业招聘人员
  128. const recruitmentSpecialist = [
  129. { name: '陈北方', position: '人事经理', desc: '正在招聘“运营专员”等职位11111', avatar: 'https://cdn.vuetifyjs.com/images/john.jpg' },
  130. { name: '蔡艳生', position: '人事经理', desc: '正在招聘“产品助理”等职位', avatar: 'https://avatars0.githubusercontent.com/u/9064066?v=4&s=460' },
  131. { name: '徐有道', position: '招聘专员', desc: '正在招聘“运营专员”等职位', avatar: 'https://cdn.vuetifyjs.com/images/john.jpg' },
  132. { name: '方晓', position: '人事经理', desc: '正在招聘“运营专员”等职位', avatar: 'https://avatars0.githubusercontent.com/u/9064066?v=4&s=460' }
  133. ]
  134. // 有tab的是首页中热门企业模块
  135. const savedTab = new URLSearchParams(window.location.search).get('tab')
  136. if (savedTab) tab.value = 2
  137. </script>
  138. <style scoped lang="scss">
  139. .banner {
  140. background-color: #fff;
  141. padding: 0 0 20px;
  142. }
  143. .banner-title {
  144. display: flex;
  145. align-items: center;
  146. justify-content: space-between;
  147. height: 125px;
  148. }
  149. .content-left {
  150. width: 844px;
  151. padding: 20px;
  152. }
  153. .content-right {
  154. flex: 1;
  155. padding: 20px 20px 0 0;
  156. }
  157. .contact {
  158. height: 60px;
  159. line-height: 60px;
  160. }
  161. .contact-name {
  162. font-size: 28px;
  163. font-weight: 700;
  164. color: #37576c;
  165. line-height: 28px;
  166. }
  167. .contact-info {
  168. font-size: 15px;
  169. font-weight: 500;
  170. color: #222;
  171. line-height: 21px;
  172. margin-top: 8px;
  173. }
  174. .tools-box {
  175. height: 80px;
  176. width: 80px;
  177. background-color: #d5e6e8;
  178. border-radius: 5px;
  179. }
  180. .tools-box-number {
  181. font-size: 30px;
  182. font-weight: 700;
  183. color: var(--v-primary-base);
  184. }
  185. .tools-box-text {
  186. color: var(--v-primary-base);
  187. font-size: 14px;
  188. }
  189. .welfare {
  190. background-color: #f3f3f3;
  191. border-radius: 8px;
  192. padding: 12px;
  193. }
  194. .welfare-tags {
  195. display: flex;
  196. width: 242px;
  197. flex-wrap: wrap;
  198. height: 100px;
  199. overflow: hidden;
  200. text-align: center;
  201. }
  202. .welfare-tags-item {
  203. display: block;
  204. width: 117px;
  205. max-width: 117px;
  206. text-align: center;
  207. line-height: 26px;
  208. margin-right: 8px;
  209. &:nth-child(2n) {
  210. margin-right: 0;
  211. }
  212. }
  213. .business-item {
  214. font-size: 14px;
  215. color: #777;
  216. font-weight: 600;
  217. }
  218. .business-value {
  219. width: 228px;
  220. color: #000;
  221. font-weight: 500;
  222. }
  223. .business-source {
  224. font-size: 14px;
  225. color: #777;
  226. }
  227. .desc {
  228. width: 180px;
  229. color: #666;
  230. font-weight: 500;
  231. font-size: 12px;
  232. }
  233. .position-name {
  234. width: 180px;
  235. font-size: 14px;
  236. font-weight: 600;
  237. }
  238. </style>