瀏覽代碼

创建门墩儿招聘任务对接

lifanagju_citu 4 天之前
父節點
當前提交
bfe869e68e

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

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

+ 18 - 22
src/views/menduner/system/talentMap/maintenance/gather/index.vue

@@ -88,12 +88,7 @@
     </template>
   </Dialog>
 
-  <!-- 人员搜索 -->
-  <Dialog :title="radioObject.menduner" v-model="openSearch" :modalClose="false" width="1200" @close="openSearch = false">
-    <Search @detail="handleDetail" />
-  </Dialog>
-
-    <!-- 解析文件上传 -->
+  <!-- 解析文件上传 -->
   <Dialog :title="radioObject[radioValue]" v-model="dialog_upload" :modalClose="false" :width="DialogWidth" @close="handleCancel">
     <div>
       <!-- 简历解析 -->
@@ -154,6 +149,10 @@
           @reset="webOriginList = []"
         />
       </template>
+      <!-- 网页解析 -->
+      <template v-if="radioValue === 'menduner'">
+        <Search ref="SearchRef" />
+      </template>
     </div>
     <template #footer>
       <el-button @click="handleSubmit" type="success" :disabled="analysisLoading" :loading="analysisLoading">提 交</el-button>
@@ -209,6 +208,8 @@ const taskType = [
 const taskStatus = ['待解析', '解析中', '解析完成']
 const itemData = ref({})
 
+const SearchRef = ref(null)
+
 /** 查询列表 */
 const getList = async () => {
   loading.value = true
@@ -324,6 +325,16 @@ const handleSubmit = async () => {
     })
     handleCreateTask(formData)
   }
+  
+  if (type === 'menduner') {
+    const formData = new FormData()
+    const list = SearchRef.value?.addList?.length ? SearchRef.value.addList : null
+    if (!list) return message.warning('请先选择人员 !')
+
+    formData.append('task_type', '招聘')
+    formData.append('data', list)
+    handleCreateTask(formData)
+  }
 }
 
 // 简历解析
@@ -369,20 +380,6 @@ const cardUploadChange = (file, type) => {
   cardUploadRow.value = type ? [{ raw: file }] : file
 }
 
-// 人员搜索
-const openSearch = ref(false)
-const id = ref(null)
-const userId = ref(null)
-const handleDetail = async ({id: use_id, userId: use_userId}) => {
-  if (!use_userId || !use_userId)  return message.warning('请先选择人才!')
-  id.value = use_id; userId.value = use_userId
-  try {
-    const data = await TalentMap.getTalentMapDetail(use_userId)
-    // 去除id
-    resumeAnalysisToForm(data) // 简历解析
-  } catch {}
-}
-
 // 选择解析方式
 const DialogWidth = ref('500')
 const handleSelect = () => {
@@ -395,8 +392,7 @@ const handleSelect = () => {
     DialogWidth.value = '800'
   }
   if (type === 'menduner') {
-    openSearch.value = true
-    return
+    DialogWidth.value = '1200'
   }
   dialog_upload.value = true
 }