details.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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 class="welfare mb-3">
  49. <h4>工作时间及福利</h4>
  50. <div 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">
  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 ? info.business[val.value] : '暂无' }}
  63. <span v-if="info?.business && val.value === 'registeredCapital' && info?.business[val.value] && info?.business[val.value].indexOf('万元') === -1">万元</span>
  64. </div>
  65. <div :class="['my-3']"></div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <!-- 快速登录 -->
  73. <login-page v-if="showLogin" @loginSuccess="loginSuccess" @close="loginClose"></login-page>
  74. </div>
  75. </template>
  76. <script setup>
  77. defineOptions({ name: 'enterprise-details'})
  78. import { ref, computed } from 'vue'
  79. import EnterpriseIntroduction from './components/introduction.vue'
  80. import recruitmentPositions from './components/positions.vue'
  81. import { getEnterpriseAuthDetails } from '@/api/position'
  82. import { getEnterpriseDetails, getEnterpriseSubscribeCheck, getEnterpriseSubscribe, getEnterpriseUnsubscribe, enterpriseClick } from '@/api/enterprise'
  83. import { timesTampChange } from '@/utils/date'
  84. import { dealDictObjData } from '@/utils/position'
  85. import { useRoute, useRouter } from 'vue-router'
  86. import { getToken } from '@/utils/auth'
  87. import Snackbar from '@/plugins/snackbar'
  88. import loginPage from '@/views/common/loginDialog.vue'
  89. const props = defineProps({
  90. id: {
  91. type: String,
  92. default: ''
  93. }
  94. })
  95. const showLogin = ref(false)
  96. // 打开快速登录
  97. const quickLogonOpen = () => {
  98. Snackbar.warning('您还未登录,请先登录后再试')
  99. showLogin.value = true
  100. }
  101. const route = useRoute()
  102. const router = useRouter()
  103. const tab = ref(1)
  104. const savedTab = new URLSearchParams(window.location.search).get('key')
  105. tab.value = savedTab ? (savedTab === 'briefIntroduction' ? 1 : 2) : 1
  106. // router.push(`${route.path}?key=${savedTab ? savedTab : 'briefIntroduction'}`)
  107. const handleTabClick = () => {
  108. router.push(`${route.path}?key=${tab.value === 1 ? 'briefIntroduction' : 'recruitmentPositions'}`)
  109. }
  110. // 企业埋点
  111. const handleEnterpriseClick = async () => {
  112. if (!props.id) return
  113. await enterpriseClick({ id: props.id })
  114. }
  115. handleEnterpriseClick()
  116. const statusList = [
  117. { label: '未认证', color: '#fb8c00', value: null, mdi: 'mdi-shield-remove' },
  118. { label: '审核中', color: '#fb8c00', value: '0', mdi: 'mdi-shield-half-full' },
  119. { label: '已认证', color: 'var(--v-primary-base)', value: '1', mdi: 'mdi-shield-check' },
  120. { label: '已驳回', color: '#fe574a', value: '2', mdi: 'mdi-shield-off' }
  121. ]
  122. // 企业详情
  123. const info = ref({})
  124. const authInfo = ref({})
  125. const getDetails = async () => {
  126. if (!props.id) return
  127. const data = await getEnterpriseDetails({ id: props.id })
  128. // 成立日期
  129. if (data?.business?.establishmentTime) {
  130. data.business.establishmentTime = timesTampChange(data.business.establishmentTime, 'Y-M-D')
  131. }
  132. info.value = { ...data, ...dealDictObjData({}, data.enterprise) }
  133. getCollectionStatus(props.id)
  134. // 企业实名认证信息
  135. authInfo.value = await getEnterpriseAuthDetails(props.id)
  136. }
  137. getDetails()
  138. const statusInfo = computed(() => {
  139. const obj = (authInfo.value && Object.keys(authInfo.value).length) ? statusList.find(e => e.value === authInfo.value.status) : statusList[0]
  140. return obj
  141. })
  142. // 效验求职者是否关注该企业
  143. const isCollection = ref(false)
  144. const getCollectionStatus = async (id) => {
  145. if (!getToken()) return isCollection.value = false
  146. const data = await getEnterpriseSubscribeCheck({ enterpriseId: id })
  147. isCollection.value = data
  148. }
  149. // 关注&取消关注企业
  150. const handleFollow = async () => {
  151. if (!getToken()) return quickLogonOpen()
  152. const api = isCollection.value ? getEnterpriseUnsubscribe : getEnterpriseSubscribe
  153. await api(isCollection.value ? props.id : { enterpriseId: props.id })
  154. getCollectionStatus(props.id)
  155. }
  156. // 工商信息
  157. const businessList = [
  158. { label: '企业类型:', value: 'type' },
  159. { label: '统一社会信用代码:', value: 'code' },
  160. { label: '成立日期:', value: 'establishmentTime' },
  161. { label: '注册资本:', value: 'registeredCapital' }
  162. ]
  163. </script>
  164. <style scoped lang="scss">
  165. .banner {
  166. background-color: #fff;
  167. padding: 0 0 20px;
  168. }
  169. .banner-title {
  170. display: flex;
  171. align-items: center;
  172. justify-content: space-between;
  173. height: 125px;
  174. }
  175. .content-left {
  176. width: 844px;
  177. padding: 20px;
  178. }
  179. .content-right {
  180. flex: 1;
  181. padding: 20px 20px 0 0;
  182. }
  183. .contact {
  184. height: 60px;
  185. line-height: 60px;
  186. }
  187. .contact-name {
  188. font-size: 28px;
  189. font-weight: 700;
  190. color: #37576c;
  191. line-height: 28px;
  192. }
  193. .contact-info {
  194. font-size: 15px;
  195. font-weight: 500;
  196. color: var(--color-222);
  197. line-height: 21px;
  198. margin-top: 8px;
  199. }
  200. .tools-box {
  201. height: 80px;
  202. width: 80px;
  203. background-color: var(--color-d5e6e8);
  204. border-radius: 5px;
  205. }
  206. .tools-box-number {
  207. font-size: 30px;
  208. font-weight: 700;
  209. color: var(--v-primary-base);
  210. }
  211. .tools-box-text {
  212. color: var(--v-primary-base);
  213. font-size: 14px;
  214. }
  215. .welfare {
  216. background-color: var(--color-f3);
  217. border-radius: 8px;
  218. padding: 12px;
  219. }
  220. .welfare-tags {
  221. display: flex;
  222. width: 242px;
  223. flex-wrap: wrap;
  224. height: 100px;
  225. overflow: hidden;
  226. text-align: center;
  227. }
  228. .welfare-tags-item {
  229. display: block;
  230. width: 117px;
  231. max-width: 117px;
  232. text-align: center;
  233. line-height: 26px;
  234. margin-right: 8px;
  235. &:nth-child(2n) {
  236. margin-right: 0;
  237. }
  238. }
  239. .business-item {
  240. font-size: 14px;
  241. color: var(--color-666);
  242. font-weight: 600;
  243. }
  244. .business-value {
  245. width: 228px;
  246. color: #000;
  247. font-weight: 500;
  248. }
  249. .business-source {
  250. font-size: 14px;
  251. color: var(--color-666);
  252. }
  253. .desc {
  254. width: 180px;
  255. color: var(--color-666);
  256. font-weight: 500;
  257. font-size: 12px;
  258. }
  259. .position-name {
  260. width: 180px;
  261. font-size: 14px;
  262. font-weight: 600;
  263. }
  264. </style>