Files
his/MD/bugs/BUG_762_ANALYSIS.md

103 lines
4.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Bug #762 诸葛亮分析报告
> **文档类型**: Bug分析
> **分析时间**: 2026-06-12 16:21:51
> **分析模型**: mimo-v2.5 (LLM深度分析)
---
## 基本信息
- **Bug #**: 762
- **标题**: [住院护士站-领药汇总]“汇总领药”界面的筛选标签文字丢失且功能失效
- **模块**: 病区护士工作站
- **提出人**: 陈显精
---
Now I have the complete picture. Here's my analysis:
---
### 一、Bug 理解
住院护士站的「汇总领药」页面(`drugDistribution/index.vue`)顶部筛选栏有 4 个按钮——"西药""中药""明细""汇总",但目前这 4 个按钮**仅显示空白**,用户看不到文字标签,也无法通过点击"西药/中药"进行药物类别筛选。期望按钮正常显示中文标签,且点击可触发对应的数据筛选。
### 二、根因分析
**根因完全在前端**`healthlink-his-ui/src/views/inpatientNurse/drugDistribution/index.vue` 存在两个问题:
**问题1`el-radio-button` 缺少标签文字**
```html
<!-- 第50~64行当前代码 -->
<el-radio-group v-model="drugType" class="ml10">
<el-radio-button value="1" /> <!-- ← 缺少标签文字 -->
<el-radio-button value="2" /> <!-- ← 缺少标签文字 -->
</el-radio-group>
<el-radio-group v-model="isDetails" class="ml20" @change="handleRadioChange">
<el-radio-button value="1" /> <!-- ← 缺少标签文字 -->
<el-radio-button value="2" /> <!-- ← 缺少标签文字 -->
</el-radio-group>
```
Element Plus 的 `el-radio-button` 需要通过默认 slot 或 `label` 属性显示文字,仅设 `value` 不会渲染任何可见文本。
**问题2`drugType` 未传递给子组件,筛选功能失效**
- `drugType``index.vue:178` 定义(`ref('1')`),但 `PrescriptionList``SummaryMedicineList` 组件在模板中**未接收此 prop**
```html
<PrescriptionList v-if="isDetails == 1" ref="prescriptionRefs"
:exe-status="exeStatus" :request-status="requestStatus"
:deadline="deadline" :therapy-enum="therapyEnum" />
<!-- 缺少 :drug-type="drugType" -->
```
- `prescriptionList.vue` 和 `summaryMedicineList.vue` 的 `defineProps` 中均未定义 `drugType`
- API 调用时也未传 `tcmFlag` 参数
**后端已具备筛选能力**`DispenseFormSearchParam` 已有 `tcmFlag` 字段第34行`HisQueryUtils.buildQueryWrapper` 会自动生成 WHERE 条件Mapper XML 使用 `${ew.customSqlSegment}` 动态拼接。前端只需传参即可。
### 三、修复方案
纯前端修复,涉及 3 个文件,后端无需改动。
**文件1`healthlink-his-ui/src/views/inpatientNurse/drugDistribution/index.vue`**
| 修改点 | 内容 |
|--------|------|
| 第53行 `el-radio-button value="1"` | 改为 `<el-radio-button value="1">西药</el-radio-button>` |
| 第56行 `el-radio-button value="2"` | 改为 `<el-radio-button value="2">中药</el-radio-button>` |
| 第62行 `el-radio-button value="1"` | 改为 `<el-radio-button value="1">明细</el-radio-button>` |
| 第65行 `el-radio-button value="2"` | 改为 `<el-radio-button value="2">汇总</el-radio-button>` |
| `PrescriptionList` 组件标签 | 添加 `:drug-type="drugType"` prop |
| `SummaryMedicineList` 组件标签 | 添加 `:drug-type="drugType"` prop |
**文件2`healthlink-his-ui/src/views/inpatientNurse/drugDistribution/components/prescriptionList.vue`**
| 修改点 | 内容 |
|--------|------|
| `defineProps` 块第259行 | 新增 `drugType: { type: String, default: '1' }` |
| `handleGetPrescription` 函数第281行 | API 调用参数中添加 `tcmFlag: props.drugType === '1' ? 0 : 1`(西药=0中药=1 |
**文件3`healthlink-his-ui/src/views/inpatientNurse/drugDistribution/components/summaryMedicineList.vue`**
| 修改点 | 内容 |
|--------|------|
| `defineProps` 块第168行 | 新增 `drugType: { type: String, default: '1' }` |
| `handleGetPrescription` 函数第186行 | API 调用参数中添加 `tcmFlag: props.drugType === '1' ? 0 : 1` |
**验证方式:**
1. `cd healthlink-his-ui && npm run build:dev` 编译通过
2. `npm run lint` 无报错
3. 手动验证进入汇总领药页4 个按钮显示"西药""中药""明细""汇总"文字;点击切换正常
### 四、路由决策
**FIXER: zhaoyun**(前端开发)
**REASON:** 此 Bug 纯前端问题,涉及 3 个 Vue 组件的模板和 props 修复,属于前端 UI/交互层面,无需后端改动,最适合由赵云处理。
---
## 路由决策
- **修复 Agent**: zhaoyun
- **原因**: ** 此 Bug 纯前端问题,涉及 3 个 Vue 组件的模板和 props 修复,属于前端 UI/交互层面,无需后端改动,最适合由赵云处理。