src/views/mes/pd/archive/modules/detail.vue
@@ -43,6 +43,15 @@
  );
}
/**
 * 资料文件地址:后端只回 attachmentList(附件中间表),业务表没有 fileUrl 字段,
 * 这里取第一个附件的访问地址,没有附件就返回空串(模板里显示「-」)。
 */
function documentFileUrl(record: MesPdArchiveApi.DocumentInfo) {
  const blob = record.attachmentList?.[0];
  return blob?.url || blob?.downloadURL || '';
}
/** 归档状态中文名:字典 mes_pd_archive_status */
function archiveStatusText(value?: number) {
  if (value === undefined || value === null || value === '') return '-';
@@ -170,9 +179,9 @@
            >
              <template #bodyCell="{ column, record }">
                <template v-if="column.key === 'action'">
                  <template v-if="record.fileUrl">
                    <a class="mr-2" @click="openPreview(record.fileUrl, record.fileName)">预览</a>
                    <a :href="record.fileUrl" target="_blank">下载</a>
                  <template v-if="documentFileUrl(record)">
                    <a class="mr-2" @click="openPreview(documentFileUrl(record), record.fileName)">预览</a>
                    <a :href="documentFileUrl(record)" target="_blank">下载</a>
                  </template>
                  <span v-else class="text-gray-400">-</span>
                </template>