瀏覽代碼

新任命查看联系方式

Xiao_123 4 月之前
父節點
當前提交
11a83d1727

+ 58 - 1
src/components/CtTable/index.vue

@@ -54,7 +54,7 @@
 
 <script setup>
 defineOptions({ name: 'CtTable'})
-import { ref, computed, useSlots, watch } from 'vue'
+import { ref, computed, useSlots, watch, onMounted } from 'vue'
 
 const selected = ref([])
 const emit = defineEmits(['pageHandleChange', 'del', 'edit', 'add', 'selected'])
@@ -157,6 +157,20 @@ const headerSlot = computed(() => {
   })
 })
 
+onMounted(() => {
+  const wrapper = table.value.$el.querySelector('.v-table__wrapper');
+  
+  const observer = new ResizeObserver(() => {
+    if (wrapper.scrollWidth > wrapper.clientWidth) {
+      wrapper.classList.add('hasScroll');
+    } else {
+      wrapper.classList.remove('hasScroll');
+    }
+  });
+
+  observer.observe(wrapper);
+});
+
 const edit = (item) => {
   emit('edit', item)
 }
@@ -187,4 +201,47 @@ const handleSelect = (e) => {
     white-space: nowrap !important;
   }
 
+  :deep {
+    .v-table__wrapper {
+      position: relative;
+      
+      &::-webkit-scrollbar:horizontal {
+        height: 8px;
+      }
+      
+      &:not(:hover)::-webkit-scrollbar:horizontal {
+        display: none;
+      }
+    }
+
+    .v-table__wrapper:not(:hover), 
+    .v-table__wrapper::-webkit-scrollbar-thumb:horizontal {
+      background: transparent;
+    }
+
+    table > tbody > tr > td:last-child,
+    table > thead > tr > th:last-child {
+      position: sticky !important;
+      position: -webkit-sticky !important;
+      right: 0;
+      z-index: 1;
+      background: white !important;
+      box-shadow: none;
+    }
+
+    .v-table__wrapper.hasScroll {
+      table > tbody > tr > td:last-child,
+      table > thead > tr > th:last-child {
+        border-left: 1px solid #e0e0e0 !important;
+        // box-shadow: inset 10px 0 10px -10px rgba(0, 0, 0, .35) !important;
+      }
+
+      table > thead > tr > th:last-child {
+        z-index: 10 !important;
+        // box-shadow: inset 10px 0 10px -10px rgba(0, 0, 0, .35) !important;
+        // border-bottom: 1px solid #e0e0e0 !important;
+      }
+    }
+  }
+
 </style>

+ 78 - 1
src/views/recruit/enterprise/newlyAppointed/index.vue

@@ -30,6 +30,9 @@
 			</template>
 			<template #actions="{ item }">
 				<v-btn variant="text" color="primary" @click.stop="handleDetail(item)">详 情</v-btn>
+				<v-btn :disabled="!item.userPersonList || !item.userPersonList.length" variant="text" color="primary" @click.stop="handleContactInformation(item)">
+					联系方式
+				</v-btn>
 			</template>
 		</CtTable>
 	</v-card>
@@ -53,15 +56,48 @@
 			</div>
 			<div class="text-center ml-5">潘青海先生(Peter Pan)</div>
 		</div>
+  </CtDialog>
+
+	<!-- 联系方式 -->
+	<CtDialog :visible="showContactDialog" title="当前联系方式匹配人员" :footer="false" widthType="0" @close="showContactDialog = false">
+		<CtTable
+			:loading="false"
+			:items="contactList"
+			:headers="contactHeaders"
+			:elevation="0"
+			:isTools="false"
+			:showPage="false"
+			itemKey="user.id"
+		>
+			<template #name="{ item }">
+				<div class="d-flex align-center cursor-pointer">
+          <v-badge
+            v-if="item?.person?.sex === '1' || item?.person?.sex === '2'"
+            bordered
+            offset-y="6"
+            :color="badgeColor(item)"
+            :icon="badgeIcon(item)">
+            <v-avatar size="40" :image="getUserAvatar(item.person.avatar, item.person.sex)"></v-avatar>
+          </v-badge>
+          <v-avatar v-else size="40" :image="getUserAvatar(item.person?.avatar, item.person?.sex)"></v-avatar>
+          <span class="ml-3">{{ item?.person?.name || item?.phone }}</span>
+        </div>
+			</template>
+			<template #actions="{ item }">
+				<v-btn variant="text" color="primary" @click.stop="handleContactInformation({ userPersonList: [item] })">联系方式</v-btn>
+			</template>
+		</CtTable>
   </CtDialog>
 </template>
 
 <script setup>
 defineOptions({ name: 'newlyAppointedTable'})
-import { ref } from 'vue'
+import { ref, computed } from 'vue'
 import { getNewAppointmentsPage, getNewAppointmentsDetail } from '@/api/recruit/enterprise/newlyAppointed'
 import { useUserStore } from '@/store/user'
 import Snackbar from '@/plugins/snackbar'
+import { getUserAvatar } from '@/utils/avatar'
+import { dealDictObjData } from '@/utils/position'
 
 const store = useUserStore()
 const loading = ref(false)
@@ -217,6 +253,47 @@ const handleDetail = async (item) => {
 	detail.value = result
 	showDetail.value = true
 }
