19 Commits

Author SHA1 Message Date
关羽
13731c2373 Fix Bug #475: 【住院医生工作站】开立检查申请单报错"请先配置当前时间段的执行科室"后,系统仍生成申请记录
将执行科室配置校验提前到数据库写入操作之前,避免校验失败时已写入RequestForm记录

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:24:08 +08:00
关羽
d63b00fd33 Fix Bug #481: [住院护士站-医嘱执行] 药品"注射用头孢哌酮钠舒巴坦钠"库存充足,但执行医嘱时提示库存不足
在 checkExeMedInventory 方法中,原代码使用 findFirst() 只取第一个批次的库存
进行校验,导致同一库房多个批次的库存总量未被聚合计算。改为 collect(Collectors.toList())
收集所有匹配批次,然后用 Stream reduce 聚合总可用库存后再与需求量比较。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:22:42 +08:00
赵云
c60cd6878e Fix Bug #413: 医生个人报卡管理核心缺陷:医生个人报卡编辑/查看界面与门诊医生站登记报卡界面设计不统一 2026-05-11 00:21:29 +08:00
赵云
cf50f8968a Fix Bug #478: 【住院医生工作站-检验申请】点击"详情"查看检验单时,"发往科室"字段回显异常(显示为"-")
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:09:19 +08:00
赵云
94fac8e257 Fix Bug #495: 【医嘱闭环】已校对医嘱无法流转至"医嘱执行"界面,导致费用无法提交执行
医嘱执行模块 prescriptionList.vue 中 try-catch 被注释掉,导致数据处理
异常时静默失败且 loading 状态无法重置,页面显示空数据无报错。
- 恢复 try-catch 错误处理,捕获 res.data.records 空值及数据处理异常
- 添加 .catch() 处理 API 接口级别失败,重置 loading 并清空列表
- 修复无患者时 loading 状态未重置的问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:02:18 +08:00
赵云
f162134156 Fix Bug #411: 智能分诊排队:底部操作控制区"过滤栏"功能实现与PRD需求不符(误设为科室过滤)
将底部过滤栏从"就诊科室快速过滤栏"改为"诊室快速过滤栏":
- UI文案:过滤栏标题、下拉框placeholder均改为诊室相关
- 数据源:移除 getLocationTree() 科室树API调用,改为从队列/候选池数据中动态提取诊室列表
- 过滤逻辑:改为按诊室名称(room字段)过滤,支持本科室下不同诊室快速切换
- 后端API调用不再依赖过滤栏选择,改用队列数据自身的organizationId

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 00:00:24 +08:00
关羽
d866d898df Fix Bug #506: 门诊挂号:门诊诊前退号后,数据库多表状态值变更与 PRD 定义不符
在 syncAppointmentReturnStatus 方法中:
1. 退号时同步将 order_main.pay_status 设为 0(未支付),修复退费后 pay_status 仍为 1 的问题
2. cancel_reason 固定使用标准化值"门诊退号",确保与 PRD 定义一致

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 23:58:40 +08:00
关羽
6725cef643 Fix Bug #477: 住院医生工作站-住院检查申请详情弹窗中"发往科室"字段显示为短横线(-),未正常获取数据
修复 examineApplication.vue 中 recursionFun 函数的空指针异常:
1. 增加 orgOptions.value 数组有效性校验,防止接口未返回数据时崩溃
2. 增加 obj.children 的 Array.isArray 检查,原代码直接访问 children.length 在 children 为 undefined 时抛 TypeError
3. 匹配成功后增加 break 提前退出循环
4. handleViewDetail 增加 targetDepartment 存在性检查,递归查找失败时回退显示原始 ID 值
2026-05-10 23:56:39 +08:00
赵云
7790a64eab Fix Bug #479: [住院护士站-三测单] 体征录入模块缺少"录入日期"字段,导致无法补录历史体征数据
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 23:53:18 +08:00
赵云
49fa1c9b90 Fix Bug #493: 【住院医生工作站-临床医嘱-检验申请】项目未维护执行科室时,医生手动选择发往科室后仍报错且数据被清空 2026-05-10 23:50:43 +08:00
关羽
e0a035204e Fix Bug #487: 【临床医嘱】诊疗类医嘱签发后,列表状态未实时刷新为"已签发"
诊疗类医嘱(handService)签发时仅依赖saveOrUpdate更新statusEnum,
但该方式对已有记录可能未正确将statusEnum更新为ACTIVE(2)。
修复:在handService方法末尾使用LambdaUpdateWrapper批量显式更新
所有已处理ServiceRequest的statusEnum为ACTIVE(签发)/DRAFT(保存),
与ServiceRequestServiceImpl中activeStatusEnum/updateDraftStatusBatch
等方法的实现模式保持一致。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 17:20:43 +08:00
关羽
349b0453c8 Fix Bug #480: [住院护士站-医嘱执行] 非耗材类医嘱执行报"耗材库存"错误且全选逻辑联动异常
1. 修复模板结构错误:删除premature的</template>和多余的</div>标签,确保el-table正确渲染
2. 新增selectedRowIds独立维护选中行ID集合,不再依赖el-table内部selection状态,避免执行选中时联动触发全选
3. 更新所有选择事件处理器同步维护selectedRowIds
4. 补充index.vue缺失的ref/nextTick/provide导入

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 17:14:00 +08:00
关羽
3ddd74d679 Fix Bug #494: 住院医生工作站-检查申请:"申请单名称"字段显示为通用名称,未展示具体检查项目名称
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 17:06:16 +08:00
关羽
9829843b3e Fix Bug #273: 门诊医生站-》医嘱TAB页面:修改用药天数字段的值,总量字段的值未自动通过公式换算
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 17:05:37 +08:00
关羽
0d95cc1341 Fix Bug #389: 住院护士站-》医嘱校对:界面筛选条件失效:勾选"临时"医嘱仍显示"长期"医嘱数据
前端therapyEnum参数在type.value为undefined时会被序列化为字符串"undefined"传递给后端,
导致后端无法正确解析而跳过过滤条件。修复为条件展开语法:仅在type.value有值时才传递therapyEnum参数,
确保"全部"筛选时不传该字段以获取全部医嘱。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:07:17 +08:00
关羽
1dfceeaf46 Fix Bug #389: 住院护士站-》医嘱校对:界面筛选条件失效:勾选"临时"医嘱仍显示"长期"医嘱数据
根因:therapyEnum 参数映射逻辑完全颠倒。
原代码:type.value === 1 ? undefined : type.value === 2 ? 1 : 2
- 选择"长期"(1)时传 undefined(不传,无过滤)
- 选择"临时"(2)时传 1(长期值)
- 选择"全部"时传 2(临时值)

