Commit 7569548a authored by 徐俊's avatar 徐俊

xujun

parent 6d7bfffb
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
<a-divider style="height: 1px; background-color: #e8e8e8;" /> <a-divider style="height: 1px; background-color: #e8e8e8;" />
<span class="form-description"> ※填报时间:{{ description }}</span> <span class="form-description"> ※填报时间:{{ description }}</span>
<a-table :dataSource="tableData" :columns="columns" rowKey="id" :pagination="false" :loading="loading"> <a-table :dataSource="tableData" :columns="columns" rowKey="id" :pagination="false" :loading="loading">
<template slot="stateSwitch" slot-scope="record"> <template slot="talentInfo" slot-scope="record">
<a-switch checked-children="启用" un-checked-children="停用" :checked="checkedState(record)" @change="switchChange($event, record)" /> <a @click="recordClick(record, 'view')">{{record.personName}}</a>
</template> </template>
<template slot="option" slot-scope="record"> <template slot="option" slot-scope="record">
<a-button type="link" size="small" @click="recordClick(record,'view')">查看</a-button> <a-button type="link" size="small" @click="recordClick(record,'view')">查看</a-button>
...@@ -37,17 +37,21 @@ ...@@ -37,17 +37,21 @@
<a-modal v-model="visibleEdit" v-if="visibleEdit" title="人才申报创建/修改" width="94%" :footer="null" :dialog-style="{ top: '8%' }" destroyOnClose :maskClosable="false"> <a-modal v-model="visibleEdit" v-if="visibleEdit" title="人才申报创建/修改" width="94%" :footer="null" :dialog-style="{ top: '8%' }" destroyOnClose :maskClosable="false">
<talent-create v-model="id" @close="closeWindow"></talent-create> <talent-create v-model="id" @close="closeWindow"></talent-create>
</a-modal> </a-modal>
<a-modal v-model="visibleView" title="查看" width="700px" :footer="null" destroyOnClose>
<talent-info v-model="id"></talent-info>
</a-modal>
</div> </div>
</template> </template>
<script> <script>
import { isEmptyParams, filterExportExcelData, tableColumnsName } from "@/views/utils/common" import { isEmptyParams, filterExportExcelData, tableColumnsName } from "@/views/utils/common"
import talentCreate from "@/views/report/talent/components/talentCreate" import talentCreate from "@/views/report/talent/components/talentCreate"
import talentInfo from "@/views/report/talent/components/talentInfo"
export default { export default {
name: "reportTalent", name: "reportTalent",
components: { components: {
talentCreate talentCreate, talentInfo
}, },
data() { data() {
return { return {
...@@ -65,7 +69,7 @@ export default { ...@@ -65,7 +69,7 @@ export default {
tableData: [], tableData: [],
columns: [ columns: [
{ title: "身份证号", dataIndex: 'certId', align: 'center' }, { title: "身份证号", dataIndex: 'certId', align: 'center' },
{ title: '姓名', scopedSlots: { customRender: 'personInfo' }, align: 'center' }, { title: '姓名', scopedSlots: { customRender: 'talentInfo' }, align: 'center' },
{ title: '性别', dataIndex: 'sex', align: 'center' }, { title: '性别', dataIndex: 'sex', align: 'center' },
{ title: '手机号', dataIndex: 'mobile', align: 'center' }, { title: '手机号', dataIndex: 'mobile', align: 'center' },
{ title: '专业', dataIndex: 'specName', align: 'center' }, { title: '专业', dataIndex: 'specName', align: 'center' },
......
<template>
<div>
<a-form-model ref="form" :model="formModel">
<a-row>
<a-col :span="24" style="border-top: 0px; text-align: center">
<div class="main-title">
<span>申报人简历</span>
</div>
</a-col>
</a-row>
<a-row type="flex" class="row_center">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<span>学历(高中以上)</span>
</div>
</a-col>
<a-col :span="20">
<!-- 学历表格 -->
<a-row type="flex" class="row_center">
<a-col :span="8" class="bg-gray">
<div class="special-middle">
<div>起止日期</div>
</div>
</a-col>
<a-col :span="6" class="bg-gray">
<div class="special-middle">
<div>学校</div>
</div>
</a-col>
<a-col :span="8" class="bg-gray">
<div class="special-middle">
<div>备注(限20字)</div>
</div>
</a-col>
<a-col :span="2" class="bg-gray">
<div class="special-middle">
<div>操作</div>
</div>
</a-col>
</a-row>
<a-row v-for="(item, index) in educationList" :key="'educationList'+index" type="flex" class="row_center">
<a-col :span="8">
<a-form-model-item :prop="`educationList.${index}.resumeRange`" :rules="{ required: true, validator: checkDateRange, trigger: 'blur' }">
<a-range-picker v-model="item.resumeRange" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" @change="(dates, dateStrings) => educationDateChange(dates, dateStrings, index)" :placeholder="['开始时间', '结束时间']" />
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item :prop="`educationList.${index}.orgName`" :rules="{ required: true, message: '*', trigger: 'blur',}">
<a-input v-model="item.orgName" :maxLength="100" placeholder="学校" style="width:85%" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item :prop="`educationList.${index}.resumeRemark`" :rules="{ required: true, message: '*', trigger: 'blur',}">
<a-input v-model="item.resumeRemark" :maxLength="50" placeholder="备注" style="width:85%" />
</a-form-model-item>
</a-col>
<a-col :span="2">
<div class="special-middle">
<a-popconfirm title="确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="deleteEducationArray(item)">
<a-button type="link" size="small">删除</a-button>
</a-popconfirm>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="24" style="text-align: center">
<div class="special-middle">
<a-button type="dashed" style="width: 20%" @click="addEducationArray()">
<a-icon type="plus" /> 添加 <span style="color:red;margin-left:10px"></span>
</a-button>
</div>
</a-col>
</a-row>
</a-col>
</a-row>
<a-row type="flex" class="row_center">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<span>研修经历</span>
</div>
</a-col>
<a-col :span="20">
<!-- 研修经历表格 -->
<a-row type="flex" class="row_center">
<a-col :span="8" class="bg-gray">
<div class="special-middle">
<div>起止日期</div>
</div>
</a-col>
<a-col :span="6" class="bg-gray">
<div class="special-middle">
<div>机构(国别)</div>
</div>
</a-col>
<a-col :span="8" class="bg-gray">
<div class="special-middle">
<div>研修内容(限20字)</div>
</div>
</a-col>
<a-col :span="2" class="bg-gray">
<div class="special-middle">
<div>操作</div>
</div>
</a-col>
</a-row>
<a-row v-for="(item, index) in studyList" :key="'studyList'+index" type="flex" class="row_center">
<a-col :span="8">
<a-form-model-item :prop="`studyList[${index}].resumeRange`" :rules="{ required: true, validator: checkDateRange, trigger: 'blur' }">
<a-range-picker v-model="item.resumeRange" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" @change="(dates, dateStrings) => studyDateChange(dates, dateStrings, index)" :placeholder="['开始时间', '结束时间']" />
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-model-item :prop="`studyList[${index}].orgName`" :rules="{ required: true, message: '*', trigger: 'blur',}">
<a-input v-model="item.orgName" :maxLength="100" placeholder="机构" style="width:85%" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item :prop="`studyList[${index}].resumeRemark`" :rules="{ required: true, message: '*', trigger: 'blur',}">
<a-input v-model="item.resumeRemark" :maxLength="50" placeholder="研修内容" style="width:85%" />
</a-form-model-item>
</a-col>
<a-col :span="2">
<div class="special-middle">
<a-popconfirm title="确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="deleteStudyArray(item)">
<a-button type="link" size="small">删除</a-button>
</a-popconfirm>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="24" style="text-align: center">
<div class="special-middle">
<a-button type="dashed" style="width: 20%" @click="addStudyArray()">
<a-icon type="plus" /> 添加 <span style="color:red;margin-left:10px"></span>
</a-button>
</div>
</a-col>
</a-row>
</a-col>
</a-row>
<a-row type="flex" class="row_center">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<span>工作经历</span>
</div>
</a-col>
<a-col :span="20">
<!-- 工作经历表格 -->
<a-row type="flex" class="row_center">
<a-col :span="6" class="bg-gray">
<div class="special-middle">
<div>起止日期</div>
</div>
</a-col>
<a-col :span="5" class="bg-gray">
<div class="special-middle">
<div>机构</div>
</div>
</a-col>
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div>职务</div>
</div>
</a-col>
<a-col :span="7" class="bg-gray">
<div class="special-middle">
<div>承担的主要工作(限20字)</div>
</div>
</a-col>
<a-col :span="2" class="bg-gray">
<div class="special-middle">
<div>操作</div>
</div>
</a-col>
</a-row>
<a-row v-for="(item, index) in workList" :key="'workList'+index" type="flex" class="row_center">
<a-col :span="6">
<a-form-model-item :prop="`workList[${index}].resumeRange`" :rules="{ required: true, validator: checkDateRange, trigger: 'blur' }">
<a-range-picker v-model="item.resumeRange" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD HH:mm:ss" @change="(dates, dateStrings) => workDateChange(dates, dateStrings, index)" :placeholder="['开始时间', '结束时间']" />
</a-form-model-item>
</a-col>
<a-col :span="5">
<a-form-model-item :prop="`workList[${index}].orgName`" :rules="{ required: true, message: '*', trigger: 'blur',}">
<a-input v-model="item.orgName" :maxLength="100" placeholder="机构" style="width:85%" />
</a-form-model-item>
</a-col>
<a-col :span="4">
<a-form-model-item :prop="`workList[${index}].positionName`" :rules="{ required: true, message: '*', trigger: 'blur',}">
<a-input v-model="item.positionName" :maxLength="50" placeholder="职务" style="width:85%" />
</a-form-model-item>
</a-col>
<a-col :span="7">
<a-form-model-item :prop="`workList[${index}].resumeRemark`" :rules="{ required: true, message: '*', trigger: 'blur',}">
<a-input v-model="item.resumeRemark" :maxLength="50" placeholder="工作内容" style="width:85%" />
</a-form-model-item>
</a-col>
<a-col :span="2">
<div class="special-middle">
<a-popconfirm title="确定要删除吗?" ok-text="确定" cancel-text="取消" @confirm="deleteWorkArray(item)">
<a-button type="link" size="small">删除</a-button>
</a-popconfirm>
</div>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="24" style="text-align: center">
<div class="special-middle">
<a-button type="dashed" style="width: 20%" @click="addWorkArray()">
<a-icon type="plus" /> 添加 <span style="color:red;margin-left:10px"></span>
</a-button>
</div>
</a-col>
</a-row>
</a-col>
</a-row>
</a-form-model>
</div>
</template>
<script>
import moment from 'moment'
import { isEmptyParams, checkDateRange } from '@/views/utils/common'
//学历
const Education = { id: null, talentId: null, resumeType: 'e76f5097-fe28-11ef-b6cb-0c42a1380f01', resumeStart: null, resumeEnd: null, orgName: null, positionName: null, resumeRemark: null, showIndex: null, resumeRange: [] }
//研修经历
const Study = { id: null, talentId: null, resumeType: 'e76f5097-fe28-11ef-b6cb-0c42a1380f02', resumeStart: null, resumeEnd: null, orgName: null, positionName: null, resumeRemark: null, showIndex: null, resumeRange: [] }
//工作经历
const Work = { id: null, talentId: null, resumeType: 'e76f5097-fe28-11ef-b6cb-0c42a1380f03', resumeStart: null, resumeEnd: null, orgName: null, positionName: null, resumeRemark: null, showIndex: null, resumeRange: [] }
export default {
name: "resumeEdit",
props: {
resumeList: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
educationList: [],
studyList: [],
workList: [],
formModel: {
educationList: [],
studyList: [],
workList: []
}
};
},
created() {
// 根据 resumeType 分类并排序
if (this.resumeList && this.resumeList.length > 0) {
// 学历记录
this.educationList = this.resumeList
.filter(item => item.resumeType === 'e76f5097-fe28-11ef-b6cb-0c42a1380f01')
.sort((a, b) => a.showIndex - b.showIndex)
.map(item => ({
...item,
resumeRange: item.resumeStart && item.resumeEnd ?
[moment(item.resumeStart), moment(item.resumeEnd)] : []
}))
// 研修经历
this.studyList = this.resumeList
.filter(item => item.resumeType === 'e76f5097-fe28-11ef-b6cb-0c42a1380f02')
.sort((a, b) => a.showIndex - b.showIndex)
.map(item => ({
...item,
resumeRange: item.resumeStart && item.resumeEnd ?
[moment(item.resumeStart), moment(item.resumeEnd)] : []
}))
// 工作经历
this.workList = this.resumeList
.filter(item => item.resumeType === 'e76f5097-fe28-11ef-b6cb-0c42a1380f03')
.sort((a, b) => a.showIndex - b.showIndex)
.map(item => ({
...item,
resumeRange: item.resumeStart && item.resumeEnd ?
[moment(item.resumeStart), moment(item.resumeEnd)] : []
}))
}
},
methods: {
moment,
checkDateRange,
educationDateChange(dates, dateStrings, index) {
if (dateStrings[0] && dateStrings[1]) {
this.educationList[index].resumeStart = dateStrings[0]
this.educationList[index].resumeEnd = dateStrings[1]
}
},
studyDateChange(dates, dateStrings, index) {
if (dateStrings[0] && dateStrings[1]) {
this.studyList[index].resumeStart = dateStrings[0]
this.studyList[index].resumeEnd = dateStrings[1]
}
},
workDateChange(dates, dateStrings, index) {
if (dateStrings[0] && dateStrings[1]) {
this.workList[index].resumeStart = dateStrings[0]
this.workList[index].resumeEnd = dateStrings[1]
}
},
addEducationArray() {
const newItem = {
...Education,
showIndex: this.educationList.length + 1,
resumeRange: []
}
this.educationList.push(newItem)
this.$nextTick(() => {
this.$refs.form && this.$refs.form.clearValidate()
})
},
deleteEducationArray(item) {
let index = this.educationList.indexOf(item)
if (index !== -1) {
this.educationList.splice(index, 1)
}
},
addStudyArray() {
const newItem = {
...Study,
showIndex: this.studyList.length + 1,
resumeRange: []
}
this.studyList.push(newItem)
this.$nextTick(() => {
this.$refs.form && this.$refs.form.clearValidate()
})
},
deleteStudyArray(item) {
let index = this.studyList.indexOf(item)
if (index !== -1) {
this.studyList.splice(index, 1)
}
},
addWorkArray() {
const newItem = {
...Work,
showIndex: this.workList.length + 1,
resumeRange: []
}
this.workList.push(newItem)
this.$nextTick(() => {
this.$refs.form && this.$refs.form.clearValidate()
})
},
deleteWorkArray(item) {
let index = this.workList.indexOf(item)
if (index !== -1) {
this.workList.splice(index, 1)
}
},
mergeResumeList() {
// 清空原有数据
this.resumeList.length = 0
// 合并三个数组
const allLists = [
...this.educationList.map((item, index) => {
// 创建一个新对象,避免直接修改原对象
const newItem = { ...item }
// 安全地添加时间部分
if (newItem.resumeStart) {
newItem.resumeStart = newItem.resumeStart + " 00:00:00"
}
if (newItem.resumeEnd) {
newItem.resumeEnd = newItem.resumeEnd + " 23:59:59"
}
newItem.showIndex = index + 1
return newItem
}),
...this.studyList.map((item, index) => {
const newItem = { ...item }
if (newItem.resumeStart) {
newItem.resumeStart = newItem.resumeStart + " 00:00:00"
}
if (newItem.resumeEnd) {
newItem.resumeEnd = newItem.resumeEnd + " 23:59:59"
}
newItem.showIndex = index + 1
return newItem
}),
...this.workList.map((item, index) => {
const newItem = { ...item }
if (newItem.resumeStart) {
newItem.resumeStart = newItem.resumeStart + " 00:00:00"
}
if (newItem.resumeEnd) {
newItem.resumeEnd = newItem.resumeEnd + " 23:59:59"
}
newItem.showIndex = index + 1
return newItem
})
]
// 移除 resumeRange 字段,因为后端不需要
const cleanedList = allLists.map(item => {
const newItem = { ...item }
delete newItem.resumeRange
return newItem
})
// 更新 resumeList
this.resumeList.push(...cleanedList)
//console.log('合并后的简历列表:', this.resumeList)
return this.resumeList
}
},
watch: {
educationList: {
handler(val) {
this.formModel.educationList = val
},
deep: true,
immediate: true
},
studyList: {
handler(val) {
this.formModel.studyList = val
},
deep: true,
immediate: true
},
workList: {
handler(val) {
this.formModel.workList = val
},
deep: true,
immediate: true
}
}
};
</script>
<template>
<div>
</div>
</template>
<script>
export default {
name: "resumeInfo",
props: {
budget: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
};
},
methods: {
},
};
</script>
\ No newline at end of file
...@@ -340,13 +340,7 @@ ...@@ -340,13 +340,7 @@
</a-row> </a-row>
</div> </div>
<div v-if="stepsArray[1].showStatus"> <div v-if="stepsArray[1].showStatus">
<a-row> <resume-edit :resumeList.sync="formData.resumeList" ref="talentResume" />
<a-col :span="24" style="border-top: 0px;text-align: center;">
<div class="main-title">
<span>申报人简历</span>
</div>
</a-col>
</a-row>
</div> </div>
<div v-if="stepsArray[2].showStatus"> <div v-if="stepsArray[2].showStatus">
</div> </div>
...@@ -366,11 +360,12 @@ import { isEmptyParams } from "@/views/utils/common" ...@@ -366,11 +360,12 @@ import { isEmptyParams } from "@/views/utils/common"
import paraRadio from '@/views/components/common/paraRadio' import paraRadio from '@/views/components/common/paraRadio'
import paraCheck from '@/views/components/common/paraCheck' import paraCheck from '@/views/components/common/paraCheck'
import cascaderSelect from '@/views/components/common/cascaderSelect' import cascaderSelect from '@/views/components/common/cascaderSelect'
import resumeEdit from '@/views/report/talent/components/resumeEdit'
export default { export default {
name: "talentEdit", name: "talentEdit",
components: { components: {
paraRadio, paraCheck, cascaderSelect paraRadio, paraCheck, cascaderSelect, resumeEdit
}, },
props: { props: {
value: { value: {
...@@ -479,7 +474,6 @@ export default { ...@@ -479,7 +474,6 @@ export default {
getTalentApplyById() { getTalentApplyById() {
this.$api.talent.getTalentApplyById({ id: this.value }).then(({ data = {} }) => { this.$api.talent.getTalentApplyById({ id: this.value }).then(({ data = {} }) => {
if (data) { if (data) {
console.log(data)
// 处理字符串转数组 // 处理字符串转数组
if (typeof data.talentType === 'string' && data.talentType) { if (typeof data.talentType === 'string' && data.talentType) {
data.talentType = data.talentType.split(',') data.talentType = data.talentType.split(',')
...@@ -638,7 +632,38 @@ export default { ...@@ -638,7 +632,38 @@ export default {
//console.log('getObj处理后的数据:', obj) //console.log('getObj处理后的数据:', obj)
return obj return obj
}, },
checkInfo (step) { checkResumeList() {
this.$refs.talentResume.mergeResumeList()
// 检查每种类型是否都有记录
const resumeList = this.formData.resumeList || []
// 检查学历记录
const hasEducation = resumeList.some(item =>
item.resumeType === 'e76f5097-fe28-11ef-b6cb-0c42a1380f01'
)
if (!hasEducation) {
this.$message.error('请至少添加一条学历记录!')
return false
}
// 检查研修经历
const hasStudy = resumeList.some(item =>
item.resumeType === 'e76f5097-fe28-11ef-b6cb-0c42a1380f02'
)
if (!hasStudy) {
this.$message.error('请至少添加一条研修经历!')
return false
}
// 检查工作经历
const hasWork = resumeList.some(item =>
item.resumeType === 'e76f5097-fe28-11ef-b6cb-0c42a1380f03'
)
if (!hasWork) {
this.$message.error('请至少添加一条工作经历!')
return false
}
return true
},
checkInfo(step) {
switch (step) { switch (step) {
case 0: case 0:
if (this.formData.certId == "" || this.formData.certId == null) { if (this.formData.certId == "" || this.formData.certId == null) {
...@@ -651,6 +676,7 @@ export default { ...@@ -651,6 +676,7 @@ export default {
} else return true } else return true
break; break;
case 1: case 1:
return this.checkResumeList()
break; break;
case 2: case 2:
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment