feat(frontend): 绩效台账与月度结算两页接入(新组绩效工资)
- 绩效台账页(order17):月/版本筛选 + 行展开计算快照 + 重算(原因 对话框,管理员/财务);核算入口在回款管理页(每笔回款行内触发) - 月结页(order18):生成快照(月份输入)+ 状态筛选 + 提交审批 + 详情抽屉(按人明细三口径/试用期说明/审批单号关联) - 均复用 usePagedList/AppPagination/--ys-* 惯例;金额 str 直出 - type-check 零错误;build 通过 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
e7e47d88bc
commit
a1217f4482
5 files changed
+609
No files matched your search
@@ -0,0 +1,105 @@
|
||||
import request from './request'
|
||||
import type { PageData } from './types'
|
||||
|
||||
/** 月结状态:1草稿 2待审批 3已审定(=已锁定)4已驳回 */
|
||||
export const SETTLEMENT_STATUS = {
|
||||
DRAFT: 1,
|
||||
PENDING: 2,
|
||||
APPROVED: 3,
|
||||
REJECTED: 4,
|
||||
} as const
|
||||
|
||||
export function settlementStatusLabel(status: number): string {
|
||||
return (
|
||||
{ 1: '草稿', 2: '待审批', 3: '已审定(锁定)', 4: '已驳回' }[status] ?? String(status)
|
||||
)
|
||||
}
|
||||
|
||||
export function settlementStatusTagType(
|
||||
status: number,
|
||||
): 'primary' | 'success' | 'danger' | 'warning' | 'info' {
|
||||
return (
|
||||
({ 1: 'info', 2: 'primary', 3: 'success', 4: 'danger', 5: 'info' } as const)[status] ?? 'info'
|
||||
)
|
||||
}
|
||||
|
||||
export interface SettlementItem {
|
||||
id: number
|
||||
personnel_id: number
|
||||
personnel_name: string
|
||||
role_code: string
|
||||
calc_type: number
|
||||
performance_sum: string
|
||||
payable_sum: string
|
||||
basic_amount: string | null
|
||||
salary_mode: string | null
|
||||
net_amount: string | null
|
||||
is_probation: number
|
||||
probation_note: string | null
|
||||
}
|
||||
|
||||
export interface Settlement {
|
||||
id: number
|
||||
settlement_month: string
|
||||
status: number
|
||||
total_performance: string | null
|
||||
total_payable: string | null
|
||||
person_count: number
|
||||
approval_order_no: string | null
|
||||
submitter_name: string
|
||||
locked_at: string | null
|
||||
locked_by: string | null
|
||||
create_time: string
|
||||
}
|
||||
|
||||
export interface SettlementDetail extends Settlement {
|
||||
items: SettlementItem[]
|
||||
}
|
||||
|
||||
export interface SettlementQueryParams {
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
status?: number
|
||||
}
|
||||
|
||||
export function listSettlements(params: SettlementQueryParams): Promise<PageData<Settlement>> {
|
||||
return request({ url: '/v1/settlements', method: 'get', params })
|
||||
}
|
||||
|
||||
export function getSettlement(id: number): Promise<SettlementDetail> {
|
||||
return request({ url: `/v1/settlements/${id}`, method: 'get' })
|
||||
}
|
||||
|
||||
export function generateSettlement(month: string): Promise<SettlementDetail> {
|
||||
return request({ url: '/v1/settlements/generate', method: 'post', data: { month } })
|
||||
}
|
||||
|
||||
export function submitSettlement(id: number): Promise<SettlementDetail> {
|
||||
return request({ url: `/v1/settlements/${id}/submit`, method: 'post' })
|
||||
}
|
||||
|
||||
/** 调整单(已锁定月份的补发/扣减) */
|
||||
export interface AdjustmentRow {
|
||||
id: number
|
||||
order_no: string
|
||||
settlement_month: string
|
||||
personnel_name: string
|
||||
direction: number
|
||||
amount: string
|
||||
reason: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export function createAdjustment(data: {
|
||||
settlement_month: string
|
||||
personnel_id: number
|
||||
direction: number
|
||||
amount: string
|
||||
reason: string
|
||||
}): Promise<Record<string, unknown>> {
|
||||
return request({ url: '/v1/settlements/adjustments', method: 'post', data })
|
||||
}
|
||||
|
||||
export function listAdjustments(): Promise<AdjustmentRow[]> {
|
||||
return request({ url: '/v1/settlements/adjustments', method: 'get' })
|
||||
}
|
||||
Reference in new issue
Block a user