|
|
@@ -180,6 +180,7 @@ import {
|
|
|
contractFlowSignStatusLabel,
|
|
|
pickFlowSignStatus
|
|
|
} from '@/api/hr';
|
|
|
+import { parseAttachmentIds } from '@/utils/attachment';
|
|
|
|
|
|
const CONTRACT_TYPES = [
|
|
|
{ value: 'FIXED', label: '固定期限劳动合同' },
|
|
|
@@ -213,16 +214,7 @@ function signMethodLabel(value) {
|
|
|
return value || '';
|
|
|
}
|
|
|
|
|
|
-function collectAttachmentFileIds(files) {
|
|
|
- const list = (Array.isArray(files) ? files : []).filter(Boolean);
|
|
|
- const attach = list.filter((item) =>
|
|
|
- ['ATTACHMENT', 'SCAN', 'ARCHIVE'].includes(item.filePurpose)
|
|
|
- );
|
|
|
- const source = attach.length ? attach : list;
|
|
|
- return source
|
|
|
- .map((item) => item.fileId || item.id)
|
|
|
- .filter((id) => id != null && id !== '');
|
|
|
-}
|
|
|
+// 附件 ID 解析已统一由 src/utils/attachment.js 的 parseAttachmentIds 处理
|
|
|
|
|
|
function adaptContract(item = {}) {
|
|
|
const files = item.files || [];
|
|
|
@@ -263,7 +255,7 @@ function adaptContract(item = {}) {
|
|
|
probationMonths: item.probationMonths,
|
|
|
createdAt: formatDateTime(item.createTime),
|
|
|
probationEnd: formatDate(item.probationEndDate),
|
|
|
- attachmentFileIds: collectAttachmentFileIds(files),
|
|
|
+ attachmentFileIds: parseAttachmentIds(item),
|
|
|
level: item.positionLevel || item.level || '',
|
|
|
manager: item.managerName || item.manager || '',
|
|
|
archived:
|