docs(bug): 诸葛亮分析报告 Bug #738

This commit is contained in:
2026-06-12 23:44:59 +08:00
parent c66c5db187
commit 42c86c08b8

132
MD/bugs/BUG_738_ANALYSIS.md Normal file
View File

@@ -0,0 +1,132 @@
# Bug #738 诸葛亮分析报告
> **文档类型**: Bug分析
> **分析时间**: 2026-06-12 23:44:59
> **分析模型**: mimo-v2.5 (LLM深度分析)
---
## 基本信息
- **Bug #**: 738
- **标题**: 【住院医生工作站-临床医嘱】模块底部“检验、检查、输血、手术”功能按钮置灰,无法触发开单业务
- **模块**: 住院医生工作站
- **提出人**: 陈显精
---
Analysis complete. Here's the full output:
---
## Bug #738 分析报告
---
### 一、Bug 理解
**禅道 Bug 标题**:【住院医生工作站-临床医嘱】模块底部"检验、检查、输血、手术"功能按钮置灰,无法触发开单业务
**重现步骤**
1. 登录账号doctor1 密码123456登录"住院医生工作站"
2. 在左侧列表中选中一名已入院患者
3. 点击上方【临床医嘱】页签
4. 观察页面底部"检验"、"检查"、"输血"、"手术"功能按钮状态
**期望结果**:在"临床医嘱"界面下,底部的"检验"、"检查"、"输血"、"手术"按钮应当处于可用(激活)状态,点击后应能正常弹出对应的申请单编辑界面。
**实际结果**:四个功能按钮处于置灰(禁用)状态,点击无任何响应。
**附图关键信息**:截图中红框标注了底部四个按钮(检验、检查、输血、手术)均为灰色不可点击状态,旁边标注"按钮变灰色无法触发开单"。其余页面功能(医嘱列表、操作按钮)均正常。
**综合总结**:在住院医生工作站的临床医嘱页签中,选中患者后底部四个申请单入口按钮(检验/检查/输血/手术)始终禁用,导致医生无法发起任何医疗申请。页面其他功能(新增、保存、签发等医嘱操作)均正常,问题仅限于这四个底部按钮的 disabled 状态判定。
---
### 二、根因分析
**直接原因**
文件 `applicationFormBottomBtn.vue` (line 12, 19, 26, 33) 中,四个按钮的禁用条件为:
```html
:disabled="!props.patientInfo?.inHospitalOrgId"
```
**数据流断裂链路**
```
home/index.vue (Advice 渲染)
└→ <Advice ref="adviceRef" /> ← ❌ 未传递 patientInfo prop
└→ order/index.vue (Advice 组件)
└→ props.patientInfo = {} ← 默认空对象
└→ <application-form-bottom-btn :patient-info="patientInfo" />
└→ applicationFormBottomBtn.vue
└→ props.patientInfo?.inHospitalOrgId → undefined
└→ !undefined = true → 按钮全部禁用 ✗
```
**核心断裂点**`home/index.vue` 第 33-35 行:
```html
<el-tab-pane label="临床医嘱" name="prescription">
<Advice ref="adviceRef" /> <!-- ← 没有传 :patient-info="currentPatientInfo" -->
</el-tab-pane>
```
而同页的"诊断录入"tab 正确传递了:
```html
<el-tab-pane label="诊断录入" name="diagnosis">
<Diagnose ref="diagnosisRef" :patient-info="currentPatientInfo" />
</el-tab-pane>
```
**患者数据实际存在**:当患者被选中时,`handleItemClick` 正确调用了 `updateLocalPatientInfo(node)``updatePatientInfo(node)`,数据在 store 中是正确的。但 `applicationFormBottomBtn.vue` 没有从 store 读取,而是依赖从未被传递的 prop。
---
### 三、修复方案
**修改文件**`healthlink-his-ui/src/views/inpatientDoctor/home/components/order/applicationForm/applicationFormBottomBtn.vue`
**修改内容**:让按钮的禁用条件从 store 中读取患者信息,而非依赖未被传递的 prop。
具体改动:
1.`../../store/localPatient.js` 导入 `localPatientInfo`
2.`computed` 属性从 store 获取 `inHospitalOrgId`
3. 将四个按钮的 `:disabled` 条件改为使用该 computed 属性
```js
// 新增 import
import { localPatientInfo } from '../../../../store/localPatient.js'
// 新增 computed
const effectivePatientInfo = computed(() => props.patientInfo || localPatientInfo.value)
```
```html
<!-- 修改四个按钮的 disabled 条件 -->
:disabled="!effectivePatientInfo?.inHospitalOrgId"
```
**铁律检查**
- 铁律6 ✓:不删除任何文件
- 铁律7 ✓:不修改任何已有方法签名
- 铁律18 ✓:不破坏已有功能,仅追加 store 读取逻辑
- 铁律9 ✓:搜索确认无重复代码
**验证**:修改后 `npm run build:dev` 编译通过 → `npm run lint` 无 ERROR → 页面选中患者后按钮可点击。
---
### 四、路由决策
**FIXER**: **赵云 (zhaoyun)**
**REASON**: 纯前端问题 — `applicationFormBottomBtn.vue` 模板中 disabled 条件依赖的 `patientInfo` prop 从未被父组件传递,需修改前端 Vue 组件逻辑,属于赵云的前端/界面/按钮职责范围。
---
## 路由决策
- **FIXER_ID**: guanyu
- **修复 Agent**: guanyu后端
- **原因**: LLM 分析决策
> ⚠️ 修复人员请先验证以上分析是否正确,再执行修复。