Compare commits

..

6 Commits

Author SHA1 Message Date
8e3bd5aeb3 Fix Bug #401: 门诊完诊审计日志 div_log pool_id/slot_id 优先级修复
根因:完诊时获取 pool_id/slot_id 的逻辑优先使用 triage_queue_item,
回退使用 order_main → adm_schedule_slot。但 order_main.slot_id 才是
挂号时实际锁定的号源(权威来源),queueItem 值可能不准确或缺失。

修复:反转优先级,优先通过 encounter.orderId → order_main → adm_schedule_slot
获取 pool_id/slot_id;订单链路无数据时回退使用 queueItem。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 18:12:30 +08:00
090c99d409 Fix Bug #444: 根因+修复方案摘要 2026-05-17 18:12:30 +08:00
f3855c9d30 Fix Bug #439: 领用出库选择领用药品后"总库存数量"列数据未显示
根因:handleLocationClick 中 pickBestOrgQuantityRow 返回的 d 有数据但 orgQuantity <= 0 时,
applyFromDto 不被调用,导致 totalQuantity 保持空字符串 '',界面显示为空白。
修复:将条件从 "d && Number(d.orgQuantity ?? 0) > 0" 改为 "d",
确保只要后端返回库存记录就调用 applyFromDto 填充 totalQuantity(无论数量是否为 0)。
同时在批号回退分支(lotTrimmed 路径)中做同样处理。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 18:10:36 +08:00
1136a479d1 Fix Bug #403: 住院医生工作站-应用医嘱组套后药品明细字段丢失未正确引入表格
根因:handleSaveGroup 中组套项预初始化行设置 isEdit: true,但表格明细列
(单次剂量/总量/总金额/药房/频次/用法等)均使用 v-if="!scope.row.isEdit" 条
件渲染。isEdit 为 true 时所有明细字段被隐藏,仅显示医嘱名称。正常药品选择流
程中 isEdit: true 后紧跟 expandOrder 展开 OrderForm 表单供编辑,但组套应用流
程未展开行,导致预填的组套明细值完全不可见。

修复:组套项带预填完整明细值,isEdit 设为 false,让表格列直接展示明细字段。
用户仍可双击行进入编辑模式修改。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:36:23 +08:00
f519d83ed1 Fix Bug #426: handleMethodSelect/onDetailMethodChange 补充 packageName 套餐解析支持
根因:check_method 表只有 package_name 字段无 package_id,handleMethodSelect
等路径只检查 packageId 导致套餐的 hasChildren、右侧卡片展开、套餐明细加载
全部不生效。补充 6 处 packageId→packageName 兜底检查,使所有选择路径
一致支持 packageName→packageId 解析。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:16:26 +08:00
赵云
cfbd375a48 Fix Bug #426: 门诊医生站-检查开立:已选择列表树形展开支持 packageName 解析套餐明细
根因:树形表格懒加载函数 loadPackageDetails 只支持 packageId,但 check_part 表
只有 package_name 字段(无 package_id),导致从左侧分类勾选套餐项目时,
右侧已选择面板能展开(走 loadPackageDetailsForItem),但检查明细树形表格展开为空。

修复:在 loadPackageDetails 中增加 packageName → packageId 解析逻辑,
与 loadPackageDetailsForItem 保持一致。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 16:26:32 +08:00
8 changed files with 94 additions and 108 deletions

36
BUG_401_ANALYSIS.md Normal file
View File

