|
@@ -10,9 +10,10 @@ import { getRecordsDetail, editRecordsDetail, generateStaffNum } from '@/api/oa/
|
|
|
import { getConfigDict } from './index'
|
|
|
import { ElRow, FormInstance } from 'element-plus'
|
|
|
import moment from 'moment'
|
|
|
-// import TechCertificate from './TechCertificate.vue'
|
|
|
+import TechCertificate from './TechCertificate.vue'
|
|
|
import avatarImg from '@/assets/imgs/avatar.jpg'
|
|
|
import DeptSelect from '@/components/DeptSelect/index.vue'
|
|
|
+import UserOrgTree from '@/views/OaSystem/components/UserOrgTree/index.vue'
|
|
|
import { createImageViewer } from '@/components/ImageViewer'
|
|
|
import WorkTable from './WorkTable.vue'
|
|
|
import FamilyTable from './familyTable.vue'
|
|
@@ -58,7 +59,10 @@ const handleTimeData = (dataSource) => {
|
|
|
})
|
|
|
return dataSource
|
|
|
}
|
|
|
-
|
|
|
+const treeNodeClick = (item, type) => {
|
|
|
+ formData.value[type] = item['label']
|
|
|
+ console.log(formData.value)
|
|
|
+}
|
|
|
/**编辑员工档案详情 */
|
|
|
const { mutate: addUserMutate } = useMutation({
|
|
|
mutationFn: async (values: any) => {
|
|
@@ -128,6 +132,27 @@ const isEdit = computed(() => {
|
|
|
return type === 'edit'
|
|
|
})
|
|
|
|
|
|
+// 上传路径
|
|
|
+const updateUrl =
|
|
|
+ import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + import.meta.env.VITE_UPLOAD_URL
|
|
|
+
|
|
|
+// 回填正确路径
|
|
|
+const imageUrl = (url) => {
|
|
|
+ if (!url) return []
|
|
|
+ return url.split(',').map((item, index) => ({
|
|
|
+ url: item,
|
|
|
+ uid: index
|
|
|
+ }))
|
|
|
+}
|
|
|
+const getImgUrlList = (url) => {
|
|
|
+ if (!url) return []
|
|
|
+ return url.split(',')
|
|
|
+}
|
|
|
+// 附件上传成功
|
|
|
+const onUploadSuccess = (file: any, type: string) => {
|
|
|
+ const fileList = file.map((item) => item.url)
|
|
|
+ formData.value[type] = fileList.join(',')
|
|
|
+}
|
|
|
// 修改并保存工作经历
|
|
|
const saveWorkList = (data: any[]) => {
|
|
|
// console.log('data', data)
|
|
@@ -148,6 +173,10 @@ const savePerformanceList = (data: any[]) => {
|
|
|
// console.log('data', data)
|
|
|
formData.value['performanceList'] = data.map((item) => ({ ...item, userId: id }))
|
|
|
}
|
|
|
+//修改病保存职称证书
|
|
|
+const saveTechCertificateList = (data: any[]) => {
|
|
|
+ formData.value['certList'] = data.map((item) => ({ ...item, userId: id }))
|
|
|
+}
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class="staff-files-wrap">
|
|
@@ -238,13 +267,17 @@ const savePerformanceList = (data: any[]) => {
|
|
|
<ul class="my-portrait-nav">
|
|
|
<li @click="goAnchor('#gsxx')" :class="{ active: tabNav === '#gsxx' }">公司信息</li>
|
|
|
<li @click="goAnchor('#gzkxx')" :class="{ active: tabNav === '#gzkxx' }">工资卡信息</li>
|
|
|
- <li @click="goAnchor('#jjlxrxx')" :class="{ active: tabNav === '#jjlxrxx' }"
|
|
|
- >紧急联系人信息</li
|
|
|
- >
|
|
|
+ <li @click="goAnchor('#sfzxx')" :class="{ active: tabNav === '#sfzxx' }">
|
|
|
+ 身份证信息
|
|
|
+ </li>
|
|
|
+ <li @click="goAnchor('#jjlxrxx')" :class="{ active: tabNav === '#jjlxrxx' }">
|
|
|
+ 紧急联系人信息
|
|
|
+ </li>
|
|
|
<li @click="goAnchor('#gzjl')" :class="{ active: tabNav === '#gzjl' }">工作经历</li>
|
|
|
<li @click="goAnchor('#jtcy')" :class="{ active: tabNav === '#jtcy' }">家庭成员</li>
|
|
|
<li @click="goAnchor('#xxjl')" :class="{ active: tabNav === '#xxjl' }">学习经历</li>
|
|
|
<li @click="goAnchor('#jxkh')" :class="{ active: tabNav === '#jxkh' }">绩效考核</li>
|
|
|
+ <li @click="goAnchor('#zczs')" :class="{ active: tabNav === '#zczs' }">职称证书</li>
|
|
|
</ul>
|
|
|
<div class="my-portrait-container">
|
|
|
<div class="my-portrait-item" id="gsxx">
|
|
@@ -266,12 +299,11 @@ const savePerformanceList = (data: any[]) => {
|
|
|
value-format="x"
|
|
|
/>
|
|
|
|
|
|
- <DeptSelect
|
|
|
- v-if="child.type === 'dept-select'"
|
|
|
- v-model="formData['deptId']"
|
|
|
- :defaultValue="formData['deptId'] ?? ''"
|
|
|
+ <UserOrgTree
|
|
|
+ v-if="child.type === 'user-select'"
|
|
|
+ v-model="formData[child?.name]"
|
|
|
+ @node-click="(item) => treeNodeClick(item, child?.sname)"
|
|
|
/>
|
|
|
-
|
|
|
<el-select
|
|
|
v-if="child.type === 'select'"
|
|
|
v-model="formData[child?.name]"
|
|
@@ -367,6 +399,59 @@ const savePerformanceList = (data: any[]) => {
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="my-portrait-item" id="sfzxx">
|
|
|
+ <div class="title">
|
|
|
+ <i></i>
|
|
|
+ <span>身份证信息</span>
|
|
|
+ </div>
|
|
|
+ <div class="my-portrait-card">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(child, c) in formConfigList[3].children" :key="c">
|
|
|
+ <el-form-item :label="`${child.title}:`" :prop="child.name">
|
|
|
+ <template v-if="child.type === 'time'">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData[child?.name]"
|
|
|
+ style="width: 100%"
|
|
|
+ :placeholder="isEdit ? child.title : ''"
|
|
|
+ type="date"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="x"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="child?.type === 'upload'">
|
|
|
+ <UploadImgs
|
|
|
+ v-if="isEdit"
|
|
|
+ :modelValue="imageUrl(formData[child?.name])"
|
|
|
+ :updateUrl="updateUrl"
|
|
|
+ height="55px"
|
|
|
+ :callback="(file) => onUploadSuccess(file, child?.name)"
|
|
|
+ />
|
|
|
+ <div v-else>
|
|
|
+ <span
|
|
|
+ style="margin-left: 3px"
|
|
|
+ v-for="(item, index) in getImgUrlList(formData[child?.name])"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <el-image
|
|
|
+ style="width: 100px; height: 100px"
|
|
|
+ :src="item"
|
|
|
+ fit="scale-down"
|
|
|
+ :preview-src-list="[item]"
|
|
|
+ />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <el-input
|
|
|
+ v-if="child?.type === undefined"
|
|
|
+ v-model="formData[child?.name]"
|
|
|
+ placeholder=""
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </li>
|
|
|
+ <li></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="my-portrait-item" id="jjlxrxx">
|
|
|
<div class="title">
|
|
|
<i></i>
|
|
@@ -374,7 +459,7 @@ const savePerformanceList = (data: any[]) => {
|
|
|
</div>
|
|
|
<div class="my-portrait-card">
|
|
|
<ul>
|
|
|
- <li v-for="(child, c) in formConfigList[3].children" :key="c">
|
|
|
+ <li v-for="(child, c) in formConfigList[4].children" :key="c">
|
|
|
<el-form-item :label="`${child.title}:`" :prop="child.name">
|
|
|
<el-date-picker
|
|
|
v-if="child.type === 'time'"
|
|
@@ -446,6 +531,13 @@ const savePerformanceList = (data: any[]) => {
|
|
|
:onlyRead="type == 'view'"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <div class="my-portrait-item" id="zczs">
|
|
|
+ <TechCertificate
|
|
|
+ :defaultData="formData['certList']"
|
|
|
+ @onSave="saveTechCertificateList"
|
|
|
+ :onlyRead="type == 'view'"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|