Compare commits
16 Commits
bugfix-403
...
关羽
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ec422fc0e | ||
|
|
fdedad618a | ||
|
|
2594e372b8 | ||
|
|
0197f5509c | ||
|
|
a75063430c | ||
|
|
300d53bdc6 | ||
|
|
284818bd8f | ||
|
|
e473e5159b | ||
|
|
a52bd8fe8a | ||
|
|
bbf230ea76 | ||
|
|
a7ea08f075 | ||
|
|
cd88bfc7d4 | ||
|
|
3ab3ddbdf1 | ||
|
|
d2cb02eeef | ||
|
|
8850689f1f | ||
|
|
4c7d362946 |
66
.analysis/bug403_analysis.md
Normal file
66
.analysis/bug403_analysis.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# Bug #403 分析报告
|
||||
|
||||
## 根因分析
|
||||
|
||||
**Bug现象**:住院医生工作站应用医嘱组套后,药品明细字段(单次剂量、总量、总金额、药房/科室)丢失。
|
||||
|
||||
**数据流追踪**:
|
||||
|
||||
1. **后端 `getGroupPackageForOrder`** (OrdersGroupPackageAppServiceImpl.java:168)
|
||||
- 查询组套明细 SQL(OrdersGroupPackageAppMapper.xml:37-82)返回:`dose`, `quantity`, `doseQuantity`, `rateCode`, `methodCode`, `dispensePerDuration` 等字段
|
||||
- 通过 `getAdviceBaseInfo` 获取 `AdviceBaseDto` 赋值给 `detail.setOrderDetailInfos()`,包含:`doseUnitCode`, `doseUnitCode_dictText`, `positionId`, `inventoryList`, `priceList`, `partPercent` 等
|
||||
|
||||
2. **前端 `orderGroupDrawer.vue`** `handleUseOrderGroup` (line 568-694)
|
||||
- 对每个组套明细项进行预处理,合并组套字段和医嘱库字段
|
||||
- 通过 `emit('useOrderGroup', processedDetailList)` 发送到父组件
|
||||
|
||||
3. **前端 `inpatientDoctor/home/components/order/index.vue`** `handleSaveGroup` (line 1546-1639)
|
||||
- 接收 `orderGroupList`,对每个 item 调用 `setValue(mergedDetail)` 填充行数据
|
||||
- 然后用 `item` 的字段显式覆盖创建 `newRow`
|
||||
|
||||
**根因定位**:`handleSaveGroup` 在构建 `newRow` 时(line 1594-1617),从 `item` 直接取值覆盖了 `setValue` 设置的值。问题在于:
|
||||
|
||||
1. **`item.unitCodeName` 可能为 undefined**:组套明细 SQL 中 `unitCodeName` 来自字典关联 `sys_dict_data`,如果字典匹配不上则为 null。`newRow` 的 `unitCode_dictText` 直接使用 `item.unitCodeName || ''`,导致显示为空。
|
||||
|
||||
2. **`positionName` 未在 `orderGroupDrawer` 处理项中显式设置**:虽然 `setValue` 会通过库存查询设置 `positionName`,但 `orderGroupDrawer.vue` 的 `handleUseOrderGroup` 没有将 `positionName`(或至少 `orderDetail.positionName`)包含在 processed item 中,导致 `setValue` 的库存查找依赖 `inventoryList`,而 `inventoryList` 来自后端 `AdviceBaseDto`。
|
||||
|
||||
3. **`doseUnitCode_dictText` 依赖 `setValue` 的 `unitCodeList`**:`orderGroupDrawer` 的处理项中没有显式包含 `doseUnitCode_dictText`,完全依赖 `mergedDetail` 中 spread 的 `orderDetail` 字段。
|
||||
|
||||
## 影响范围
|
||||
|
||||
- 前端文件:`openhis-ui-vue3/src/views/doctorstation/components/prescription/orderGroupDrawer.vue`
|
||||
- 前端文件:`openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue`
|
||||
- 影响场景:住院医生工作站和门诊医生工作站应用医嘱组套
|
||||
|
||||
## 修复方案
|
||||
|
||||
**修改 `orderGroupDrawer.vue` 的 `handleUseOrderGroup` 函数**(line 630-688):
|
||||
|
||||
在 processed item 的 return 对象中显式添加缺失的字段:
|
||||
- `doseUnitCode_dictText`:从 orderDetail 获取剂量单位显示文本
|
||||
- `positionName`:从 orderDetail 获取执行科室/药房名称
|
||||
- `injectFlag` / `injectFlag_enumText`:注射标识
|
||||
- `skinTestFlag` / `skinTestFlag_enumText`:皮试标识
|
||||
- `partPercent`、`partAttributeEnum`、`unitConversionRatio`:用于价格计算的关键字段
|
||||
|
||||
这些字段在 `orderDetail`(AdviceBaseDto)中都有,只是没有在 processed item 的顶层显式设置。`handleSaveGroup` 的 `newRow` 通过 `...prescriptionList.value[rowIndex.value]` spread 能获取到 `setValue` 设置的值,但显式在顶层包含可以确保数据流的完整性。
|
||||
|
||||
## 验证计划
|
||||
|
||||
1. 修改代码后,用 `node --check` 验证语法
|
||||
2. 在住院医生工作站测试:选择患者 → 点击组套 → 预览组套 → 应用到当前患者
|
||||
3. 验证表格中显示的字段:单次剂量、总量、总金额、药房/科室均有值
|
||||
|
||||
---
|
||||
|
||||
## 修复结果:✅ 成功,10行改动
|
||||
|
||||
**修改文件**:`openhis-ui-vue3/src/views/doctorstation/components/prescription/orderGroupDrawer.vue`
|
||||
|
||||
**改动说明**:在 `handleUseOrderGroup` 函数的 processed item 中显式添加了以下缺失字段:
|
||||
- `doseUnitCode_dictText`:剂量单位显示文本(如"mg"),用于"单次剂量"列的后缀显示
|
||||
- `positionName`:药房/科室名称,用于"药房/科室"列显示
|
||||
- `injectFlag` / `injectFlag_enumText`:注射药品标识及文本
|
||||
- `skinTestFlag` / `skinTestFlag_enumText`:皮试标识及文本
|
||||
|
||||
**策略**:策略A(直接修复代码逻辑)—— 组套应用时数据预处理缺失部分关键字段,导致父组件 `handleSaveGroup` 构建行数据时无法获取完整信息。补充字段后,`setValue` 和 `newRow` 构造均能正确传递这些数据到表格。
|
||||
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` 语法通过
|
||||
89
BUG461_ANALYSIS.md
Normal file
89
BUG461_ANALYSIS.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Bug #461 分析报告
|
||||
|
||||
## Bug描述
|
||||
[系统管理-执行科室配置] 保存项目配置后,项目名称回显为ID码,未显示正确名称
|
||||
|
||||
## 根因分析
|
||||
|
||||
### 数据流
|
||||
1. 前端调用 `getDiagnosisTreatmentList()` → GET `/base-data-manage/org-loc/org-loc`
|
||||
2. 后端 `OrganizationLocationController.getOrgLocPage()` 返回 `Page<OrgLocQueryDto>`
|
||||
3. `OrgLocQueryDto.activityDefinitionId` 标注了 `@Dict(dictTable="wor_activity_definition", dictCode="id", dictText="name")`
|
||||
4. `DictAspect` AOP 拦截 GET/POST 请求,对带 `@Dict` 注解的字段执行 SQL 翻译:`SELECT name FROM wor_activity_definition WHERE id::varchar = ? LIMIT 1`
|
||||
5. 翻译结果写入 `activityDefinitionId_dictText` 字段
|
||||
6. 前端使用 `record.activityDefinitionId_dictText` 作为项目名称显示
|
||||
|
||||
### 根本原因
|
||||
**`DictAspect.queryDictLabel` 方法在 SQL 查询失败时返回空字符串 `""`,导致 `_dictText` 字段被设置为空值。**
|
||||
|
||||
具体代码 (`DictAspect.java:123-149`):
|
||||
```java
|
||||
private String queryDictLabel(String dictTable, String dictCode, String dictText, String deleteFlag, String dictValue) {
|
||||
if (!StringUtils.hasText(dictTable)) {
|
||||
return DictUtils.getDictLabel(dictCode, dictValue);
|
||||
} else {
|
||||
if (!StringUtils.hasText(dictText)) {
|
||||
return DictUtils.getDictLabel(dictCode, dictValue);
|
||||
}
|
||||
String sql = String.format("SELECT %s FROM %s WHERE %s::varchar = ?", dictText, dictTable, dictCode);
|
||||
// ...
|
||||
try {
|
||||
return jdbcTemplate.queryForObject(sql, String.class, dictValue);
|
||||
} catch (DataAccessException e) {
|
||||
return ""; // ← 关键问题:查询失败返回空字符串
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
当 `jdbcTemplate.queryForObject` 查询失败(无结果或异常)时,返回空字符串 `""`。而在 `processDict` 中:
|
||||
```java
|
||||
String dictLabel = queryDictLabel(...);
|
||||
if (dictLabel != null) { // ← 空字符串 "" 不等于 null,条件为 true
|
||||
textField.set(dto, dictLabel); // ← 设置为空字符串
|
||||
}
|
||||
```
|
||||
|
||||
空字符串 `""` 不是 `null`,所以 `_dictText` 被设为空字符串,而不是保持 `null`(未翻译)。前端收到 `activityDefinitionId_dictText: ""`,当作有效值处理,显示为空或回退到 ID。
|
||||
|
||||
### 前端 fallback 的不足
|
||||
前端代码在 `getList()` 中尝试用 `activityDefinitionId_dictText` 补充选项,但:
|
||||
```javascript
|
||||
if (record.activityDefinitionId && !filteredOptions.some(o => o.value === record.activityDefinitionId)) {
|
||||
filteredOptions.push({
|
||||
value: record.activityDefinitionId,
|
||||
label: record.activityDefinitionId_dictText || record.activityDefinitionId // ← 空字符串时显示ID
|
||||
});
|
||||
}
|
||||
```
|
||||
空字符串是 falsy 值,所以 `"" || record.activityDefinitionId` 回退到 ID,仍然显示 ID。
|
||||
|
||||
## 影响范围
|
||||
- **前端**: `openhis-ui-vue3/src/views/basicmanage/implementDepartment/index.vue`
|
||||
- **后端**: `openhis-server-new/.../basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java`
|
||||
- **AOP**: `openhis-server-new/.../common/aspectj/DictAspect.java`
|
||||
- **DTO**: `openhis-server-new/.../basedatamanage/dto/OrgLocQueryDto.java`
|
||||
- **数据库表**: `adm_organization_location`, `wor_activity_definition`
|
||||
|
||||
## 修复方案
|
||||
|
||||
### 方案:在 service 层直接 JOIN 查询项目名称
|
||||
|
||||
修改 `OrganizationLocationAppServiceImpl.getOrgLocPage()` 方法,在返回结果前手动填充 `activityDefinitionId_dictText`,不依赖 DictAspect 的行为。这样更可靠,避免了 AOP 执行顺序、SQL异常处理等不确定因素。
|
||||
|
||||
具体改动:在 `OrganizationLocationAppServiceImpl` 中,利用已有的 `activityDefinitionMapper` 对每条记录补充 `activityDefinitionId_dictText`。
|
||||
|
||||
## 验证计划
|
||||
1. 修改代码后编译通过
|
||||
2. 验证 `activityDefinitionId_dictText` 在 API 响应中正确填充
|
||||
3. 前端 el-select 能正确显示项目名称而非 ID
|
||||
|
||||
---
|
||||
|
||||
## 修复结果:✅ 成功,12行改动
|
||||
|
||||
**修改文件**: `openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java`
|
||||
|
||||
**改动内容**: 在 `getOrgLocPage()` 方法中,对分页返回的每条记录,使用已注入的 `activityDefinitionMapper` 查询对应的 `ActivityDefinition` 实体,手动填充 `activityDefinitionId_dictText` 字段。
|
||||
|
||||
**策略**: 不依赖 DictAspect 的 AOP 翻译机制,在 service 层直接填充字典翻译值,确保前端能接收到正确的项目名称。
|
||||
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'`
|
||||
|
||||
### 根因
|
||||
`sys_dict_type` 表中 **缺少 `specimen_code` 字典类型**,导致 `sys_dict_data` 表中也无对应的标本数据记录。
|
||||
|
||||
前端 `useDict('specimen_code')` 调用 API 后返回空数组 `[]`,下拉框 `v-for` 遍历空数组,没有任何 `<el-option>` 渲染,Element Plus 显示默认空状态文案"无数据"。
|
||||
|
||||
**与 Bug #433 对比**:Bug #433 是"麻醉方法回显为代码"和"外请专家姓名数据未加载",根因也是字典数据缺失。本次 Bug #462 属于同类问题——新增字典类型时只在前端引用了 `useDict('specimen_code')`,但后端数据库中未创建对应的字典类型和数据。
|
||||
|
||||
## 影响范围
|
||||
- **前端文件**:`openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue`(仅一处引用)
|
||||
- **后端文件**:无代码变更,纯数据问题
|
||||
- **数据库表**:`sys_dict_type`(插入字典类型)、`sys_dict_data`(插入7条标本数据)
|
||||
- **影响接口**:`GET /system/dict/data/type/specimen_code`
|
||||
|
||||
## 修复方案
|
||||
执行 DDL 脚本 `sql/bug_462_add_specimen_code_dict.sql`:
|
||||
|
||||
1. 在 `sys_dict_type` 表插入 `specimen_code` 字典类型(dict_name='所需标本')
|
||||
2. 在 `sys_dict_data` 表插入7条标本记录:
|
||||
- 血液(1)、尿液(2)、粪便(3)、呼吸道(4)、无菌体液(5)、生殖道(6)、其他(99)
|
||||
|
||||
**注意**:数据库中已存在该字典数据(由测试验证),需检查 DDL 是否已执行。
|
||||
若数据已存在但前端仍显示"无数据",则需重启后端服务刷新字典缓存(`SysDictTypeServiceImpl.loadingDictCache()`)。
|
||||
|
||||
## 验证计划
|
||||
1. 确认数据库中 `sys_dict_type` 存在 `specimen_code` 记录
|
||||
2. 确认数据库中 `sys_dict_data` 存在7条 `specimen_code` 数据(status='0')
|
||||
3. 重启后端服务(刷新字典缓存)
|
||||
4. 前端进入诊疗目录编辑弹窗,点击"所需标本"下拉框,应显示7条标本选项
|
||||
5. 选择任意标本后保存,再次编辑应正确回显已选标本
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -1250,7 +1250,8 @@ function handleRowClick(row) {
|
||||
expanded: false,
|
||||
packageDetailsLoading: false,
|
||||
isPackage: false,
|
||||
packageId: null
|
||||
packageId: null,
|
||||
hasChildren: false // #426修复: 树形表格懒加载展开标记,后续根据packageId动态设置
|
||||
};
|
||||
// 加载该项目的检查方法
|
||||
if (m.bodyPartCode) {
|
||||
@@ -1278,6 +1279,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 +1288,7 @@ function handleRowClick(row) {
|
||||
if (item.selectedMethod?.packageId) {
|
||||
item.packageId = item.selectedMethod.packageId;
|
||||
item.isPackage = true;
|
||||
item.hasChildren = true; // #426修复
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -1361,6 +1364,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 +1399,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 +1488,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) // #426修复: 树形表格懒加载展开标记
|
||||
};
|
||||
selectedItems.value.push(newRow);
|
||||
// 必须用数组里的响应式行,不能继续改局部 newRow:push 后列表内是 proxy,改 raw 对象不会触发右侧卡片更新(会一直卡在「加载中」)
|
||||
@@ -1605,6 +1611,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);
|
||||
|
||||
@@ -653,6 +653,16 @@ async function handleUseOrderGroup(row) {
|
||||
unitCodeName: item.unitCodeName || orderDetail.unitCode_dictText,
|
||||
minUnitCode: orderDetail.minUnitCode,
|
||||
doseUnitCode: orderDetail.doseUnitCode,
|
||||
doseUnitCode_dictText: orderDetail.doseUnitCode_dictText || '',
|
||||
|
||||
// 药房/科室名称(setValue 通过库存查找设置,但需确保 orderDetail 中有)
|
||||
positionName: orderDetail.positionName || '',
|
||||
|
||||
// 注射/皮试标识(表格列显示依赖这些字段)
|
||||
injectFlag: orderDetail.injectFlag,
|
||||
injectFlag_enumText: orderDetail.injectFlag_enumText || '',
|
||||
skinTestFlag: orderDetail.skinTestFlag,
|
||||
skinTestFlag_enumText: orderDetail.skinTestFlag_enumText || '',
|
||||
|
||||
// 字典文本(传递到 item 层级,避免后续代码依赖 mergedDetail 再查一次)
|
||||
methodCode_dictText: methodCodeDictText,
|
||||
|
||||
@@ -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="180">
|
||||
<template #default="scope">
|
||||
<!-- 待签发:可修改、删除 -->
|
||||
<template v-if="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>
|
||||
<!-- 已签发:可撤回 -->
|
||||
<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)] || '-';
|
||||
};
|
||||
|
||||
@@ -1325,13 +1325,13 @@ 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)
|
||||
// 使用nextTick确保在Vue响应式更新后再赋值,避免el-select无法匹配选项
|
||||
nextTick(() => {
|
||||
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 {
|
||||
proxy.$modal.msgError('获取手术安排详情失败')
|
||||
}
|
||||
@@ -1351,13 +1351,13 @@ 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)
|
||||
// 使用nextTick确保在Vue响应式更新后再赋值,避免el-select无法匹配选项
|
||||
nextTick(() => {
|
||||
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 {
|
||||
proxy.$modal.msgError('获取手术安排详情失败')
|
||||
}
|
||||
@@ -1944,6 +1944,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 {
|
||||
|
||||
Reference in New Issue
Block a user