Browse Source

人才采集

Xiao_123 2 tháng trước cách đây
mục cha
commit
f6d5ad3ee5

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

@@ -354,7 +354,8 @@ defineExpose({
 	setFormData,
 	resetFormData,
 	changeLoading,
-	formQuery
+	formQuery,
+  careerTrajectory
 })
 </script>
 

+ 14 - 11
src/views/menduner/system/talentMap/maintenance/examine/index.vue

@@ -40,21 +40,27 @@
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true">
+      <el-table-column label="ID" align="center" prop="id" />
       <el-table-column label="姓名" align="center" prop="name_zh" />
       <el-table-column label="职位" align="center" prop="title_zh" />
       <el-table-column label="酒店" align="center" prop="hotel_zh" />
       <el-table-column label="手机号码" align="center" prop="mobile" />
       <el-table-column label="来源" align="center" prop="task_type" />
-      <el-table-column label="状态" align="center" prop="status" />
+      <el-table-column label="状态" align="center" prop="status">
+        <template #default="{ row }">
+          <el-tag :type="typeObj[row.status]">{{ row.status }}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="创建时间" align="center" prop="created_at" :formatter="dateFormatter" />
       <el-table-column label="更新时间" align="center" prop="updated_at" :formatter="dateFormatter" />
       <el-table-column label="操作" align="center" fixed="right" min-width="110">
         <template #default="scope">
           <el-button
+            v-if="scope.row.status === '待审核'"
             link
             type="primary"
             @click="handleStore(scope.row)"
-          >入库</el-button>
+          >审核入库</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -97,6 +103,11 @@ const taskType = [
   { label: '门墩儿招聘', value: '招聘' },
   { label: '杂项', value: '杂项' }
 ]
