Browse Source

人才地图维护-简历调整

Xiao_123 2 ngày trước cách đây
mục cha
commit
99c0e2a18e

+ 5 - 2
src/views/menduner/system/talentMap/details/components/edu.vue

@@ -1,7 +1,7 @@
 <template>
   <el-card shadow="never" class="m-t-10px">
     <template #header>
-      <div style="display: flex; justify-content: space-between;">
+      <div class="flex justify-between">
         <CardTitle title="教育经历" />
         <el-button link type="primary" @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" />新增</el-button>
       </div>
@@ -68,6 +68,7 @@ import { cloneDeep } from 'lodash-es'
 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
 import { timesTampChange } from '@/utils/transform/date'
 import { TalentMap } from '@/api/menduner/system/talentMap';
+import { formatName } from '@/utils'
 
 const props = defineProps({
   modelValue: Array,
@@ -75,7 +76,9 @@ const props = defineProps({
 })
 const list = ref([])
 watch(() => props.modelValue, (newVal) => {
-  list.value = newVal
+  list.value = newVal ? newVal.map(e => {
+    return { ...e, schoolName: formatName(e.schoolName), major: formatName(e.major) }
+  }) : []
 }, { deep: true })
 
 const message = useMessage() // 消息弹窗

+ 6 - 3
src/views/menduner/system/talentMap/details/components/exp.vue

@@ -1,7 +1,7 @@
 <template>
   <el-card shadow="never" class="m-t-10px">
     <template #header>
-      <div style="display: flex; justify-content: space-between;">
+      <div class="flex justify-between">
         <CardTitle title="工作经历" />
         <el-button link type="primary" @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" />新增</el-button>
       </div>
@@ -60,7 +60,8 @@
 defineOptions({ name: 'TalentMapExp'})
 import { cloneDeep } from 'lodash-es'
 import { timesTampChange } from '@/utils/transform/date'
-import { TalentMap } from '@/api/menduner/system/talentMap';
+import { TalentMap } from '@/api/menduner/system/talentMap'
+import { formatName } from '@/utils'
 
 const props = defineProps({
   modelValue: Array,
@@ -68,7 +69,9 @@ const props = defineProps({
 })
 const list = ref([])
 watch(() => props.modelValue, (newVal) => {
-  list.value = newVal
+  list.value = newVal ? newVal.map(e => {
+    return { ...e, enterpriseName: formatName(e.enterpriseName), positionName: formatName(e.positionName), content: formatName(e.content) }
+  }) : []
 }, { deep: true })
 
 const message = useMessage() // 消息弹窗

+ 5 - 4
src/views/menduner/system/talentMap/details/components/info.vue

@@ -79,7 +79,7 @@
       </el-form-item>
     </el-form>
     <div v-if="isEdit" class="text-right">
-      <el-button class="!w-120px" type="primary" @click="handleSave">保 存</el-button>
+      <el-button type="primary" @click="handleSave">保 存</el-button>
     </div>
   </el-card>
 </template>
@@ -87,9 +87,9 @@
 <script setup>
 defineOptions({ name: 'EnterpriseDetailsInfo'})
 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
-import { cloneDeep } from 'lodash-es'
 import { timesTampChange } from '@/utils/transform/date'
-import { TalentMap } from '@/api/menduner/system/talentMap';
+import { TalentMap } from '@/api/menduner/system/talentMap'
+import { formatName } from '@/utils'
 
 const props = defineProps({
   modelValue: Object,
@@ -102,12 +102,13 @@ const formRef = ref()
 const formData = ref({})
 const formLoading = ref(false)
 const formRules = reactive({
-  // name: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
+  name: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
   // phone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }]
 })
 
 watch(() => props.modelValue, (newVal) => {
   formData.value = newVal
+  if (newVal && newVal?.advantage) formData.value.advantage = formatName(newVal.advantage)
 }, { deep: true })
 
 // 未来的时间不可选

+ 3 - 2
src/views/menduner/system/talentMap/details/components/jobIntention.vue

@@ -1,7 +1,7 @@
 <template>
   <el-card shadow="never" class="m-t-10px">
     <template #header>
-      <div style="display: flex; justify-content: space-between;">
+      <div class="flex justify-between">
         <CardTitle title="求职意向" />
         <el-button link type="primary" @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" />新增</el-button>
       </div>
@@ -40,6 +40,7 @@ defineOptions({ name: 'TalentMapJobIntention'})
 import { cloneDeep } from 'lodash-es'
 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
 import { timesTampChange } from '@/utils/transform/date'
+import { formatName } from '@/utils'
 
 const emit = defineEmits(['update:modelValue'])
 const props = defineProps({
@@ -50,7 +51,7 @@ const list = ref([])
 watch(() => props.modelValue, (newVal) => {
   if (!newVal || !newVal.length) return list.value = []
   list.value = newVal.map(e => {
-    return { name: e }
+    return { name: formatName(e) }
   })
 }, { deep: true })
 

+ 10 - 2
src/views/menduner/system/talentMap/details/components/search.vue

@@ -90,6 +90,9 @@ import { PersonInfoApi } from '@/api/menduner/system/person'
 import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
 
 const emit = defineEmits(['detail'])
+const props = defineProps({
+  searchName: String
+})
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 
@@ -136,7 +139,12 @@ const handleDetail = (row) => {
 }
 
 /** 初始化 **/
-onMounted(() => {
-  getList()
+onMounted(async () => {
+  setTimeout(() => {
+    if (props.searchName) {
+      queryParams.name = props.searchName
+    }
+    getList()
+  }, 100)
 })
 </script>

+ 6 - 3
src/views/menduner/system/talentMap/details/components/training.vue

@@ -1,7 +1,7 @@
 <template>
   <el-card shadow="never" class="m-t-10px">
     <template #header>
-      <div style="display: flex; justify-content: space-between;">
+      <div class="flex justify-between">
         <CardTitle title="培训经历" />
         <el-button link type="primary" @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" />新增</el-button>
       </div>
@@ -59,7 +59,8 @@
 defineOptions({ name: 'TalentMapTraining'})
 import { cloneDeep } from 'lodash-es'
 import { timesTampChange } from '@/utils/transform/date'
-import { TalentMap } from '@/api/menduner/system/talentMap';
+import { TalentMap } from '@/api/menduner/system/talentMap'
+import { formatName } from '@/utils'
 
 const props = defineProps({
   modelValue: Array,
@@ -67,7 +68,9 @@ const props = defineProps({
 })
 const list = ref([])
 watch(() => props.modelValue, (newVal) => {
-  list.value = newVal
+  list.value = newVal ? newVal.map(e => {
+    return { ...e, orgName: formatName(e.orgName), course: formatName(e.course), content: formatName(e.content) }
+  }) : []
 }, { deep: true })
 
 const message = useMessage() // 消息弹窗

+ 15 - 14
src/views/menduner/system/talentMap/details/index.vue

@@ -2,8 +2,8 @@
   <div v-loading="saveLoading">
     <el-row :gutter="10">
       <el-col :span="12">
-        <el-tabs type="border-card">
-          <el-tab-pane label="简历解析" v-loading="loading">
+        <el-tabs v-model="activeName" type="border-card">
+          <el-tab-pane label="简历解析" v-loading="loading" name="resumeAnalysis">
             <div v-if="fileUrl">
               <div class="text-right m-b-10px">
                 <el-button @click="handleText">查看文本信息</el-button>
@@ -35,19 +35,19 @@
               :http-request="httpRequest"
               accept=".pdf, doc, .docx"
               drag
-              style="flex: 1;"
+              class="flex-1"
             >
               <i class="el-icon-upload"></i>
               <div class="el-upload__text">上传附件, 将文件拖到此处,或 <em>点击上传</em></div>
               <template #tip>
-                <div class="el-upload__tip" style="color: red">
+                <div class="el-upload__tip color-red">
                   提示:仅允许导入 pdf、doc、docx 格式文件!
                 </div>
               </template>
             </el-upload>
           </el-tab-pane>
-          <el-tab-pane label="人员搜索">
-            <Search @detail="handleDetail" />
+          <el-tab-pane label="人员搜索" name="personnelSearch">
+            <Search @detail="handleDetail" :searchName="result?.person?.name" />
           </el-tab-pane>
         </el-tabs>
       </el-col>
@@ -63,7 +63,7 @@
               <Training v-model="result.trainList" :isEdit="isEdit" />
               <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 @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-affix>
               </div>
@@ -111,6 +111,7 @@ import Search from './components/search.vue'
 
 const { push } = 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
@@ -157,7 +158,7 @@ const getTalentMap = async () => {
     if (!data || !Object.keys(data).length) return
     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)) : []
   } catch (error) {
@@ -251,12 +252,12 @@ const handleSave = async () => {
   console.log(result.value, 'result-add')
 
   // 效验基本信息中必填项是否有填写
-  // if (!result.value?.person.name || !result.value.person.phone) {
-  //   message.notifyWarning('请将必填项填写完整')
-  //   InfoRef.value.formRef.validate()
-  //   content.value.scrollTo({ top: 0, behavior: 'smooth' })
-  //   return
-  // }
+  if (!result.value?.person?.name) {
+    message.notifyWarning('请填写用户姓名后再提交!')
+    InfoRef.value.formRef.validate()
+    content.value.scrollTo({ top: -100, behavior: 'smooth' })
+    return
+  }
 
   saveLoading.value = true
   try {

+ 1 - 1
src/views/menduner/system/talentMap/index.vue

@@ -20,5 +20,5 @@ import resumePage from './components/resume.vue'
 import cardPage from './components/card.vue'
 import webPageParsing from './components/webPageParsing.vue'
 
-const activeName = ref('card')
+const activeName = ref('resume')
 </script>

+ 1 - 1
src/views/menduner/system/talentMap/search/index.vue

@@ -14,7 +14,7 @@
 						<el-button :icon="Search" @click="handleSearch" />
 					</template>
 				</el-input>
-				<el-text v-if="!isSearch" class="text-xs !color-gray-400">例如:有酒店筹开经验,担任总经理的人</el-text>
+				<el-text v-if="!isSearch" class="text-xs !color-gray-400">例如:有酒店筹开经验,担任总经理的人</el-text>
       </div>
     </div>
   </ContentWrap>