Compare commits
22 Commits
0197f5509c
...
bugfix/518
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ae958af8e | ||
|
|
19cd4a87d4 | ||
|
|
d89128ec54 | ||
|
|
96a57f1b7e | ||
|
|
48f6b7195b | ||
|
|
7024831904 | ||
|
|
6c274ad2b9 | ||
|
|
57598b3c54 | ||
|
|
7c14c12c55 | ||
|
|
24c90e9cd7 | ||
|
|
52077c613c | ||
|
|
bd471223a4 | ||
|
|
ed644c4a91 | ||
|
|
7799de81de | ||
|
|
5f5d1c548a | ||
|
|
02b9dc8725 | ||
|
|
7af922684a | ||
|
|
be334f8f53 | ||
|
|
395ef2548e | ||
|
|
f3f55f9fd0 | ||
|
|
7f9e01f6b2 | ||
|
|
b7708dec7d |
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行改动**
|
||||
@@ -14,31 +14,31 @@
|
||||
6. 最终查询 `sys_dict_data` 表,条件:`status = '0' AND dict_type = 'specimen_code'`
|
||||
|
||||
### 根因
|
||||
`sys_dict_type` 表中 **缺少 `specimen_code` 字典类型**,导致 `sys_dict_data` 表中也无对应的标本数据记录。
|
||||
**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 属于同类问题——新增字典类型时只在前端引用了 `useDict('specimen_code')`,但后端数据库中未创建对应的字典类型和数据。
|
||||
**与 Bug #433 对比**:Bug #433 是"麻醉方法回显为代码"和"外请专家姓名数据未加载",根因也是字典数据缺失。本次 Bug #462 属于同类问题——字典类型已创建但生产环境的数据记录未同步插入。
|
||||
|
||||
## 影响范围
|
||||
- **前端文件**:`openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue`(仅一处引用)
|
||||
- **后端文件**:无代码变更,纯数据问题
|
||||
- **数据库表**:`sys_dict_type`(插入字典类型)、`sys_dict_data`(插入7条标本数据)
|
||||
- **数据库表**:`hisprd.sys_dict_data`(插入7条标本数据)
|
||||
- **影响接口**:`GET /system/dict/data/type/specimen_code`
|
||||
|
||||
## 修复方案
|
||||
执行 DDL 脚本 `sql/bug_462_add_specimen_code_dict.sql`:
|
||||
在 `hisprd.sys_dict_data` 表插入7条标本记录:
|
||||
- 血液(1)、尿液(2)、粪便(3)、呼吸道(4)、无菌体液(5)、生殖道(6)、其他(99)
|
||||
|
||||
1. 在 `sys_dict_type` 表插入 `specimen_code` 字典类型(dict_name='所需标本')
|
||||
2. 在 `sys_dict_data` 表插入7条标本记录:
|
||||
- 血液(1)、尿液(2)、粪便(3)、呼吸道(4)、无菌体液(5)、生殖道(6)、其他(99)
|
||||
|
||||
**注意**:数据库中已存在该字典数据(由测试验证),需检查 DDL 是否已执行。
|
||||
若数据已存在但前端仍显示"无数据",则需重启后端服务刷新字典缓存(`SysDictTypeServiceImpl.loadingDictCache()`)。
|
||||
**注意**:hisprd 的 sys_dict_data 表无 `py_str` 字段(旧表结构),DDL 中不包含该字段。
|
||||
|
||||
## 验证计划
|
||||
1. 确认数据库中 `sys_dict_type` 存在 `specimen_code` 记录
|
||||
2. 确认数据库中 `sys_dict_data` 存在7条 `specimen_code` 数据(status='0')
|
||||
3. 重启后端服务(刷新字典缓存)
|
||||
4. 前端进入诊疗目录编辑弹窗,点击"所需标本"下拉框,应显示7条标本选项
|
||||
5. 选择任意标本后保存,再次编辑应正确回显已选标本
|
||||
1. 确认 hisprd 中 `sys_dict_data` 存在7条 `specimen_code` 数据(status='0')✅ 已验证
|
||||
2. 重启后端服务(刷新字典缓存)
|
||||
3. 前端进入诊疗目录编辑弹窗,点击"所需标本"下拉框,应显示7条标本选项
|
||||
4. 选择任意标本后保存,再次编辑应正确回显已选标本
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -872,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,
|
||||
@@ -892,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,
|
||||
@@ -917,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">
|
||||
|
||||
@@ -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(); // 更新过滤
|
||||
|
||||
@@ -54,9 +54,9 @@
|
||||
<el-col :span="7" class="form-item">
|
||||
<span class="form-label required">性别</span>
|
||||
<el-radio-group v-model="form.sex" class="gender-radio-group">
|
||||
<el-radio value="男">男</el-radio>
|
||||
<el-radio value="女">女</el-radio>
|
||||
<el-radio value="未知">未知</el-radio>
|
||||
<el-radio label="男">男</el-radio>
|
||||
<el-radio label="女">女</el-radio>
|
||||
<el-radio label="未知">未知</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="10" class="form-item">
|
||||
@@ -1044,8 +1044,9 @@ function normalizeSexFromPatientInfo(patientInfo) {
|
||||
if (patientInfo.genderName) return patientInfo.genderName;
|
||||
if (patientInfo.sex) return normalizeSex(patientInfo.sex);
|
||||
// 使用数字枚举字段
|
||||
if (patientInfo.genderEnum === 1) return '男';
|
||||
if (patientInfo.genderEnum === 2) return '女';
|
||||
if (patientInfo.genderEnum === 1 || patientInfo.genderEnum === '1') return '男';
|
||||
if (patientInfo.genderEnum === 2 || patientInfo.genderEnum === '2') return '女';
|
||||
if (patientInfo.genderEnum === 0 || patientInfo.genderEnum === '0') return '未知';
|
||||
return '未知';
|
||||
}
|
||||
|
||||
|
||||
@@ -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([]);
|
||||
@@ -1489,7 +1485,7 @@ async function handleItemSelect(checked, item, cat) {
|
||||
packageName: item.packageName || null,
|
||||
packageDetailsLoading: false,
|
||||
packageId: item.packageId || null,
|
||||
hasChildren: !!(item.packageId) // #426修复: 树形表格懒加载展开标记
|
||||
hasChildren: !!(item.packageId || item.packageName) // #426修复: 树形表格懒加载展开标记,支持 packageName 解析
|
||||
};
|
||||
selectedItems.value.push(newRow);
|
||||
// 必须用数组里的响应式行,不能继续改局部 newRow:push 后列表内是 proxy,改 raw 对象不会触发右侧卡片更新(会一直卡在「加载中」)
|
||||
|
||||
@@ -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>`;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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)] || '-';
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
// 使用nextTick确保在Vue响应式更新后再赋值,避免el-select无法匹配选项
|
||||
nextTick(() => {
|
||||
// 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)
|
||||
// 使用nextTick确保在Vue响应式更新后再赋值,避免el-select无法匹配选项
|
||||
nextTick(() => {
|
||||
// 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('获取手术安排详情失败')
|
||||
}
|
||||
|
||||
@@ -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