|
@@ -24,24 +24,24 @@
|
|
|
<!-- 列表 -->
|
|
|
<ContentWrap>
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true">
|
|
|
- <el-table-column label="姓名(中)" align="center" prop="name_zh" fixed="left" />
|
|
|
- <el-table-column label="姓名(英)" align="center" prop="name_en" />
|
|
|
+ <el-table-column label="中文名称" align="center" prop="name_zh" fixed="left" />
|
|
|
+ <el-table-column label="英文名称" align="center" prop="name_en" />
|
|
|
<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="phone" />
|
|
|
- <el-table-column label="固定电话" align="center" prop="mobile" />
|
|
|
- <el-table-column label="创建日期" align="center" prop="created_at" :formatter="dateFormatter" />
|
|
|
+ <el-table-column label="手机号码" align="center" prop="mobile" />
|
|
|
+ <el-table-column label="固定电话" align="center" prop="phone" />
|
|
|
<el-table-column label="状态" align="center" prop="status" width="80">
|
|
|
<template #default="scope">
|
|
|
<el-tag type="success" v-if="scope.row.status === 'active'">已启用</el-tag>
|
|
|
<el-tag type="danger" v-else>已禁用</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="创建日期" align="center" prop="created_at" :formatter="dateFormatter" />
|
|
|
<el-table-column label="操作" align="center" fixed="right" min-width="110">
|
|
|
<template #default="scope">
|
|
|
<el-button link type="primary" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
<el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
|
|
- <el-button link :type="scope.row.status === 'active' ? 'danger': 'success'" @click="handleDisable(scope.row)">
|
|
|
+ <el-button link :type="scope.row.status === 'active' ? 'warning': 'success'" @click="handleDisable(scope.row)">
|
|
|
{{ scope.row.status === 'active' ? '禁用' : '启用'}}
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -85,9 +85,8 @@
|
|
|
</UploadImg>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="formBox">
|
|
|
+ <!-- <div class="formBox">
|
|
|
<el-form
|
|
|
- ref="formRef"
|
|
|
:model="formQuery"
|
|
|
label-width="128px"
|
|
|
v-loading="formLoading"
|
|
@@ -246,7 +245,8 @@
|
|
|
<el-tag v-if="itemData.updated_at" type="primary" effect="light">{{ itemData.updated_at }}</el-tag>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ <FormPage ref="FormPageRef" :formType="formType" :itemData="itemData" />
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<el-button @click="handleSave" type="success" :disabled="analysisLoading">保 存</el-button>
|
|
@@ -263,8 +263,9 @@ import { dateFormatter } from '@/utils/formatTime'
|
|
|
import { talentLabelingApi } from '@/api/menduner/system/talentMap/labeling'
|
|
|
import { Delete, Plus } from '@element-plus/icons-vue'
|
|
|
import MergeForm from '@/views/menduner/system/talentMap/components/merge.vue'
|
|
|
+import FormPage from './FormPage.vue'
|
|
|
|
|
|
-/** 人才地图 列表 */
|
|
|
+/** 人才采集 名片解析 */
|
|
|
defineOptions({ name: 'TalentMapCard' })
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
@@ -274,7 +275,7 @@ const loading = ref(false) // 列表的加载中
|
|
|
const list = ref([]) // 列表的数据
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
const queryParams = reactive({
|
|
|
- name: undefined,
|
|
|
+ name: undefined
|
|
|
})
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
@@ -305,14 +306,14 @@ const resetQuery = () => {
|
|
|
handleQuery()
|
|
|
}
|
|
|
|
|
|
-const dealData = (item) => {
|
|
|
- itemData.value = { ...item }
|
|
|
- careerTrajectory.value = item?.career_path ? JSON.parse(JSON.stringify(item.career_path)) : []
|
|
|
- if (!careerTrajectory.value?.length) careerTrajectory.value = [{ company_name: null, position: null, current_date: null }]
|
|
|
- Object.keys(formQuery.value).forEach(key => {
|
|
|
- formQuery.value[key] = item[key] || null
|
|
|
- })
|
|
|
-}
|
|
|
+// const dealData = (item) => {
|
|
|
+ // itemData.value = { ...item }
|
|
|
+ // careerTrajectory.value = item?.career_path ? JSON.parse(JSON.stringify(item.career_path)) : []
|
|
|
+ // if (!careerTrajectory.value?.length) careerTrajectory.value = [{ hotel_zh: null, title_zh: null, date: null }]
|
|
|
+ // Object.keys(formQuery.value).forEach(key => {
|
|
|
+ // formQuery.value[key] = item[key] || null
|
|
|
+ // })
|
|
|
+// }
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
const handleDelete = async (id) => {
|
|
@@ -333,7 +334,8 @@ const handleDelete = async (id) => {
|
|
|
const { push } = useRouter()
|
|
|
const handleEdit = async (item) => {
|
|
|
formType.value = 'edit'
|
|
|
- dealData(item)
|
|
|
+ // dealData(item)
|
|
|
+ itemData.value = item
|
|
|
file.value = null
|
|
|
filePath.value = null
|
|
|
try {
|
|
@@ -372,29 +374,29 @@ const handleDisable = async (item) => {
|
|
|
} catch {}
|
|
|
}
|
|
|
|
|
|
-const formQuery = ref({
|
|
|
- name_zh: undefined,
|
|
|
- name_en: undefined,
|
|
|
- title_zh: undefined,
|
|
|
- title_en: undefined,
|
|
|
- mobile: undefined,
|
|
|
- phone: undefined,
|
|
|
- email: undefined,
|
|
|
- hotel_zh: undefined,
|
|
|
- hotel_en: undefined,
|
|
|
- brand_zh: undefined,
|
|
|
- brand_en: undefined,
|
|
|
- affiliation_zh: undefined,
|
|
|
- affiliation_en: undefined,
|
|
|
- brand_group: undefined,
|
|
|
- address_zh: undefined,
|
|
|
- address_en: undefined,
|
|
|
- postal_code_zh: undefined,
|
|
|
- postal_code_en: undefined,
|
|
|
- birthday: undefined,
|
|
|
- residence: undefined,
|
|
|
-})
|
|
|
-const careerTrajectory = ref([{ company_name: null, position: null, current_date: null }])
|
|
|
+// const formQuery = ref({
|
|
|
+// name_zh: undefined,
|
|
|
+// name_en: undefined,
|
|
|
+// title_zh: undefined,
|
|
|
+// title_en: undefined,
|
|
|
+// mobile: undefined,
|
|
|
+// phone: undefined,
|
|
|
+// email: undefined,
|
|
|
+// hotel_zh: undefined,
|
|
|
+// hotel_en: undefined,
|
|
|
+// brand_zh: undefined,
|
|
|
+// brand_en: undefined,
|
|
|
+// affiliation_zh: undefined,
|
|
|
+// affiliation_en: undefined,
|
|
|
+// brand_group: undefined,
|
|
|
+// address_zh: undefined,
|
|
|
+// address_en: undefined,
|
|
|
+// postal_code_zh: undefined,
|
|
|
+// postal_code_en: undefined,
|
|
|
+// birthday: undefined,
|
|
|
+// residence: undefined,
|
|
|
+// })
|
|
|
+// const careerTrajectory = ref([{ company_name: null, position: null, current_date: null }])
|
|
|
|
|
|
const file = ref(null)
|
|
|
const uploadFile = ref(null)
|
|
@@ -402,31 +404,33 @@ const uploadChange = (raw) => {
|
|
|
file.value = raw
|
|
|
}
|
|
|
|
|
|
-const addCareer = () => {
|
|
|
- careerTrajectory.value = careerTrajectory.value || []
|
|
|
- careerTrajectory.value.push({ company_name: null, position: null, current_date: null })
|
|
|
-}
|
|
|
-const removeCareer = (index) => {
|
|
|
- if (careerTrajectory.value.length <= 1) return
|
|
|
- careerTrajectory.value.splice(index, 1)
|
|
|
-}
|
|
|
+// const addCareer = () => {
|
|
|
+// careerTrajectory.value = careerTrajectory.value || []
|
|
|
+// careerTrajectory.value.push({ company_name: null, position: null, current_date: null })
|
|
|
+// }
|
|
|
+// const removeCareer = (index) => {
|
|
|
+// if (careerTrajectory.value.length <= 1) return
|
|
|
+// careerTrajectory.value.splice(index, 1)
|
|
|
+// }
|
|
|
|
|
|
// 更新
|
|
|
const showAnalysisTable = ref(false)
|
|
|
const formLoading = ref(false)
|
|
|
const formType = ref('')
|
|
|
-const formRef = ref() // 表单 Ref
|
|
|
+const FormPageRef = ref(null)
|
|
|
const mergeFormRef = ref() // 合并表单 Ref
|
|
|
const handleSave = async () => {
|
|
|
+ const params = FormPageRef.value.formQuery
|
|
|
+ console.log(params, 'handleSubmit')
|
|
|
try {
|
|
|
formLoading.value = true
|
|
|
- formQuery.value.career_path = careerTrajectory
|
|
|
- Object.assign(itemData.value, formQuery.value)
|
|
|
+ // formQuery.value.career_path = careerTrajectory
|
|
|
+ // Object.assign(itemData.value, formQuery.value)
|
|
|
|
|
|
let result = {}
|
|
|
|
|
|
if (formType.value === 'create') {
|
|
|
- uploadFile.value.append('card_data', JSON.stringify(itemData.value))
|
|
|
+ uploadFile.value.append('card_data', JSON.stringify(params))
|
|
|
result = await talentLabelingApi.createBusinessCard(uploadFile.value)
|
|
|
message.success('新增成功')
|
|
|
showAnalysisTable.value = false
|
|
@@ -440,7 +444,7 @@ const handleSave = async () => {
|
|
|
mergeFormRef.value.open(result.data?.main_card?.id)
|
|
|
}
|
|
|
} else {
|
|
|
- await talentLabelingApi.updateBusinessCard(itemData.value, itemData.value.id)
|
|
|
+ await talentLabelingApi.updateBusinessCard(params, itemData.value.id)
|
|
|
message.success('更新成功')
|
|
|
showAnalysisTable.value = false
|
|
|
// 刷新列表
|
|
@@ -481,7 +485,8 @@ const handleAnalysis = async () => {
|
|
|
const res = await talentLabelingApi.businessCardParse(uploadFile.value)
|
|
|
|
|
|
if (index !== createAnalysisNum.value || !openUploadImg.value) return // 不是最新的名片解析数据(用户在解析完成前已重新上传)或用户已取消解析
|
|
|
- dealData(res?.data || res)
|
|
|
+ // dealData(res?.data || res)
|
|
|
+ itemData.value = res?.data || res
|
|
|
openUploadImg.value = false
|
|
|
showAnalysisTable.value = true
|
|
|
message.success('名片解析成功')
|
|
@@ -502,7 +507,7 @@ const handleAdd = () => {
|
|
|
filePath.value = null
|
|
|
analysisLoading.value = false
|
|
|
createAnalysisNum.value++
|
|
|
- careerTrajectory.value = [{ company_name: null, position: null, current_date: null }]
|
|
|
+ // careerTrajectory.value = [{ company_name: null, position: null, current_date: null }]
|
|
|
openUploadImg.value = true
|
|
|
}
|
|
|
|