details.vue 8.7 KB

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