+const typeObj = {
+  '待审核': 'primary',
+  '已入库': 'success',
+  '已拒绝': 'danger'
+}
 
 /** 查询列表 */
 const getList = async () => {
@@ -127,15 +138,7 @@ const resetQuery = () => {
 // 入库
 const StorePageRef = ref(null)
 const handleStore = (row) => {
-  const isRecruitment = Boolean(row.task_type === '招聘')
-  // if (isRecruitment) {
-  //   if (!task_source?.data) return message.warning(txt)
-  // } else {
-  //   if (!parse_result) return message.warning(txt)
-  // }
-
-  const list = isRecruitment ? { results: [row] } : [row] // 解析的人才列表
-  StorePageRef.value.open(row.task_type, list, row.task_id)
+  StorePageRef.value.open(row.task_type, [row], row.task_id)
 }
 
 /** 初始化 **/

+ 55 - 135
src/views/menduner/system/talentMap/maintenance/examine/store.vue

@@ -1,6 +1,6 @@
 <template>
   <Dialog
-    title="人才入库"
+    title="人才审核入库"
     v-model="dialogVisible"
     :modalClose="false"
     width="90%"
@@ -11,7 +11,7 @@
         <div v-if="hasSourceUrl">
           <!-- 门墩儿人才库 -->
           <template v-if="type === '招聘'">
-            <el-tabs v-model="activeName" type="border-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" />
@@ -19,7 +19,8 @@
               <el-tab-pane label="附件简历" name="Attachment">
                 <Attachment showPreview :user-id="userId" />
               </el-tab-pane>
-            </el-tabs>
+            </el-tabs> -->
+            人才ID:{{ originUrl }}
           </template>
           <!-- 简历解析 -->
           <template v-if="type === '简历'">
@@ -44,28 +45,7 @@
         <el-empty v-else description="暂无原始文件" />
       </div>
       <div class="flex-1">
-				<!-- <el-tabs type="border-card">
-					<el-tab-pane label="已解析人才列表"> -->
-						<!-- <div class="tagBox mb-10px" v-if="tagList?.length">
-              <el-tag 
-                :type="index === tagCurrentIndex ? 'primary' : 'info'" 
-                size="large"
-                effect="plain"
-                v-for="(val, index) in tagList"
-                :key="val.name + index"
-                class="mr-10px cursor-pointer mb-10px"
-                @click="handleTagClick(index)"
-              >
-                <div class="flex items-center">
-                  <el-checkbox v-model="val.checked" @click.stop />
-                  <span class="ml-5px">{{ val.name }}</span>
-                  <Icon icon="ep:view" class="ml-5px" /> 
-                </div>
-              </el-tag>
-            </div> -->
-            <FormPage	ref="FormPageRef"	formType="create"	:itemData="itemData" />
-					<!-- </el-tab-pane>
-				</el-tabs> -->
+        <FormPage	ref="FormPageRef"	formType="create"	:itemData="itemData" />
       </div>
     </div>
     <template #footer>
@@ -80,9 +60,9 @@
 defineOptions({ name: 'Store' })
 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 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 { cloneDeep } from 'lodash-es'
 import { marked } from 'marked'
 import { timesTampChange, timestampToAge } from '@/utils/transform/date'
@@ -94,15 +74,13 @@ const emit = defineEmits(['refresh'])
 const dialogVisible = ref(false)
 const FormPageRef = ref(null)
 const itemData = ref({})
-// const tagList = ref([])
-// const tagCurrentIndex = ref(0)
 const type = ref('')
 const originData = ref([])
 
 const originUrl = ref(null)
-const personId = ref('')
-const userId = ref('')
-const activeName = ref('info')
+// const personId = ref('')
+// const userId = ref('')
+// const activeName = ref('info')
 const hasSourceUrl = ref(false)
 
 // markdown回显
@@ -148,16 +126,15 @@ const dealData = async (type, data) => {
   hasSourceUrl.value = data.image_path ? true : false
   if (!data.image_path) return
 
-  if (['名片', '杂项', '简历'].includes(type)) {
+  if (['名片', '杂项', '简历', '招聘'].includes(type)) {
     originUrl.value = data.image_path
   }
   
-  if (type === '招聘') { // 门墩儿招聘-人员信息在组件中通过id和userId获取
-    personId.value = data?.id || ''
-    userId.value = data?.userId || ''
-    activeName.value = 'info'
-    // return
-  }
+  // if (type === '招聘') { // 门墩儿招聘-人员信息在组件中通过id和userId获取
+  //   personId.value = data?.id || ''
+  //   userId.value = data?.userId || ''
+  //   activeName.value = 'info'
+  // }
   if (type === '新任命') {
     await nextTick()
     const response = await fetch(data.image_path)
@@ -177,60 +154,50 @@ const dealData = async (type, data) => {
 }
 
 // 门墩儿招聘人才详情回显赋值
-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,
-  }
-}
+// 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,
+//   }
+// }
 
 // 门墩儿招聘人才工作经历回显赋值
-const expEcho = (workList) => {
-  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
-  }
-}
+// const expEcho = (workList) => {
+//   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
+//   }
+// }
 
 // 重置
 const resetData = () => {
-  // tagCurrentIndex.value = 0
-  id.value = null
+  taskId.value = null
   type.value = null
   originUrl.value = null
   itemData.value = {}
   originData.value = []
-  // tagList.value = []
 }
 
 // 打开弹窗
-const id = ref(null)
+const taskId = ref(null)
 const open = async (task_type, parse_result, task_id) => {
   resetData()
-  id.value = task_id
+  taskId.value = task_id
   type.value = task_type
 
-  // const dataList = parse_result.map((e, index) => {
-  //   tagList.value.push({
-  //     name: e.name_zh || `人才${ index + 1 }`,
-  //     checked: true
-  //   })
-  //   return e
-  // })
-
   originData.value = parse_result
   itemData.value = originData.value[0]
   dealData(type.value, originData.value[0]) // 赋值左侧原始文件
@@ -238,65 +205,29 @@ const open = async (task_type, parse_result, task_id) => {
 }
 defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 
-// 当前操作数据
-// const handleTagClick = (index) => {
-// 	tagCurrentIndex.value = index
-//   const row = originData.value[tagCurrentIndex.value]
-// 	itemData.value = row
-//   dealData(type.value, row)
-// }
-
-// 监听表单变化,同步更新originData中对应的数据
-// watch(() => FormPageRef.value?.formQuery, (newVal) => {
-//   if (tagCurrentIndex.value !== null && originData.value && originData.value.length > tagCurrentIndex.value) {
-//     originData.value[tagCurrentIndex.value] = { ...newVal }
-//   }
-// }, { deep: true })
-
 // 入库
 const handleStore = async () => {
-  // 验证originData数组中每个人才的name_zh字段,并处理mobile字段
-  // const results = [] // 只提交勾选的数据
-  // if (list && Array.isArray(list) && list.length > 0) {
-  //   for (let i = 0; i < list.length; i++) {
-  //     // 只校验勾选的数据
-  //     if (tagList.value[i].checked) {
-  //       const talent = list[i]
-  //       if (!talent.name_zh || talent.name_zh.trim() === '') {
-  //         return message.warning(`第${i + 1}个人才中的中文姓名未填写,请完善后再进行保存`)
-  //         // return message.warning(`中文姓名未填写,请完善后再进行保存`)
-  //       }
-        
-  //       // 处理mobile字段,如果是数组则转换为字符串
-  //       if (Array.isArray(talent.mobile)) {
-  //         talent.mobile = talent.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
-  //       }
-  //       results.push(talent)
-  //     }
-  //   }
-  // }
-  
-  // if (!results?.length) return message.warning(`未选择人才,请选择要入库的人才!`)
-  // await message.confirm('是否对当前选中的人才进行入库?')
-
+  if (!itemData.value.id) return message.warning('缺少id,请稍后再试')
   const formQuery = FormPageRef.value?.formQuery || {}
   if (!formQuery?.name_zh) return message.warning(`中文姓名未填写,请完善后再进行保存`)
   if (Array.isArray(formQuery.mobile)) {
     formQuery.mobile = formQuery.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',')
   }
+ 
+  const params = {
+    task_id: taskId.value,
+    task_type: type.value,
+    data: {
+      results: [Object.assign(itemData.value, formQuery, { career_path: FormPageRef.value.careerTrajectory })]
+    }
+  }
+  console.log(params, '审核入库')
 
   const loading = ElLoading.service({
     lock: true,
     text: '正在保存中...',
     background: 'rgba(0, 0, 0, 0.7)'
   })
-  const params = {
-    task_id: id.value,
-    task_type: type.value,
-    data: {
-      results: [formQuery]
-    }
-  }
   try {
     await talentGatherApi.talentsAdd(JSON.stringify(params))
     message.success('入库成功!')
@@ -318,15 +249,4 @@ const handleStore = async () => {
     overflow: auto;
   }
 }
-// .tagBox {
-//   padding: 12px;
-//   border: 1px dashed #409EFF;
-//   border-radius: 4px;
-// }
-// :deep {
-//   .el-tag__content {
-//     display: flex;
-//     align-items: center;
-//   }
-// }
 </style>

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

@@ -54,8 +54,8 @@
 							<el-table-column v-if="source !== '招聘'" label="文件名" align="center" prop="original_filename" />
 							<el-table-column v-if="source === '新任命'" label="发布时间" align="center" prop="publish_time" />
 							<template v-if="source === '招聘'">
-								<el-table-column label="姓名" align="center" prop="data.name_zh" />
-								<el-table-column label="联系电话" align="center" prop="data.mobile" />
+								<el-table-column label="姓名" align="center" prop="name_zh" />
+								<el-table-column label="联系电话" align="center" prop="mobile" />
 							</template>
 							<el-table-column label="状态" align="center" prop="status">
 								<template #default="scope">{{ source === '招聘' ? '成功' : scope.row.status }}</template>
@@ -207,4 +207,12 @@ const handleDetail = (row) => {
 </script>
 
 <style lang="scss" scpoed>
+.analysisInfoBox {
+  display: flex;
+	min-height: 50vh;
+  .analysisFile {
+    padding-right: 12px;
+    overflow: auto;
+  }
+}
 </style>

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

@@ -217,23 +217,20 @@ const getTypicalData = (row, expData) => {
   return {
     id: row.id,
     userId: row.userId,
-    name_zh: row.name,
-    data: {
-      name_zh: row?.name || '',
-      email: row?.email || '',
-      mobile: row?.phone || '',
-      birthday: row?.birthday ? timesTampChange(row.birthday, 'Y-M-D') : '',
-      age: row?.birthday ? timestampToAge(row.birthday) : null,
-      created_at: row?.createTime ? timesTampChange(row.createTime, 'Y-M-D') : null,
-      updated_at: row?.updateTime ? timesTampChange(row.updateTime, 'Y-M-D') : null,
-      career_path: expData ? expData.map(e => {
-        return {
-          hotel_zh: e?.enterpriseName || null,
-          title_zh: e?.positionName || null,
-          date: e?.startTime ? timesTampChange(e.startTime, 'Y-M-D') : null
-        }
-      }) : null
-    }
+    name_zh: row?.name || '',
+    email: row?.email || '',
+    mobile: row?.phone || '',
+    birthday: row?.birthday ? timesTampChange(row.birthday, 'Y-M-D') : '',
+    age: row?.birthday ? timestampToAge(row.birthday) : null,
+    created_at: row?.createTime ? timesTampChange(row.createTime, 'Y-M-D') : null,
+    updated_at: row?.updateTime ? timesTampChange(row.updateTime, 'Y-M-D') : null,
+    career_path: expData ? expData.map(e => {
+      return {
+        hotel_zh: e?.enterpriseName || null,
+        title_zh: e?.positionName || null,
+        date: e?.startTime ? timesTampChange(e.startTime, 'Y-M-D') : null
+      }
+    }) : null
   }
 }
 

+ 15 - 5
src/views/menduner/system/talentMap/maintenance/labeling/LabelingForm.vue

@@ -269,14 +269,24 @@ const baseInfoRef = ref(null)
 const saveLoading = ref(false)
 const handleSave = async () => {
 	saveLoading.value = true
-	const params = baseInfoRef.value.formQuery
-	if (!params || !Object.keys(params).length) return saveLoading.value = true
+
+	const formQuery = baseInfoRef.value.formQuery
+	if (!formQuery || !Object.keys(formQuery).length) return saveLoading.value = true
 	// 数组转为字符串保存
-  if (Array.isArray(params?.mobile)) {
-    params.mobile = params.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
+  if (Array.isArray(formQuery?.mobile)) {
+    formQuery.mobile = formQuery.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
   }
+
+	const params = {
+		...formQuery,
+		origin_source: talentItem.value?.origin_source,
+		image_path: talentItem.value?.image_path
+	}
+
+	console.log(params, '编辑')
+
 	try {
-		await talentLabelingApi.updateBusinessCard({...params, origin_source: talentItem.value?.origin_source}, talentItem.value.id)
+		await talentLabelingApi.updateBusinessCard(params, talentItem.value.id)
 		dialogVisible.value = false
 		message.success('保存成功')
 		emit('success')