= {
+ overtime: '加班记录',
+ performance: '绩效记录',
+ bonus: '奖金记录',
+ deduction: '扣款记录',
+}
+
// 金额格式化:保留两位小数 + 千分位
// ========== 薪酬模版管理 ==========
@@ -24,6 +32,7 @@ export function TemplateManager() {
type: 'INPUT' as 'INPUT' | 'CALCULATED',
formula: '',
calcType: 'FORMULA' as 'FORMULA' | 'SYSTEM',
+ dataSource: '' as string,
order: 99,
isEditable: true,
})
@@ -68,7 +77,7 @@ export function TemplateManager() {
/** 打开新增表单 */
const handleAdd = () => {
setEditingItem(null)
- setForm({ name: '', code: '', type: 'INPUT', formula: '', calcType: 'FORMULA', order: items?.length ? items.length + 1 : 99, isEditable: true })
+ setForm({ name: '', code: '', type: 'INPUT', formula: '', calcType: 'FORMULA', dataSource: '', order: items?.length ? items.length + 1 : 99, isEditable: true })
setShowForm(true)
}
@@ -81,6 +90,7 @@ export function TemplateManager() {
type: item.type,
formula: item.formula || '',
calcType: item.calcType || 'FORMULA',
+ dataSource: item.dataSource || '',
order: item.order,
isEditable: item.isEditable,
})
@@ -98,6 +108,7 @@ export function TemplateManager() {
type: form.type,
formula: form.type === 'CALCULATED' ? form.formula.trim() || null : null,
calcType: form.type === 'CALCULATED' ? form.calcType : 'FORMULA',
+ dataSource: form.dataSource || null,
order: Number(form.order),
isEditable: form.isEditable,
}
@@ -132,6 +143,7 @@ export function TemplateManager() {
| 字段代码 |
类型 |
计算方式 |
+ 数据来源 |
计算公式 |
可编辑 |
操作 |
@@ -155,6 +167,15 @@ export function TemplateManager() {
)}
+
+ {item.dataSource ? (
+
+ {DATA_SOURCE_LABELS[item.dataSource] || item.dataSource}
+
+ ) : (
+ 手动填写
+ )}
+ |
{item.formula || '—'} |
@@ -283,6 +304,22 @@ export function TemplateManager() {
)}
+ {form.type === 'INPUT' && (
+
+
+
+ 选择外部数据来源后,发薪批次中会显示对应的"获取"按钮
+
+ )}
|