| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /hrm/salary/calculation/calculate | 执行薪酬核算 |
| POST | /hrm/salary/calculation/confirm | 确认薪酬核算 |
| POST | /hrm/salary/calculation/save | 批量保存薪酬核算记录 |
| GET | /hrm/salary/calculation/page | 获取薪酬核算分页列表 |
| GET | /hrm/salary/calculation/get | 获取薪酬核算详情 |
| GET | /hrm/salary/calculation/preview | 预览部门下所有员工的薪资核算信息 |
| GET | /hrm/salary/calculation/export-excel | 导出薪酬核算 Excel |
薪酬核算请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| period | String | 是 | 核算周期,格式如 2024-01 |
| deptId | Long | 否 | 部门ID,为空则核算所有部门 |
预览接口请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| period | String | 是 | 核算周期,格式如 2024-01 |
| deptId | Long | 是 | 部门ID |
批量保存接口请求体:
{
"period": "2024-01",
"list": [
{
"id": null,
"userId": 1,
"deptId": 100,
"baseSalary": 10000.00,
"performanceSalary": 2000.00,
"overtimePay": 500.00,
"mealAllowance": 300.00,
"transportAllowance": 200.00,
"otherAllowance": 0.00,
"socialSecurityDeduction": 1050.00,
"housingFundDeduction": 1200.00,
"taxDeduction": 290.00,
"otherDeduction": 0.00,
"actualSalary": 10460.00,
"workDays": 22,
"overtimeHours": 8.00,
"remark": ""
}
]
}
薪酬核算记录响应字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| id | Long | 核算ID |
| no | String | 核算单号 |
| period | String | 核算周期 |
| userId | Long | 员工ID |
| deptId | Long | 部门ID |
| baseSalary | BigDecimal | 基本工资 |
| performanceSalary | BigDecimal | 绩效工资 |
| overtimePay | BigDecimal | 加班工资 |
| mealAllowance | BigDecimal | 餐补 |
| transportAllowance | BigDecimal | 交通补贴 |
| otherAllowance | BigDecimal | 其他补贴 |
| socialSecurityDeduction | BigDecimal | 社保扣除 |
| housingFundDeduction | BigDecimal | 公积金扣除 |
| taxDeduction | BigDecimal | 个税扣除 |
| otherDeduction | BigDecimal | 其他扣除 |
| actualSalary | BigDecimal | 实发工资 |
| workDays | Integer | 出勤天数 |
| overtimeHours | BigDecimal | 加班时长 |
| status | Integer | 状态:0-待确认,10-已确认,20-已发放 |
<el-form-item label="核算部门">
<el-select v-model="calculationDeptId" placeholder="全部部门" clearable>
<el-option label="全部部门" value="" />
<el-option v-for="dept in deptList" :key="dept.id" :label="dept.name" :value="dept.id" />
</el-select>
</el-form-item>
<el-button type="primary" @click="handleCalculate">执行核算</el-button>
data() {
return {
calculationPeriod: '', // 核算周期
calculationDeptId: null, // 核算部门ID
deptList: [], // 部门列表
}
}
// 执行薪酬核算
handleCalculate() {
if (!this.calculationPeriod) {
this.$message.warning('请选择核算周期')
return
}
const params = {
period: this.calculationPeriod
}
if (this.calculationDeptId) {
params.deptId = this.calculationDeptId
}
request.post('/hrm/salary/calculation/calculate', null, { params })
.then(res => {
this.$message.success('薪酬核算执行成功')
this.getList() // 刷新列表
})
.catch(err => {
this.$message.error(err.message || '薪酬核算执行失败')
})
}
selectLatestByUserId(userId) 获取员工最新生效的薪酬档案baseSalary 字段作为基本工资,其他薪资项目设为 0