为 HRM 模块中缺失删除接口的 Controller 补全删除功能,主要涉及员工相关子模块(教育经历、工作经历、紧急联系人)以及薪资模块的撤销/删除功能。
| 方法 | 路径 | 说明 |
|---|---|---|
| DELETE | /hrm/employee/education/delete | 删除教育经历 |
| DELETE | /hrm/employee/work-history/delete | 删除工作经历 |
| DELETE | /hrm/employee/emergency-contact/delete | 删除紧急联系人 |
请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 记录ID |
响应:
{
"code": 200,
"data": true,
"msg": "操作成功"
}
<el-button type="danger" size="small" @click="handleDeleteEducation(row)">
删除
</el-button>
<el-button type="danger" size="small" @click="handleDeleteWorkHistory(row)">
删除
</el-button>
<el-button type="danger" size="small" @click="handleDeleteEmergencyContact(row)">
删除
</el-button>
// 删除教育经历
handleDeleteEducation(row) {
this.$modal.confirm('是否确认删除该教育经历?').then(() => {
return deleteEducation(row.id);
}).then(() => {
this.getEducationList();
this.$modal.msgSuccess('删除成功');
}).catch(() => {});
},
// 删除工作经历
handleDeleteWorkHistory(row) {
this.$modal.confirm('是否确认删除该工作经历?').then(() => {
return deleteWorkHistory(row.id);
}).then(() => {
this.getWorkHistoryList();
this.$modal.msgSuccess('删除成功');
}).catch(() => {});
},
// 删除紧急联系人
handleDeleteEmergencyContact(row) {
this.$modal.confirm('是否确认删除该紧急联系人?').then(() => {
return deleteEmergencyContact(row.id);
}).then(() => {
this.getEmergencyContactList();
this.$modal.msgSuccess('删除成功');
}).catch(() => {});
},
// api/hrm/employee.js
// 删除教育经历
export function deleteEducation(id) {
return request({
url: '/hrm/employee/education/delete',
method: 'delete',
params: { id }
});
}
// 删除工作经历
export function deleteWorkHistory(id) {
return request({
url: '/hrm/employee/work-history/delete',
method: 'delete',
params: { id }
});
}
// 删除紧急联系人
export function deleteEmergencyContact(id) {
return request({
url: '/hrm/employee/emergency-contact/delete',
method: 'delete',
params: { id }
});
}
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /hrm/salary/calculation/revoke | 批量撤销薪酬核算确认 |
| DELETE | /hrm/salary/calculation/delete | 删除薪酬核算记录(仅待确认状态) |
撤销确认请求:
{
"ids": [1, 2, 3]
}
删除请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 核算记录ID |
撤销确认逻辑说明:
删除逻辑说明:
// api/hrm/salary/calculation.js
// 撤销薪酬核算确认
export function revokeSalaryCalculation(ids) {
return request({
url: '/hrm/salary/calculation/revoke',
method: 'post',
data: { ids }
});
}
// 删除薪酬核算记录
export function deleteSalaryCalculation(id) {
return request({
url: '/hrm/salary/calculation/delete',
method: 'delete',
params: { id }
});
}
<!-- 撤销确认按钮 -->
<el-button type="warning" size="small" @click="handleRevoke(row)"
v-if="row.status === 10">
撤销确认
</el-button>
<!-- 删除按钮 -->
<el-button type="danger" size="small" @click="handleDelete(row)"
v-if="row.status === 0">
删除
</el-button>
// 撤销确认
handleRevoke(row) {
this.$modal.confirm('撤销确认后,该记录将恢复为待确认状态,关联的发放明细将被删除。是否继续?').then(() => {
return revokeSalaryCalculation([row.id]);
}).then(() => {
this.getList();
this.$modal.msgSuccess('撤销成功');
}).catch(() => {});
},
// 删除
handleDelete(row) {
this.$modal.confirm('是否确认删除该薪酬核算记录?').then(() => {
return deleteSalaryCalculation(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
}).catch(() => {});
},
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /hrm/salary/payment/revoke-detail | 批量撤销薪资发放明细 |
| DELETE | /hrm/salary/payment/delete | 删除薪资发放台账(仅待发放状态) |
撤销发放请求:
{
"detailIds": [1, 2, 3]
}
删除请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 发放台账ID |
撤销发放逻辑说明:
删除台账逻辑说明:
// api/hrm/salary/payment.js
// 撤销薪资发放明细
export function revokeSalaryPaymentDetail(detailIds) {
return request({
url: '/hrm/salary/payment/revoke-detail',
method: 'post',
data: { detailIds }
});
}
// 删除薪资发放台账
export function deleteSalaryPayment(id) {
return request({
url: '/hrm/salary/payment/delete',
method: 'delete',
params: { id }
});
}
<!-- 明细列表 - 撤销发放按钮 -->
<el-button type="warning" size="small" @click="handleRevokeDetail(row)"
v-if="row.status === 10">
撤销发放
</el-button>
<!-- 台账列表 - 删除按钮 -->
<el-button type="danger" size="small" @click="handleDelete(row)"
v-if="row.status === 0">
删除
</el-button>
// 撤销发放明细
handleRevokeDetail(row) {
this.$modal.confirm('撤销发放后,该明细将恢复为待发放状态,关联的核算记录将恢复为已确认。是否继续?').then(() => {
return revokeSalaryPaymentDetail([row.id]);
}).then(() => {
this.getDetailList();
this.$modal.msgSuccess('撤销成功');
}).catch(() => {});
},
// 删除发放台账
handleDelete(row) {
this.$modal.confirm('删除后将同时删除所有待发放明细,是否继续?').then(() => {
return deleteSalaryPayment(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
}).catch(() => {});
},
| 状态值 | 状态名称 | 说明 |
|---|---|---|
| 0 | 待确认 | 初始状态,可删除、可确认 |
| 10 | 已确认 | 可撤销确认 |
| 20 | 已发放 | 已完成发放,不可操作 |
| 状态值 | 状态名称 | 说明 |
|---|---|---|
| 0 | 待发放 | 初始状态 |
| 10 | 已发放 | 可撤销发放 |
薪酬核算:
待确认(0) --确认--> 已确认(10) --发放--> 已发放(20)
已确认(10) --撤销确认--> 待确认(0)
待确认(0) --删除--> (删除)
薪资发放明细:
待发放(0) --发放--> 已发放(10)
已发放(10) --撤销发放--> 待发放(0)
薪资发放台账:
待发放(0) --删除--> (删除)
注:需先撤销所有已发放明细才能删除
以下模块已有删除接口,无需前端额外修改:
| 模块 | 删除接口路径 |
|---|---|
| 员工主表 | /hrm/employee/delete |
| 请假申请 | /hrm/leave/delete |
| 调岗申请 | /hrm/transfer/delete |
| 离职申请 | /hrm/resignation/delete |
| 考勤异常申请 | /hrm/attendance/exception/delete |
| 社保公积金配置 | /hrm/salary/social-security-config/delete |
| 个税税率配置 | /hrm/salary/tax-rate-config/delete |
| 社保公积金方案 | /hrm/salary/social-security-scheme/delete |
| 员工社保档案 | /hrm/salary/employee-social-security/delete |
以下模块不提供删除接口(审计类数据不允许直接删除):
| 权限标识 | 说明 |
|---|---|
| hrm:employee:delete | 员工及子模块删除权限 |
| hrm:salary:confirm | 薪酬核算确认/撤销权限 |
| hrm:salary:delete | 薪酬核算/发放删除权限 |
| hrm:salary:pay | 薪资发放/撤销权限 |