完善招聘信息主键关联与工作经历维护

This commit is contained in:
wkc
2026-05-07 01:04:23 +08:00
parent 4d1acc7484
commit 3bc60fedeb
22 changed files with 584 additions and 191 deletions

View File

@@ -10,9 +10,9 @@ export function listStaffRecruitment(query) {
}
// 查询招聘信息详细
export function getStaffRecruitment(recruitId) {
export function getStaffRecruitment(id) {
return request({
url: '/ccdi/staffRecruitment/' + recruitId,
url: '/ccdi/staffRecruitment/' + id,
method: 'get'
})
}
@@ -36,9 +36,9 @@ export function updateStaffRecruitment(data) {
}
// 删除招聘信息
export function delStaffRecruitment(recruitIds) {
export function delStaffRecruitment(ids) {
return request({
url: '/ccdi/staffRecruitment/' + recruitIds,
url: '/ccdi/staffRecruitment/' + ids,
method: 'delete'
})
}

View File

@@ -317,10 +317,10 @@
</el-col>
</el-row>
<template v-if="!isAdd && isSocialRecruitment(form)">
<template v-if="isSocialRecruitment(form)">
<el-divider content-position="left">候选人历史工作经历</el-divider>
<div class="work-experience-toolbar">
<span class="work-experience-tip">支持在编辑页手动补录候选人的历史工作经历保存后会覆盖当前记录下已有的工作经历</span>
<span class="work-experience-tip">支持手动维护候选人的历史工作经历保存后随招聘记录一起提交</span>
<el-button type="primary" plain size="mini" icon="el-icon-plus" @click="handleAddWorkExperience">新增经历</el-button>
</div>
<el-table
@@ -624,6 +624,7 @@ const gradPattern = /^((19|20)\d{2})(0[1-9]|1[0-2])$/;
const workMonthPattern = /^((19|20)\d{2})-(0[1-9]|1[0-2])$/;
const previewRecruitmentList = [
{
id: 1,
recruitId: "RC2025001205",
recruitName: "2024年社会招聘-技术部",
posName: "Java开发工程师",
@@ -666,6 +667,7 @@ const previewRecruitmentList = [
]
},
{
id: 2,
recruitId: "RC2025001206",
recruitName: "2024年社会招聘-技术部",
posName: "数据分析师",
@@ -700,6 +702,7 @@ const previewRecruitmentList = [
]
},
{
id: 3,
recruitId: "RC2025001003",
recruitName: "2024年春季校园招聘",
posName: "Java开发工程师",
@@ -735,6 +738,8 @@ export default {
loading: true,
// 选中数组
ids: [],
// 选中招聘记录编号
recruitIds: [],
// 非单个禁用
single: true,
// 非多个禁用
@@ -910,6 +915,7 @@ export default {
// 表单重置
reset() {
this.form = {
id: null,
recruitId: null,
recruitName: null,
posName: null,
@@ -944,7 +950,8 @@ export default {
},
/** 多选框选中数据 */
handleSelectionChange(selection) {
this.ids = selection.map(item => item.recruitId);
this.ids = selection.map(item => item.id);
this.recruitIds = selection.map(item => item.recruitId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
@@ -958,7 +965,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const recruitId = row.recruitId || this.ids[0];
const id = row.id || this.ids[0];
const recruitId = row.recruitId || this.recruitIds[0];
if (this.isPreviewMode()) {
const target = this.findPreviewRecruitment(recruitId);
if (target) {
@@ -973,7 +981,7 @@ export default {
this.isAdd = false;
return;
}
getStaffRecruitment(recruitId).then(response => {
getStaffRecruitment(id).then(response => {
this.form = {
...this.form,
...response.data,
@@ -986,6 +994,7 @@ export default {
},
/** 详情按钮操作 */
handleDetail(row) {
const id = row.id;
const recruitId = row.recruitId;
if (this.isPreviewMode()) {
const target = this.findPreviewRecruitment(recruitId);
@@ -998,7 +1007,7 @@ export default {
}
return;
}
getStaffRecruitment(recruitId).then(response => {
getStaffRecruitment(id).then(response => {
this.recruitmentDetail = {
...response.data,
workExperienceList: this.normalizeWorkExperienceList(response.data && response.data.workExperienceList)
@@ -1102,7 +1111,7 @@ export default {
},
/** 校验工作经历 */
validateWorkExperienceList() {
if (this.isAdd || !this.isSocialRecruitment(this.form)) {
if (!this.isSocialRecruitment(this.form)) {
return true;
}
const workExperienceList = this.normalizeWorkExperienceList(this.form.workExperienceList);
@@ -1183,9 +1192,7 @@ export default {
return;
}
if (this.isAdd) {
const addData = { ...formData };
delete addData.workExperienceList;
addStaffRecruitment(addData).then(response => {
addStaffRecruitment(formData).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@@ -1202,13 +1209,14 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const recruitIds = row.recruitId || this.ids;
const ids = row.id || this.ids;
const recruitIds = row.recruitId || this.recruitIds;
if (this.isPreviewMode()) {
this.$modal.msgSuccess(`预览模式:已模拟删除 ${recruitIds}`);
return;
}
this.$modal.confirm('是否确认删除招聘信息编号为"' + recruitIds + '"的数据项?').then(function() {
return delStaffRecruitment(recruitIds);
return delStaffRecruitment(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");