|
@@ -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>
|