修复:直接传 type.value,与后端 therapyEnum 枚举一致:
- undefined → 全部 / 1 → 长期 / 2 → 临时

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:06:21 +08:00
关羽
1b79df4f93 Fix Bug #488: 【临床医嘱】双击编辑待签发医嘱,医嘱类型回显为数字且点击确认报接口错误
- 修复 handleSaveSign 中 getBindDevice 调用时 itemNo 可能为 undefined 导致的后端报错 "Required request parameter 'itemNo' for method parameter type String is not present":增加 itemNo 空值检查,为空时 console.warn 跳过调用而非发送无效请求
- 移除模板中两处调试残留:console.log 表达式渲染到页面(类型列和频次/用法列)
- 修复签发失败处理中截断的 conso; 语法错误
2026-05-10 16:05:42 +08:00
关羽
f62a280dfc Fix Bug #390: 住院护士站-医嘱执行:通过住院号检索无法定位/筛选患者
原 handleSearch 调用 reloadAllPatients 仅尝试刷新已展开的病区节点,
对懒加载树不可靠。改为递增 treeKey 强制树组件完全重新渲染,
触发 loadNode/loadPatientList 重新从后端拉取数据并传入 searchKey 过滤。
2026-05-10 16:05:17 +08:00
关羽
e5d949a740 Fix Bug #486: [住院医生工作站-临床医嘱] 医嘱检索框不支持全局模糊搜索,未选"医嘱类型"时检索结果为空
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 16:02:35 +08:00
16 changed files with 232 additions and 195 deletions

View File

@@ -633,9 +633,9 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
Order updateOrder = new Order();
updateOrder.setId(appointmentOrder.getId());
updateOrder.setStatus(CommonConstants.AppointmentOrderStatus.RETURNED);
updateOrder.setPayStatus(0);
updateOrder.setCancelTime(now);
updateOrder.setCancelReason(
StringUtils.isNotEmpty(reason) ? reason : "门诊退号");
updateOrder.setCancelReason("门诊退号");
updateOrder.setUpdateTime(now);
orderService.updateById(updateOrder);
}

View File

