Files
his/BUG_556_ANALYSIS.md

56 lines
2.9 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 #556 分析报告
## Bug 描述
【门诊医生站-检验】新增检验申请单时就诊卡号/执行时间未自动回显,且项目列表冗余显示"套餐"文字
## 三个子问题分析
### 问题1就诊卡号未自动回显
**位置**: `inspectionApplication.vue` 第 146 行 `formData.medicalrecordNumber`
**根因**:
- `initData()` 第 886 行使用 `props.patientInfo.identifierNo` 填充
- `resetForm()` 第 1526 行同样使用 `props.patientInfo.identifierNo` 填充
- `handleSave()` 第 1598-1607 行同步患者信息时,只同步了 `visitNo`(对应 `busNo`**没有同步 `medicalrecordNumber`**
- `props.patientInfo` 中就诊卡号对应的字段是 `busNo`(就诊流水号/卡号),而 `identifierNo` 是身份证号/标识号,可能为空
- **修复**: `medicalrecordNumber` 应使用 `props.patientInfo.busNo` 填充,与 `visitNo` 保持一致
### 问题2执行时间未自动填充
**位置**: `inspectionApplication.vue` 第 978 行 `executeTime: null`
**根因**:
- `formData.executeTime` 初始值为 `null`
- `initData()``resetForm()` 都**没有**设置 `executeTime` 默认值
- 第 176-186 行的日期选择器 placeholder 为"选择执行时间",无默认值
- **修复**: 在 `initData()``resetForm()` 中将 `executeTime` 设置为当前时间(格式与 `applyTime` 一致)
### 问题3项目列表冗余显示"套餐"文字
**位置**: `inspectionApplication.vue` 第 566 行 `el-tag v-if="item.isPackage"`
**根因**:
- `loadCategoryItems()` 第 1190 行: `const isPackage = item.feePackageId != null && item.feePackageId !== '' && item.feePackageId !== 'null'`
- 数据库中 ALL 12条 lab_activity_definition 记录都有 `fee_package_id`
- 但通过 `inspection_package_detail` 比对,只有 **2条** 记录的名称与套餐名称匹配("肝功能12项"和"免疫组织化学染色诊断"
- 其余 10 条是套餐子项或普通项目,不应显示"套餐"标签
- **修复**: 改为检查 `item.packageName && item.itemName === item.packageName`,即只有当项目名称与套餐名称匹配时才标记为套餐
## 修复方案
### 修复1: 就诊卡号
- `initData()`: `formData.medicalrecordNumber = props.patientInfo.busNo || ''`(替代 `identifierNo`
- `resetForm()`: 同样改为 `busNo`
- `handleSave()`: 同步时增加 `formData.medicalrecordNumber` 同步
### 修复2: 执行时间
- `initData()`: 新增 `formData.executeTime = formatDateTime(new Date())`
- `resetForm()`: 将 `executeTime: null` 改为 `executeTime: formatDateTime(new Date())`
### 修复3: 套餐标签
- `loadCategoryItems()` 第1190行: 将 `isPackage` 判断改为 `item.packageName && item.name === item.packageName`
## 验证门禁
- Gate A: 根因已定位到具体代码行
- Gate B: 已读取 inspectionApplication.vue 全部代码,理解数据流
- Gate C: 修复方案与验收标准一致
- Gate D: 不涉及数据库 DDL 变更