فهرست منبع

创建门墩儿招聘多选任务

lifanagju_citu 6 روز پیش
والد
کامیت
4a63336cbe

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

@@ -93,6 +93,13 @@
     </el-form>
   </ContentWrap>
 
+  <ContentWrap v-if="addList?.length">
+    <span style="color: #666;">已选择: </span>
+    <el-tag v-for="(i, index) in addList" :key="i.id" closable type="success" style="margin: 5px 10px 5px 0;" @close="delAddTag(index)">
+      {{ i.name }}
+    </el-tag>
+  </ContentWrap>
+
   <!-- 列表 -->
   <ContentWrap v-loading="loading">
     <div class="listBox">
@@ -105,6 +112,7 @@
         :key="item.id"
         :data="item"
         class="item"
+        detailButTxt="+ 添加"
         @detail="detail"
       />
     </div>
@@ -215,8 +223,21 @@ const resetQuery = () => {
   handleQuery()
 }
 
+const addList = ref([])
 const detail = (row) => {
-  emit('detail', { id: row.id, userId: row.userId })
+  if (!row?.id) {
+    message.warning('添加失败 !')
+    return
+  }
+  if (addList.value.some(e => e.id === row.id)) {
+    message.warning('已经被添加,请勿重复添加 !')
+    return
+  }
+  addList.value.push(row)
+  // emit('detail', { id: row.id, userId: row.userId, name: row.name })
+}
+const delAddTag = (index) => {
+  addList.value.splice(index, 1)
 }
 
 /** 初始化 **/
@@ -231,6 +252,10 @@ const detail = (row) => {
 // })
 
 if (!props.paramsVerify) getList()
+
+defineExpose({
+  addList
+})
 </script>
 
 <style lang="scss" scoped>

+ 20 - 11
src/views/menduner/system/talentMap/maintenance/gather/index.vue

@@ -67,7 +67,11 @@
 
     <!-- 人员搜索 -->
     <Dialog :title="radioObject.menduner" v-model="openSearch" :modalClose="false" width="1200" @close="openSearch = false">
-      <Search @detail="handleDetail" />
+      <Search ref="SearchRef" />
+      <template #footer>
+        <el-button type="primary" @click="handleSubmit">确 认</el-button>
+        <el-button @click="openSearch = false">取 消</el-button>
+      </template>
     </Dialog>
 
     <!-- 解析文件上传 -->
@@ -681,16 +685,21 @@ const cardUploadChange = (raw) => {
 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) // 简历解析
-    dialog_analysisInfo.value = true
-    // message.success(`操作成功`)
-  } catch {}
+// 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)
+//     resumeAnalysisToForm(data) // 简历解析
+//     dialog_analysisInfo.value = true
+//   } catch {}
+// }
+
+const SearchRef = ref(null)
+const handleSubmit = async () => {
+  console.log('打印->addList', SearchRef.value.addList)
+  message.success('创建任务成功!')
+  openSearch.value = false
 }
 
 const DialogWidth = ref('500')