@@ -178,22 +178,26 @@ public class AdviceUtils {
// 生命提示信息集合
List<String> tipsList = new ArrayList<>();
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
Optional<AdviceInventoryDto> matchedInventory = adviceInventory.stream()
// 聚合同一位置所有批次的库存总量
List<AdviceInventoryDto> matchedInventories = adviceInventory.stream()
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
&& medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId())
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
.findFirst();
.collect(Collectors.toList());
// 匹配到库存信息
if (matchedInventory.isPresent()) {
AdviceInventoryDto inventoryDto = matchedInventory.get();
if ((medicationRequestUseExe.getExecuteTimesNum()
.multiply(medicationRequestUseExe.getMinUnitQuantity()))
.compareTo(inventoryDto.getQuantity()) > 0) {
if (!matchedInventories.isEmpty()) {
// 聚合所有批次的可用库存
BigDecimal totalQuantity = matchedInventories.stream()
.map(dto -> dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO)
.reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal requestQuantity = medicationRequestUseExe.getExecuteTimesNum()
.multiply(medicationRequestUseExe.getMinUnitQuantity());
if (requestQuantity.compareTo(totalQuantity) > 0) {
tipsList
.add("" + medicationRequestUseExe.getBusNo() + "】在" + inventoryDto.getLocationName() + "库存不足");
.add("" + medicationRequestUseExe.getBusNo() + "】在" + matchedInventories.get(0).getLocationName() + "库存不足");
}
} else {
tipsList.add("" + medicationRequestUseExe.getBusNo() + "】未匹配到库存信息");

View File

@@ -511,6 +511,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
// 签发操作
boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType);
// 收集已处理的requestId用于批量更新状态
List<Long> processedRequestIds = new ArrayList<>();
// 声明长期医嘱诊疗请求
ServiceRequest longServiceRequest;
// 新增 + 修改 (长期医嘱)
@@ -555,6 +558,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
}
}
iServiceRequestService.saveOrUpdate(longServiceRequest);
if (longServiceRequest.getId() != null) {
processedRequestIds.add(longServiceRequest.getId());
}
}
// 声明临时医嘱诊疗请求
@@ -603,6 +609,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
}
}
iServiceRequestService.saveOrUpdate(tempServiceRequest);
if (tempServiceRequest.getId() != null) {
processedRequestIds.add(tempServiceRequest.getId());
}
// 保存时,保存诊疗费用项
if (is_save) {
@@ -654,6 +663,14 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
}
}
// 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新)
if (!processedRequestIds.isEmpty()) {
iServiceRequestService.update(null,
new LambdaUpdateWrapper<ServiceRequest>()
.set(ServiceRequest::getStatusEnum,
is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue())
.in(ServiceRequest::getId, processedRequestIds));
}
}
/**

View File

@@ -95,6 +95,13 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_PSYCHOTROPIC_NO.getPrefix(), 8);
}
// 诊疗执行科室配置校验(必须在数据库操作之前执行)
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
if (activityOrganizationConfig.isEmpty()) {
throw new ServiceException("请先配置当前时间段的执行科室");
}
// 当前时间
Date curDate = new Date();
// 请求类型
@@ -139,12 +146,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
// 诊疗集合
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
log.info("保存申请单typeCode={}, activityListSize={}, encounterId={}", typeCode, activityList != null ? activityList.size() : 0, encounterId);
// 诊疗执行科室配置
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
if (activityOrganizationConfig.isEmpty()) {
throw new ServiceException("请先配置当前时间段的执行科室");
}
for (ActivitySaveDto activitySaveDto : activityList) {
serviceRequest = new ServiceRequest();

View File

@@ -41,43 +41,7 @@
</el-col>
</el-row>
<!-- 性别出生日期实足年龄 -->
<el-row :gutter="16" class="form-row align-bottom">
<el-col :span="6" class="form-item">
<span class="form-label required">性别</span>
<el-radio-group v-model="form.sex">
<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 birth-date">
<span class="form-label required">出生日期</span>
<div class="date-inputs">
<el-input v-model="form.birthYear" class="underline-input small" maxlength="4" @change="calculateAge" />
<span></span>
<el-input v-model="form.birthMonth" class="underline-input small" maxlength="2" @change="calculateAge" />
<span></span>
<el-input v-model="form.birthDay" class="underline-input small" maxlength="2" @change="calculateAge" />
<span></span>
</div>
</el-col>
<el-col :span="8" class="form-item age-item">
<span class="form-label"> 实足年龄</span>
<div class="age-inputs">
<el-input v-model="form.age" class="underline-input small"/>
<el-select v-model="form.ageUnit" class="age-unit-select">
<el-option label="岁" value="岁" />
<el-option label="月" value="月" />
<el-option label="天" value="天" />
</el-select>
</div>
</el-col>
</el-row>
<!-- 工作单位 -->
<el-row :gutter="16" class="form-row">
<el-col :span="24" class="form-item full-width">
<span class="form-label">工作单位学校</span>
<el-input v-model="form.workplace" class="underline-input" />
</el-col>

View File

@@ -313,6 +313,7 @@
data-prop="dispensePerDuration">
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
@change="calculateTotalAmount(scope.row, scope.$index)"
@keyup.enter.prevent="
handleEnter('dispensePerDuration', scope.row, scope.$index)
">

View File

@@ -86,7 +86,11 @@
</template>
<el-table-column type="index" label="序号" width="60" align="center" />
<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>{{ getItemName(scope.row) }}</span>
</template>
</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" />
@@ -159,7 +163,7 @@
currentDetail.patientName || '-'
}}</el-descriptions-item>
<el-descriptions-item label="申请单名称">{{
currentDetail.name || '-'
getItemName(currentDetail)
}}</el-descriptions-item>
<el-descriptions-item label="申请单状态">{{
parseStatus(currentDetail.status)
@@ -399,6 +403,28 @@ const parseStatus = (status) => {
return statusMap[String(status)] || '-';
};
/**
* 获取申请单展示名称:优先使用具体医嘱名称列表
*/
const getItemName = (row) => {
const items = row?.requestFormDetailList;
if (items && items.length > 0) {
return items.map(item => item.adviceName).filter(Boolean).join('、') || row.name || '-';
}
return row.name || '-';
};
/**
* 构建打印用项目名称字符串(同步函数,用于模板字符串)
*/
const buildItemNames = (row) => {
const items = row?.requestFormDetailList;
if (items && items.length > 0) {
return items.map(item => item.adviceName).filter(Boolean).join('、') || row.name || '';
}
return row.name || '';
};
const labelMap = {
categoryType: '项目类别',
targetDepartment: '发往科室',
@@ -431,20 +457,27 @@ const getLocationInfo = () => {
};
const recursionFun = (targetDepartment) => {
if (!targetDepartment) return '';
if (!Array.isArray(orgOptions.value) || orgOptions.value.length === 0) return '';
let name = '';
for (let index = 0; index < orgOptions.value.length; index++) {
const obj = orgOptions.value[index];
if (obj.id == targetDepartment) {
name = obj.name;
break;
}
const subObjArray = obj['children'];
for (let index = 0; index < subObjArray.length; index++) {
const item = subObjArray[index];
if (Array.isArray(subObjArray)) {
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;
};
@@ -456,7 +489,10 @@ const handleViewDetail = (row) => {
if (row.descJson) {
try {
const obj = JSON.parse(row.descJson);
obj.targetDepartment = recursionFun(obj.targetDepartment);
if (obj.targetDepartment) {
const deptName = recursionFun(obj.targetDepartment);
obj.targetDepartment = deptName || obj.targetDepartment;
}
descJsonData.value = obj;
} catch (e) {
console.error('解析 descJson 失败:', e);
@@ -651,7 +687,7 @@ const buildPrintContent = (row) => {
return `
<h2>检查申请单</h2>
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</div>
<div class="info-row"><span class="label">申请单名称:</span>${row.name || '-'}</div>
<div class="info-row"><span class="label">申请单名称:</span>${buildItemNames(row) || '-'}</div>
<div class="info-row"><span class="label">创建时间:</span>${row.createTime || '-'}</div>
<div class="info-row"><span class="label">处方号:</span>${row.prescriptionNo || '-'}</div>
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>

View File

@@ -173,7 +173,7 @@ import {computed, getCurrentInstance, ref, watch} from 'vue';
import {Refresh, Search} from '@element-plus/icons-vue';
import {patientInfo} from '../../store/patient.js';
import {getInspection} from './api';
import {getOrgList} from '@/views/doctorstation/components/api.js';
import {getDepartmentList} from '@/api/public.js';
const { proxy } = getCurrentInstance();
@@ -332,8 +332,8 @@ const hasMatchedFields = computed(() => {
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data.records;
getDepartmentList().then((res) => {
orgOptions.value = res.data || [];
});
};
@@ -345,13 +345,15 @@ const recursionFun = (targetDepartment) => {
name = obj.name;
}
const subObjArray = obj['children'];
for (let index = 0; index < subObjArray.length; index++) {
const item = subObjArray[index];
if (subObjArray && subObjArray.length > 0) {
for (let i = 0; i < subObjArray.length; i++) {
const item = subObjArray[i];
if (item.id == targetDepartment) {
name = item.name;
}
}
}
}
return name;
};

View File

@@ -122,7 +122,6 @@
<el-table-column label="类型" align="center" prop="" width="120">
<template #default="scope">
{{ console.log(scope.row, 1111) }}
<el-radio-group
v-model="scope.row.therapyEnum"
size="small"
@@ -270,7 +269,6 @@
</el-table-column>
<el-table-column label="频次/用法" align="center" prop="" width="180">
<template #default="scope">
{{ console.log(scope.row) }}
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
{{
[
@@ -1212,12 +1210,8 @@ function handleSave() {
getListInfo(false);
bindMethod.value = {};
nextId.value == 1;
// 处方保存成功后,自动将医嘱信息同步至患者处置记录
// handleEmrTreatment();
} else {
proxy.$modal.msgError(res.message);
conso;
isSaving.value = false;
}
})
@@ -1317,6 +1311,9 @@ function handleCancelEdit(row, index) {
function handleSaveSign(row, index) {
if (row.adviceType != 2) {
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
if (!itemNo) {
console.warn('绑定设备检查跳过itemNo为空adviceType=' + row.adviceType + ', adviceName=' + row.adviceName + '');
} else {
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
if (res.data.length == 0) {
return;
@@ -1334,6 +1331,7 @@ function handleSaveSign(row, index) {
}
});
}
}
// 更新UI状态
row.isEdit = false;

View File

@@ -16,14 +16,12 @@
<Advice ref="adviceRef" />
</el-tab-pane>
<!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> -->
<el-tab-pane label="检验申请" name="test">
<TestApplication ref="testApplicationRef" :show-status-column="true" />
<el-tab-pane label="检验申请" name="test">
<TestApplication ref="testApplicationRef" :show-status-column="false" />
</el-tab-pane>
```vue
<el-tab-pane label="检查申请" name="examine">
<ExamineApplication ref="examineApplicationRef" />
</el-tab-pane>
```
<el-tab-pane label="汇总发药申请" name="summaryDrug">
<SummaryDrugApplication ref="summaryDrugApplicationRef" />
</el-tab-pane>
@@ -48,6 +46,10 @@
<script setup>
import {computed, onBeforeMount, onMounted, provide, reactive, ref, watch,} from 'vue';
import Emr from './emr/index.vue';
import inPatientBarDoctorFold from '@/component
```
import Emr from './emr/index.vue';
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
import PatientList from '@/components/PatientList/patient-list.vue';

View File

@@ -273,8 +273,9 @@ function handleSearch() {
// 清除缓存(搜索时需要重新加载)
patientDataCache.value.clear();
// 重新加载所有已展开病区患者列表
reloadAllPatients();
// 通过递增 key 强制重新渲染树组件,触发重新加载所有病区患者列表
// 此时 searchKey 已有值,loadPatientList 会将 searchKey 传给后端进行过滤
treeKey.value += 1;
}
// 暴露方法供外部调用

View File

@@ -68,8 +68,6 @@
</div>
</div>
</div>
</template>
</div>
<div
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
v-loading="loading"
@@ -232,7 +230,7 @@ import {adviceCancel, adviceExecute, adviceNoExecute, getPrescriptionList} from
import {patientInfoList} from '../../components/store/patient.js';
import {lotNumberMatch} from '@/api/public';
import {formatDateStr} from '@/utils/index';
import {getCurrentInstance, nextTick, ref} from 'vue';
import {getCurrentInstance, nextTick, ref, provide} from 'vue';
const activeNames = ref([]);
const prescriptionList = ref([]);
@@ -242,6 +240,8 @@ const therapyEnum = ref(undefined);
const { proxy } = getCurrentInstance();
const loading = ref(false);
const chooseAll = ref(false);
// 独立维护选中行ID集合避免el-table内部selection状态异常导致联动全选
const selectedRowIds = ref(new Set());
const props = defineProps({
exeStatus: {
type: Number,
@@ -283,9 +283,10 @@ function handleGetPrescription() {
exeStatus: props.exeStatus,
requestStatus: props.requestStatus,
}).then((res) => {
// try {
try {
const records = res?.data?.records || [];
// 根据encounterId分组
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => {
const groupedPrescriptions = records.reduce((groups, prescription) => {
// 获取当前医嘱全部执行频次
let rate;
let times;
@@ -430,18 +431,26 @@ function handleGetPrescription() {
// 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions);
loading.value = false;
// 默认选中全部行
nextTick(() => {
defaultSelectAllRows();
});
// } catch {
// loading.value = false;
// }
} catch (error) {
console.error('医嘱执行-获取处方列表数据处理失败:', error);
prescriptionList.value = [];
} finally {
loading.value = false;
}
}).catch((error) => {
console.error('医嘱执行-获取处方列表接口失败:', error);
prescriptionList.value = [];
loading.value = false;
});
chooseAll.value = false;
} else {
prescriptionList.value = [];
selectedRowIds.value.clear();
loading.value = false;
// proxy.$message.warning('请选择患者');
}
}
@@ -530,10 +539,14 @@ function handleCancel() {
}
function getSelectRows() {
// 获取选中的医嘱信息
let list = [];
prescriptionList.value.forEach((item, index) => {
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
// 优先从独立维护的selectedRowIds集合中获取选中行避免el-table内部selection状态异常
const list = [];
prescriptionList.value.forEach((item) => {
item.forEach((row) => {
if (selectedRowIds.value.has(row.requestId)) {
list.push(row);
}
});
});
return list;
}
@@ -609,12 +622,14 @@ function handelSwicthChange(value) {
if (value) {
// 全选选中所有行并联动checkbox
item.forEach((row) => {
selectedRowIds.value.add(row.requestId);
tableRef[0].toggleRowSelection(row, true);
selectAllCheckboxesInRow(row);
});
} else {
// 取消全选取消选中所有行并联动checkbox
item.forEach((row) => {
selectedRowIds.value.delete(row.requestId);
tableRef[0].toggleRowSelection(row, false);
unselectAllCheckboxesInRow(row);
});
@@ -625,11 +640,14 @@ function handelSwicthChange(value) {
// 默认选中全部行
function defaultSelectAllRows() {
// 清空并重建选中集合
selectedRowIds.value.clear();
prescriptionList.value.forEach((item, index) => {
const tableRef = proxy.$refs['tableRef' + index];
if (tableRef && tableRef[0]) {
// 选中该表格的所有行
item.forEach((row) => {
selectedRowIds.value.add(row.requestId);
tableRef[0].toggleRowSelection(row, true);
// 同时选中该行内部的所有checkbox
selectAllCheckboxesInRow(row);
@@ -709,13 +727,14 @@ function checkAndToggleRowSelection(row) {
const tableRef = proxy.$refs['tableRef' + tableIndex];
if (tableRef && tableRef[0]) {
const isAllSelected = isAllCheckboxesSelected(row);
const selectedRows = tableRef[0].getSelectionRows();
const isCurrentlySelected = selectedRows.some((r) => r.requestId === row.requestId);
const isCurrentlySelected = selectedRowIds.value.has(row.requestId);
// 根据checkbox状态更新表格行选中状态
if (isAllSelected && !isCurrentlySelected) {
selectedRowIds.value.add(row.requestId);
tableRef[0].toggleRowSelection(row, true);
} else if (!isAllSelected && isCurrentlySelected) {
selectedRowIds.value.delete(row.requestId);
tableRef[0].toggleRowSelection(row, false);
}
}
@@ -728,9 +747,11 @@ function handleRowSelect(selection, row, tableIndex) {
const isSelected = selection.some((item) => item.requestId === row.requestId);
if (isSelected) {
selectedRowIds.value.add(row.requestId);
// 选中行时选中该行内部的所有checkbox
selectAllCheckboxesInRow(row);
} else {
selectedRowIds.value.delete(row.requestId);
// 取消选中行时取消选中该行内部的所有checkbox
unselectAllCheckboxesInRow(row);
}
@@ -747,11 +768,13 @@ function handleSelectAll(selection, tableIndex) {
if (selection.length > 0) {
// 全选时选中所有行内部的所有checkbox
tableData.forEach((row) => {
selectedRowIds.value.add(row.requestId);
selectAllCheckboxesInRow(row);
});
} else {
// 取消全选时取消选中所有行内部的所有checkbox
tableData.forEach((row) => {
selectedRowIds.value.delete(row.requestId);
unselectAllCheckboxesInRow(row);
});
}
@@ -763,17 +786,13 @@ function handleSelectAll(selection, tableIndex) {
// 更新全选开关状态
function updateChooseAllStatus() {
let allSelected = true;
prescriptionList.value.forEach((item, index) => {
const tableRef = proxy.$refs['tableRef' + index];
if (tableRef && tableRef[0]) {
const selectedRows = tableRef[0].getSelectionRows();
if (selectedRows.length !== item.length) {
allSelected = false;
}
} else {
prescriptionList.value.forEach((item) => {
item.forEach((row) => {
if (!selectedRowIds.value.has(row.requestId)) {
allSelected = false;
}
});
});
chooseAll.value = allSelected;
}

View File

@@ -51,7 +51,7 @@
</template>
<script setup>
import {getCurrentInstance} from 'vue';
import {getCurrentInstance, ref, nextTick, provide} from 'vue';
import PatientList from '../components/patientList.vue';
import PrescriptionList from './components/prescriptionList.vue';
import { RequestStatus } from '@/utils/medicalConstants';

View File

@@ -181,7 +181,7 @@ function handleGetPrescription() {
getPrescriptionList({
encounterIds: encounterIds,
requestStatus: props.requestStatus,
therapyEnum: type.value === 1 ? undefined : type.value === 2 ? 1 : 2, // 1=全部(不传), 2=长期(1), 3=临时(2)
...(type.value !== undefined ? { therapyEnum: type.value } : {}),
pageSize: 10000,
pageNo: 1,
}).then((res) => {

View File

@@ -112,6 +112,19 @@
<el-form ref="dynamicForm" :model="formData" label-width="100px" :rules="formRules">
<div class="page-bottom">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item style="margin-top: 15px" label="录入日期">
<el-date-picker
v-model="formData.recordingDate"
type="date"
placeholder="请选择日期"
size="small"
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-top: 15px" label="录入时间">
<div class="input-time-inline">
@@ -766,6 +779,7 @@ const receptionTime = ref(null);
// 表单数据 - 体征录入
const formData = ref({
recordingDate: '',
timePoint: '',
temperature: '',
systolicPressure: '',
@@ -872,6 +886,7 @@ function getPatientDetial() {
// 默认查询今天的数据
const today = moment().format('YYYY-MM-DD');
receptionTime.value = [today, today];
formData.value.recordingDate = today;
// 自动加载数据
getPatientList();
listPatient(queryParams.value).then((res) => {
@@ -920,6 +935,7 @@ function handleRowClick(row) {
formData.value = {
...formData.value,
id: row.id,
recordingDate: row.recordingDate || '',
timePoint: convertTimePoint(row.timePoint) || '',
temperature: row.temperature || '',
systolicPressure: row.systolicPressure || '',
@@ -1038,7 +1054,7 @@ function confirmCharge() {
params.vitalSignsCode = vitalSignsCode;
params.vitalSignsValues = vitalSignsValues;
params.recordingDate = moment(new Date()).format('YYYY-MM-DD');
params.recordingDate = formData.value.recordingDate || moment(new Date()).format('YYYY-MM-DD');
addVitalSigns(params).then(res => {
console.log('保存成功:', res);
@@ -1047,6 +1063,7 @@ function confirmCharge() {
getPatientList();
// 清空表单
formData.value = {
recordingDate: '',
timePoint: '',
temperature: '',
systolicPressure: '',

View File

@@ -220,15 +220,15 @@
<!-- 底部控制面板 -->
<div class="footer-section">
<!-- 就诊科室快速过滤栏 -->
<!-- 室快速过滤栏 -->
<div class="filter-section">
<div class="filter-label">
就诊科室快速过滤栏
室快速过滤栏
</div>
<div class="filter-select-wrapper">
<el-select
v-model="selectedDept"
placeholder="请选择就诊科室"
v-model="selectedClinicRoom"
placeholder="请选择室"
clearable
filterable
style="width: 100%"
@@ -239,10 +239,10 @@
value="all"
/>
<el-option
v-for="dept in departmentList"
:key="dept.id"
:label="dept.name"
:value="dept.id"
v-for="room in clinicRoomList"
:key="room"
:label="room"
:value="room"
/>
</el-select>
</div>
@@ -648,7 +648,6 @@ import { Refresh } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import {
getCandidatePool,
getLocationTree,
getTriageQueueList,
addToQueue,
removeFromQueue,
@@ -681,10 +680,10 @@ const selectedCandidates = ref([])
// 显示选项
const showOnlyWaiting = ref(false)
// 室过滤(改为使用就诊科室
const selectedDept = ref('all')
// 就诊科室列表
const departmentList = ref([])
// 室过滤(按诊室维度筛选
const selectedClinicRoom = ref('all')
// 诊室列表(从数据中动态提取)
const clinicRoomList = ref([])
// 修复【#397】动态获取当前科室名称
const currentDeptName = computed(() => {
@@ -907,13 +906,11 @@ const mapFrontendStatusToBackend = (status) => {
// 从数据库加载队列
const loadQueueFromDb = async () => {
try {
// 如果选择了具体科室,就按科室加载;否则加载当前登录人科室(后端默认)
const organizationId = selectedDept.value !== 'all' ? selectedDept.value : undefined
// 只查询今天的患者
// 使用当前登录人科室
const today = new Date()
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`
console.log('【心内科】loadQueueFromDb 开始:organizationId=', organizationId, 'date=', todayStr, 'selectedDept=', selectedDept.value)
const res = await getTriageQueueList({ organizationId, date: todayStr }).catch((err) => {
console.log('【心内科】loadQueueFromDb 开始:date=', todayStr)
const res = await getTriageQueueList({ date: todayStr }).catch((err) => {
console.error('【心内科】loadQueueFromDb 请求异常:', err)
return { code: 500, msg: err?.message || '请求失败', data: null }
})
@@ -1141,6 +1138,8 @@ const loadDataFromApi = async () => {
// 同步当前呼叫(队列从 DB 加载后已同步;这里再兜底一次)
syncCurrentCallFromQueue()
// 提取诊室列表供过滤栏使用
extractClinicRooms()
console.log('【心内科】数据加载完成:候选池', originalCandidatePoolList.value.length, '条,队列', originalQueueList.value.length, '条')
ElMessage.success('【心内科】已从门诊挂号接口加载数据')
} catch (e) {
@@ -1152,56 +1151,37 @@ const loadDataFromApi = async () => {
totalSignedIn.value = originalCandidatePoolList.value.length
totalInQueue.value = originalQueueList.value.length
syncCurrentCallFromQueue()
extractClinicRooms()
}
}
// 原始数据存储(用于过滤)
const originalCandidatePoolList = ref(getInitialCandidatePoolList())
// 辅助函数:扁平化科室树形结构
const flattenDepartmentTree = (tree, result = []) => {
if (!Array.isArray(tree)) return result
tree.forEach(node => {
if (node.id && node.name) {
result.push({ id: node.id, name: node.name })
}
if (node.children && Array.isArray(node.children)) {
flattenDepartmentTree(node.children, result)
// 提取诊室列表(从队列和候选池数据中动态获取)
const extractClinicRooms = () => {
const roomSet = new Set()
// 从队列中提取
originalQueueList.value.forEach(item => {
if (item.room && item.room !== '-') {
roomSet.add(item.room)
}
})
return result
}
// 加载就诊科室列表
const loadDepartmentList = async () => {
try {
const response = await getLocationTree()
if (response && response.data) {
// 扁平化树形结构
departmentList.value = flattenDepartmentTree(response.data)
console.log('【心内科】已加载就诊科室列表:', departmentList.value.length, '个科室')
// 从候选池中提取
originalCandidatePoolList.value.forEach(item => {
if (item.room && item.room !== '-') {
roomSet.add(item.room)
}
} catch (error) {
console.error('【心内科】加载就诊科室列表失败:', error)
ElMessage.warning('加载就诊科室列表失败,使用默认数据')
}
}
// 获取选中科室的名称
const getSelectedDeptName = () => {
if (selectedDept.value === 'all') return null
const dept = departmentList.value.find(d => d.id === selectedDept.value)
return dept ? dept.name : null
})
clinicRoomList.value = Array.from(roomSet).sort()
}
// 过滤后的智能候选池数据
const filteredCandidatePoolList = computed(() => {
if (selectedDept.value === 'all') {
if (selectedClinicRoom.value === 'all') {
return originalCandidatePoolList.value
}
const deptName = getSelectedDeptName()
if (!deptName) return originalCandidatePoolList.value
return originalCandidatePoolList.value.filter(item => item.room === deptName)
return originalCandidatePoolList.value.filter(item => item.room === selectedClinicRoom.value)
})
// 原始队列数据存储(用于过滤)
@@ -1223,19 +1203,16 @@ const formatSecondsToMmSs = (totalSeconds) => {
return `${mm}:${ss}`
}
// 过滤后的智能队列数据(同时考虑室过滤和状态过滤)
// 过滤后的智能队列数据(同时考虑室过滤和状态过滤)
const filteredQueueList = computed(() => {
let filtered = originalQueueList.value
// 先过滤掉"已完成"状态的患者(无论什么情况都不显示)
filtered = filtered.filter(item => item.status !== '已完成')
// 再按室过滤
if (selectedDept.value !== 'all') {
const deptName = getSelectedDeptName()
if (deptName) {
filtered = filtered.filter(item => item.room === deptName)
}
// 再按室过滤
if (selectedClinicRoom.value !== 'all') {
filtered = filtered.filter(item => item.room === selectedClinicRoom.value)
}
// 再按状态过滤(只显示等待)
@@ -1747,9 +1724,9 @@ const handleNextPatient = async () => {
reqData.organizationId = selectedQueueRow.value.organizationId
} else {
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
// "全科"模式:优先用"当前叫号中/第一个等待"所在科室
if (orgId == null) {
// 全科模式:优先用"当前叫号中/第一个等待"所在科室
let orgId = null
{
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
const waiting = originalQueueList.value.find((i) => i.status === '等待')
console.log('【心内科】handleNextPatient 查找:叫号中=', calling?.patientName, '等待=', waiting?.patientName)
@@ -1785,9 +1762,9 @@ const handleSkip = async () => {
reqData.organizationId = selectedQueueRow.value.organizationId
} else {
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
// “全科”模式:优先用“当前叫号中”所在科室
if (orgId == null) {
// 全科模式:优先用”当前叫号中”所在科室
let orgId = null
{
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
orgId = calling?.organizationId
}
@@ -1819,9 +1796,9 @@ const handleComplete = async () => {
reqData.organizationId = selectedQueueRow.value.organizationId
} else {
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
// “全科”模式:优先用“当前叫号中”所在科室
if (orgId == null) {
// 全科模式:优先用”当前叫号中”所在科室
let orgId = null
{
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
orgId = calling?.organizationId
}
@@ -1853,9 +1830,9 @@ const handleRequeue = async () => {
reqData.organizationId = selectedQueueRow.value.organizationId
} else {
// 如果没有选中患者,使用查询条件(兼容旧逻辑)
let orgId = selectedDept.value !== 'all' ? selectedDept.value : undefined
// “全科”模式:优先用“当前叫号中”所在科室
if (orgId == null) {
// 全科模式:优先用”当前叫号中”所在科室
let orgId = null
{
const calling = originalQueueList.value.find((i) => i.status === '叫号中')
orgId = calling?.organizationId
}
@@ -2121,8 +2098,6 @@ const handleTestRule = () => {
// 组件挂载
onMounted(() => {
// 加载就诊科室列表
loadDepartmentList()
// 初始化:优先从后端加载,失败则回退本地假数据
loadDataFromApi()
startWaitingTimer()