+
+// 查看联系方式
+const contactList = ref([])
+const showContactDialog = ref(false)
+const contactHeaders = ref([
+  { title: '中文名', key: 'name', sortable: false },
+  { title: '英文名', key: 'person.foreignName', sortable: false },
+	{ title: '求职状态', key: 'person.jobStatusName', sortable: false },
+	{ title: '工作经验', key: 'person.expName', sortable: false },
+	{ title: '最高学历', key: 'person.eduName', sortable: false },
+	{ title: '联系电话', key: 'phone', sortable: false, value: item => item?.person?.phone || item.user.phone },
+  { title: '电子邮箱', key: 'email', sortable: false, value: item => item?.person?.email || item.user.email },
+  { title: '操作', key: 'actions', sortable: false, align: 'center' }
+])
+const handleContactInformation = async ({ userPersonList }) => {
+	await store.getEnterpriseInfo(true)
+	// 没有权限提示联系门墩儿
+	if (!info.value?.entitlement?.newAppointment) {
+		showDialog.value = true
+		return
+	}
+	// 只匹配到一个用户的直接查看详情
+	if (userPersonList.length === 1) {
+		window.open(`/recruit/enterprise/talentPool/details/${userPersonList[0].user.id}`)
+		return
+	}
+	// 匹配到多个用户,展示列表
+	contactList.value = userPersonList.map(e => {
+		if (e?.person) e.person = Object.assign(e.person, dealDictObjData({}, e.person))
+		return e
+	})
+	showContactDialog.value = true
+}
+
+const badgeColor = computed(() => (item) => {
+  return (item.person && item.person.sex) ? (item.person.sex === '1' ? '#1867c0' : 'error') : 'error'
+})
+
+const badgeIcon = computed(() => (item) => {
+  return (item.person && item.person.sex) ? (item.person.sex === '1' ? 'mdi-gender-male' : 'mdi-gender-female') : 'mdi-gender-female'
+})
 </script>
 
 <style scoped lang="scss">

+ 1 - 1
src/views/recruit/enterprise/resume/components/table.vue

@@ -158,7 +158,7 @@ const handleToPersonDetail = async ({ userId, id }) => {
   } catch (err) {
     console.log(err)
   }
-  window.open(`/recruit/enterprise/talentPool/details/${userId}?id=${id}&isMark=1`)
+  window.open(`/recruit/enterprise/talentPool/details/${userId}`)
 }
 
 // 加入人才库 

+ 3 - 3
src/views/recruit/enterprise/search/recommend/index.vue

@@ -177,9 +177,9 @@ const handleCommunicate = async (item) => {
 }
 
 // 人才详情
-const handleToPersonDetail = ({ userId, id }) => {
-  if (!userId || !id) return
-  window.open(`/recruit/enterprise/talentPool/details/${userId}?id=${id}`)
+const handleToPersonDetail = ({ userId }) => {
+  if (!userId) return
+  window.open(`/recruit/enterprise/talentPool/details/${userId}`)
 }
 
 const handleToInterviewManagement = () => {

+ 3 - 3
src/views/recruit/enterprise/search/retrieval/index.vue

@@ -270,9 +270,9 @@ const handleToInterviewManagement = () => {
 }
 
 // 人才详情
-const handleToPersonDetail = ({ userId, id }) => {
-  if (!userId || !id) return
-  window.open(`/recruit/enterprise/talentPool/details/${userId}?id=${id}`)
+const handleToPersonDetail = ({ userId }) => {
+  if (!userId) return
+  window.open(`/recruit/enterprise/talentPool/details/${userId}`)
 }
 
 const badgeColor = computed(() => (item) => {

+ 3 - 3
src/views/recruit/enterprise/talentMap/index.vue

@@ -246,9 +246,9 @@ const textItem = ref({
 })
 
 // 人才详情
-const talentPoolDetails = ({ userId, id }) => {
-  if (!userId || !id) return
-  window.open(`/recruit/enterprise/talentPool/details/${userId}?id=${id}`)
+const talentPoolDetails = ({ userId }) => {
+  if (!userId) return
+  window.open(`/recruit/enterprise/talentPool/details/${userId}`)
 }
 
 </script>

+ 9 - 4
src/views/recruit/enterprise/talentPool/components/details.vue

@@ -86,10 +86,15 @@ const operateItems = [
 // 获取人才详情
 const cvData = ref({})
 const getCvDetail = async () => {
-  const { id } = route.query
-  const { id: userId } = router.currentRoute.value.params
-  if (!id || !userId) return
-  const data = await getPersonCvDetail(userId || id)
+  const { id } = route.params
+  if (!id) {
+    Snackbar.warning('缺少简历id')
+    setTimeout(() => {
+      window.close()
+    }, 2000)
+    return
+  }
+  const data = await getPersonCvDetail(id)
   cvData.value = data
 }
 getCvDetail()

+ 3 - 3
src/views/recruit/enterprise/talentPool/index copy.vue

@@ -280,9 +280,9 @@ const openDrawer = () => {
 
 
 // 人才详情
-const talentPoolDetails = ({ userId, id }) => {
-  if (!userId || !id) return
-  window.open(`/recruit/enterprise/talentPool/details/${userId}?id=${id}`)
+const talentPoolDetails = ({ userId }) => {
+  if (!userId) return
+  window.open(`/recruit/enterprise/talentPool/details/${userId}`)
 }
 </script>
 

+ 3 - 3
src/views/recruit/enterprise/talentPool/index.vue

@@ -140,9 +140,9 @@ const badgeIcon = computed(() => (item) => {
 })
 
 // 人才详情
-const talentPoolDetails = ({ userId, id }) => {
-  if (!userId || !id) return
-  window.open(`/recruit/enterprise/talentPool/details/${userId}?id=${id}`)
+const talentPoolDetails = ({ userId }) => {
+  if (!userId) return
+  window.open(`/recruit/enterprise/talentPool/details/${userId}`)
 }
 </script>