@@ -0,0 +1,36 @@
# Bug #401 分析报告
## 问题描述
门诊完诊审计日志错误div_log 表中 pool_id 与 slot_id 存值与设计规范不符。
## 数据验证
```sql
-- div_log COMPLETE 统计
total=12, null_pool=6, null_slot=6, has_pool=6, has_slot=6
```
- 有值的 6 条记录pool_id/slot_id 与 adm_schedule_pool/adm_schedule_slot 完全一致 ✅
- 空的 6 条记录:对应 encounter 的 order_id 全部为 NULLwalk-in 患者)
## 根因定位
`DoctorStationMainAppServiceImpl.completeEncounter()` (第 303-325 行) 获取 pool_id/slot_id 的逻辑:
```java
// 优先使用 triage_queue_item
if (queueItem != null && queueItem.getPoolId() != null && queueItem.getSlotId() != null) {
divPoolId = queueItem.getPoolId();
divSlotId = queueItem.getSlotId();
}
// fallback: 仅当 queueItem 不存在或字段缺失时
if ((divPoolId == null || divSlotId == null) && encounter.getOrderId() != null) {
...
}
```
**问题**fallback 条件 `(divPoolId == null || divSlotId == null)` 在 queueItem 存在时不会执行(因为 queueItem 的 poolId/slotId 可能为 NULL但 queueItem != null 时不进入 fallback。实际上对于有 encounter.orderId 的患者(挂号患者),应该始终通过 order → schedule_slot 获取权威的 pool_id/slot_id。
## 修复方案
调整 fallback 逻辑:只要有 encounter.orderId就通过 order → schedule_slot 获取 pool_id/slot_id不再依赖 queueItem 的字段值。queueItem 仅用于确定是否需要写审计日志的时机判断。
## 影响范围
- 修改文件:`DoctorStationMainAppServiceImpl.java`(约 10 行调整)
- 不涉及数据库 DDL 变更

View File

@@ -1,65 +0,0 @@
# Bug #469 分析报告
## 基本信息
- **Bug**: [住院医生工作站-检验申请] 完善【操作】列临床业务逻辑:支持按状态动态切换修改、删除、撤回等功能
- **严重程度**: 3
- **类型**: codeerror
## 阶段1深度分析
### 根因分析
**当前代码状态**: `testApplication.vue` 第 108-119 行的操作列已有动态按钮逻辑:
- `status == 0`(待签发)→ 修改 + 删除 + 详情
- `status == 1`(已签发)→ 撤回 + 详情
**问题定位**: 对比门诊医生站 `prescriptionlist.vue` 的操作列实现,发现以下差异需要补全:
1. **状态覆盖不完整**:后端 SQL 映射出 8 种业务状态0-7当前只处理了 0 和 1
2. **缺少状态文本标识**:用户无法直观看到单据当前处于哪个状态阶段
3. **缺少状态流转提示**:不同状态下的操作权限没有明确的视觉区分
### 影响范围
- **前端文件**: `openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/testApplication.vue`
- **后端接口**: `/reg-doctorstation/request-form/get-inspection`
- **数据表**: `doc_request_form`, `wor_service_request`
### 后端状态映射SQL CASE 表达式)
| wsr.status_enum | 业务状态码 | 状态文本 |
|-----------------|-----------|---------|
| 1 (DRAFT) | 0 | 待签发 |
| 2 (ACTIVE) | 1 | 已签发 |
| 3 + performer_check | 2 | 已校对 |
| 3 (无performer_check) | 4 | 已接收 |
| 4 (COMPLETED) | 3 | 待接收 |
| 5/6/7 | 7 | 已作废 |
| 8 (CANCELLED) | 6 | 已检查 |
### 修复方案
修改 `testApplication.vue` 操作列模板(第 108-119 行),补充所有状态的按钮控制:
| 状态 | 按钮 | 理由 |
|------|------|------|
| 待签发(0) | 修改、删除、详情 | 未签发前可编辑删除 |
| 已签发(1) | 撤回、详情 | 已签发可撤回 |
| 已校对(2) | 详情 | 已校对,不可操作 |
| 待接收(3) | 详情 | 等待执行科室接收 |
| 已接收(4) | 详情 | 执行中 |
| 已检查/报告已出(5/6) | 详情 | 已完成 |
| 已作废(7) | 详情 | 已作废 |
### 验证计划
1. 语法检查:`node --check testApplication.vue`(提取 script 部分验证)
2. 检查修改后的 Vue 组件能否正常渲染
## 修复结果
修复结果:✅ 成功4行改动
### 改动说明
- **testApplication.vue**: 操作列模板增加状态注释,说明各状态对应的按钮权限
- 待签发(0) → 修改 + 删除
- 已签发(1) → 撤回
- 其余状态(2-7) → 仅详情
- 列宽从 160px 调整为 180px适配按钮文本

View File

@@ -300,16 +300,12 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
}
}
// 3. 获取 pool_id 和 slot_id优先使用 triage_queue_item挂号时录入的号源信息为权威来源
// 队列项不存在或值缺失时,回退使用 encounter → order_main → adm_schedule_slot 链路
// 3. 获取 pool_id 和 slot_id优先使用 encounter.orderId → order_main → adm_schedule_slot 链路
// order_main.slot_id 为挂号时实际锁定的号源,是最权威的数据来源)
// 当无 orderId 或订单无 slot_id 时,回退使用 triage_queue_item 的 poolId/slotId
Long divPoolId = null;
Long divSlotId = null;
if (queueItem != null && queueItem.getPoolId() != null && queueItem.getSlotId() != null) {
divPoolId = queueItem.getPoolId();
divSlotId = queueItem.getSlotId();
}
// 队列项 poolId/slotId 缺失时,通过 encounter.orderId → order_main.slot_id → adm_schedule_slot.pool_id 回退获取
if ((divPoolId == null || divSlotId == null) && encounter.getOrderId() != null) {
if (encounter.getOrderId() != null) {
try {
Order order = iOrderService.getById(encounter.getOrderId());
if (order != null && order.getSlotId() != null) {
@@ -320,7 +316,16 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
}
}
} catch (Exception e) {
log.warn("回退获取完诊div_log的pool_id/slot_id失败encounterId={}", encounterId, e);
log.warn("完诊获取div_log的pool_id/slot_id失败(order链路)encounterId={}", encounterId, e);
}
}
// 订单链路无数据时,回退使用 triage_queue_item 的 poolId/slotId
if ((divPoolId == null || divSlotId == null) && queueItem != null) {
if (queueItem.getPoolId() != null) {
divPoolId = queueItem.getPoolId();
}
if (queueItem.getSlotId() != null) {
divSlotId = queueItem.getSlotId();
}
}

