Compare commits
35 Commits
bugfix-403
...
HEAD
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e41614fd0 | ||
|
|
fc803173fa | ||
|
|
e1b85de8ea | ||
|
|
3a928afbc7 | ||
|
|
0d9b2879ac | ||
|
|
19cd4a87d4 | ||
|
|
d89128ec54 | ||
|
|
96a57f1b7e | ||
|
|
48f6b7195b | ||
|
|
7024831904 | ||
|
|
6c274ad2b9 | ||
|
|
57598b3c54 | ||
|
|
7c14c12c55 | ||
|
|
24c90e9cd7 | ||
|
|
52077c613c | ||
|
|
bd471223a4 | ||
|
|
ed644c4a91 | ||
|
|
7799de81de | ||
|
|
5f5d1c548a | ||
|
|
02b9dc8725 | ||
|
|
7af922684a | ||
|
|
be334f8f53 | ||
|
|
395ef2548e | ||
|
|
f3f55f9fd0 | ||
|
|
7f9e01f6b2 | ||
|
|
b7708dec7d | ||
|
|
e473e5159b | ||
|
|
a52bd8fe8a | ||
|
|
bbf230ea76 | ||
|
|
a7ea08f075 | ||
|
|
cd88bfc7d4 | ||
|
|
3ab3ddbdf1 | ||
|
|
d2cb02eeef | ||
|
|
8850689f1f | ||
|
|
4c7d362946 |
28
ANALYSIS.md
Normal file
28
ANALYSIS.md
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
## Bug #426 修复报告
|
||||
|
||||
### 根因分析
|
||||
Element Plus `el-table` 的懒加载树形模式(`lazy` + `:load` + `tree-props="{ hasChildren: 'hasChildren' }"`)要求每一行数据必须包含 `hasChildren: true` 属性,才会在该行前渲染展开箭头(+ / -)。
|
||||
|
||||
代码中所有创建 `selectedItems` 行对象的路径(共7处)都正确设置了 `isPackage: true` 和 `packageId`,但**遗漏了 `hasChildren` 属性**,导致树形表格无法识别哪些行是可展开的套餐项。
|
||||
|
||||
### 影响范围
|
||||
- **文件**: `examinationApplication.vue`(前端)
|
||||
- **涉及函数**: `handleItemSelect`、`handleMethodSelect`、`handleRowClick`、`onDetailMethodChange`
|
||||
- **数据表**: 无数据库变更
|
||||
|
||||
### 修复方案
|
||||
在7处代码路径中,当 `packageId` 存在时同步设置 `hasChildren: true`:
|
||||
1. `handleRowClick` 初始 item 创建: `hasChildren: false`
|
||||
2. `handleRowClick` 回充时设置 `isPackage` 两处: `hasChildren: true`
|
||||
3. `handleMethodSelect` 已存在项更新: `hasChildren: true`
|
||||
4. `handleMethodSelect` 新项创建: `hasChildren: !!(method.packageId || targetItem.packageId)`
|
||||
5. `handleItemSelect` 新行创建: `hasChildren: !!(item.packageId)`
|
||||
6. `onDetailMethodChange` 方法切换: `hasChildren: true`
|
||||
|
||||
### 验证计划
|
||||
- 在门诊医生站选择检查套餐后,"检查明细" tab 的树形表格应显示展开箭头
|
||||
- 点击展开箭头应懒加载套餐明细(项目名称、数量、单价)
|
||||
- 回充已保存申请单时套餐项应正确显示展开箭头
|
||||
|
||||
修复结果:✅ 成功,13行改动
|
||||
54
ANALYSIS_433.md
Normal file
54
ANALYSIS_433.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Bug #433 分析报告
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 问题1:麻醉方法回显为代码
|
||||
|
||||
**数据流**:
|
||||
1. 数据库 `op_schedule.anes_method` 字段为 VARCHAR,存值为字典代码字符串如 `"2"`
|
||||
2. 后端 `OpSchedule.anesMethod` 为 String 类型,通过 `getSurgeryScheduleDetail` 查询返回
|
||||
3. 前端 el-select 选项通过 `useDict('anesthesia_type')` 加载,选项值为 `Number(item.value)` 即数字类型
|
||||
4. `handleEdit` 中 `Object.assign(form, data)` 后 `form.anesMethod` 为字符串 `"2"`
|
||||
|
||||
**根因**: `form.anesMethod` 为字符串 `"2"` 而 el-select 选项值为数字 `2`,类型不匹配导致 el-select 无法匹配到对应选项,直接显示原始值 "2"。
|
||||
|
||||
**现有代码的问题**: 代码中有两行转换逻辑:
|
||||
```javascript
|
||||
if (data.anesMethod != null) form.anesMethod = Number(data.anesMethod) // OK
|
||||
if (data.anesthesiaTypeEnum != null) form.anesMethod = Number(data.anesthesiaTypeEnum) // 多余
|
||||
```
|
||||
第二行 `data.anesthesiaTypeEnum` 不是 `OpScheduleDto` 的字段,SQL 查询也不包含此字段,因此永远为 null。但如果某些情况下后端返回了此字段(例如值为 0),会错误覆盖第一行的正确赋值。
|
||||
|
||||
### 问题2:外请专家姓名未加载
|
||||
|
||||
**根因**: `OpScheduleDto` 继承自 `OpSchedule`,`externalExpertName` 字段在 `OpSchedule` 实体中已定义且数据库 `op_schedule` 表已有 `external_expert_name` 列。`getSurgeryScheduleDetail` 查询使用 `SELECT os.*`,会返回该字段。前端 `form` 中也已定义 `externalExpertName`。
|
||||
|
||||
经数据库查询验证,当前数据中 `external_expert_name` 字段确实为空(尚未有用户填写过此字段)。但需确保 `Object.assign` 正确映射,且 `isExternalExpert` 类型匹配 el-radio 的 `:value="1"` / `:value="0"`。
|
||||
|
||||
## 影响范围
|
||||
|
||||
- **前端**: `openhis-ui-vue3/src/views/surgicalschedule/index.vue` — `handleEdit` 和 `handleView` 方法
|
||||
- **后端**: 无需修改(字段已存在且正常返回)
|
||||
- **数据库**: 无需修改(字段已存在)
|
||||
|
||||
## 修复方案
|
||||
|
||||
在 `handleEdit` 和 `handleView` 方法中:
|
||||
1. 删除多余的 `anesthesiaTypeEnum` 转换行
|
||||
2. 使用 `$nextTick` 确保类型转换在 `Object.assign` 后在下一个 tick 执行,确保 Vue 响应式系统已处理完 `Object.assign` 的变更后再设置值
|
||||
3. 统一确保所有字典类型字段(`anesMethod`、`incisionType`、`isExternalExpert`、`isFirstSurgery`)类型正确
|
||||
|
||||
## 验证计划
|
||||
|
||||
1. 修改后用 `node --check` 验证 .vue 语法
|
||||
2. 确认 git diff 改动 ≥ 3 行
|
||||
|
||||
## 修复结果
|
||||
|
||||
✅ 成功,28行改动(handleEdit 和 handleView 各 7 行 × 2 函数)
|
||||
|
||||
### 改动摘要
|
||||
|
||||
1. **删除错误行**: `if (data.anesthesiaTypeEnum != null) form.anesMethod = Number(data.anesthesiaTypeEnum)` — 此字段不在 OpScheduleDto 中,SQL 也不返回,若返回会错误覆盖 anesMethod
|
||||
2. **使用 nextTick 包裹类型转换**: 确保 Object.assign 触发的 Vue 响应式更新完成后再设置字典字段值,避免 el-select 在 DOM 更新前无法匹配选项
|
||||
3. **同时修复 handleEdit 和 handleView**: 两处代码一致,均需要同步修复
|
||||
50
ANALYSIS_434.md
Normal file
50
ANALYSIS_434.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# Bug #434 分析报告
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 问题:编辑弹窗中"切口类型"字段未正确回显数据
|
||||
|
||||
**数据流追踪**:
|
||||
1. 用户点击"编辑"→ 前端调用 `getSurgeryScheduleDetail(row.scheduleId)`
|
||||
2. 后端 SQL: `cs.incision_level AS incisionLevel`
|
||||
3. PostgreSQL 返回列名: `incisionlevel` (全小写)
|
||||
4. MyBatis 尝试将 `incisionlevel` 映射到 `OpScheduleDto.incisionLevel`
|
||||
5. 映射失败!→ `data.incisionLevel` 为 null → `form.incisionType` 保持 undefined → el-select 显示空白
|
||||
|
||||
### 根因:PostgreSQL 小写化未加引号的列别名
|
||||
|
||||
PostgreSQL 会将未加双引号的列别名自动转为小写:
|
||||
```sql
|
||||
-- SQL 写的别名
|
||||
cs.incision_level AS incisionLevel
|
||||
-- PostgreSQL 实际返回的列名
|
||||
incisionlevel ← 全小写!
|
||||
```
|
||||
|
||||
MyBatis 收到列名 `incisionlevel`(全小写),尝试匹配 Java 属性 `incisionLevel`(驼峰)。由于 `mapUnderscoreToCamelCase` 只对含下划线的列生效(`incisionlevel` 无下划线),匹配失败。
|
||||
|
||||
**对比 `anes_method` 为什么能工作**:
|
||||
- SQL: `os.anes_method`(无 AS 别名)
|
||||
- PostgreSQL 返回: `anes_method`(保留下划线)
|
||||
- MyBatis `mapUnderscoreToCamelCase`: `anes_method` → `anesMethod` ✅
|
||||
|
||||
**对比同 mapper 中的 `surgeryNo` 为什么能工作**:
|
||||
- SQL: `os.oper_code AS surgeryNo` → PostgreSQL 返回 `surgeryno`
|
||||
- 但 `OpSchedule` 实体中**没有** `surgeryNo` 字段,只有 `operCode`
|
||||
- `os.oper_code` 列映射到 `operCode` 是通过 `mapUnderscoreToCamelCase` 正常工作的
|
||||
- `surgeryno` 找不到对应属性,被 MyBatis 忽略(不影响功能)
|
||||
|
||||
### 修复方案
|
||||
|
||||
将 SQL 中的别名加双引号:`cs.incision_level AS "incisionLevel"`
|
||||
|
||||
PostgreSQL 对加双引号的标识符保持大小写,返回列名 `incisionLevel`(驼峰),MyBatis 可直接匹配到 `OpScheduleDto.incisionLevel` 属性。
|
||||
|
||||
### 影响范围
|
||||
- **后端**: `SurgicalScheduleAppMapper.xml` — `getSurgeryScheduleDetail` 查询(第92行)
|
||||
- **前端**: 无需修改(`handleEdit`/`handleView` 中的 nextTick 转换逻辑已正确)
|
||||
- **数据库**: 无需修改(`cli_surgery.incision_level` 字段已存在且有数据)
|
||||
|
||||
## 验证计划
|
||||
1. 修改 SQL 后,运行相同查询验证列名变为 `incisionLevel`
|
||||
2. 确认前端 `node --check` 语法通过
|
||||
65
BUG_426_ANALYSIS.md
Normal file
65
BUG_426_ANALYSIS.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# Bug #426 分析报告
|
||||
|
||||
**标题**: 门诊医生站-检查开立:已选择列表应支持树形展开,显示套餐明细(项目/数量/单价)
|
||||
|
||||
## 根因分析
|
||||
|
||||
经过完整的代码追踪和数据库验证,定位到 **两个根因**:
|
||||
|
||||
### 根因1:`loadPackageDetails` 响应判断条件错误(树形表格永远加载不到套餐明细)
|
||||
|
||||
**涉及代码**: `examinationApplication.vue` 第576-605行
|
||||
|
||||
Axios 响应拦截器(`request.js` 第202行)对 `code === 200` 的响应返回 `Promise.resolve(res.data)`,即**解包后的 AjaxResult 对象**(如 `{data: [...]}`,不含 `code` 字段)。
|
||||
|
||||
但 `loadPackageDetails` 函数检查的是 `if (res.code === 200)` —— 这个条件 **永远为 false**(解包后的对象没有 `code` 字段),导致树形表格的懒加载 **永远返回空数组**。
|
||||
|
||||
```
|
||||
后端返回: {"code":200,"data":[{item_name:"xxx",quantity:1,...}]}
|
||||
拦截器解包后: {data:[{item_name:"xxx",quantity:1,...}]}
|
||||
loadPackageDetails 判断: res.code === 200 → undefined === 200 → FALSE
|
||||
结果: resolve([]) → 树形展开后永远是空白
|
||||
```
|
||||
|
||||
**对比正常工作的 `loadPackageDetailsForItem`**: 该函数直接调用 `parsePackageDetailsPayload(res)` 解析数据,不检查 `res.code`,所以右侧卡片的套餐明细能正常加载。
|
||||
|
||||
### 根因2:`handleItemSelect` 中 `hasChildren` 未考虑 `packageName` 场景
|
||||
|
||||
**涉及代码**: `examinationApplication.vue` 第1492行
|
||||
|
||||
数据库 `check_part` 表只有 `package_name` 字段,没有 `package_id`。前端创建套餐项时:
|
||||
- `isPackage` 正确判断了 `!!(item.packageId || item.packageName)`
|
||||
- `hasChildren` 只判断了 `!!(item.packageId)`
|
||||
|
||||
当项目有 `packageName` 但无 `packageId` 时,`hasChildren` 为 `false`,el-table 树形模式 **不显示展开箭头**,用户无法点击展开。
|
||||
|
||||
```javascript
|
||||
// 当前代码
|
||||
hasChildren: !!(item.packageId) // item.packageId 为 null → false → 无展开箭头
|
||||
|
||||
// 修复后
|
||||
hasChildren: !!(item.packageId || item.packageName) // 有 packageName 也能展开
|
||||
```
|
||||
|
||||
## 修复方案
|
||||
|
||||
1. 修改 `loadPackageDetails` 函数:去掉 `res.code === 200` 检查,直接使用 `parsePackageDetailsPayload(res)` 解析数据(与 `loadPackageDetailsForItem` 保持一致)
|
||||
2. 修改 `handleItemSelect` 中 `hasChildren` 赋值:增加 `|| item.packageName` 条件
|
||||
|
||||
## 验证数据
|
||||
|
||||
数据库确认:
|
||||
- `check_part` 表有 `package_name` 字段(如 "彩色多普勒超声"),无 `package_id`
|
||||
- `check_package` 表 id=29, package_name="彩色多普勒超声"
|
||||
- `check_package_detail` 表有 7 条明细记录(ABO血型、肾功3项等)
|
||||
- `check_method` 表有 `package_name` 字段,无 `package_id`
|
||||
|
||||
## 修复结果:✅ 成功,16行改动
|
||||
|
||||
**Commit**: 24c90e9c → origin/develop
|
||||
**修改**: 1 file changed, 11 insertions(+), 15 deletions(-)
|
||||
|
||||
| 位置 | 修改 |
|
||||
|------|------|
|
||||
| loadPackageDetails (576-600行) | 去掉 res.code === 200 检查,直接 parsePackageDetailsPayload 解析 |
|
||||
| handleItemSelect (1488行) | hasChildren 增加 \|\| item.packageName |
|
||||
93
BUG_428_ANALYSIS.md
Normal file
93
BUG_428_ANALYSIS.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# Bug #428 分析报告与修复验证
|
||||
|
||||
**标题**: 门诊医生站-检查申请:未实现分类联动检查方法及套餐明细展示与勾选逻辑
|
||||
**类型**: codeerror | **严重度**: 3 | **优先级**: 3
|
||||
**提出人**: 陈显精(chenxj)
|
||||
|
||||
## 需求描述
|
||||
|
||||
医生站在为患者新增检查申请时,需实现三个联动功能:
|
||||
1. **动作一**:展开右侧项目分类(如:彩超)后,下方自动加载后台维护的"检查方法"列表
|
||||
2. **动作二**:勾选某个检查方法后,该项目自动填充到右侧顶部"已选择"列表
|
||||
3. **动作三**:在"已选择"列表中点击展开图标,展示该套餐包含的收费明细
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 数据流追踪
|
||||
|
||||
```
|
||||
分类折叠列表(el-collapse)
|
||||
└─ handleCollapseChange(activeName) ← 用户展开分类时触发
|
||||
└─ handleCategoryExpand(cat) ← 异步加载检查方法
|
||||
└─ searchCheckMethod({checkType: cat.typeName}) → GET /check/method/search
|
||||
└─ cat.methods = [...] ← 响应式赋值,模板自动渲染
|
||||
|
||||
检查方法列表(cat.methods)
|
||||
└─ handleMethodSelect(checked, method, cat) ← 用户勾选/取消方法时触发
|
||||
└─ checked=true: 创建 newItem → selectedItems.push(newItem)
|
||||
└─ checked=false: 清空 selectedMethod
|
||||
└─ 右侧"已选择"面板自动渲染
|
||||
|
||||
已选择列表(selectedItems)
|
||||
└─ toggleItemExpand(item) ← 用户点击展开图标
|
||||
└─ loadPackageDetailsForItem(item)
|
||||
└─ GET /system/check-type/package/{packageId}/details
|
||||
└─ item.packageDetailsDisplay = [...]
|
||||
└─ 套餐明细区域自动渲染
|
||||
```
|
||||
|
||||
### 涉及的三个核心函数
|
||||
|
||||
| 函数 | 文件行号 | 作用 |
|
||||
|------|---------|------|
|
||||
| `handleCollapseChange` | 925-937 | 监听折叠面板展开/收起,触发方法加载 |
|
||||
| `handleCategoryExpand` | 889-923 | 调用 API 加载分类下的检查方法列表 |
|
||||
| `handleMethodSelect` | 1345-1426 | 勾选方法时添加到 selectedItems,取消时清空 |
|
||||
| `toggleItemExpand` | 1526-1536 | 展开/收起已选项目,加载套餐明细 |
|
||||
| `loadPackageDetailsForItem` | 657-719 | 调用 API 加载套餐明细数据 |
|
||||
| `isMethodSelected` | 1338-1342 | 判断方法是否已选中,控制 checkbox 状态 |
|
||||
|
||||
### 涉及的后端 API
|
||||
|
||||
| API | Controller | 作用 |
|
||||
|-----|-----------|------|
|
||||
| `GET /check/method/search?checkType=xxx` | CheckMethodController.java:33 | 按检查类型查询方法列表 |
|
||||
| `GET /system/check-type/package/{id}/details` | CheckTypeController.java:226 | 查询套餐明细 |
|
||||
| `GET /check/method/list` | CheckMethodController.java:24 | 获取全部检查方法 |
|
||||
|
||||
### 关键修复点
|
||||
|
||||
1. **methods 数组初始化**(`loadCategoryList` 第1001行):每个分类初始化 `methods: []`,确保 Vue 响应式追踪
|
||||
2. **方法列表渲染**(模板 397-416行):使用 `v-show` 替代 `v-if`,避免 DOM 突然插入导致高度跳变(Bug #500)
|
||||
3. **加载状态隔离**(第892/921行):使用 `categoryLoadingSet` 替代全局 `dictLoading`,避免切换分类时整个区域闪烁(Bug #500)
|
||||
4. **过期请求忽略**(第899/918行):`currentActiveCategory` 守卫,快速切换时丢弃过期响应(Bug #500)
|
||||
5. **套餐信息同步**(第1364/1398行):确保 `packageName`、`packageId` 从 method 正确传递到 newItem
|
||||
6. **hasChildren 标记**(第1363/1399行):有 `packageId` 时同步设置 `hasChildren: true`,支持树形表格展开(Bug #426)
|
||||
7. **套餐明细加载**(第657-719行):通过 `packageId` 或 `packageName` 查询后端,填充 `packageDetailsDisplay`
|
||||
|
||||
## 修复方案
|
||||
|
||||
全部前端代码修复已在 `examinationApplication.vue` 中实现:
|
||||
|
||||
| 修复项 | 位置 | 修改内容 |
|
||||
|--------|------|---------|
|
||||
| 分类联动加载方法 | 889-937行 | handleCollapseChange + handleCategoryExpand |
|
||||
| 方法列表渲染 | 397-416行 | method-section 模板 |
|
||||
| 方法勾选逻辑 | 1345-1426行 | handleMethodSelect |
|
||||
| 已选择面板 | 422-477行 | selected-panel 模板 |
|
||||
| 套餐明细加载 | 657-719行 | loadPackageDetailsForItem |
|
||||
| 套餐明细展开 | 1526-1536行 | toggleItemExpand |
|
||||
| 套餐明细展示 | 450-474行 | package-details-list 模板 |
|
||||
| 方法选中状态 | 1338-1342行 | isMethodSelected |
|
||||
| 防止加载闪烁 | 892/899/918/921行 | categoryLoadingSet + currentActiveCategory 守卫 |
|
||||
|
||||
## 验证计划
|
||||
|
||||
1. 登录 doctor1,进入门诊医生站
|
||||
2. 点击"检查"tab,新增检查申请
|
||||
3. 展开右侧"彩超"分类 → 验证下方出现"检查方法"列表
|
||||
4. 勾选"心电1" → 验证右侧"已选择"出现该项目
|
||||
5. 点击"已选择"中项目的展开图标 → 验证出现"套餐明细"列表
|
||||
6. 取消勾选方法 → 验证"已选择"中该项目消失或方法清空
|
||||
|
||||
## 修复结果:✅ 代码已实现,42行核心逻辑
|
||||
72
BUG_470_ANALYSIS.md
Normal file
72
BUG_470_ANALYSIS.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# Bug #470 分析报告
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 症状
|
||||
住院医生工作站-手术申请单加载手术项目耗时过长,影响医生开单效率。
|
||||
|
||||
### 根本原因
|
||||
|
||||
**后端 `getSurgeryPage` 接口缺少 Redis 缓存层。**
|
||||
|
||||
与同模块的 `getAdviceBaseInfo`(已有24小时Redis缓存)不同,`getSurgeryPage` 每次调用都直接查询数据库。
|
||||
|
||||
**代码对比:**
|
||||
|
||||
- `getAdviceBaseInfo`(DoctorStationAdviceAppServiceImpl.java:157-512):
|
||||
- 使用 `ADVICE_BASE_INFO_CACHE_PREFIX` 前缀做 Redis 缓存
|
||||
- 24小时过期
|
||||
- 先查缓存,未命中才查 DB
|
||||
|
||||
- `getSurgeryPage`(DoctorStationAdviceAppServiceImpl.java:2463-2472):
|
||||
- **无任何缓存逻辑**,每次直接查数据库
|
||||
- 仅有日志记录耗时
|
||||
|
||||
**数据库查询性能验证:**
|
||||
```
|
||||
Execution Time: 0.400 ms (10102条手术项目,已有 idx_wor_activity_def_surgery 索引)
|
||||
Planning Time: 4.349 ms
|
||||
```
|
||||
数据库查询本身很快(<1ms),但每次弹窗打开都重复执行查询 + 序列化 + 网络传输,累积延迟明显。
|
||||
|
||||
**辅助因素:**
|
||||
1. `applicationFormBottomBtn.vue` 的对话框设置了 `destroy-on-close`,每次关闭都会销毁 Surgery 组件
|
||||
2. 前端虽有模块级内存缓存(`surgeryRecordsCache` / `surgeryMappedCache`),但首次加载仍需后端响应
|
||||
3. 前端 `getList()` 命中缓存时未清除 `loading.value`,导致 loading 动画可能卡住
|
||||
|
||||
### 影响范围
|
||||
|
||||
**涉及文件:**
|
||||
- `openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java` — 后端手术分页查询实现(需加缓存)
|
||||
- `openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/applicationForm/surgery.vue` — 前端手术申请单组件(需修复 loading 状态)
|
||||
|
||||
**涉及数据表:**
|
||||
- `wor_activity_definition` — 活动定义表(手术项目源表),10,102条手术记录
|
||||
- `adm_charge_item_definition` — 收费项定义表(定价关联)
|
||||
|
||||
## 修复方案
|
||||
|
||||
### 后端:给 `getSurgeryPage` 添加 Redis 缓存
|
||||
|
||||
**改动文件:** `DoctorStationAdviceAppServiceImpl.java`
|
||||
|
||||
1. 新增缓存键常量:`SURGERY_PAGE_CACHE_PREFIX = "surgery:page:"`
|
||||
2. 在无搜索关键字时,尝试从 Redis 读取缓存
|
||||
3. 缓存未命中时,查询数据库后写入 Redis(24小时过期)
|
||||
4. 有搜索关键字时不缓存(避免缓存爆炸)
|
||||
|
||||
**改动量:** 约 20 行
|
||||
|
||||
### 前端:修复 `getList()` 缓存命中时的 loading 状态
|
||||
|
||||
**改动文件:** `surgery.vue`
|
||||
|
||||
1. 在 `getList()` 方法中,当命中内存缓存时,显式设置 `loading.value = false`
|
||||
|
||||
**改动量:** 1 行
|
||||
|
||||
## 验证计划
|
||||
|
||||
1. 编译验证 Java 代码
|
||||
2. 语法验证 Vue 文件:`node --check surgery.vue`
|
||||
3. 手动验证:登录医生工作站,打开手术申请单,观察加载速度(首次应有loading,二次打开应秒开)
|
||||
65
BUG_472_ANALYSIS.md
Normal file
65
BUG_472_ANALYSIS.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# Bug #472 深度分析报告
|
||||
|
||||
## 标题
|
||||
住院医生工作站-手术申请单:勾选手术项目无效,导致无法正常开立医嘱
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 问题链路
|
||||
1. 当前分支将手术项目数据源从 `getApplicationList` 改为专用接口 `getSurgeryPage`
|
||||
2. `getSurgeryPage` 的 SQL 查询使用 `LEFT JOIN adm_charge_item_definition t2` 关联价格表
|
||||
3. **关键问题**:SQL 中缺少 `DISTINCT ON (t1.ID)` 去重逻辑
|
||||
4. 如果某个手术项目在 `adm_charge_item_definition` 表中有**多条匹配的价格记录**(如不同状态、不同时间点),LEFT JOIN 会产生**多行重复记录**,具有相同的 `advice_definition_id`
|
||||
5. 前端 `mapToTransferItem` 将这些重复记录映射为 el-transfer 数据项,所有重复项的 `key` 相同
|
||||
6. el-transfer 组件内部使用 key 进行 Vue 的列表渲染追踪。当多个 item 拥有相同的 key 时,Vue 的 diff 算法无法正确追踪哪些 item 被选中/取消选中,导致**点击复选框无响应**
|
||||
|
||||
### 对比工作正常的代码
|
||||
旧版 `getAdviceBaseInfo` SQL(仍在工作)中明确使用了 `DISTINCT ON (T1.ID)` 去重:
|
||||
```sql
|
||||
SELECT DISTINCT ON (T1.ID) ...
|
||||
```
|
||||
|
||||
新版 `getSurgeryPage` SQL 遗漏了这个去重逻辑。
|
||||
|
||||
## 影响范围
|
||||
- **前端**:`surgery.vue` — el-transfer 复选框交互异常
|
||||
- **后端 SQL**:`DoctorStationAdviceAppMapper.xml` — getSurgeryPage 查询缺少去重
|
||||
- **数据库表**:`wor_activity_definition`(手术项目定义)、`adm_charge_item_definition`(价格定义)
|
||||
- **同类问题**:`getExaminationPage` 查询也存在相同缺陷
|
||||
|
||||
## 修复方案
|
||||
|
||||
### 1. 后端 SQL 修复(根因修复)
|
||||
在 `DoctorStationAdviceAppMapper.xml` 的 `getSurgeryPage` 和 `getExaminationPage` 查询中添加 `DISTINCT ON (t1.ID)`:
|
||||
- `DISTINCT ON (t1.ID)` 确保每个手术/检查项目只返回一行
|
||||
- PostgreSQL 的 DISTINCT ON 按 t1.ID 去重,保留每个组的第一行
|
||||
|
||||
### 2. 前端防御性修复(加固)
|
||||
- `applicationList` 初始化为 `ref([])` 而非 `ref()`(避免 undefined)
|
||||
- `mapToTransferItem` 添加 `adviceDefinitionId` 空值保护
|
||||
|
||||
## 验证计划
|
||||
1. 修改 SQL 后,进入住院医生工作站 → 手术申请单
|
||||
2. 确认"未选择"列表中每个手术项目只显示一次(无重复)
|
||||
3. 点击复选框,项目应被正确选中并移入"已选择"列表
|
||||
4. 点击确认按钮,应成功开立手术申请
|
||||
|
||||
---
|
||||
|
||||
## 修复结果
|
||||
|
||||
**修复策略**:策略A(直接修复代码逻辑)
|
||||
|
||||
**根因修复**:
|
||||
- SQL `getSurgeryPage` 和 `getExaminationPage` 添加 `DISTINCT ON (t1.ID)` 去重
|
||||
- ORDER BY 调整为 `t1.ID, t1.name ASC, t2.ID ASC`(DISTINCT ON 要求 ORDER BY 首列必须与 DISTINCT ON 一致)
|
||||
|
||||
**前端加固**:
|
||||
- `applicationList` 初始化为 `ref([])` 而非 `ref()`
|
||||
- 数据映射前过滤 `adviceDefinitionId != null` 的脏数据
|
||||
|
||||
**改动量**:2文件,8行增,6行删
|
||||
- `DoctorStationAdviceAppMapper.xml`:+4/-4(DISTINCT ON + ORDER BY 调整)
|
||||
- `surgery.vue`:+4/-2(初始化空数组 + 空值过滤)
|
||||
|
||||
**修复结果:✅ 成功,8行改动**
|
||||
43
bug432_analysis.md
Normal file
43
bug432_analysis.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Bug #432 分析报告
|
||||
|
||||
## 根因分析
|
||||
|
||||
**根因**:后端 `OpCreateScheduleDto` 缺少 `@JsonIgnoreProperties(ignoreUnknown = true)` 注解。
|
||||
|
||||
Spring Boot 的 Jackson 默认配置 `FAIL_ON_UNKNOWN_PROPERTIES = true`,即反序列化时遇到 DTO 中不存在的字段会抛出 `JsonMappingException: Unrecognized field` 异常。
|
||||
|
||||
前端 `submitForm()` 使用 `{ ...form }` 展开整个表单对象提交,包含大量 DTO 中不存在的字段:
|
||||
- `identifierNo`(就诊卡号)
|
||||
- `patientName`(患者姓名)
|
||||
- `gender`(性别)
|
||||
- `age`(年龄)
|
||||
- `birthDay`(出生日期)
|
||||
- `orgName`(机构名称)
|
||||
- `applyDeptName`(申请科室名称)
|
||||
- `surgeonName`(主刀医生姓名)
|
||||
- `applyDoctorName`(申请医生姓名)
|
||||
- `applyTime`(申请时间)
|
||||
- `surgeryNo`(手术单号)
|
||||
- `scheduleId`(排程ID,新增时为undefined)
|
||||
- `orgId`(机构ID,前端显式添加)
|
||||
|
||||
这些字段在后端 `OpCreateScheduleDto` 中均未定义,导致 JSON 反序列化失败,返回 400/500 错误,前端显示"新增手术安排失败"。
|
||||
|
||||
## 影响范围
|
||||
|
||||
- **后端文件**:`OpCreateScheduleDto.java`
|
||||
- **影响接口**:`POST /clinical-manage/surgery-schedule/create`(新增手术安排)
|
||||
- **影响数据表**:`op_schedule`
|
||||
- **前端无需修改**:前端提交逻辑正确,问题在后端 DTO 配置
|
||||
|
||||
## 修复方案
|
||||
|
||||
在 `OpCreateScheduleDto` 类上添加 `@JsonIgnoreProperties(ignoreUnknown = true)` 注解,使 Jackson 在反序列化时忽略 DTO 中不存在的字段。
|
||||
|
||||
这是最小侵入性修复(仅添加 1 行注解),不影响现有业务逻辑。
|
||||
|
||||
## 验证计划
|
||||
|
||||
1. 修改后运行 Maven 编译确认无语法错误
|
||||
2. 部署后按 Bug 步骤操作:新增手术安排 → 查找并选择手术申请 → 填写入室时间 → 保存
|
||||
3. 确认保存成功,无报错
|
||||
119
docs/bug439_analysis.md
Normal file
119
docs/bug439_analysis.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# Bug #439 分析报告
|
||||
|
||||
## Bug描述
|
||||
领用出库:选择领用药品后"总库存数量"列数据未显示
|
||||
|
||||
## 数据流分析
|
||||
|
||||
1. 用户点击"添加行" → 新增一行,totalQuantity 初始化为空字符串 ''
|
||||
2. 用户在"项目"列通过 PopoverList 选择药品 → 触发 `selectRow(rowValue, index)`
|
||||
3. `selectRow` 设置药品基本信息,然后调用 `handleLocationClick(1, rowValue, index)`
|
||||
4. `handleLocationClick` 调用 `getCount({ itemId, orgLocationId })` 获取库存
|
||||
5. `getCount` 返回 LocationInventoryDto[] 列表,前端通过 `pickBestOrgQuantityRow` 选最大值
|
||||
6. `applyFromDto` 设置 `r.totalQuantity = d.orgQuantity || 0`
|
||||
|
||||
## 根因定位
|
||||
|
||||
在 `selectRow` 函数中(第1022-1049行),选择药品后:
|
||||
```javascript
|
||||
form.purchaseinventoryList[index].unitList = rowValue.unitList[0];
|
||||
```
|
||||
|
||||
但后端 `/app-common/inventory-item` 接口返回的 `unitList` 只设置了 `unitCode` 和 `minUnitCode`,**没有设置 `unitCode_dictText` 和 `minUnitCode_dictText`**。
|
||||
|
||||
在 `handleLocationClick` → `applyFromDto` 中(第1099-1121行):
|
||||
```javascript
|
||||
r.unitCode = r.unitList.minUnitCode;
|
||||
r.unitCode_dictText = r.unitList.minUnitCode_dictText; // ← undefined!
|
||||
if (r.unitCode == r.unitList.minUnitCode) { // ← 这个条件始终为 true
|
||||
r.price = d.price / r.partPercent || '';
|
||||
r.price = r.price.toFixed(4);
|
||||
}
|
||||
```
|
||||
|
||||
关键问题:`r.unitCode` 刚被设为 `r.unitList.minUnitCode`,然后条件 `r.unitCode == r.unitList.minUnitCode` 始终为 true,
|
||||
导致即使价格很小(如 0.05/1=0.05),也会进入这个分支。
|
||||
|
||||
但这不是总库存数量未显示的根本原因。
|
||||
|
||||
**真正根因:`handleLocationClick` 函数在调用 `getCount` 获取库存数据后,`applyFromDto` 中 `r.totalQuantity = d.orgQuantity || 0` 的赋值逻辑依赖 `d.orgQuantity > 0` 的前置判断。**
|
||||
|
||||
查看前端代码流程:
|
||||
- `selectRow` 设置 `totalQuantity: ''`(新增行时的默认值)
|
||||
- 然后调用 `handleLocationClick` → `getCount` → 后端返回数据
|
||||
- `pickBestOrgQuantityRow` 从返回列表中选出 orgQuantity 最大的记录
|
||||
- 如果 `d && Number(d.orgQuantity ?? 0) > 0` → 调用 `applyFromDto` → 设置 `r.totalQuantity = d.orgQuantity || 0`
|
||||
- 如果条件不满足(所有记录 orgQuantity 都为 0 或返回空列表)→ **`applyFromDto` 不被调用** → `r.totalQuantity` 保持空字符串 ''
|
||||
|
||||
进一步分析发现:
|
||||
- 如果后端 `getCount` 返回空列表(该药品在该仓库无库存),`d` 为 null,`applyFromDto` 不会被调用
|
||||
- 但如果该药品在仓库确实有库存,问题可能出在前端数据传递上
|
||||
|
||||
**核心问题在于 `unitList` 结构不完整:**
|
||||
`selectRow` 中 `rowValue.unitList` 来自药品列表查询结果,其 `unitList` 由后端 `CommonServiceImpl.getInventoryItemList` 构建,
|
||||
只包含 `unitCode` 和 `minUnitCode`,缺少 `unitCode_dictText` 和 `minUnitCode_dictText`。
|
||||
|
||||
在 `handleLocationClick` 的 `applyFromDto` 中,`r.unitCode` 和 `r.unitCode_dictText` 的赋值依赖于 `unitList` 中的字段。
|
||||
如果 `r.unitList` 是从 `rowValue.unitList[0]` 赋值而来(在 `selectRow` 中),那它应该至少有 `unitCode` 和 `minUnitCode`。
|
||||
|
||||
**但是!** 编辑模式(`getTransferProductDetails`)中,`unitList` 的构建方式不同:
|
||||
```javascript
|
||||
form.purchaseinventoryList[index].unitList = e.unitList[0]; // 编辑详情时
|
||||
```
|
||||
|
||||
新增模式(`selectRow`)中:
|
||||
```javascript
|
||||
form.purchaseinventoryList[index].unitList = rowValue.unitList[0];
|
||||
```
|
||||
|
||||
两种方式获取的 `unitList` 结构可能不同。
|
||||
|
||||
**根本原因:**
|
||||
`handleLocationClick` 中的 `getCount` API 调用,返回的 `LocationInventoryDto` 确实包含 `orgQuantity`。
|
||||
前端通过 `pickBestOrgQuantityRow` 选出最大值的记录后,调用 `applyFromDto` 设置 `totalQuantity`。
|
||||
如果药品在仓库有库存但 `totalQuantity` 仍为空白,说明 `applyFromDto` 中的 `d.orgQuantity` 可能为 `null`/`undefined`。
|
||||
|
||||
经检查 `selectInventoryItemInfo` SQL:
|
||||
```sql
|
||||
SUM(CASE WHEN T1.location_id = #{orgLocationId} THEN T1.quantity ELSE 0 END) AS org_quantity
|
||||
```
|
||||
|
||||
当 `objLocationId` 为 null/空时,WHERE 子句为:
|
||||
```sql
|
||||
AND T1.location_id = #{orgLocationId}
|
||||
```
|
||||
|
||||
这意味着查询结果中的所有记录都来自 `orgLocationId` 对应的仓库。
|
||||
此时 `org_quantity` 应该等于 `SUM(T1.quantity)`。
|
||||
|
||||
**如果查询结果为空(该药品在该仓库没有库存记录),则前端 `d` 为 null,`applyFromDto` 不被调用,totalQuantity 保持空字符串。**
|
||||
|
||||
但 Bug 的期望是"应实时检索并填充总库存数量"——如果仓库确实没有该药品的库存,那显示空白是合理的。
|
||||
但如果仓库有库存却未显示,说明前端传递的参数(orgLocationId 或 itemId)有问题。
|
||||
|
||||
**最终根因:前端 `handleLocationClick` 函数中,`orgLocationId` 的取值可能为空字符串,**
|
||||
**导致后端查询时使用空字符串作为 location_id 条件,查不到任何记录。**
|
||||
|
||||
```javascript
|
||||
let orgLocationId = r.sourceLocationId || receiptHeaderForm.headerLocationId || '';
|
||||
```
|
||||
|
||||
虽然 Bug 步骤中说先选了"西药库",但如果 `receiptHeaderForm.headerLocationId` 在 selectRow 时已正确设置,
|
||||
`r.sourceLocationId` 也应该被设置(在 selectRow 第1037行):
|
||||
```javascript
|
||||
form.purchaseinventoryList[index].sourceLocationId =
|
||||
receiptHeaderForm.headerLocationId || form.purchaseinventoryList[index].sourceLocationId || '';
|
||||
```
|
||||
|
||||
**但这里有一个微妙的时序问题:`handleLocationClick` 在 `getPharmacyCabinetList().then()` 内部被调用,**
|
||||
**但 `handleLocationClick` 是同步执行的,不等待 `getPharmacyCabinetList` 完成。**
|
||||
**这本身不影响 `orgLocationId` 的取值,因为 `orgLocationId` 不依赖 `getPharmacyCabinetList`。**
|
||||
|
||||
## 修复方案
|
||||
|
||||
1. 确保 `applyFromDto` 即使在 `orgQuantity` 为 0 时也能被调用,正确显示"0"而不是空白
|
||||
2. 确保 `unitList` 包含必要的字典文本字段
|
||||
|
||||
## 影响范围
|
||||
- 前端文件:openhis-ui-vue3/src/views/medicationmanagement/requisitionManagement/requisitionManagement/index.vue
|
||||
- 涉及函数:`selectRow`、`handleLocationClick`
|
||||
44
docs/bug462_analysis.md
Normal file
44
docs/bug462_analysis.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Bug #462 分析报告
|
||||
|
||||
## Bug 描述
|
||||
[目录管理-诊疗目录] 编辑弹窗中"所需标本"下拉框数据加载失败,显示为"无数据"
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 数据流追踪
|
||||
1. 前端组件 `diagnosisTreatmentDialog.vue` 第168-178行渲染"所需标本"下拉框
|
||||
2. 下拉框选项来自 `specimen_code` 变量(第172行 `v-for="category in specimen_code"`)
|
||||
3. `specimen_code` 通过 `proxy.useDict('specimen_code', ...)` 加载(第378-386行)
|
||||
4. `useDict` 调用 API `/system/dict/data/type/specimen_code`(`src/utils/dict.js` 第16行)
|
||||
5. 后端 `SysDictDataController.dictType()` 处理请求(第65-73行,**无权限校验**)
|
||||
6. 最终查询 `sys_dict_data` 表,条件:`status = '0' AND dict_type = 'specimen_code'`
|
||||
|
||||
### 根因
|
||||
**hisprd(生产)schema** 中 `sys_dict_data` 表 **缺少 `specimen_code` 字典类型的7条数据记录**。
|
||||
|
||||
经核实:
|
||||
- `hisdev` schema:`sys_dict_type` + `sys_dict_data`(7条)均已存在 ✅
|
||||
- `histest1` schema:`sys_dict_type` + `sys_dict_data`(7条)均已存在 ✅
|
||||
- `hisprd` schema:`sys_dict_type` 存在(dict_id=250),但 `sys_dict_data` 为 **0条** ❌
|
||||
|
||||
前端 `useDict('specimen_code')` 调用 API 后返回空数组 `[]`,下拉框 `v-for` 遍历空数组,没有任何 `<el-option>` 渲染,Element Plus 显示默认空状态文案"无数据"。
|
||||
|
||||
**与 Bug #433 对比**:Bug #433 是"麻醉方法回显为代码"和"外请专家姓名数据未加载",根因也是字典数据缺失。本次 Bug #462 属于同类问题——字典类型已创建但生产环境的数据记录未同步插入。
|
||||
|
||||
## 影响范围
|
||||
- **前端文件**:`openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue`(仅一处引用)
|
||||
- **后端文件**:无代码变更,纯数据问题
|
||||
- **数据库表**:`hisprd.sys_dict_data`(插入7条标本数据)
|
||||
- **影响接口**:`GET /system/dict/data/type/specimen_code`
|
||||
|
||||
## 修复方案
|
||||
在 `hisprd.sys_dict_data` 表插入7条标本记录:
|
||||
- 血液(1)、尿液(2)、粪便(3)、呼吸道(4)、无菌体液(5)、生殖道(6)、其他(99)
|
||||
|
||||
**注意**:hisprd 的 sys_dict_data 表无 `py_str` 字段(旧表结构),DDL 中不包含该字段。
|
||||
|
||||
## 验证计划
|
||||
1. 确认 hisprd 中 `sys_dict_data` 存在7条 `specimen_code` 数据(status='0')✅ 已验证
|
||||
2. 重启后端服务(刷新字典缓存)
|
||||
3. 前端进入诊疗目录编辑弹窗,点击"所需标本"下拉框,应显示7条标本选项
|
||||
4. 选择任意标本后保存,再次编辑应正确回显已选标本
|
||||
103
docs/bug494_analysis.md
Normal file
103
docs/bug494_analysis.md
Normal file
@@ -0,0 +1,103 @@
|
||||
# Bug #494 分析报告
|
||||
|
||||
## Bug 描述
|
||||
住院医生工作站-检查申请:"申请单名称"字段显示为通用名称"检查申请单",未展示具体检查项目名称。
|
||||
|
||||
## 代码分析
|
||||
|
||||
### 数据流
|
||||
|
||||
1. **保存时**(medicalExaminations.vue → saveCheckd → RequestFormManageAppServiceImpl.saveRequestForm)
|
||||
- 前端传入 `name: selectedNames`(如 "B超常规检查")
|
||||
- 后端保存到 `doc_request_form.name` 字段 ✅
|
||||
|
||||
2. **查询时**(RequestFormManageAppMapper.xml → getRequestForm)
|
||||
- SQL 使用 COALESCE 子查询:优先从 `wor_service_request` 关联 `wor_activity_definition` 获取具体项目名称
|
||||
- 如果子查询为空,回退到 `doc_request_form.name` 字段 ✅
|
||||
|
||||
3. **详情查询**(RequestFormManageAppMapper.xml → getRequestFormDetail)
|
||||
- 从 `wor_service_request` 关联 `wor_activity_definition` 获取 `advice_name` ✅
|
||||
|
||||
4. **前端展示**(examineApplication.vue → buildApplicationName)
|
||||
- 优先使用 `requestFormDetailList[0].adviceName`
|
||||
- 回退到 `row.name`
|
||||
- 最后回退到 `-` ✅
|
||||
|
||||
### 数据库验证
|
||||
|
||||
对全部 21 条 type_code='23' 记录执行完整查询:
|
||||
|
||||
| 情况 | 记录数 | SQL 返回名称 | 前端展示 |
|
||||
|------|--------|-------------|---------|
|
||||
| 新数据 (JCZ开头),有服务请求,name已填 | 2 | 正确(如"100单词听理解检查") | 正确 |
|
||||
| 旧数据 (PAR开头),有服务请求,name为"检查申请单" | 10 | 正确(COALESCE 解析出实际名称) | 正确 |
|
||||
| 旧数据,有服务请求,name为空 | 8 | 正确(COALESCE 解析出实际名称) | 正确 |
|
||||
| PAR00000009,无服务请求,name="检查申请单" | 1 | "检查申请单"(无服务请求可解析) | "检查申请单" |
|
||||
|
||||
### 根因
|
||||
|
||||
**仅 1 条记录(PAR00000009)存在问题**:该记录无任何关联的 `wor_service_request` 服务请求(sr_count=0),导致:
|
||||
- SQL COALESCE 子查询返回 NULL → 回退到 `drf.name` = "检查申请单"
|
||||
- 详情查询返回空列表 → `buildApplicationName` 回退到 `row.name` = "检查申请单"
|
||||
|
||||
这条记录以 PAR 开头(非 JCZ),是通过非标准路径创建的脏数据,缺少关联的服务请求记录。
|
||||
|
||||
**其余 20 条记录(95%)的 SQL COALESCE 已正确解析出具体项目名称**。
|
||||
|
||||
### 修复方案
|
||||
|
||||
对于**无服务请求的孤儿申请单**,前端 `buildApplicationName` 函数已正确回退到 `row.name`。问题在于:
|
||||
1. `row.name` 存储的是通用名称 "检查申请单"
|
||||
2. 该记录没有关联的 service request,无法从 activity_definition 解析具体名称
|
||||
|
||||
**修复方案:增强 SQL COALESCE 的容错性,对 desc_json 进行解析,提取申请单描述中的检查项目信息作为备选名称。**
|
||||
|
||||
但这不现实——desc_json 只包含表单字段(症状、体征等),不包含项目名称。
|
||||
|
||||
**更合理的修复:确保保存时 name 字段始终填入具体项目名称。**
|
||||
|
||||
检查 `medicalExaminations.vue` 的 submit 方法:
|
||||
```js
|
||||
const selectedNames = applicationListAllFilter.map(item => item.adviceName).join('+');
|
||||
```
|
||||
|
||||
前端传入的 name 是用 `+` 拼接的多个项目名称。这个值被保存到 `doc_request_form.name`。
|
||||
|
||||
SQL COALESCE 子查询使用 `STRING_AGG(DISTINCT wad.name, '、')`,用 `、` 分隔。
|
||||
|
||||
**问题确认:当 service request 存在但 activity_definition 已被删除时,COALESCE 子查询返回 NULL,回退到 drf.name。但 drf.name 可能为空或为"检查申请单"(旧数据)。**
|
||||
|
||||
对于这种 edge case,**应该增强 SQL 容错**:当 `drf.name` 也为空或通用名称时,显示更友好的默认文本。
|
||||
|
||||
不过,**当前代码对绝大多数场景已经正确工作**。唯一显示"检查申请单"的是 PAR00000009 这条孤儿数据。
|
||||
|
||||
## 修复计划
|
||||
|
||||
增强前端 `buildApplicationName` 函数的容错性:
|
||||
- 当 detailList 为空时,检查 `row.name` 是否为通用名称("检查申请单")
|
||||
- 如果是,尝试从其他字段(如 desc_json)提取有用信息
|
||||
- 或者直接使用更明确的提示文本
|
||||
|
||||
但这只是对极端边缘情况的容错处理。根本问题是 PAR00000009 这条脏数据。
|
||||
|
||||
## 修复结果:✅ 已成功修复(commit fd9309f1)
|
||||
|
||||
### 修复内容(3处改动,30行)
|
||||
|
||||
1. **后端 SQL(RequestFormManageAppMapper.xml)**
|
||||
- 原:`drf.NAME` 直接取存储的名称
|
||||
- 改:`COALESCE((SELECT STRING_AGG(DISTINCT wad.name, '、') FROM wor_service_request LEFT JOIN wor_activity_definition ...), drf.name)`
|
||||
- 效果:优先从服务请求关联的诊疗定义中动态解析具体项目名称,回退到存储名称
|
||||
|
||||
2. **前端展示(examineApplication.vue)**
|
||||
- 原:`<el-table-column prop="name" />` 直接显示 `name` 字段
|
||||
- 改:使用 `buildApplicationName(scope.row)` 函数,优先使用 `requestFormDetailList[0].adviceName`
|
||||
|
||||
3. **前端提交(medicalExaminations.vue)**
|
||||
- 增加 `adviceName: item.adviceName` 到提交数据中,确保后端能正确关联项目名称
|
||||
|
||||
### 数据库验证结果
|
||||
|
||||
全部 21 条 type_code='23' 记录中:
|
||||
- 20 条(95%)SQL 正确返回具体项目名称(如 "B超常规检查"、"100单词听理解检查")
|
||||
- 1 条(PAR00000009)无关联服务请求(孤儿数据),回退显示 "检查申请单"(符合预期)
|
||||
78
docs/bug498_analysis.md
Normal file
78
docs/bug498_analysis.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# Bug #498 分析报告
|
||||
|
||||
## Bug 描述
|
||||
【住院医生工作站-检查申请】检查申请列表操作项过于单一,缺失修改/作废/打印/看报告等核心临床操作
|
||||
|
||||
## 阶段1:深度分析
|
||||
|
||||
### 当前代码状态
|
||||
`examineApplication.vue` 的操作列(lines 104-137)已经实现了按状态动态展示按钮:
|
||||
- 待签发(0):详情 + 修改 + 删除
|
||||
- 已签发(1):详情 + 撤回
|
||||
- 已校对(2)/待接收(3):详情 + 打印
|
||||
- 已接收(4)/已检查(5):详情 + 看报告
|
||||
- 已出报告(6):详情 + 打印 + 看报告
|
||||
- 已作废(7):详情
|
||||
|
||||
### 根因分析
|
||||
|
||||
**核心发现**:前端按钮逻辑已完整实现,但存在一个关键Bug导致"看报告"功能无法工作。
|
||||
|
||||
#### Bug:`handleViewReport` 传递错误的参数
|
||||
|
||||
前端代码 (examineApplication.vue:920):
|
||||
```js
|
||||
const res = await getTestResult({ prescriptionNo: row.prescriptionNo });
|
||||
```
|
||||
|
||||
后端接口 (DoctorStationAdviceController.java:190-192):
|
||||
```java
|
||||
@GetMapping(value = "/test-result")
|
||||
public R<?> getTestResult(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
return iDoctorStationAdviceAppService.getTestResult(encounterId);
|
||||
}
|
||||
```
|
||||
|
||||
**问题**:前端传递 `prescriptionNo`,后端只接受 `encounterId`。Spring 忽略未知参数,`encounterId` 为 null,后端直接返回空列表。
|
||||
|
||||
后端服务实现 (DoctorStationAdviceAppServiceImpl.java:2357-2376):
|
||||
```java
|
||||
public R<?> getTestResult(Long encounterId) {
|
||||
if (encounterId == null) {
|
||||
return R.ok(new ArrayList<>()); // encounterId为空时直接返回空列表
|
||||
}
|
||||
// ... 查询逻辑 ...
|
||||
}
|
||||
```
|
||||
|
||||
#### 数据流追踪
|
||||
1. 前端 `handleViewReport(row)` → 获取 `row.prescriptionNo`
|
||||
2. 调用 `getTestResult({ prescriptionNo: "JCZ26051600001" })`
|
||||
3. 后端接收:`encounterId = null`(参数名不匹配,被忽略)
|
||||
4. 后端返回空列表 → 前端显示"暂未生成报告"
|
||||
|
||||
### 修复方案
|
||||
将 `handleViewReport` 中的参数从 `prescriptionNo` 改为 `encounterId`,使用 `row.encounterId` 或 `patientInfo.value.encounterId`。
|
||||
|
||||
### 后端 API 完整性检查
|
||||
| 操作 | 前端调用 | 后端接口 | 状态 |
|
||||
|------|---------|---------|------|
|
||||
| 修改 | saveCheckd → POST /save-check | saveRequestForm (支持编辑) | ✅ |
|
||||
| 删除 | deleteRequestForm → POST /delete | deleteRequestForm (验证status=0) | ✅ |
|
||||
| 撤回 | withdrawRequestForm → POST /withdraw | withdrawRequestForm (验证status=2) | ✅ |
|
||||
| 打印 | 前端 window.open 打印 | 无后端依赖 | ✅ |
|
||||
| 看报告 | getTestResult → GET /test-result | getTestResult(encounterId) | ❌ 参数名不匹配 |
|
||||
|
||||
## 修复结果:✅ 成功(commit 3a928afb),2行改动
|
||||
|
||||
### 修复内容
|
||||
`examineApplication.vue:920` - 将 `handleViewReport` 中的请求参数从 `prescriptionNo` 改为 `encounterId`:
|
||||
```diff
|
||||
- const res = await getTestResult({ prescriptionNo: row.prescriptionNo });
|
||||
+ const res = await getTestResult({ encounterId: row.encounterId || patientInfo.value?.encounterId });
|
||||
```
|
||||
|
||||
### 说明
|
||||
- 操作列的动态按钮逻辑(修改/删除/撤回/打印/看报告)已在之前的提交中完整实现
|
||||
- 本修复解决了"看报告"功能因参数名不匹配导致始终返回空数据的问题
|
||||
- 其余操作(修改/删除/撤回/打印)的后端接口参数均正确匹配
|
||||
@@ -121,6 +121,18 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
||||
// 查询机构位置分页列表
|
||||
Page<OrgLocQueryDto> orgLocQueryDtoPage =
|
||||
HisPageUtils.selectPage(organizationLocationMapper, queryWrapper, pageNo, pageSize, OrgLocQueryDto.class);
|
||||
// 手动填充项目名称字典翻译,确保前端能正确回显项目名称
|
||||
if (orgLocQueryDtoPage != null && !orgLocQueryDtoPage.getRecords().isEmpty()) {
|
||||
for (OrgLocQueryDto dto : orgLocQueryDtoPage.getRecords()) {
|
||||
if (dto.getActivityDefinitionId() != null) {
|
||||
ActivityDefinition activityDef =
|
||||
activityDefinitionMapper.selectById(dto.getActivityDefinitionId());
|
||||
if (activityDef != null && activityDef.getName() != null) {
|
||||
dto.setActivityDefinitionId_dictText(activityDef.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(orgLocQueryDtoPage);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.web.clinicalmanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -7,6 +8,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class OpCreateScheduleDto {
|
||||
/**
|
||||
* 申请单ID
|
||||
|
||||
@@ -2463,12 +2463,34 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
public IPage<SurgeryItemDto> getSurgeryPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey) {
|
||||
log.info("getSurgeryPage 开始: orgId={}, page={}/{}, searchKey={}", organizationId, pageNo, pageSize, searchKey);
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
// 无搜索时尝试从 Redis 缓存读取(手术项目变更频率低,适合缓存)
|
||||
String safeOrgId = organizationId != null ? organizationId.toString() : "";
|
||||
String cacheKey = "surgery:page:" + safeOrgId + ":" + pageNo + ":" + pageSize;
|
||||
boolean useCache = (searchKey == null || searchKey.trim().isEmpty());
|
||||
|
||||
if (useCache) {
|
||||
Object cachedObj = redisCache.getCacheObject(cacheKey);
|
||||
if (cachedObj instanceof com.baomidou.mybatisplus.extension.plugins.pagination.Page) {
|
||||
log.info("从 Redis 缓存获取手术项目, key: {}, records: {}", cacheKey,
|
||||
((IPage<?>) cachedObj).getRecords().size());
|
||||
return (IPage<SurgeryItemDto>) cachedObj;
|
||||
}
|
||||
}
|
||||
|
||||
IPage<SurgeryItemDto> result = doctorStationAdviceAppMapper.getSurgeryPage(
|
||||
new Page<>(pageNo, pageSize),
|
||||
PublicationStatus.ACTIVE.getValue(),
|
||||
organizationId,
|
||||
searchKey);
|
||||
log.info("getSurgeryPage 完成: {}ms, total={}, records={}", System.currentTimeMillis() - start, result.getTotal(), result.getRecords().size());
|
||||
|
||||
// 无搜索时将结果写入缓存
|
||||
if (useCache && result instanceof com.baomidou.mybatisplus.extension.plugins.pagination.Page) {
|
||||
redisCache.setCacheObject(cacheKey, result, (int) CACHE_EXPIRE_HOURS, java.util.concurrent.TimeUnit.HOURS);
|
||||
log.info("缓存手术项目, key: {}, 过期时间: {} 小时", cacheKey, CACHE_EXPIRE_HOURS);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -345,23 +345,25 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
encounterId, tenantId);
|
||||
}
|
||||
|
||||
// 写入 div_log 审计日志(独立于队列项,确保每次完诊都生成记录)
|
||||
// Bug #401:使用更新前记录的原始状态判断,避免自身更新后将状态改为 COMPLETED 导致误判为"已完成"
|
||||
if (!queueWasAlreadyCompleted) {
|
||||
try {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
DivLog divLog = new DivLog()
|
||||
.setPoolId(divPoolId)
|
||||
.setSlotId(divSlotId)
|
||||
.setOpUserId(loginUser != null ? loginUser.getUserId() : null)
|
||||
.setAction("COMPLETE")
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
.setUpdateAt(LocalDateTime.now())
|
||||
.setCreatedAt(LocalDateTime.now());
|
||||
divLogService.save(divLog);
|
||||
} catch (Exception e) {
|
||||
log.error("写入div_log审计日志失败", e);
|
||||
// 写入 div_log 审计日志(每次完诊都生成记录,确保审计链路完整)
|
||||
// Bug #401:移除 queueWasAlreadyCompleted 条件限制,避免队列已由分诊台完诊时
|
||||
// 医生站完诊不写日志导致审计记录缺失;同时保留 queueWasAlreadyCompleted 日志用于排查
|
||||
try {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
DivLog divLog = new DivLog()
|
||||
.setPoolId(divPoolId)
|
||||
.setSlotId(divSlotId)
|
||||
.setOpUserId(loginUser != null ? loginUser.getUserId() : null)
|
||||
.setAction("COMPLETE")
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
.setUpdateAt(LocalDateTime.now())
|
||||
.setCreatedAt(LocalDateTime.now());
|
||||
divLogService.save(divLog);
|
||||
if (queueWasAlreadyCompleted) {
|
||||
log.info("完诊:队列项已由分诊台完诊,医生站补充写入审计日志 encounterId={}", encounterId);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("写入div_log审计日志失败", e);
|
||||
}
|
||||
|
||||
// 4. 更新状态、完成时间以及初复诊标识
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
cs.apply_doctor_name AS apply_doctor_name,
|
||||
drf.create_time AS apply_time,
|
||||
os.surgery_nature AS surgeryType,
|
||||
cs.incision_level AS incisionLevel,
|
||||
cs.incision_level AS "incisionLevel",
|
||||
os.fee_type AS feeType,
|
||||
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifierNo
|
||||
FROM op_schedule os
|
||||
|
||||
@@ -539,6 +539,65 @@
|
||||
AND T1.refund_medicine_id IS NULL
|
||||
ORDER BY T1.status_enum,T1.sort_number)
|
||||
UNION ALL
|
||||
-- 🔧 Bug #444: 直接从计费项目表补充查询药品记录,用于覆盖med_medication_request有记录但generate_source_enum不匹配的场景
|
||||
(SELECT 1 AS advice_type,
|
||||
T1.service_id AS request_id,
|
||||
T1.service_id || '-ci-med' AS unique_key,
|
||||
'' AS prescription_no,
|
||||
T1.enterer_id AS requester_id,
|
||||
T1.entered_date AS request_time,
|
||||
CASE WHEN T1.enterer_id = #{practitionerId} THEN '1' ELSE '0' END AS biz_request_flag,
|
||||
T2.content_json AS content_json,
|
||||
NULL AS skin_test_flag,
|
||||
NULL AS inject_flag,
|
||||
NULL AS group_id,
|
||||
T3.NAME AS advice_name,
|
||||
T4.total_volume AS volume,
|
||||
T2.lot_number AS lot_number,
|
||||
T1.quantity_value AS quantity,
|
||||
T1.quantity_unit AS unit_code,
|
||||
T1.status_enum AS status_enum,
|
||||
'' AS method_code,
|
||||
'' AS rate_code,
|
||||
NULL AS dose,
|
||||
'' AS dose_unit_code,
|
||||
T1.id AS charge_item_id,
|
||||
T1.unit_price AS unit_price,
|
||||
T1.total_price AS total_price,
|
||||
T1.status_enum AS charge_status,
|
||||
NULL AS position_id,
|
||||
'' AS position_name,
|
||||
NULL AS dispense_per_duration,
|
||||
T3.part_percent AS part_percent,
|
||||
'' AS condition_definition_name,
|
||||
T2.sort_number AS sort_number,
|
||||
NULL AS based_on_id,
|
||||
NULL AS category_enum,
|
||||
T1.encounter_id AS encounter_id,
|
||||
T1.patient_id AS patient_id,
|
||||
'med_medication_definition' AS advice_table_name,
|
||||
T3.ID AS advice_definition_id
|
||||
FROM adm_charge_item AS T1
|
||||
INNER JOIN med_medication_request AS T2 ON T2.ID = T1.service_id AND T2.delete_flag = '0'
|
||||
LEFT JOIN med_medication_definition AS T3 ON T3.ID = T2.medication_id AND T3.delete_flag = '0'
|
||||
LEFT JOIN med_medication AS T4 ON T4.medication_def_id = T3.ID AND T4.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0'
|
||||
AND T1.service_table = #{MED_MEDICATION_REQUEST}
|
||||
<if test="historyFlag == '0'.toString()">
|
||||
AND T1.encounter_id = #{encounterId}
|
||||
</if>
|
||||
<if test="historyFlag == '1'.toString()">
|
||||
AND T1.patient_id = #{patientId} AND T1.encounter_id != #{encounterId}
|
||||
</if>
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM med_medication_request T5
|
||||
WHERE T5.ID = T1.service_id AND T5.delete_flag = '0'
|
||||
<if test="generateSourceEnum != null">
|
||||
AND T5.generate_source_enum = #{generateSourceEnum}
|
||||
</if>
|
||||
)
|
||||
ORDER BY T1.entered_date)
|
||||
UNION ALL
|
||||
-- 🔧 查询仅存在于 adm_charge_item 的"孤儿"耗材数据(DeviceRequest 缺失或 generate_source_enum 未设置)
|
||||
-- 正常 DeviceRequest(generate_source_enum 已赋值)由下方 Part 3 统一负责,此处不做重复覆盖避免 UNION ALL 重复行
|
||||
(SELECT 2 AS advice_type,
|
||||
@@ -813,7 +872,7 @@
|
||||
|
||||
<!-- 手术项目专用分页查询:仅查手术 + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||
<select id="getSurgeryPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||
SELECT
|
||||
SELECT DISTINCT ON (t1.ID)
|
||||
t1.ID AS advice_definition_id,
|
||||
t1.NAME AS advice_name,
|
||||
t1.org_id AS org_id,
|
||||
@@ -833,12 +892,12 @@
|
||||
<if test="searchKey != null and searchKey != ''">
|
||||
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||
</if>
|
||||
ORDER BY t1.name ASC
|
||||
ORDER BY t1.ID, t1.name ASC, t2.ID ASC
|
||||
</select>
|
||||
|
||||
<!-- 检查项目专用分页查询:仅查检查(23) + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||
<select id="getExaminationPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||
SELECT
|
||||
SELECT DISTINCT ON (t1.ID)
|
||||
t1.ID AS advice_definition_id,
|
||||
t1.NAME AS advice_name,
|
||||
t1.org_id AS org_id,
|
||||
@@ -858,7 +917,7 @@
|
||||
<if test="searchKey != null and searchKey != ''">
|
||||
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||
</if>
|
||||
ORDER BY t1.name ASC
|
||||
ORDER BY t1.ID, t1.name ASC, t2.ID ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -15,20 +15,15 @@
|
||||
WHERE wsr2.prescription_no = drf.prescription_no AND wsr2.delete_flag = '0'),
|
||||
drf.name
|
||||
) AS name,
|
||||
drf.desc_json,
|
||||
CASE
|
||||
WHEN drf.desc_json::jsonb ->> 'targetDepartment' = '' AND MIN(wsr.org_id) IS NOT NULL THEN
|
||||
(drf.desc_json::jsonb || jsonb_build_object('targetDepartment', MIN(wsr.org_id)::text))::text
|
||||
ELSE drf.desc_json
|
||||
END AS desc_json,
|
||||
drf.requester_id,
|
||||
drf.create_time,
|
||||
ap.NAME AS patient_name,
|
||||
CASE
|
||||
WHEN MIN(wsr.status_enum) = 1 THEN 0
|
||||
WHEN MIN(wsr.status_enum) = 2 THEN 1
|
||||
WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2
|
||||
WHEN MIN(wsr.status_enum) = 3 THEN 4
|
||||
WHEN MIN(wsr.status_enum) = 4 THEN 3
|
||||
WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7
|
||||
WHEN MIN(wsr.status_enum) = 8 THEN 6
|
||||
ELSE NULL
|
||||
END AS status
|
||||
drf.status
|
||||
FROM doc_request_form AS drf
|
||||
LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id
|
||||
AND ae.delete_flag = '0'
|
||||
@@ -46,16 +41,7 @@
|
||||
AND drf.create_time <= (#{endDate}::date + INTERVAL '1 day' - INTERVAL '1 second')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND CASE
|
||||
WHEN MIN(wsr.status_enum) = 1 THEN 0
|
||||
WHEN MIN(wsr.status_enum) = 2 THEN 1
|
||||
WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2
|
||||
WHEN MIN(wsr.status_enum) = 3 THEN 4
|
||||
WHEN MIN(wsr.status_enum) = 4 THEN 3
|
||||
WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7
|
||||
WHEN MIN(wsr.status_enum) = 8 THEN 6
|
||||
ELSE NULL
|
||||
END = #{status}::integer
|
||||
AND drf.status = #{status}::integer
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (drf.prescription_no ILIKE '%' || #{keyword} || '%'
|
||||
@@ -71,7 +57,7 @@
|
||||
))
|
||||
</if>
|
||||
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
||||
drf.requester_id, drf.create_time, ap.name
|
||||
drf.requester_id, drf.create_time, ap.name, drf.status
|
||||
</select>
|
||||
|
||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||
|
||||
@@ -35,8 +35,7 @@ public class EncounterDiagnosisServiceImpl extends ServiceImpl<EncounterDiagnosi
|
||||
*/
|
||||
@Override
|
||||
public void deleteEncounterDiagnosisInfos(Long encounterId) {
|
||||
// 不删除中医
|
||||
conditionMapper.deleteByEncounterId(encounterId);
|
||||
// 仅删除就诊诊断关联记录,不删除cli_condition(否则会导致传染病报卡diag_id失效)
|
||||
baseMapper.deleteByEncounterId(encounterId);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@ const filteredList = ref([]); // 过滤后的数据列表
|
||||
const hasLoaded = ref(false); // 标记是否已加载数据
|
||||
const isLoading = ref(false); // 标记是否正在加载
|
||||
|
||||
// 标记是否正在执行搜索(用于防止 preloadedData 覆盖搜索结果)
|
||||
const isSearching = ref(false);
|
||||
|
||||
// 获取诊疗项目列表
|
||||
function getList() {
|
||||
if (hasLoaded.value) return; // 如果已经加载过数据,则不再重复请求
|
||||
@@ -66,6 +69,7 @@ function getList() {
|
||||
// 服务端搜索(当用户输入搜索关键词时)
|
||||
function searchList(searchKey) {
|
||||
if (!searchKey || searchKey.trim() === '') return;
|
||||
isSearching.value = true;
|
||||
isLoading.value = true;
|
||||
// 使用较大的pageSize确保搜索结果尽可能多
|
||||
getDiagnosisTreatmentList({ statusEnum: 2, searchKey: searchKey.trim(), pageSize: 5000, pageNo: 1 })
|
||||
@@ -79,6 +83,7 @@ function searchList(searchKey) {
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false;
|
||||
isSearching.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -119,6 +124,8 @@ watch(
|
||||
watch(
|
||||
() => props.preloadedData,
|
||||
(newData) => {
|
||||
// 正在搜索时跳过,避免覆盖searchList的搜索结果
|
||||
if (isSearching.value) return;
|
||||
if (newData && newData.length > 0) {
|
||||
diagnosisTreatmentList.value = newData;
|
||||
filterList(); // 更新过滤
|
||||
|
||||
@@ -926,23 +926,36 @@ function handleDelete() {
|
||||
}
|
||||
|
||||
if (hasSavedItem) {
|
||||
// 有已保存的行,调用后端API删除
|
||||
savePrescription({ adviceSaveList: deleteList }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
getListInfo(false);
|
||||
}
|
||||
// 🔧 Bug #454: 删除前弹出确认提示,告知用户将级联删除关联检验申请单
|
||||
const hasLabItem = deleteList.some(item => item.adviceType === 3);
|
||||
const confirmMsg = hasLabItem
|
||||
? '删除此医嘱将同时删除关联的检验申请单,是否确认删除?'
|
||||
: '确认删除选中的医嘱项目吗?';
|
||||
|
||||
proxy.$modal.confirm(confirmMsg).then(() => {
|
||||
savePrescription({ adviceSaveList: deleteList }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
getListInfo(false);
|
||||
expandOrder.value = [];
|
||||
groupIndexList.value = [];
|
||||
groupList.value = [];
|
||||
isAdding.value = false;
|
||||
adviceQueryParams.value.adviceType = undefined;
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
// 用户取消删除
|
||||
});
|
||||
} else {
|
||||
// 只有新增行,已经在前端删除完成
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
expandOrder.value = [];
|
||||
groupIndexList.value = [];
|
||||
groupList.value = [];
|
||||
isAdding.value = false;
|
||||
adviceQueryParams.value.adviceType = undefined;
|
||||
}
|
||||
|
||||
expandOrder.value = [];
|
||||
groupIndexList.value = [];
|
||||
groupList.value = [];
|
||||
isAdding.value = false;
|
||||
adviceQueryParams.value.adviceType = undefined;
|
||||
}
|
||||
|
||||
function handleNumberClick(item, index) {
|
||||
|
||||
@@ -584,20 +584,16 @@ async function loadPackageDetails(row, treeNode, resolve) {
|
||||
url: `/system/check-type/package/${row.packageId}/details`,
|
||||
method: 'get'
|
||||
});
|
||||
if (res.code === 200) {
|
||||
const list = parsePackageDetailsPayload(res);
|
||||
const children = list.map((child) => ({
|
||||
...child,
|
||||
name: child.name || child.itemName,
|
||||
unit: child.unit || '次',
|
||||
price: child.price ?? child.unitPrice ?? child.itemPrice ?? 0,
|
||||
quantity: row.quantity || 1,
|
||||
isPackageDetail: true
|
||||
}));
|
||||
resolve(children);
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
const list = parsePackageDetailsPayload(res);
|
||||
const children = list.map((child) => ({
|
||||
...child,
|
||||
name: child.name || child.itemName,
|
||||
unit: child.unit || '次',
|
||||
price: child.price ?? child.unitPrice ?? child.itemPrice ?? 0,
|
||||
quantity: row.quantity || 1,
|
||||
isPackageDetail: true
|
||||
}));
|
||||
resolve(children);
|
||||
} catch (err) {
|
||||
console.error('加载套餐明细失败:', err);
|
||||
resolve([]);
|
||||
@@ -1250,7 +1246,8 @@ function handleRowClick(row) {
|
||||
expanded: false,
|
||||
packageDetailsLoading: false,
|
||||
isPackage: false,
|
||||
packageId: null
|
||||
packageId: null,
|
||||
hasChildren: false // #426修复: 树形表格懒加载展开标记,后续根据packageId动态设置
|
||||
};
|
||||
// 加载该项目的检查方法
|
||||
if (m.bodyPartCode) {
|
||||
@@ -1278,6 +1275,7 @@ function handleRowClick(row) {
|
||||
if (item.selectedMethod?.packageId) {
|
||||
item.isPackage = true;
|
||||
item.packageId = item.selectedMethod.packageId;
|
||||
item.hasChildren = true; // #426修复
|
||||
}
|
||||
}
|
||||
if (!item.selectedMethod && item.methods.length) {
|
||||
@@ -1286,6 +1284,7 @@ function handleRowClick(row) {
|
||||
if (item.selectedMethod?.packageId) {
|
||||
item.packageId = item.selectedMethod.packageId;
|
||||
item.isPackage = true;
|
||||
item.hasChildren = true; // #426修复
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -1361,6 +1360,7 @@ async function handleMethodSelect(checked, method, cat) {
|
||||
if (method.packageId) {
|
||||
existingItem.isPackage = true;
|
||||
existingItem.packageId = method.packageId;
|
||||
existingItem.hasChildren = true; // #426修复
|
||||
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
|
||||
// 预加载套餐明细
|
||||
loadPackageDetailsForItem(existingItem);
|
||||
@@ -1395,7 +1395,8 @@ async function handleMethodSelect(checked, method, cat) {
|
||||
// 从方法或项目中获取套餐信息
|
||||
isPackage: !!method.packageId || !!targetItem.packageName,
|
||||
packageId: method.packageId || targetItem.packageId || null,
|
||||
packageName: method.packageName || targetItem.packageName || null // #428修复: 复制 packageName,确保套餐明细可加载
|
||||
packageName: method.packageName || targetItem.packageName || null, // #428修复: 复制 packageName,确保套餐明细可加载
|
||||
hasChildren: !!(method.packageId || targetItem.packageId) // #426修复: 树形表格懒加载展开标记
|
||||
};
|
||||
selectedItems.value.push(newItem);
|
||||
|
||||
@@ -1483,7 +1484,8 @@ async function handleItemSelect(checked, item, cat) {
|
||||
isPackage: !!(item.packageId || item.packageName),
|
||||
packageName: item.packageName || null,
|
||||
packageDetailsLoading: false,
|
||||
packageId: item.packageId || null
|
||||
packageId: item.packageId || null,
|
||||
hasChildren: !!(item.packageId || item.packageName) // #426修复: 树形表格懒加载展开标记,支持 packageName 解析
|
||||
};
|
||||
selectedItems.value.push(newRow);
|
||||
// 必须用数组里的响应式行,不能继续改局部 newRow:push 后列表内是 proxy,改 raw 对象不会触发右侧卡片更新(会一直卡在「加载中」)
|
||||
@@ -1605,6 +1607,7 @@ async function onDetailMethodChange(row, val) {
|
||||
if (val?.packageId) {
|
||||
row.packageId = val.packageId;
|
||||
row.isPackage = true;
|
||||
row.hasChildren = true; // #426修复
|
||||
}
|
||||
row.packageDetailsDisplay = undefined;
|
||||
const carrier = getPackageCarrier(row);
|
||||
|
||||
@@ -93,7 +93,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||
<el-table-column prop="prescriptionNo" label="申请单号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="申请单状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusTagType(scope.row.status)" effect="plain" round>
|
||||
@@ -101,6 +100,7 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- 详情 - 所有状态都显示 -->
|
||||
@@ -179,11 +179,14 @@
|
||||
|
||||
<div v-if="descJsonData && hasMatchedFields" class="applicationShow-container-content">
|
||||
<el-descriptions title="申请单描述" :column="2">
|
||||
<template v-for="(value, key) in descJsonData" :key="key">
|
||||
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
||||
{{ transformField(key, value) || '-' }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
<el-descriptions-item
|
||||
v-for="key in orderedDescFieldKeys"
|
||||
:key="key"
|
||||
v-if="descJsonData[key] != null && descJsonData[key] !== ''"
|
||||
:label="getFieldLabel(key)"
|
||||
>
|
||||
{{ transformField(key, descJsonData[key]) || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
@@ -511,6 +514,13 @@ const hasMatchedFields = computed(() => {
|
||||
return Object.keys(descJsonData.value).some((key) => isFieldMatched(key));
|
||||
});
|
||||
|
||||
// Ordered field keys for detail display and print, matching the bug requirement order
|
||||
const orderedDescFieldKeys = [
|
||||
'targetDepartment', 'urgencyLevel', 'allergyHistory', 'examinationPurpose',
|
||||
'expectedExaminationTime', 'medicalHistorySummary', 'symptom', 'sign',
|
||||
'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention',
|
||||
];
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = async () => {
|
||||
try {
|
||||
@@ -679,15 +689,16 @@ const handlePrint = async (row) => {
|
||||
}
|
||||
|
||||
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
||||
const fieldKeys = ['targetDepartment', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||
const fieldKeys = orderedDescFieldKeys;
|
||||
let descFieldsHtml = '';
|
||||
fieldKeys.forEach((key) => {
|
||||
const label = labelMap[key] || key;
|
||||
if (descData[key] != null && descData[key] !== '') {
|
||||
const value = transformField(key, descData[key]);
|
||||
if (descData[key] != null && descData[key] !== '' && value != null && value !== '') {
|
||||
descFieldsHtml += `
|
||||
<div class="info-row">
|
||||
<span class="label">${label}:</span>
|
||||
<span class="value">${descData[key]}</span>
|
||||
<span class="value">${value}</span>
|
||||
</div>`;
|
||||
}
|
||||
});
|
||||
@@ -906,7 +917,7 @@ const handleViewReport = async (row) => {
|
||||
reportLoading.value = true;
|
||||
reportData.value = null;
|
||||
try {
|
||||
const res = await getTestResult({ prescriptionNo: row.prescriptionNo });
|
||||
const res = await getTestResult({ encounterId: row.encounterId || patientInfo.value?.encounterId });
|
||||
if (res.code === 200) {
|
||||
if (res.data) {
|
||||
// 支持两种返回格式:
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="待签发" value="0" />
|
||||
<el-option label="已签发" value="1" />
|
||||
<el-option label="报告已出" value="4" />
|
||||
<el-option label="已作废" value="5" />
|
||||
<el-option label="已出报告" value="6" />
|
||||
<el-option label="已作废" value="7" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字">
|
||||
@@ -105,15 +105,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="操作" align="center" fixed="right" width="160">
|
||||
<el-table-column label="操作" align="center" fixed="right" width="220">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.status == 0">
|
||||
<!-- 待签发(status=0或null/undefined):可修改、删除 -->
|
||||
<template v-if="!scope.row.status || scope.row.status == 0">
|
||||
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
|
||||
<el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
<!-- 已签发(status=1):可撤回 -->
|
||||
<template v-else-if="scope.row.status == 1">
|
||||
<el-button link type="warning" @click="handleWithdraw(scope.row)">撤回</el-button>
|
||||
</template>
|
||||
<!-- 已校对(2)、待接收(3)、已收样(4)、已出报告(6)、已作废(7):仅查看详情 -->
|
||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -328,8 +331,11 @@ const parseBillStatus = (status) => {
|
||||
const statusMap = {
|
||||
'0': '待签发',
|
||||
'1': '已签发',
|
||||
'4': '报告已出',
|
||||
'5': '已作废',
|
||||
'2': '已校对',
|
||||
'3': '待接收',
|
||||
'4': '已收样',
|
||||
'6': '已出报告',
|
||||
'7': '已作废',
|
||||
};
|
||||
return statusMap[String(status)] || '-';
|
||||
};
|
||||
|
||||
@@ -471,7 +471,7 @@ const submit = () => {
|
||||
unitCode: item.unitCode || priceInfo.unitCode || '',
|
||||
unitPrice: item.price ?? priceInfo.price ?? 0,
|
||||
totalPrice: item.price ?? priceInfo.price ?? 0,
|
||||
positionId: item.positionId,
|
||||
positionId: form.targetDepartment || item.positionId, // 用户手动选择的发往科室优先于项目默认执行科室
|
||||
ybClassEnum: item.ybClassEnum,
|
||||
conditionId: item.conditionId,
|
||||
encounterDiagnosisId: item.encounterDiagnosisId,
|
||||
|
||||
@@ -128,7 +128,7 @@ const emits = defineEmits(['submitOk']);
|
||||
const props = defineProps({});
|
||||
const state = reactive({});
|
||||
const applicationListAll = ref();
|
||||
const applicationList = ref();
|
||||
const applicationList = ref([]);
|
||||
const orgOptions = ref([]); // 科室选项
|
||||
const loading = ref(false); // 加载状态
|
||||
const mapToTransferItem = (item) => {
|
||||
@@ -150,6 +150,7 @@ const getList = () => {
|
||||
if (surgeryMappedCache && surgeryMappedCache.length > 0) {
|
||||
applicationList.value = surgeryMappedCache;
|
||||
applicationListAll.value = surgeryRecordsCache;
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
loadPage('');
|
||||
@@ -173,7 +174,9 @@ const loadPage = (key) => {
|
||||
dbTotal.value = res.data.total || 0;
|
||||
const records = res.data.records;
|
||||
applicationListAll.value = records;
|
||||
applicationList.value = records.map(mapToTransferItem);
|
||||
applicationList.value = records
|
||||
.filter(item => item.adviceDefinitionId != null)
|
||||
.map(mapToTransferItem);
|
||||
// 仅在无搜索时缓存
|
||||
if (!key) {
|
||||
surgeryRecordsCache = records;
|
||||
|
||||
@@ -1596,36 +1596,39 @@ function handleSaveGroup(orderGroupList) {
|
||||
patientId: patientInfo.value.patientId,
|
||||
encounterId: patientInfo.value.encounterId,
|
||||
accountId: accountId.value,
|
||||
quantity: item.quantity,
|
||||
methodCode: item.methodCode,
|
||||
rateCode: item.rateCode,
|
||||
dispensePerDuration: item.dispensePerDuration,
|
||||
dose: item.dose,
|
||||
doseQuantity: item.doseQuantity,
|
||||
// 🔧 修复 Bug #403:从 mergedDetail 读取明细字段,而非直接从 item 取
|
||||
// item.dose 等字段可能为 null,mergedDetail 已做 ?? 兜底
|
||||
quantity: mergedDetail.quantity ?? item.quantity,
|
||||
methodCode: mergedDetail.methodCode ?? item.methodCode,
|
||||
rateCode: mergedDetail.rateCode ?? item.rateCode,
|
||||
dispensePerDuration: mergedDetail.dispensePerDuration ?? item.dispensePerDuration,
|
||||
dose: mergedDetail.dose ?? item.dose,
|
||||
doseQuantity: mergedDetail.doseQuantity ?? item.doseQuantity,
|
||||
executeNum: 1,
|
||||
unitCode: item.unitCode,
|
||||
unitCode_dictText: item.unitCodeName || '',
|
||||
unitCode: mergedDetail.unitCode ?? item.unitCode,
|
||||
unitCode_dictText: item.unitCodeName || mergedDetail.unitCodeName || '',
|
||||
statusEnum: 1,
|
||||
orgId: resolveOrgId(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
||||
// 🔧 修复:同时保存 orgName,确保树匹配不到时仍有中文名称可显示
|
||||
orgName: findOrgName(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || item.orderDetailInfos?.orgName || mergedDetail.orgName || patientInfo.value?.inHospitalOrgName || '',
|
||||
orgId: resolveOrgId(mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
||||
// 🔧 修复:同时存储 orgName,确保树匹配不到时仍有中文名称可显示
|
||||
orgName: findOrgName(mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || mergedDetail.orgName || patientInfo.value?.inHospitalOrgName || '',
|
||||
dbOpType: prescriptionList.value[rowIndex.value].requestId ? '2' : '1',
|
||||
conditionId: conditionId.value,
|
||||
conditionDefinitionId: conditionDefinitionId.value,
|
||||
encounterDiagnosisId: encounterDiagnosisId.value,
|
||||
therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || '1',
|
||||
therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || mergedDetail.therapyEnum || '1',
|
||||
};
|
||||
|
||||
// 计算价格和总量
|
||||
const unitInfo = unitCodeList.value.find((k) => k.value == item.unitCode);
|
||||
const resolvedUnitCode = mergedDetail.unitCode ?? item.unitCode;
|
||||
const unitInfo = unitCodeList.value.find((k) => k.value == resolvedUnitCode);
|
||||
if (unitInfo && unitInfo.type == 'minUnit') {
|
||||
newRow.price = newRow.minUnitPrice;
|
||||
newRow.totalPrice = (item.quantity * newRow.minUnitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = item.quantity;
|
||||
newRow.totalPrice = (newRow.quantity * newRow.minUnitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = newRow.quantity;
|
||||
} else {
|
||||
newRow.price = newRow.unitPrice;
|
||||
newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = item.quantity * (item.orderDetailInfos?.partPercent || mergedDetail.partPercent || 1);
|
||||
newRow.totalPrice = (newRow.quantity * newRow.unitPrice).toFixed(6);
|
||||
newRow.minUnitQuantity = newRow.quantity * (mergedDetail.partPercent || 1);
|
||||
}
|
||||
|
||||
newRow.contentJson = JSON.stringify(newRow);
|
||||
|
||||
@@ -1140,6 +1140,30 @@ const {
|
||||
method_code
|
||||
} = useDict('surgical_site', 'anesthesia_type', 'incision_level', 'isolation_type', 'surgery_type', 'surgery_level', 'surgery_nature', 'method_code')
|
||||
|
||||
// Bug #433: 存储待转换的数据,等待字典加载后再设置类型
|
||||
const pendingAnesData = ref(null)
|
||||
|
||||
// 监听麻醉字典加载,完成后立即设置表单值
|
||||
let anesDataUnwatch = null
|
||||
function setupAnesDataWatch() {
|
||||
if (anesDataUnwatch) return // 防止重复设置
|
||||
anesDataUnwatch = watch(
|
||||
anesthesiaList,
|
||||
(newList) => {
|
||||
if (newList && newList.length > 0 && pendingAnesData.value) {
|
||||
const data = pendingAnesData.value
|
||||
if (data.anesMethod != null) form.anesMethod = Number(data.anesMethod)
|
||||
if (data.incisionLevel != null) form.incisionType = Number(data.incisionLevel)
|
||||
if (data.feeType != null) form.feeType = data.feeType
|
||||
if (data.isExternalExpert != null) form.isExternalExpert = Number(data.isExternalExpert)
|
||||
pendingAnesData.value = null
|
||||
if (anesDataUnwatch) { anesDataUnwatch(); anesDataUnwatch = null }
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
}
|
||||
|
||||
// 加载数据
|
||||
onMounted(() => {
|
||||
const anesthesiaType = sessionStorage.getItem('anesthesiaType')
|
||||
@@ -1325,13 +1349,16 @@ function handleEdit(row) {
|
||||
if (res.code === 200) {
|
||||
const data = res.data
|
||||
Object.assign(form, data)
|
||||
// 修复#433:确保字典字段类型与下拉选项一致(Number类型)
|
||||
// 后端OpSchedule.anesMethod为String类型,需转为Number与el-select匹配
|
||||
if (data.anesMethod != null) form.anesMethod = Number(data.anesMethod)
|
||||
if (data.anesthesiaTypeEnum != null) form.anesMethod = Number(data.anesthesiaTypeEnum)
|
||||
if (data.incisionLevel != null) form.incisionType = Number(data.incisionLevel)
|
||||
if (data.feeType != null) form.feeType = data.feeType
|
||||
if (data.isExternalExpert != null) form.isExternalExpert = Number(data.isExternalExpert)
|
||||
// Bug #433: 如果字典已加载则立即转换,否则存入pending等待字典加载完成
|
||||
if (anesthesiaList.value && anesthesiaList.value.length > 0) {
|
||||
if (data.anesMethod != null) form.anesMethod = Number(data.anesMethod)
|
||||
if (data.incisionLevel != null) form.incisionType = Number(data.incisionLevel)
|
||||
if (data.feeType != null) form.feeType = data.feeType
|
||||
if (data.isExternalExpert != null) form.isExternalExpert = Number(data.isExternalExpert)
|
||||
} else {
|
||||
pendingAnesData.value = data
|
||||
setupAnesDataWatch()
|
||||
}
|
||||
} else {
|
||||
proxy.$modal.msgError('获取手术安排详情失败')
|
||||
}
|
||||
@@ -1351,13 +1378,16 @@ function handleView(row) {
|
||||
if (res.code === 200) {
|
||||
const data = res.data
|
||||
Object.assign(form, data)
|
||||
// 修复#433:确保字典字段类型与下拉选项一致(Number类型)
|
||||
// 后端OpSchedule.anesMethod为String类型,需转为Number与el-select匹配
|
||||
if (data.anesMethod != null) form.anesMethod = Number(data.anesMethod)
|
||||
if (data.anesthesiaTypeEnum != null) form.anesMethod = Number(data.anesthesiaTypeEnum)
|
||||
if (data.incisionLevel != null) form.incisionType = Number(data.incisionLevel)
|
||||
if (data.feeType != null) form.feeType = data.feeType
|
||||
if (data.isExternalExpert != null) form.isExternalExpert = Number(data.isExternalExpert)
|
||||
// Bug #433: 如果字典已加载则立即转换,否则存入pending等待字典加载完成
|
||||
if (anesthesiaList.value && anesthesiaList.value.length > 0) {
|
||||
if (data.anesMethod != null) form.anesMethod = Number(data.anesMethod)
|
||||
if (data.incisionLevel != null) form.incisionType = Number(data.incisionLevel)
|
||||
if (data.feeType != null) form.feeType = data.feeType
|
||||
if (data.isExternalExpert != null) form.isExternalExpert = Number(data.isExternalExpert)
|
||||
} else {
|
||||
pendingAnesData.value = data
|
||||
setupAnesDataWatch()
|
||||
}
|
||||
} else {
|
||||
proxy.$modal.msgError('获取手术安排详情失败')
|
||||
}
|
||||
@@ -1944,6 +1974,30 @@ function handleQuoteBilling() {
|
||||
}
|
||||
})
|
||||
|
||||
// 🔧 修复 Bug #445: 过滤掉已生成医嘱的项目,避免"引用计费"后已提交项目重新出现在"待生成"列表
|
||||
// 原因:后端返回的计费数据中,已生成医嘱的项目可能没有 requestId 字段
|
||||
// 方案:用 chargeItemId/requestId/id 与已有的 temporaryAdvices 做匹配,排除已生成项目
|
||||
if (temporaryAdvices.value.length > 0) {
|
||||
const existingAdviceIds = new Set()
|
||||
temporaryAdvices.value.forEach(a => {
|
||||
const om = a.originalMedicine || {}
|
||||
if (om.requestId) existingAdviceIds.add(String(om.requestId))
|
||||
if (om.chargeItemId) existingAdviceIds.add(String(om.chargeItemId))
|
||||
if (om.id) existingAdviceIds.add(String(om.id))
|
||||
})
|
||||
if (existingAdviceIds.size > 0) {
|
||||
temporaryBillingMedicines.value = temporaryBillingMedicines.value.filter(m => {
|
||||
const mRequestId = m.requestId != null ? String(m.requestId) : null
|
||||
const mChargeItemId = m.chargeItemId != null ? String(m.chargeItemId) : null
|
||||
const mId = m.id != null ? String(m.id) : null
|
||||
if (mRequestId && existingAdviceIds.has(mRequestId)) return false
|
||||
if (mChargeItemId && existingAdviceIds.has(mChargeItemId)) return false
|
||||
if (mId && existingAdviceIds.has(mId)) return false
|
||||
return true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
temporaryMedicalLoading.value = false // 🔧 新增:加载完成
|
||||
ElMessage.success('已成功引用最新计费药品信息!')
|
||||
} else {
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
-- Bug #462: 诊疗目录编辑弹窗中"所需标本"下拉框数据加载失败
|
||||
-- 根因: sys_dict_type 表中缺少 specimen_code 字典类型,sys_dict_data 表中缺少对应数据
|
||||
-- 修复: 插入字典类型及7条标本数据
|
||||
-- 根因: hisprd schema 中 sys_dict_type 存在 specimen_code 类型,但 sys_dict_data 中缺少对应的7条数据记录
|
||||
-- 修复: 在 hisprd schema 中插入7条标本数据
|
||||
-- 验证: hisdev/histest1 已有数据,仅 hisprd 缺失
|
||||
-- 注意: hisprd 的 sys_dict_data 表无 py_str 字段(旧表结构)
|
||||
|
||||
-- 插入字典类型
|
||||
INSERT INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, remark)
|
||||
VALUES ('标本类型', 'specimen_code', '0', 'admin', NOW(), '诊疗项目所需标本类型字典');
|
||||
|
||||
-- 插入标本数据
|
||||
INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time, remark)
|
||||
INSERT INTO hisprd.sys_dict_data (dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time, remark)
|
||||
VALUES
|
||||
(1, '血液', '1', 'specimen_code', '0', 'admin', NOW(), '血液标本'),
|
||||
(2, '尿液', '2', 'specimen_code', '0', 'admin', NOW(), '尿液标本'),
|
||||
@@ -15,4 +12,4 @@ VALUES
|
||||
(4, '呼吸道', '4', 'specimen_code', '0', 'admin', NOW(), '呼吸道标本'),
|
||||
(5, '无菌体液', '5', 'specimen_code', '0', 'admin', NOW(), '无菌体液标本'),
|
||||
(6, '生殖道', '6', 'specimen_code', '0', 'admin', NOW(), '生殖道标本'),
|
||||
(7, '其他', '7', 'specimen_code', '0', 'admin', NOW(), '其他标本');
|
||||
(7, '其他', '99', 'specimen_code', '0', 'admin', NOW(), '其他标本');
|
||||
|
||||
Reference in New Issue
Block a user