|
@@ -47,7 +47,7 @@
|
|
|
</el-upload>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="人员搜索" name="personnelSearch">
|
|
|
- <Search @detail="handleDetail" :searchName="result?.person?.name" />
|
|
|
+ <Search @detail="handleDetail" :searchName="formData?.name_zh || formData?.name_en || ''" />
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-col>
|
|
@@ -56,15 +56,10 @@
|
|
|
<div ref="content" :style="{'height': height, 'overflow-y': 'auto'}">
|
|
|
<el-tabs type="border-card">
|
|
|
<el-tab-pane label="简历解析内容">
|
|
|
- <Info ref="InfoRef" v-model="result.person" :areaTreeData="areaTreeData" :isEdit="isEdit" />
|
|
|
- <JobIntention v-model="result.person.jobInterestedList" :isEdit="isEdit" @change="handleUpdateJobIntention" />
|
|
|
- <Edu v-model="result.eduList" :isEdit="isEdit" />
|
|
|
- <Exp v-model="result.workList" :isEdit="isEdit" />
|
|
|
- <Training v-model="result.trainList" :isEdit="isEdit" />
|
|
|
+ <FormPage ref="FormPageRef" :formType="isEdit ? 'edit' : 'create'" :itemData="formData" />
|
|
|
<div class="text-center m-t-30px">
|
|
|
<el-affix position="bottom" :offset="20">
|
|
|
- <!-- <el-button @click="push('/headhunting/menduner/system/talentMap/talentMap')" type="warning" plain size="large" class="!w-120px">取 消</el-button> -->
|
|
|
- <el-button v-if="id === 'add'" type="primary" @click="handleSave" size="large" class="!w-120px">保 存</el-button>
|
|
|
+ <el-button type="primary" @click="handleSave" size="large" class="!w-120px">保 存</el-button>
|
|
|
</el-affix>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
@@ -73,14 +68,8 @@
|
|
|
<template #header>
|
|
|
<CardTitle title="已有标签" />
|
|
|
</template>
|
|
|
- <m-tags v-if="Object.keys(result).length" :data="result?.resume?.skillsObjs" />
|
|
|
+ <m-tags v-if="formData && Object.keys(formData).length" :data="formData?.skillsObjs" />
|
|
|
</el-card>
|
|
|
- <!-- <el-card shadow="never" class="m-t-10px">
|
|
|
- <template #header>
|
|
|
- <CardTitle title="推荐标签" />
|
|
|
- </template>
|
|
|
- <TagsRecommend />
|
|
|
- </el-card> -->
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</div>
|
|
@@ -97,23 +86,18 @@ import { useUpload } from '@/components/UploadFile/src/useUpload'
|
|
|
import { commonApi } from '@/api/menduner/common'
|
|
|
import { Base64 } from 'js-base64'
|
|
|
import { getDict } from '@/hooks/web/useDictionaries'
|
|
|
-import DefaultData from './defaultData'
|
|
|
-import { cloneDeep } from 'lodash-es';
|
|
|
-
|
|
|
-import Info from './components/info.vue'
|
|
|
-import Edu from './components/edu.vue'
|
|
|
-import Exp from './components/exp.vue'
|
|
|
-import JobIntention from './components/jobIntention.vue'
|
|
|
-import Training from './components/training.vue'
|
|
|
import MTags from './components/tags.vue'
|
|
|
-import TagsRecommend from './components/tagsRecommend.vue'
|
|
|
+// import DefaultData from './defaultData'
|
|
|
+import { cloneDeep } from 'lodash-es';
|
|
|
+import { timesTampChange, timestampToAge } from '@/utils/transform/date'
|
|
|
+import FormPage from '@/views/menduner/system/talentMap/components/FormPage.vue'
|
|
|
import Search from './components/search.vue'
|
|
|
+import { talentLabelingApi } from '@/api/menduner/system/talentMap/labeling'
|
|
|
|
|
|
-const { push } = useRouter()
|
|
|
+const { back } = useRouter()
|
|
|
const loading = ref(false)
|
|
|
const activeName = ref('resumeAnalysis')
|
|
|
const saveLoading = ref(false)
|
|
|
-const result = ref(cloneDeep(DefaultData))
|
|
|
const fileUrl = ref('') // https://minio.menduner.com/dev/person/229988673960153088/attachment/ee3eb21f45e13ede3557a03d18585ed80c5b4212ac5634e3436e309afaa8fe6a.pdf
|
|
|
const uploadRef = ref()
|
|
|
const fileList = ref([])
|
|
@@ -121,7 +105,7 @@ const data = ref({ path: '' })
|
|
|
const { uploadUrl, httpRequest } = useUpload()
|
|
|
|
|
|
/** 初始化 */
|
|
|
-const InfoRef = ref()
|
|
|
+// const InfoRef = ref()
|
|
|
const content = ref()
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
const height = ref(0)
|
|
@@ -134,21 +118,8 @@ const isEdit = ref(false)
|
|
|
const drawer = ref(false)
|
|
|
|
|
|
const resumeTxt = ref([])
|
|
|
-
|
|
|
-// 地区树状列表
|
|
|
-const areaTreeData = ref([])
|
|
|
-const getDictData = async () => {
|
|
|
- const { data } = await getDict('areaTreeData', {}, 'areaTreeData')
|
|
|
- const obj = data.find(e => e.name === '中国')
|
|
|
- const list = obj?.children ? obj.children.map(e =>{
|
|
|
- // 市辖区直接显示区
|
|
|
- const municipality = e.children && e.children.length && e.children[0].name === '市辖区'
|
|
|
- if (municipality && e.children[0].children?.length) e.children = e.children[0].children
|
|
|
- return e
|
|
|
- }) : []
|
|
|
- areaTreeData.value = list.length ? list : []
|
|
|
-}
|
|
|
-getDictData()
|
|
|
+const formData = ref({})
|
|
|
+const FormPageRef = ref(null)
|
|
|
|
|
|
// 获取人才详情
|
|
|
const getTalentMap = async () => {
|
|
@@ -159,8 +130,7 @@ const getTalentMap = async () => {
|
|
|
if (data.person?.resumeUrl) {
|
|
|
fileUrl.value = !data.person?.resumeUrl.includes('.pdf') ? `${baseUrl}/onlinePreview?url=${encodeURIComponent(Base64.encode(data.person?.resumeUrl))}` : data.person?.resumeUrl
|
|
|
} else activeName.value = 'personnelSearch'
|
|
|
- result.value = data
|
|
|
- result.value.person.interestedAreaIdList = result.value.person.interestedAreaIdList && result.value.person.interestedAreaIdList.length ? result.value.person.interestedAreaIdList.map(e => Number(e)) : []
|
|
|
+ setItemDataValue(data)
|
|
|
} catch (error) {
|
|
|
console.log(error)
|
|
|
} finally {
|
|
@@ -173,7 +143,7 @@ onMounted(async () => {
|
|
|
if (id && id !== 'add') {
|
|
|
isEdit.value = true
|
|
|
await getTalentMap()
|
|
|
- } else result.value = cloneDeep(DefaultData)
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
// 简历解析
|
|
@@ -181,8 +151,7 @@ const getResumeParser = async (url) => {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
const data = await commonApi.resumeParser({ fileUrl: url })
|
|
|
- result.value = data
|
|
|
- result.value.person.interestedAreaIdList = result.value.person.interestedAreaIdList && result.value.person.interestedAreaIdList.length ? result.value.person.interestedAreaIdList.map(e => Number(e)) : []
|
|
|
+ setItemDataValue(data)
|
|
|
} finally {
|
|
|
loading.value = false
|
|
|
}
|
|
@@ -217,7 +186,6 @@ const submitFormSuccess = () => {
|
|
|
// 查看文本信息
|
|
|
const handleText = () => {
|
|
|
drawer.value = true
|
|
|
- resumeTxt.value = result.value.resume.rawText.split('\n')
|
|
|
}
|
|
|
|
|
|
// 重新上传简历
|
|
@@ -226,63 +194,80 @@ const handleResetUpload = async () => {
|
|
|
fileUrl.value = ''
|
|
|
data.value.path = ''
|
|
|
fileList.value = []
|
|
|
- result.value = cloneDeep(DefaultData)
|
|
|
+ setItemDataValue()
|
|
|
+}
|
|
|
+
|
|
|
+const setItemDataValue = (data) => {
|
|
|
+ formData.value = {
|
|
|
+ name_zh: data?.person?.name || '',
|
|
|
+ email: data?.person?.email || '',
|
|
|
+ mobile: data?.person?.phone || '',
|
|
|
+ birthday: data?.person?.birthday ? timesTampChange(data.person.birthday, 'Y-M-D') : '',
|
|
|
+ age: data?.person?.birthday ? timestampToAge(data.person.birthday) : null,
|
|
|
+ career_path: data?.workList ? data.workList.map(e => {
|
|
|
+ return {
|
|
|
+ hotel_zh: e?.enterpriseName || null,
|
|
|
+ title_zh: e?.positionName || null,
|
|
|
+ date: e?.startTime ? timesTampChange(e.startTime, 'Y-M-D') : null
|
|
|
+ }
|
|
|
+ }) : [],
|
|
|
+ created_at: data?.person?.createTime ? timesTampChange(data.person.createTime, 'Y-M-D') : null,
|
|
|
+ updated_at: data?.person?.updateTime ? timesTampChange(data.person.updateTime, 'Y-M-D') : null,
|
|
|
+ }
|
|
|
+ resumeTxt.value = data?.resume?.rawText?.split('\n') || ''
|
|
|
+ if (FormPageRef.value?.setFormData) FormPageRef.value.setFormData(formData.value)
|
|
|
}
|
|
|
|
|
|
// 搜索-查看详情
|
|
|
-const keyList = ['person', 'eduList', 'workList', 'trainList']
|
|
|
const handleDetail = async (userId) => {
|
|
|
if (!userId) return message.warning('请先选择人才!')
|
|
|
try {
|
|
|
const data = await TalentMap.getTalentMapDetail(userId)
|
|
|
- if (data && data.person && data.person.id) delete data.person.id
|
|
|
- keyList.forEach(key => result.value[key] = data[key])
|
|
|
+ // 去除id
|
|
|
+ setItemDataValue(data, true)
|
|
|
} catch {}
|
|
|
}
|
|
|
|
|
|
// 新增人才
|
|
|
-const arrKey = ['eduList', 'workList', 'trainList']
|
|
|
+const formLoading = ref(false)
|
|
|
+const uploadFile = ref(null)
|
|
|
const handleSave = async () => {
|
|
|
- if (result.value?.resume) delete result.value.resume
|
|
|
- if (!fileUrl.value) {
|
|
|
- arrKey.forEach(key => {
|
|
|
- if (result.value[key] && result.value[key].length) result.value[key].forEach(item => delete item.id)
|
|
|
- })
|
|
|
+ const params = { ...FormPageRef.value.formQuery }
|
|
|
+ if (!params.name_zh) return message.warning('请填写姓名!')
|
|
|
+
|
|
|
+ // 数组转为字符串保存
|
|
|
+ if (Array.isArray(params?.mobile)) {
|
|
|
+ params.mobile = params.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
|
|
|
}
|
|
|
- console.log(result.value, 'result-add')
|
|
|
-
|
|
|
- // 效验基本信息中必填项是否有填写
|
|
|
- if (!result.value?.person?.name) {
|
|
|
- message.notifyWarning('请填写用户姓名后再提交!')
|
|
|
- InfoRef.value.formRef.validate()
|
|
|
- content.value.scrollTo({ top: -100, behavior: 'smooth' })
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- saveLoading.value = true
|
|
|
+ console.log(params, 'handleSubmit')
|
|
|
try {
|
|
|
- await TalentMap.createTalentMapInfo(result.value)
|
|
|
- message.success('新增成功!')
|
|
|
- result.value = cloneDeep(DefaultData)
|
|
|
- push('/headhunting/menduner/system/talentMap/talentMap')
|
|
|
- } catch (error) {
|
|
|
- console.log(error)
|
|
|
- } finally {
|
|
|
- saveLoading.value = false
|
|
|
- }
|
|
|
-}
|
|
|
+ formLoading.value = true
|
|
|
+ let result = {}
|
|
|
+ if (!id || id === 'add') { // 新增
|
|
|
+ // uploadFile.value.append('card_data', JSON.stringify(params))
|
|
|
+ result = await talentLabelingApi.createBusinessCardPost(params)
|
|
|
+ message.success('新增成功')
|
|
|
+ back()
|
|
|
|
|
|
-// 查看详情-编辑求职意向
|
|
|
-const handleUpdateJobIntention = async (val, type) => {
|
|
|
- try {
|
|
|
- await TalentMap.updateTalentMapInfo(result.value.person)
|
|
|
- message.success((type === 'add' ? '新增' : type === 'edit' ? '编辑' : '删除') + '成功')
|
|
|
+ if (result.code === 202 || result.message.includes('疑似重复')) {
|
|
|
+ if (!result.data?.main_card?.id) return
|
|
|
+
|
|
|
+ await message.confirm('发现与当前名片的疑似重复数据,去处理')
|
|
|
+ mergeFormRef.value.open(result.data?.main_card?.id)
|
|
|
+ }
|
|
|
+ } else { // 编辑
|
|
|
+ await talentLabelingApi.updateBusinessCard(params, id)
|
|
|
+ message.success('更新成功')
|
|
|
+ back()
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
- console.log(error)
|
|
|
+ console.log('更新失败', error)
|
|
|
} finally {
|
|
|
+ uploadFile.value = null
|
|
|
formLoading.value = false
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
:deep(.drawer) {
|