Kaynağa Gözat

门墩儿招聘信息回显

lifanagju_citu 2 ay önce
ebeveyn
işleme
bf87871575

+ 6 - 2
src/views/menduner/system/person/details/components/attachment.vue

@@ -35,7 +35,6 @@ const queryParams = reactive({
   userId: props.userId
 })
 
-
 const fileUrl = ref('')
 const openPreview = ref(false)
 const fileName = ref('')
@@ -57,5 +56,10 @@ const getList = async () => {
     loading.value = false
   }
 }
-getList()
+
+watch(() => props.userId, (newVal) => {
+  if (newVal) {
+    getList()
+  }
+}, { immediate: true }, { deep: true })
 </script>

+ 10 - 1
src/views/menduner/system/person/details/components/expExtend.vue

@@ -39,6 +39,8 @@ import { dateFormatter2 } from '@/utils/formatTime'
 import { timesTampChange, getTimeDifferenceInChinese } from '@/utils/transform/date'
 import { formatName } from '@/utils'
 
+const emit = defineEmits(['echo'])
+
 const props = defineProps({
   userId: [String, Number], // 通过userId调用接口查询工作经验列表
   data: Array, // 传入工作经验列表
@@ -50,6 +52,7 @@ const queryParams = reactive({
   pageSize: 100,
   userId: props.userId
 })
+
 const expandAll = ref(props.defaultShowAll) // 展开/折叠
 const foldNum = ref(2) // 折叠时展示个数-1
 
@@ -75,13 +78,19 @@ const getExpList = async () => {
   try {
     const data = await PersonInfoApi.getPersonExpPage(queryParams)
     list.value = data.list?.length ? deal(data.list) : []
+    emit('echo', JSON.stringify(list.value))
     
     total.value = data.total
   } finally {
     loading.value = false
   }
 }
-getExpList()
+
+watch(() => props.userId, (newVal) => {
+  if (newVal) {
+    getExpList()
+  }
+}, { immediate: true }, { deep: true })
 </script>
 <style lang="scss" scoped>
 .exp {

+ 19 - 8
src/views/menduner/system/person/details/components/info.vue

@@ -47,6 +47,8 @@ import { DICT_TYPE } from '@/utils/dict'
 import { formatDate } from '@/utils/formatTime'
 import { PersonInfoApi } from '@/api/menduner/system/person'
 
+const emit = defineEmits(['echo'])
+
 const props = defineProps({
   id: String,
   userId: [String, Number]
@@ -55,10 +57,26 @@ const props = defineProps({
 // 获取人才详情
 const info = ref({})
 const getInfo = async () => {
+  if (!props.id) return
   const data = await PersonInfoApi.getPersonDetails(props.id)
   info.value = data
+  emit('echo', JSON.stringify(data))
+}
+
+// 获取用户详情
+const user = ref({})
+const getUserDetails = async () => {
+  if (!props.userId) return
+  const data = await PersonInfoApi.getUserDetails(props.userId)
+  user.value = data
 }
-if (props.id) getInfo()
+
+watch(() => props.userId, (newVal) => {
+  if (newVal) {
+    getInfo()
+    getUserDetails()
+  }
+}, { immediate: true }, { deep: true })
 
 // 会员套餐列表
 const packageList = ref([])
@@ -68,11 +86,4 @@ const getPackageList = async () => {
 }
 getPackageList()
 
-// 获取用户详情
-const user = ref({})
-const getUserDetails = async () => {
-  const data = await PersonInfoApi.getUserDetails(props.userId)
-  user.value = data
-}
-getUserDetails()
 </script>

+ 1 - 0
src/views/menduner/system/talentMap/components/FormPage.vue

@@ -330,6 +330,7 @@ const setFormData = (data) => {
       !Object.keys(data).length) {
     return;
   }
+  resetFormData()
   Object.entries(formQuery.value).forEach(([key]) => {
     const value = data[key];
     switch (key) {

+ 3 - 1
src/views/menduner/system/talentMap/maintenance/gather/components/data.js

@@ -75,12 +75,14 @@ export default {
 		{
 			"name_zh": "招聘1",
 			"checked": true,
+			"id": '1793583467288223745',
 			"userId": 1
 		},
 		{
 			"name_zh": '招聘2',
 			"checked": true,
-			"userId": 1
+			"id": '1843906600113389570',
+			"userId": '598525227328212992'
 		}
 	]
 }

+ 2 - 2
src/views/menduner/system/talentMap/maintenance/gather/components/search.vue

@@ -225,7 +225,7 @@ const resetQuery = () => {
 
 const addList = ref([])
 const detail = (row) => {
-  if (!row?.userId) {
+  if (!row?.id || !row?.userId) {
     message.warning('添加失败 !')
     return
   }
@@ -233,7 +233,7 @@ const detail = (row) => {
     message.warning('已经被添加,请勿重复添加 !')
     return
   }
-  addList.value.push({ userId: row.userId, name: row.name })
+  addList.value.push({ id: row.id, userId: row.userId, name: row.name })
   message.success('已添加到选择列表!')
   // emit('detail', { id: row.id, userId: row.userId, name: row.name })
 }

+ 52 - 6
src/views/menduner/system/talentMap/maintenance/gather/components/store.vue

@@ -4,10 +4,15 @@
       <div class="analysisFile !w-50%">
           <!-- 门墩儿人才库 -->
           <template v-if="source === '招聘'">
-            <el-card shadow="never">
-              <Info id="1793583467288223745" :user-id="userId" />
-              <expExtend :user-id="userId" defaultShowAll class="m-t-20px" />
-            </el-card>
+            <el-tabs v-model="activeName" type="border-card">
+              <el-tab-pane label="基本信息" name="info">
+                <Info :id="personId" :user-id="userId" @echo="infoEcho" />
+                <expExtend :user-id="userId" defaultShowAll class="m-t-20px" @echo="expEcho" />
+              </el-tab-pane>
+              <el-tab-pane label="附件简历" name="Attachment">
+                <Attachment showPreview :user-id="userId" />
+              </el-tab-pane>
+            </el-tabs>
           </template>
           <!-- 简历解析 -->
           <template v-if="source === '简历'">
@@ -69,10 +74,12 @@ import { ElLoading } from 'element-plus'
 import FormPage from '@/views/menduner/system/talentMap/components/FormPage.vue'
 import Info from '@/views/menduner/system/person/details/components/info.vue'
 import expExtend from '@/views/menduner/system/person/details/components/expExtend.vue'
+import Attachment from '@/views/menduner/system/person/details/components/attachment.vue'
 import TestData from './data.js'
 import { cloneDeep } from 'lodash-es'
 import { marked } from 'marked'
 import data from './data.js'
+import { timesTampChange, timestampToAge } from '@/utils/transform/date'
 
 // 配置 marked
 // marked.setOptions({
@@ -91,7 +98,9 @@ const originData = ref([])
 
 const imgUrl = ref(null)
 const fileUrl = ref(null)
-const userId = ref(null)
+const personId = ref('')
+const userId = ref('')
+const activeName = ref('info')
 
 // markdown回显
 const showPage = (html) => {
@@ -136,13 +145,50 @@ const dealData = async (type, data) => {
     imgUrl.value = data.pic_url
   }
   if (type === '简历') fileUrl.value = data.pic_url
-  if (type === '招聘') userId.value = data.userId
+  
+  if (type === '招聘') { // 门墩儿招聘-人员信息在组件中通过id和userId获取
+    personId.value = data?.id || ''
+    userId.value = data?.userId || ''
+    // return
+  }
   if (type === '新任命') {
     await nextTick()
     showPage(marked(data.originText))
   }
 }
 
+// 门墩儿招聘人才详情回显赋值
+const infoEcho = (data) => {
+  data = data ? JSON.parse(data) : null
+  itemData.value = {
+    ...itemData.value,
+    name_zh: data?.name || '',
+    email: data?.email || '',
+    mobile: data?.phone || '',
+    birthday: data?.birthday ? timesTampChange(data.birthday, 'Y-M-D') : '',
+    age: data?.birthday ? timestampToAge(data.birthday) : null,
+    created_at: data?.createTime ? timesTampChange(data.createTime, 'Y-M-D') : null,
+    updated_at: data?.updateTime ? timesTampChange(data.updateTime, 'Y-M-D') : null,
+  }
+  // if (FormPageRef.value?.setFormData) FormPageRef.value.setFormData(itemData.value)
+}
+
+// 门墩儿招聘人才工作经历回显赋值
+const expEcho = (workList) => {
+  workList = workList ? JSON.parse(workList) : null
+  itemData.value = {
+    ...itemData.value,
+    career_path: workList ? workList.map(e => {
+      return {
+        hotel_zh: e?.enterpriseName || null,
+        title_zh: e?.positionName || null,
+        date: e?.startTime ? timesTampChange(e.startTime, 'Y-M-D') : null
+      }
+    }) : null
+  }
+  // if (FormPageRef.value?.setFormData) FormPageRef.value.setFormData(itemData.value)
+}
+
 // 重置
 const resetData = () => {
   imgUrl.value = null