[住院医生工作站-检验申请] 列表显示信息不规范:标题术语错误且单据名称未展示具体检验项目
466 [住院医生工作站-检验申请] 申请单界面缺失核心质控字段(申请类型、标本类型、执行时间)及联动逻辑
This commit is contained in:
wangjian963
2026-06-01 14:15:59 +08:00
parent 296e825fbd
commit 76c623ba1d
7 changed files with 205 additions and 67 deletions

View File

@@ -130,7 +130,13 @@
width="140"
>
<template #default="scope">
<span>{{ buildApplicationName(scope.row) }}</span>
<el-tooltip
:content="buildFullName(scope.row)"
placement="top"
:disabled="!scope.row.requestFormDetailList || scope.row.requestFormDetailList.length <= 1"
>
<span>{{ buildApplicationName(scope.row) }}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
@@ -639,8 +645,8 @@ const parseSpecimenType = (descJson) => {
if (!descJson) return '-';
try {
const obj = JSON.parse(descJson);
// specimenName 或 sampleType 字段
return obj.specimenName || obj.sampleType || '-';
// 优先取标签字段(新格式),其次取码值字段,兼容旧数据 sampleType
return obj.specimenNameLabel || obj.specimenName || obj.sampleType || '-';
} catch (e) {
console.error('解析 descJson 失败:', e);
return '-';
@@ -649,8 +655,8 @@ const parseSpecimenType = (descJson) => {
/**
* 根据申请单详情构建申请单名称
* 单一项目:显示项目名称+数量
* 多个项目:显示首个项目名称+数量+"等X项"
* 单一项目:直接显示项目全名(不拼接数量
* 多个项目:显示"项目1 + 项目2 等n项"缩略格式
*/
const buildApplicationName = (row) => {
const details = row.requestFormDetailList;
@@ -658,11 +664,24 @@ const buildApplicationName = (row) => {
return row.name || '-';
}
if (details.length === 1) {
const item = details[0];
return `${item.adviceName}${item.quantity || ''}`;
// 单一项目:直接显示项目全名
return details[0].adviceName || row.name || '-';
}
const first = details[0];
return `${first.adviceName}${first.quantity || ''}${details.length}`;
// 多个项目:首项 + 第二项 + 等n项
const names = details.map((d) => d.adviceName).filter(Boolean);
if (names.length === 0) return row.name || '-';
const first = names[0];
const second = names.length > 1 ? ` + ${names[1]}` : '';
return `${first}${second}${details.length}`;
};
/**
* 获取申请单完整项目名称列表(用于 tooltip 展示)
*/
const buildFullName = (row) => {
const details = row.requestFormDetailList;
if (!details || details.length === 0) return row.name || '-';
return details.map((d) => d.adviceName).filter(Boolean).join(' + ') || row.name || '-';
};
const isFieldMatched = (key) => {