6 Commits

Author SHA1 Message Date
关羽
da57354324 Fix Bug #493: 【住院医生工作站-临床医嘱-检验申请】项目未维护执行科室时,医生手动选择发往科室后仍报错且数据被清空
原因:projectWithDepartment 函数在 watch 触发时(type=1)若项目未配置执行科室,
立即弹出"未找到项目执行的科室"错误,干扰用户操作;且提交时(type=2)的错误提示
分支没有区分"用户已手动选择"和"用户未选择"两种情况。

修复:将 findItem 未找到时的错误弹窗限制在 type=2(提交)且用户未手动选择科室时触发,
type=1(选择项目变化)时仅清空科室字段让用户自行选择,不再弹窗阻断。
2026-05-14 05:05:41 +08:00
赵云
d646afa0c0 Fix Bug #487: 【临床医嘱】诊疗类医嘱签发后,列表状态未实时刷新为"已签发"
根因分析:诊疗类(活动)医嘱签发时,后端handService()的批量状态更新
未区分签发/保存场景,导致statusEnum字段在签发时可能未被正确更新为
ACTIVE(2);前端依赖后端刷新,缺乏乐观更新机制。

修复方案:
- 前端:签发成功后立即将saveList中对应医嘱的statusEnum设为2(乐观更新),
  再执行getListInfo从后端刷新
- 后端:handService()中分离签发/保存的批量更新逻辑,签发时显式设置
  statusEnum=ACTIVE、authoredTime和signCode,并添加日志

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 05:05:41 +08:00
关羽
d31b7ff549 Fix Bug #486: [住院医生工作站-临床医嘱] 医嘱检索框不支持全局模糊搜索,未选"医嘱类型"时检索结果为空
根因:adviceTypes 参数使用逗号分隔字符串 '1,2,3,6',经 tansParams 序列化后变成
adviceTypes=1%2C2%2C3%2C6(URL编码的逗号),Spring MVC 无法将其正确解析为 List<Integer>,
导致后端 SQL 返回空结果。改为数组 [1,2,3,6] 后,tansParams 正确序列化为
adviceTypes=1&adviceTypes=2&adviceTypes=3&adviceTypes=6,后端可正常解析。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 05:05:41 +08:00
关羽
5b6f33912d Fix Bug #477: 住院检查申请详情弹窗中"发往科室"字段显示异常
根因:recursionFun 使用嵌套循环搜索科室树,但 API 返回扁平列表导致匹配失败。
修复:改用递归 findTreeItem 搜索(与 medicalExaminations.vue 一致),添加 API 错误处理,
并在 ID 匹配失败时回退显示原始值而非空白。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 05:05:41 +08:00
荀彧
c7f87a9c95 Fix Bug #467: [住院医生工作站-检验申请] 列表显示信息不规范:标题术语错误且单据名称未展示具体检验项目
1. 详情弹窗中"处方号"改为"申请单号",符合住院检验业务术语规范
2. 列表"申请单名称"列改为从 requestFormDetailList 动态构建:
   - 单一项目:显示"项目名称+数量"
   - 多个项目:显示"首项目名称+数量等X项"
   解决此前统一显示"检验申请单"无法区分单据内容的问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 05:05:41 +08:00
关羽
2823f8eb05 Fix Bug #481: [住院护士站-医嘱执行] 药品库存充足但执行时提示库存不足
根因: AdviceUtils.checkExeMedInventory() 中硬编码 performLocation == locationId 的匹配条件,
当医嘱的 performLocation 指向的药房没有该药品库存时(库存实际在其他药房),匹配失败导致"库存不足"错误。

修复策略: 采用两步匹配法 -
1. 先按 performLocation 匹配指定药房的库存(添加 null 容错)
2. 若指定药房无匹配,则放宽条件跨所有药房聚合库存

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 03:14:08 +08:00
7 changed files with 88 additions and 36 deletions

View File

