diff --git a/web-admin/src/utils/protocol-source-attachment.test.ts b/web-admin/src/utils/protocol-source-attachment.test.ts index 57e7c500..2817732e 100644 --- a/web-admin/src/utils/protocol-source-attachment.test.ts +++ b/web-admin/src/utils/protocol-source-attachment.test.ts @@ -42,7 +42,7 @@ describe('protocol-source-attachment', () => { }) assert.deepEqual( groups.map((g) => g.label), - ['协议附件', '知情同意书', '孕妇健康调查表'] + ['知情同意书', '孕妇健康调查表', '协议附件'] ) assert.ok(groups.every((g) => g.files.length === 1)) }) diff --git a/web-admin/src/utils/protocol-source-attachment.ts b/web-admin/src/utils/protocol-source-attachment.ts index 571f53a8..c677f1f8 100644 --- a/web-admin/src/utils/protocol-source-attachment.ts +++ b/web-admin/src/utils/protocol-source-attachment.ts @@ -37,13 +37,17 @@ export function getConsentProtocolAttachment( /** * 样本接收弹窗:按来源返回质检需查看的协议附件分组。 - * 细胞存储:协议附件 / 知情同意书 / 孕妇健康调查表 + * 细胞存储:知情同意书 / 孕妇健康调查表 / 协议附件(评论优先前两项) * 科研捐赠:知情同意书 / 传染病检测报告 / 其他附件 + * 兼容 attachments 别名(协议详情字段名)。 */ export function getSourceProtocolAttachmentGroups( row: Record ): ProtocolSourceAttachmentMeta[] { const source = String(row.sourceType || 'cell_storage').trim() + const protocolFiles = normalizeAttachmentFiles( + row.protocolAttachmentFiles ?? row.attachments + ) if (source === 'research_donation') { return [ { @@ -56,15 +60,11 @@ export function getSourceProtocolAttachmentGroups( }, { label: '其他附件', - files: normalizeAttachmentFiles(row.attachmentFiles) + files: normalizeAttachmentFiles(row.attachmentFiles ?? row.otherAttachmentFiles) } ] } return [ - { - label: '协议附件', - files: normalizeAttachmentFiles(row.protocolAttachmentFiles) - }, { label: '知情同意书', files: normalizeAttachmentFiles(row.consentAttachmentFiles) @@ -72,6 +72,10 @@ export function getSourceProtocolAttachmentGroups( { label: '孕妇健康调查表', files: normalizeAttachmentFiles(row.healthSurveyAttachmentFiles) + }, + { + label: '协议附件', + files: protocolFiles } ] } diff --git a/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue b/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue index 0c6338b1..96ddf945 100644 --- a/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue +++ b/web-admin/src/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue @@ -44,6 +44,7 @@