ATTV1 实现考勤统一入口与企微同步
这个提交包含在:
@@ -37,6 +37,10 @@ function buildReference(normalizedEntityType, entityRecord, entityId) {
|
||||
return formatDateRange(entityRecord?.start_date, entityRecord?.end_date) ?? entityId;
|
||||
}
|
||||
|
||||
if (normalizedEntityType === "attendance_correction") {
|
||||
return entityRecord?.work_date ? formatDateOnly(entityRecord.work_date) : entityId;
|
||||
}
|
||||
|
||||
if (normalizedEntityType === "purchase_request") {
|
||||
return entityRecord?.request_no ?? entityId;
|
||||
}
|
||||
@@ -81,6 +85,29 @@ function buildWorkflowEntityMeta(entityType, entityRecord, entityId) {
|
||||
};
|
||||
}
|
||||
|
||||
if (normalizedEntityType === "attendance_correction") {
|
||||
const kindLabel =
|
||||
entityRecord?.kind === "missed_punch"
|
||||
? "补卡"
|
||||
: entityRecord?.kind === "out"
|
||||
? "外出"
|
||||
: entityRecord?.kind === "overtime"
|
||||
? "加班"
|
||||
: "考勤修正";
|
||||
return {
|
||||
entityType: normalizedEntityType,
|
||||
label: "考勤修正",
|
||||
reference: buildReference(normalizedEntityType, entityRecord, entityId),
|
||||
targetType: "attendance_correction",
|
||||
detailPath: "/attendance",
|
||||
summary: {
|
||||
applicantName: entityRecord?.owner?.name ?? null,
|
||||
kindLabel,
|
||||
reason: entityRecord?.reason ?? null,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (normalizedEntityType === "purchase_request") {
|
||||
return {
|
||||
entityType: normalizedEntityType,
|
||||
@@ -137,6 +164,14 @@ function buildSummaryLines(entityMeta) {
|
||||
];
|
||||
}
|
||||
|
||||
if (entityMeta.entityType === "attendance_correction") {
|
||||
return [
|
||||
`申请人:${entityMeta.summary.applicantName ?? "未知申请人"}`,
|
||||
`类型:${entityMeta.summary.kindLabel ?? "考勤修正"}`,
|
||||
`日期:${entityMeta.reference}`,
|
||||
];
|
||||
}
|
||||
|
||||
if (entityMeta.entityType === "purchase_request") {
|
||||
return [
|
||||
`申请人:${entityMeta.summary.applicantName ?? "未知申请人"}`,
|
||||
|
||||
在新工单中引用
屏蔽一个用户