@@ -178,15 +178,26 @@ public class AdviceUtils {
// 生命提示信息集合 // 生命提示信息集合
List<String> tipsList = new ArrayList<>(); List<String> tipsList = new ArrayList<>();
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) { for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
// 聚合同一位置所有批次的库存总量 // 第一步:按 performLocation 匹配指定药房的库存
List<AdviceInventoryDto> matchedInventories = adviceInventory.stream() List<AdviceInventoryDto> matchedInventories = adviceInventory.stream()
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId()) .filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable()) && CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
&& medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId()) && (medicationRequestUseExe.getPerformLocation() == null
|| medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId()))
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件 // 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber()) && (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber()))) || medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
.collect(Collectors.toList()); .collect(Collectors.toList());
// 第二步:如果指定药房没有匹配到库存,则放宽条件查询所有药房的库存
if (matchedInventories.isEmpty()) {
matchedInventories = adviceInventory.stream()
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
.collect(Collectors.toList());
}
// 匹配到库存信息 // 匹配到库存信息
if (!matchedInventories.isEmpty()) { if (!matchedInventories.isEmpty()) {
// 聚合所有批次的可用库存 // 聚合所有批次的可用库存

View File

@@ -710,11 +710,21 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
// 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新) // 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新)
if (!processedRequestIds.isEmpty()) { if (!processedRequestIds.isEmpty()) {
iServiceRequestService.update(null, // 🔧 Bug #487 修复:签发时额外设置 authoredTime确保签发时间被记录
new LambdaUpdateWrapper<ServiceRequest>() if (is_sign) {
.set(ServiceRequest::getStatusEnum, iServiceRequestService.update(null,
is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue()) new LambdaUpdateWrapper<ServiceRequest>()
.in(ServiceRequest::getId, processedRequestIds)); .set(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
.set(ServiceRequest::getAuthoredTime, authoredTime)
.set(ServiceRequest::getSignCode, signCode)
.in(ServiceRequest::getId, processedRequestIds));
log.info("签发诊疗医嘱成功requestIds: {}, signCode: {}", processedRequestIds, signCode);
} else {
iServiceRequestService.update(null,
new LambdaUpdateWrapper<ServiceRequest>()
.set(ServiceRequest::getStatusEnum, RequestStatus.DRAFT.getValue())
.in(ServiceRequest::getId, processedRequestIds));
}
} }
} }

View File

@@ -51,7 +51,7 @@ const currentSelectRow = ref<any>({});
const queryParams = ref({ const queryParams = ref({
pageSize: 100, pageSize: 100,
pageNo: 1, pageNo: 1,
adviceTypes: '1,2,3,6', adviceTypes: [1, 2, 3, 6],
searchKey: '', searchKey: '',
organizationId: '', organizationId: '',
categoryCode: '', categoryCode: '',
@@ -88,10 +88,10 @@ const tableColumns = computed<TableColumn[]>(() => [
function refresh(adviceType: any, categoryCode: string, searchKey: string) { function refresh(adviceType: any, categoryCode: string, searchKey: string) {
// 有搜索词时跨类型搜索,避免用户输入"级护理"但因当前adviceType为药品而搜不到诊疗类护理项目 // 有搜索词时跨类型搜索,避免用户输入"级护理"但因当前adviceType为药品而搜不到诊疗类护理项目
if (searchKey) { if (searchKey) {
queryParams.value.adviceTypes = '1,2,3,6'; queryParams.value.adviceTypes = [1, 2, 3, 6];
} else { } else {
queryParams.value.adviceTypes = queryParams.value.adviceTypes =
adviceType !== undefined && adviceType !== '' ? String(adviceType) : '1,2,3,6'; adviceType !== undefined && adviceType !== '' ? [parseInt(adviceType)] : [1, 2, 3, 6];
} }
queryParams.value.categoryCode = categoryCode || ''; queryParams.value.categoryCode = categoryCode || '';
queryParams.value.searchKey = searchKey || ''; queryParams.value.searchKey = searchKey || '';

View File

@@ -310,32 +310,26 @@ const hasMatchedFields = computed(() => {
/** 查询科室 */ /** 查询科室 */
const getLocationInfo = async () => { const getLocationInfo = async () => {
const res = await getDepartmentList(); try {
orgOptions.value = res.data || []; const res = await getDepartmentList();
orgOptions.value = Array.isArray(res.data) ? res.data : [];
} catch (e) {
console.warn('科室列表加载失败:', e.message);
orgOptions.value = [];
}
}; };
const recursionFun = (targetDepartment) => { // 递归查找树形科室节点
if (!targetDepartment) return ''; const findTreeItem = (list, id) => {
let name = ''; if (!list || list.length === 0) return null;
for (let index = 0; index < orgOptions.value.length; index++) { for (const item of list) {
const obj = orgOptions.value[index]; if (item.id == id) return item;
if (obj.id == targetDepartment) { if (item.children && item.children.length > 0) {
name = obj.name; const found = findTreeItem(item.children, id);
break; if (found) return found;
} }
const subObjArray = obj['children'];
if (subObjArray && subObjArray.length > 0) {
for (let i = 0; i < subObjArray.length; i++) {
const item = subObjArray[i];
if (item.id == targetDepartment) {
name = item.name;
break;
}
}
}
if (name) break;
} }
return name; return null;
}; };
const handleViewDetail = async (row) => { const handleViewDetail = async (row) => {
@@ -349,7 +343,11 @@ const handleViewDetail = async (row) => {
if (row.descJson) { if (row.descJson) {
try { try {
const obj = JSON.parse(row.descJson); const obj = JSON.parse(row.descJson);
obj.targetDepartment = recursionFun(obj.targetDepartment); // 将发往科室 ID 转换为名称
if (obj.targetDepartment) {
const deptItem = findTreeItem(orgOptions.value, obj.targetDepartment);
obj.targetDepartment = deptItem ? deptItem.name : obj.targetDepartment;
}
descJsonData.value = obj; descJsonData.value = obj;
} catch (e) { } catch (e) {
console.error('解析 descJson 失败:', e); console.error('解析 descJson 失败:', e);

View File

@@ -82,7 +82,11 @@
</template> </template>
<el-table-column type="index" label="序号" width="60" align="center" /> <el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="patientName" label="患者姓名" width="120" /> <el-table-column prop="patientName" label="患者姓名" width="120" />
<el-table-column prop="name" label="申请单名称" width="140" /> <el-table-column label="申请单名称" width="140">
<template #default="scope">
<span>{{ buildApplicationName(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160" /> <el-table-column prop="createTime" label="创建时间" width="160" />
<el-table-column prop="prescriptionNo" label="申请单号" width="140" /> <el-table-column prop="prescriptionNo" label="申请单号" width="140" />
<el-table-column label="单据状态" width="100" align="center"> <el-table-column label="单据状态" width="100" align="center">
@@ -137,7 +141,7 @@
<el-descriptions-item label="创建时间">{{ <el-descriptions-item label="创建时间">{{
currentDetail.createTime || '-' currentDetail.createTime || '-'
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="处方号">{{ <el-descriptions-item label="申请单号">{{
currentDetail.prescriptionNo || '-' currentDetail.prescriptionNo || '-'
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="申请者">{{ <el-descriptions-item label="申请者">{{
@@ -339,6 +343,24 @@ const parseSpecimenType = (descJson) => {
} }
}; };
/**
* 根据申请单详情构建申请单名称
* 单一项目:显示项目名称+数量
* 多个项目:显示首个项目名称+数量+"等X项"
*/
const buildApplicationName = (row) => {
const details = row.requestFormDetailList;
if (!details || details.length === 0) {
return row.name || '-';
}
if (details.length === 1) {
const item = details[0];
return `${item.adviceName}${item.quantity || ''}`;
}
const first = details[0];
return `${first.adviceName}${first.quantity || ''}${details.length}`;
};
const isFieldMatched = (key) => { const isFieldMatched = (key) => {
return key in labelMap; return key in labelMap;
}; };

View File

@@ -256,12 +256,16 @@ const projectWithDepartment = (selectProjectIds, type) => {
if (type === 2 && manualDept) { if (type === 2 && manualDept) {
form.targetDepartment = manualDept; form.targetDepartment = manualDept;
isRelease = true; isRelease = true;
} else { } else if (type === 2 && !manualDept) {
// 提交时用户未手动选择科室,才提示错误
isRelease = false; isRelease = false;
ElMessage({ ElMessage({
type: 'error', type: 'error',
message: '未找到项目执行的科室', message: '未找到项目执行的科室',
}); });
} else {
// type=1(选择项目变化)时,不弹窗,仅清空科室让用户自行选择
isRelease = false;
} }
} }
if (findItem && isRelease) { if (findItem && isRelease) {

View File

@@ -1241,6 +1241,13 @@ function handleSave() {
if (res.code === 200) { if (res.code === 200) {
proxy.$modal.msgSuccess('签发成功'); proxy.$modal.msgSuccess('签发成功');
isSaving.value = false; isSaving.value = false;
// 乐观更新:立即将已签发医嘱的状态设为"已签发",确保列表实时刷新
saveList.forEach((item) => {
const row = prescriptionList.value.find((r) => r.requestId && r.requestId === item.requestId);
if (row) {
row.statusEnum = 2;
}
});
getListInfo(false); getListInfo(false);
bindMethod.value = {}; bindMethod.value = {};
nextId.value = 1; nextId.value = 1;