details.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <div class="default-width banner px-6">
  3. <div v-if="Object.keys(info).length">
  4. <div class="banner-title" v-if="Object.keys(info).length">
  5. <div class="float-left d-flex align-center">
  6. <v-img width="60" height="60" :src="info.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></v-img>
  7. <div class="ml-4">
  8. <div class="contact-name">
  9. {{ info.enterprise.name }}
  10. <v-icon :color="statusInfo.color" size="20">{{ statusInfo.mdi }}</v-icon>
  11. <span :style="{'color': statusInfo.color,'font-size': '14px'}">{{ statusInfo.label }}</span>
  12. </div>
  13. <div class="contact-info">
  14. {{ info.financingName }}
  15. <span v-if="info.financingName && info.scaleName">·</span>
  16. {{ info.scaleName }}
  17. <span v-if="info.industryName && info.scaleName">·</span>
  18. {{ info.industryName }}
  19. </div>
  20. </div>
  21. </div>
  22. <div class="float-right d-flex">
  23. <div class="tools-box text-center" v-if="info.jobAdvertisedCount">
  24. <div class="tools-box-number">{{ info.jobAdvertisedCount }}</div>
  25. <div class="tools-box-text">职位在招</div>
  26. </div>
  27. <!-- 是否关注该企业 -->
  28. <v-tooltip location="bottom">
  29. <template v-slot:activator="{ props }">
  30. <v-icon v-bind="props" class="ml-5 mr-2" size="25" :color="isCollection ? 'error' : ''" @click="handleFollow">{{ isCollection ? 'mdi-heart' : 'mdi-heart-outline' }}</v-icon>
  31. </template>
  32. <span>关注该企业</span>
  33. </v-tooltip>
  34. </div>
  35. </div>
  36. <v-divider></v-divider>
  37. <div class="mt-3">
  38. <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f3f3f3" @update:model-value="handleTabClick">
  39. <v-tab :value="1">公司简介</v-tab>
  40. <v-tab :value="2">在招职位{{ info.jobAdvertisedCount ? `(${info.jobAdvertisedCount})` : '' }}</v-tab>
  41. </v-tabs>
  42. <div class="d-flex" v-if="Object.keys(info).length">
  43. <div class="content-left">
  44. <EnterpriseIntroduction v-if="tab === 1" :info="info" />
  45. <recruitmentPositions v-else :info="info"/>
  46. </div>
  47. <div class="content-right">
  48. <div v-if="info.enterprise?.workTime && info?.enterprise?.welfareList.length" class="welfare mb-3">
  49. <h4>工作时间及福利</h4>
  50. <div v-if="info.enterprise?.workTime" class="my-3" style="color: var(--color-666);font-size: 14px;">
  51. <v-icon size="17" color="#ccc" class="mr-2">mdi-clock</v-icon>{{ info.enterprise.workTime }}
  52. </div>
  53. <div class="welfare-tags">
  54. <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>
  55. </div>
  56. </div>
  57. <div class="welfare" v-if="info?.business">
  58. <h4>工商信息</h4>
  59. <div :class="['mt-2', 'business-item']" v-for="val in businessList" :key="val.value">
  60. <div>{{ val.label }}</div>
  61. <div class="business-value ellipsis">
  62. {{ info.business[val.value] || '暂无' }}
  63. <span v-if="val.value === 'registeredCapital' && info.business[val.value]">万元</span>
  64. </div>
  65. <div :class="['my-3']"></div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <script setup>
  75. defineOptions({ name: 'enterprise-details'})
  76. import { ref, computed } from 'vue'
  77. import EnterpriseIntroduction from './components/introduction.vue'
  78. import recruitmentPositions from './components/positions.vue'
  79. import { getEnterpriseAuthDetails } from '@/api/position'
  80. import { getEnterpriseDetails, getEnterpriseSubscribeCheck, getEnterpriseSubscribe, getEnterpriseUnsubscribe, enterpriseClick } from '@/api/enterprise'
  81. import { timesTampChange } from '@/utils/date'
  82. import { dealDictObjData } from '@/utils/position'
  83. import { useRoute, useRouter } from 'vue-router'
  84. import { getToken } from '@/utils/auth'
  85. const props = defineProps({
  86. id: {
  87. type: String,
  88. default: ''
  89. }
  90. })
  91. const route = useRoute()
  92. const router = useRouter()
  93. const tab = ref(1)
  94. const savedTab = new URLSearchParams(window.location.search).get('key')
  95. tab.value = savedTab ? (savedTab === 'briefIntroduction' ? 1 : 2) : 1
  96. // router.push(`${route.path}?key=${savedTab ? savedTab : 'briefIntroduction'}`)
  97. const handleTabClick = () => {
  98. router.push(`${route.path}?key=${tab.value === 1 ? 'briefIntroduction' : 'recruitmentPositions'}`)
  99. }
  100. // 企业埋点
  101. const handleEnterpriseClick = async () => {
  102. if (!props.id) return
  103. await enterpriseClick({ id: props.id })
  104. }
  105. handleEnterpriseClick()
  106. const statusList = [
  107. { label: '未认证', color: '#fb8c00', value: null, mdi: 'mdi-shield-remove' },
  108. { label: '审核中', color: '#fb8c00', value: '0', mdi: 'mdi-shield-half-full' },
  109. { label: '已认证', color: 'var(--v-primary-base)', value: '1', mdi: 'mdi-shield-check' },
  110. { label: '已驳回', color: '#fe574a', value: '2', mdi: 'mdi-shield-off' }
  111. ]
  112. // 企业详情
  113. const info = ref({})
  114. const authInfo = ref({})
  115. const getDetails = async () => {
  116. if (!props.id) return
  117. const data = await getEnterpriseDetails({ id: props.id })
  118. // 成立日期
  119. if (data?.business?.establishmentTime) {
  120. data.business.establishmentTime = timesTampChange(data.business.establishmentTime, 'Y-M-D')
  121. }
  122. info.value = { ...data, ...dealDictObjData({}, data.enterprise) }
  123. getCollectionStatus(props.id)
  124. // 企业实名认证信息
  125. authInfo.value = await getEnterpriseAuthDetails(props.id)
  126. }
  127. getDetails()
  128. const statusInfo = computed(() => {
  129. const obj = (authInfo.value && Object.keys(authInfo.value).length) ? statusList.find(e => e.value === authInfo.value.status) : statusList[0]
  130. return obj
  131. })
  132. // 效验求职者是否关注该企业
  133. const isCollection = ref(false)
  134. const getCollectionStatus = async (id) => {
  135. if (!getToken()) return isCollection.value = false
  136. const data = await getEnterpriseSubscribeCheck({ enterpriseId: id })
  137. isCollection.value = data
  138. }
  139. // 关注&取消关注企业
  140. const handleFollow = async () => {
  141. const api = isCollection.value ? getEnterpriseUnsubscribe : getEnterpriseSubscribe
  142. await api(isCollection.value ? props.id : { enterpriseId: props.id })
  143. getCollectionStatus(props.id)
  144. }
  145. // 工商信息
  146. const businessList = [
  147. { label: '企业类型:', value: 'type' },
  148. { label: '统一社会信用代码:', value: 'code' },
  149. { label: '成立日期:', value: 'establishmentTime' },
  150. { label: '注册资本:', value: 'registeredCapital' }
  151. ]
  152. </script>
  153. <style scoped lang="scss">
  154. .banner {
  155. background-color: #fff;
  156. padding: 0 0 20px;
  157. }
  158. .banner-title {
  159. display: flex;
  160. align-items: center;
  161. justify-content: space-between;
  162. height: 125px;
  163. }
  164. .content-left {
  165. width: 844px;
  166. padding: 20px;
  167. }
  168. .content-right {
  169. flex: 1;
  170. padding: 20px 20px 0 0;
  171. }
  172. .contact {
  173. height: 60px;
  174. line-height: 60px;
  175. }
  176. .contact-name {
  177. font-size: 28px;
  178. font-weight: 700;
  179. color: #37576c;
  180. line-height: 28px;
  181. }
  182. .contact-info {
  183. font-size: 15px;
  184. font-weight: 500;
  185. color: var(--color-222);
  186. line-height: 21px;
  187. margin-top: 8px;
  188. }
  189. .tools-box {
  190. height: 80px;
  191. width: 80px;
  192. background-color: var(--color-d5e6e8);
  193. border-radius: 5px;
  194. }
  195. .tools-box-number {
  196. font-size: 30px;
  197. font-weight: 700;
  198. color: var(--v-primary-base);
  199. }
  200. .tools-box-text {
  201. color: var(--v-primary-base);
  202. font-size: 14px;
  203. }
  204. .welfare {
  205. background-color: var(--color-f3);
  206. border-radius: 8px;
  207. padding: 12px;
  208. }
  209. .welfare-tags {
  210. display: flex;
  211. width: 242px;
  212. flex-wrap: wrap;
  213. height: 100px;
  214. overflow: hidden;
  215. text-align: center;
  216. }
  217. .welfare-tags-item {
  218. display: block;
  219. width: 117px;
  220. max-width: 117px;
  221. text-align: center;
  222. line-height: 26px;
  223. margin-right: 8px;
  224. &:nth-child(2n) {
  225. margin-right: 0;
  226. }
  227. }
  228. .business-item {
  229. font-size: 14px;
  230. color: var(--color-666);
  231. font-weight: 600;
  232. }
  233. .business-value {
  234. width: 228px;
  235. color: #000;
  236. font-weight: 500;
  237. }
  238. .business-source {
  239. font-size: 14px;
  240. color: var(--color-666);
  241. }
  242. .desc {
  243. width: 180px;
  244. color: var(--color-666);
  245. font-weight: 500;
  246. font-size: 12px;
  247. }
  248. .position-name {
  249. width: 180px;
  250. font-size: 14px;
  251. font-weight: 600;
  252. }
  253. </style>