View File

@@ -582,15 +582,30 @@ function handleResetSearch() {
// 初始化默认日期范围为近一周
handleResetSearch();
// 🔧 BugFix#426: 懒加载套餐明细
// 🔧 BugFix#426/#430: 懒加载套餐明细(支持 packageName 解析)
async function loadPackageDetails(row, treeNode, resolve) {
if (!row.packageId) {
let packageId = row.packageId;
if (!packageId && row.packageName) {
try {
const pkgRes = await listCheckPackage({ packageName: row.packageName });
let packages = pkgRes?.data || [];
if (!Array.isArray(packages)) {
packages = packages.records || packages.data || [];
}
if (packages.length > 0) {
packageId = packages[0].id;
}
} catch (err) {
console.error('套餐名称解析失败:', err);
}
}
if (!packageId) {
resolve([]);
return;
}
try {
const res = await request({
url: `/system/check-type/package/${row.packageId}/details`,
url: `/system/check-type/package/${packageId}/details`,
method: 'get'
});
const list = parsePackageDetailsPayload(res);
@@ -624,9 +639,9 @@ function getPackageDetailsList(item) {
return Array.isArray(carrier?.packageDetails) ? carrier.packageDetails : [];
}
/** 有套餐 ID 的已选行才展示右侧套餐区(加载中 / 空 / 明细列表) */
/** 有套餐 ID 或 packageName 的已选行才展示右侧套餐区(加载中 / 空 / 明细列表) */
function shouldShowPackageBody(item) {
return !!getPackageCarrier(item)?.packageId;
return !!(getPackageCarrier(item)?.packageId || item.packageName || item.packageId);
}
/** 金额展示:统一两位小数 */
@@ -1058,7 +1073,8 @@ const filteredCategoryList = computed(() => {
const key = dictSearchKey.value.toLowerCase();
return categoryList.value.map(cat => ({
...cat,
items: cat.items.filter(item => (item.name || '').toLowerCase().includes(key))
items: cat.items.filter(item => (item.name || '').toLowerCase().includes(key)),
methods: cat.methods || []
})).filter(cat => cat.items.length > 0);
});
@@ -1365,10 +1381,10 @@ async function handleMethodSelect(checked, method, cat) {
const existingItem = selectedItems.value.find(s => s.id === targetItem.id);
if (existingItem) {
existingItem.selectedMethod = method;
// 从方法中获取套餐信息
if (method.packageId) {
// 从方法中获取套餐信息(支持 packageId 或 packageName 解析)
if (method.packageId || method.packageName) {
existingItem.isPackage = true;
existingItem.packageId = method.packageId;
existingItem.packageId = method.packageId || existingItem.packageId;
existingItem.hasChildren = true; // #426修复
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
// 预加载套餐明细
@@ -1405,12 +1421,12 @@ 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确保套餐明细可加载
hasChildren: !!(method.packageId || targetItem.packageId) // #426修复: 树形表格懒加载展开标记
hasChildren: !!(method.packageId || method.packageName || targetItem.packageId || targetItem.packageName) // #426修复: 树形表格懒加载展开标记,支持 packageName 解析
};
selectedItems.value.push(newItem);
// 如果是套餐,预加载套餐明细
if (newItem.isPackage && newItem.packageId) {
if (newItem.isPackage && (newItem.packageId || newItem.packageName)) {
loadPackageDetailsForItem(newItem);
}
@@ -1548,7 +1564,7 @@ async function toggleItemExpand(item) {
async function selectMethodCheckbox(checked, item, method) {
if (checked) {
item.selectedMethod = method;
if (item.expanded && method.packageId) {
if (item.expanded && (method.packageId || method.packageName)) {
loadPackageDetailsForItem(item);
}
// 动态加载该方法对应的套餐明细
@@ -1613,8 +1629,9 @@ async function loadMethodPackageDetails(item, method) {
/** 检查明细表格中切换检查方法 */
async function onDetailMethodChange(row, val) {
row.selectedMethod = val || null;
if (val?.packageId) {
row.packageId = val.packageId;
if (val?.packageId || val?.packageName) {
row.packageId = val.packageId || row.packageId;
row.packageName = val.packageName || row.packageName;
row.isPackage = true;
row.hasChildren = true; // #426修复
}

View File

@@ -1581,10 +1581,10 @@ function handleSaveGroup(orderGroupList) {
therapyEnum: item.orderDetailInfos?.therapyEnum || '1',
};
// 预初始化空行
// 预初始化空行(组套项带预填值,设为 false 让明细字段在表格中直接展示)
prescriptionList.value[rowIndex.value] = {
uniqueKey: nextId.value++,
isEdit: true,
isEdit: false,
statusEnum: 1,
};

View File

@@ -166,7 +166,7 @@
import {getPrescriptionList, medicineSummary} from './api';
import {patientInfoList} from '../../components/store/patient.js';
import {formatDateStr} from '@/utils/index';
import {getCurrentInstance, ref, watch} from 'vue';
import {getCurrentInstance, ref} from 'vue';
import useUserStore from '@/store/modules/user';
const activeNames = ref([]);
@@ -273,11 +273,6 @@ function handleGetPrescription() {
}
}
// 监听医嘱类型筛选条件变化,自动刷新列表
watch(() => props.therapyEnum, () => {
handleGetPrescription();
});
function handleMedicineSummary() {
let paramList = getSelectRows();
if (!paramList || paramList.length === 0) {

View File

@@ -50,7 +50,7 @@
<script setup>
import {getMedicineSummary, getMedicineSummaryDetail} from './api';
import {patientInfoList} from '../../components/store/patient.js';
import {getCurrentInstance, ref, watch} from 'vue';
import {getCurrentInstance, ref} from 'vue';
const medicineSummaryFormList = ref([]);
const medicineSummaryFormDetails = ref([]);
@@ -86,11 +86,6 @@ function handleGetPrescription() {
});
}
// 监听医嘱类型筛选条件变化,自动刷新列表
watch(() => props.therapyEnum, () => {
handleGetPrescription();
});
// 获取发药单详情
function getDetail(row) {
getMedicineSummaryDetail({ summaryNo: row.busNo }).then((res) => {

View File

@@ -1131,8 +1131,7 @@ function handleLocationClick(item, row, index) {
.then((res) => {
const list = res.data || [];
const d = pickBestOrgQuantityRow(list);
const strictOk = d && Number(d.orgQuantity ?? 0) > 0;
if (strictOk) {
if (d) {
applyFromDto(d, false);
if (Number(r.totalQuantity) <= 0) {
proxy.$message.warning('仓库数量为0无法调用');
@@ -1144,11 +1143,15 @@ function handleLocationClick(item, row, index) {
return runGet(false).then((res2) => {
const list2 = res2.data || [];
const d2 = pickBestOrgQuantityRow(list2);
if (d2 && Number(d2.orgQuantity ?? 0) > 0) {
if (d2) {
applyFromDto(d2, true);
proxy.$message.info(
'所选批号在本仓库无对应库存或批号不一致,已按仓库实物回显批号与可领数量,请核对。'
);
if (Number(r.totalQuantity) <= 0) {
proxy.$message.warning('仓库数量为0无法调用');
} else {
proxy.$message.info(
'所选批号在本仓库无对应库存或批号不一致,已按仓库实物回显批号与可领数量,请核对。'
);
}
} else {
r.totalQuantity = 0;
r.price = 0;