details.vue 7.1 KB

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