42 Commits

Author SHA1 Message Date
赵云
d61373593e Fix Bug #453: 住院医生站-临床医嘱:开立医嘱时输入"级护理"检索结果显示"暂无数据"
根因:新行未选医嘱类型时,adviceType为undefined,handleFocus回退为默认值1(药品)
并携带categoryCode='2'(西药),导致searchKey为空时仅搜索西药库,护理项目被过滤

修复:refresh函数新增adviceType为空时的跨类型搜索分支,同时清空categoryCode
避免按药品分类过滤导致诊疗类护理项目被排除

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 14:08:53 +08:00
赵云
d2699f5cdd Fix Bug #480: [住院护士站-医嘱执行] 非耗材类医嘱执行报"耗材库存"错误且全选逻辑联动异常
根因分析:
1. 非耗材类医嘱执行报"耗材库存"错误: handleExecute 中无条件调用 lotNumberMatch,
   后端会校验该就诊下所有待发放耗材库存,即使当前执行的是口服药等非耗材类医嘱
2. 全选联动异常: msgSuccess 在 handleGetPrescription 之前执行,数据刷新后
   defaultSelectAllRows 重新选中所有行,用户关闭弹窗后看到全选效果

修复方案:
1. 增加医嘱类型判断,仅当选中医嘱包含药品(med_medication_request)或耗材(device)
   类型时才调用 lotNumberMatch
2. 调整执行顺序:先刷新数据再显示成功弹窗,避免用户看到数据刷新的副作用

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 14:06:20 +08:00
赵云
7deba511d4 Fix Bug #494: 住院医生工作站-检查申请:"申请单名称"字段显示为通用名称,未展示具体检查项目名称
根因:保存检查申请时,name 字段硬编码为"检查申请单",导致列表中无法展示具体检查项目名称。
修复:在保存时从选中的检查项目中动态提取名称(使用 adviceName 字段,以"、"分隔拼接),
      当无具体名称时仍使用"检查申请单"作为兜底。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:50:00 +08:00
赵云
3fed829cc8 Fix Bug #466: [住院医生工作站-检验申请] 申请单界面缺失核心质控字段(申请类型、标本类型、执行时间)及联动逻辑
根因分析:前端表单已包含申请类型、标本类型、执行时间三个字段,但缺少标本类型联动逻辑。
当医生选择检验项目时,系统应根据所选项目的 sampleType 自动带出标本类型,而非始终显示硬编码默认值"血液"。

修复内容:
- 在 selectedInspectionItems watch 中新增标本类型自动带出逻辑:当标本类型为空或仍为初始化默认值"血液"时,根据第一个检验项目的 sampleType 自动设置
- 当检验项目被清空时,同时清空标本类型(下次选择时会重新自动设置)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:49:50 +08:00
赵云
5cbaee98f7 Fix Bug #497: 【住院医生工作站-检查申请】检查申请列表缺失"申请单状态"列及全流程闭环状态流转逻辑
根因:get-check 接口只接收 encounterId 参数,忽略前端传递的 startDate/endDate/status 筛选参数,
导致日期筛选和状态筛选全部失效。同类型的 get-inspection 接口已正确支持这些参数。
修复:在 controller 的 get-check 方法增加 startDate、endDate、status 三个 @RequestParam,
调用 5 参数重载的 service 方法,使筛选参数正确传递到 SQL 层。
前端 examineApplication.vue 已包含状态列、parseStatus 映射、状态筛选下拉框,无需修改。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:48:35 +08:00
赵云
d4da94c400 Fix Bug #493: 【住院医生工作站-临床医嘱-检验申请】项目未维护执行科室时,医生手动选择发往科室后仍报错且数据被清空
根因:projectWithDepartment() 在提交时会清空用户手动选择的发往科室,
且项目未配置执行科室时 findTreeItem 返回 null 导致校验失败。
同时 submit() 使用 item.positionId(可能为 undefined)作为执行科室。

修复:
1. 清空科室前保存用户手动选择的值(manualDept)
2. type=2(提交)且 findItem 不存在时,若用户已手动选择科室则恢复并允许通过
3. positionId 兜底使用 form.targetDepartment

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:48:13 +08:00
赵云
3103c619f2 Fix Bug #444: 【手术管理-门诊手术安排】生成临时医嘱界面,"已引用计费药品"列表未正常显示药品详细名称信息
根因:后端 getRequestBaseInfo 接口通过 SQL UNION ALL 返回三类数据(药品adviceType=1、耗材adviceType=2、项目adviceType=3),
前端 handleMedicalAdvice 和 handleQuoteBilling 两处过滤逻辑均未按 adviceType 筛选,导致手术诊疗项目(如"小腿烧伤扩创交腿皮瓣修复术")
和检查项目(如"心脏彩色多普勒超声")混入"已引用计费药品"列表。

修复:在两个函数的 filter 条件中增加 adviceType === 1 的判断,仅保留药品类数据。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 13:46:54 +08:00
赵云
f9ab4c5688 Fix Bug #508: [住院护士站-住院记账-补费] 点击"划价组套"按钮无任何响应,无法选择组套项目
修复三个问题:
1. 后端DTO字段名为Name(大写)而前端模板引用name(小写),导致组套名称显示为空,使用name || Name兼容
2. 后端未返回rangeCode_dictText字段,新增getRangeText()函数根据当前选中范围标签动态显示
3. 前端向/group-package-for-order接口发送searchKey参数但后端不支持,移除该多余参数
2026-05-11 12:06:55 +08:00
赵云
861129c9d4 Fix Bug #507: [住院护士站-住院记账-补费] 项目单位未获取、执行科室显示内码且缺乏默认/模糊搜索逻辑
1. 修复单位字段默认为空:selectChange中增加defaultUnitCode逻辑,优先取minUnitCode,回退到unitCode
2. 修复执行科室显示内码:统一positionId和el-option value为字符串类型,避免类型不匹配导致el-select无法匹配选项
3. 科室匹配增加String类型转换:find时用String(d.id)===String(patientOrgId)避免因类型不同找不到匹配科室
4. loadDepartmentOptions和getDiseaseInitLoc增加.catch优雅降级,避免API失败时页面阻断

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 12:04:36 +08:00
赵云
78a2dfa3fe Fix Bug #501: 【住院护士站-医嘱执行】医嘱执行页面点击"取消执行"报错
根因分析:handleCancel 函数从 exePerformRecordList 提取 procedureId 时,
未过滤 null/空值,导致无效 procedureId 被发送到后端,引发 SQL 异常。
同时 therapyEnum 可能存在类型不一致问题。

修复内容:
1. 提取 procedureId 后增加 filter 过滤空值
2. 构建请求参数时再次过滤,确保不发无效 procedureId
3. therapyEnum 显式转为 Number 类型确保后端正确匹配过滤
4. producerIds 为空时增加用户提示
5. 增加 .catch 错误处理避免未捕获的 Promise rejection
2026-05-11 11:35:19 +08:00
赵云
98e5a0b984 Fix Bug #509: [门诊医生站-手术申请] 提交申请后列表未实时刷新展示数据,且提示语需优化
1. 修复列表不显示问题:SurgeryMapper.xml 中 sr.id IS NULL 条件导致已生成医嘱的手术被过滤,
   提交手术时 addSurgery() 会创建 category_enum=4 的 ServiceRequest,导致查询立即被排除。
   移除 sr.id IS NULL 过滤条件,使手术申请列表正常展示所有手术记录。

2. 修复提示语问题:将后端 addSurgery 返回消息从"手术信息添加成功"改为"手术申请提交成功!",
   updateSurgery 改为"手术申请修改成功!",前端直接使用后端返回消息。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 11:24:06 +08:00
e5c944069b bug 273 门诊医生站-》医嘱TAB页面:修改用药天数字段的值,总量字段的值未自动通过公式换算 补充:修改单词用量和用药频次时也自动换算总量字段 2026-05-11 11:11:30 +08:00
a68ffbfec4 去除多余的字符,修复语法问题 2026-05-11 10:00:15 +08:00
14f8a8b0a3 import 去掉多余逗号并略作格式整理 2026-05-11 09:53:02 +08:00
0f1e57227b 修复标签语法错误 2026-05-11 09:44:08 +08:00
赵云
98a370f3a2 fix: 修复 surgeryApplication.vue 多余的 </template> 标签 2026-05-11 09:31:02 +08:00
b2ce368749 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue
2026-05-11 09:25:32 +08:00
c691f82958 feat(diagnosis): 添加传染病报告对话框中的工作单位字段
- 在传染病报告对话框中新增工作单位输入框
- 添加了相应的工作单位表单项布局结构
- 集成了工作单位数据绑定功能
2026-05-11 09:24:59 +08:00
赵云
d2bfde7230 fix: 修复 Bug #412 引入的 Vue template 语法错误(缺少 el-row/el-col 标签) 2026-05-11 09:18:13 +08:00
赵云
62a09a8b94 Fix Bug #412: 门诊医生站:传染病报告卡保存失败,提示报错
根因:infectiousDiseaseReportDialog.vue 的 show() 函数将 cardNo 初始化为空字符串,
而后端 DTO 的 cardNo 字段有 @NotBlank 校验,导致保存时后端拒绝请求。
同仓库的 infectiousReport/index.vue 已有此修复(调用 getNextCardNo API),
但诊断流程使用的 infectiousDiseaseReportDialog.vue 漏掉了此修复。

修复:在 show() 函数中调用 getNextCardNo API 获取卡片编号,
API 失败时降级为 TEMP_ 前缀的临时卡号,与 infectiousReport/index.vue 保持一致。
2026-05-11 09:03:38 +08:00
关羽
10b2c58a3e Fix Bug #476: 住院医生工作-检查申请单界面缺失核心临床字段(紧急程度、过敏史、检查目的等)
在检查申请单开立界面新增5个核心临床字段(依次放在发往科室之后):
1. 紧急程度:el-select下拉选择(普通/急诊),区分急诊和普通检查
2. 过敏史:textarea输入,提示造影剂过敏风险
3. 检查目的:textarea输入,让执行科室医生了解临床背景
4. 病史摘要:textarea输入,补充患者病史信息
5. 期望检查时间:datetime选择器,实现精准调度

同步更新:
- medicalExaminations.vue: 表单模板 + form reactive对象新增字段
- examineApplication.vue: labelMap映射 + 详情弹窗紧急程度转换 + 修改弹窗新增字段 + 编辑/保存逻辑覆盖新字段
2026-05-11 08:45:13 +08:00
赵云
abc995523b Fix Bug #492: 【门诊手术安排】关闭"手术计费"主弹窗后,项目字典选择列表依然残留悬浮在界面上
在 prescriptionlist 组件中新增 closeAllPopovers 方法,关闭手术计费弹窗时
先关闭所有行悬浮的项目字典下拉弹窗,避免主弹窗关闭后残留

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 08:45:05 +08:00
赵云
c0438c0288 Fix Bug #496: 【住院医生工作站-检查申请】检查申请列表字段命名不规范及单号生成规则不符合医疗行业标准
将检查申请列表及详情中的"处方号"统一修改为"申请单号",涉及列表表头、详情弹窗和打印内容三处

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 08:44:25 +08:00
关羽
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
29 changed files with 514 additions and 398 deletions

View File

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

View File

@@ -418,7 +418,7 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
// 清除相关缓存 // 清除相关缓存
clearSurgeryAppCache(surgery); clearSurgeryAppCache(surgery);
return R.ok(surgeryId, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[]{"手术信息"})); return R.ok(surgeryId, "手术申请提交成功!");
} }
/** /**
@@ -497,7 +497,7 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
// 清除相关缓存 // 清除相关缓存
clearSurgeryAppCache(surgery); clearSurgeryAppCache(surgery);
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"手术信息"})); return R.ok(null, "手术申请修改成功!");
} }
/** /**

View File

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

View File

@@ -511,6 +511,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
// 签发操作 // 签发操作
boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType); boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType);
// 收集已处理的requestId用于批量更新状态
List<Long> processedRequestIds = new ArrayList<>();
// 声明长期医嘱诊疗请求 // 声明长期医嘱诊疗请求
ServiceRequest longServiceRequest; ServiceRequest longServiceRequest;
// 新增 + 修改 (长期医嘱) // 新增 + 修改 (长期医嘱)
@@ -555,6 +558,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
} }
} }
iServiceRequestService.saveOrUpdate(longServiceRequest); iServiceRequestService.saveOrUpdate(longServiceRequest);
if (longServiceRequest.getId() != null) {
processedRequestIds.add(longServiceRequest.getId());
}
} }
// 声明临时医嘱诊疗请求 // 声明临时医嘱诊疗请求
@@ -603,6 +609,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
} }
} }
iServiceRequestService.saveOrUpdate(tempServiceRequest); iServiceRequestService.saveOrUpdate(tempServiceRequest);
if (tempServiceRequest.getId() != null) {
processedRequestIds.add(tempServiceRequest.getId());
}
// 保存时,保存诊疗费用项 // 保存时,保存诊疗费用项
if (is_save) { 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); 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(); Date curDate = new Date();
// 请求类型 // 请求类型
@@ -139,12 +146,6 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
// 诊疗集合 // 诊疗集合
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList(); List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
log.info("保存申请单typeCode={}, activityListSize={}, encounterId={}", typeCode, activityList != null ? activityList.size() : 0, encounterId); 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) { for (ActivitySaveDto activitySaveDto : activityList) {
serviceRequest = new ServiceRequest(); serviceRequest = new ServiceRequest();

View File

@@ -81,14 +81,21 @@ public class RequestFormManageController {
* 查询检查申请单 * 查询检查申请单
* *
* @param encounterId 就诊id * @param encounterId 就诊id
* @param startDate 开始日期可选格式yyyy-MM-dd
* @param endDate 结束日期可选格式yyyy-MM-dd
* @param status 单据状态(可选)
* @return 检查申请单 * @return 检查申请单
*/ */
@GetMapping(value = "/get-check") @GetMapping(value = "/get-check")
public R<?> getCheckRequestForm(@RequestParam(required = false) Long encounterId) { public R<?> getCheckRequestForm(
@RequestParam(required = false) Long encounterId,
@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate,
@RequestParam(required = false) String status) {
if (encounterId == null) { if (encounterId == null) {
return R.fail("就诊ID不能为空"); return R.fail("就诊ID不能为空");
} }
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.TEST.getCode())); return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.TEST.getCode(), startDate, endDate, status));
} }
/** /**

View File

@@ -331,12 +331,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) t ) t
WHERE rn = 1 WHERE rn = 1
) pi ON s.patient_id = pi.patient_id ) pi ON s.patient_id = pi.patient_id
<!-- 排除已生成医嘱的手术 --> <!-- 关联服务请求表(仅用于数据关联,不再过滤) -->
LEFT JOIN wor_service_request sr ON sr.activity_id = s.id AND sr.delete_flag = '0' AND sr.category_enum = 4 LEFT JOIN wor_service_request sr ON sr.activity_id = s.id AND sr.delete_flag = '0' AND sr.category_enum = 4
<where> <where>
s.delete_flag = '0' s.delete_flag = '0'
<!-- 只显示未生成医嘱的手术 -->
AND sr.id IS NULL
<if test="ew.sqlSegment != null and ew.sqlSegment != ''"> <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
<!-- 补充 encounter_id 替换,修复多表关联时字段歧义。注释不能放进 OGNL 表达式内部。 --> <!-- 补充 encounter_id 替换,修复多表关联时字段歧义。注释不能放进 OGNL 表达式内部。 -->
<![CDATA[ <![CDATA[

View File

@@ -38,7 +38,6 @@ export function listAdviceTypes(query) {
params: query params: query
}) })
} }
```
/** /**
* 查询手术室详细 * 查询手术室详细

View File

@@ -1146,7 +1146,13 @@ function calculateTotalPrice(row, index) {
}); });
} }
defineExpose({ getListInfo }); function closeAllPopovers() {
prescriptionList.value.forEach(row => {
row.showPopover = false;
});
}
defineExpose({ getListInfo, closeAllPopovers });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -41,43 +41,9 @@
</el-col> </el-col>
</el-row> </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-row :gutter="16" class="form-row">
<el-col :span="24" class="form-item full-width"> <el-col :span="12" class="form-item">
<span class="form-label">工作单位学校</span> <span class="form-label">工作单位学校</span>
<el-input v-model="form.workplace" class="underline-input" /> <el-input v-model="form.workplace" class="underline-input" />
</el-col> </el-col>
@@ -522,7 +488,7 @@
<script setup> <script setup>
import { ref, computed, getCurrentInstance, watch } from 'vue'; import { ref, computed, getCurrentInstance, watch } from 'vue';
import pcas from 'china-division/dist/pcas-code.json'; import pcas from 'china-division/dist/pcas-code.json';
import { saveInfectiousDiseaseReport } from '../api'; import { saveInfectiousDiseaseReport, getNextCardNo } from '../api';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import { useDict } from '@/utils/dict'; import { useDict } from '@/utils/dict';
@@ -1237,7 +1203,7 @@ function calculateAge() {
* 显示对话框并初始化表单数据 * 显示对话框并初始化表单数据
* @param {Object} diagnosisData - 诊断数据,包含已选疾病和地址信息 * @param {Object} diagnosisData - 诊断数据,包含已选疾病和地址信息
*/ */
function show(diagnosisData) { async function show(diagnosisData) {
dialogVisible.value = true; dialogVisible.value = true;
// 重置地址选择器状态 // 重置地址选择器状态
@@ -1267,12 +1233,24 @@ function show(diagnosisData) {
}); });
} }
// 生成默认卡片编号:医疗机构编码+当前年月日+4位流水 // 生成默认卡片编号:调用后端接口获取
const orgCode = userStore.fixmedinsCode || '0000'; const orgCode = userStore.fixmedinsCode || '0000';
let cardNo = '';
try {
const res = await getNextCardNo(orgCode);
if (res.code === 200 && res.data) {
cardNo = res.data;
} else {
cardNo = 'TEMP_' + Date.now();
}
} catch (err) {
console.error('获取卡片编号失败:', err);
cardNo = 'TEMP_' + Date.now();
}
form.value = { form.value = {
// 卡片编号:单位自编,与网络直报一致 // 卡片编号:单位自编,与网络直报一致
cardNo: '', cardNo: cardNo,
// 患者基本信息 // 患者基本信息
patName: patientInfo.patientName || patientInfo.name || '', // 患者姓名 patName: patientInfo.patientName || patientInfo.name || '', // 患者姓名

View File

@@ -2063,15 +2063,20 @@ watch(() => props.patientInfo, async (newVal) => {
} }
}, { deep: true, immediate: true }) }, { deep: true, immediate: true })
// Bug #329: 监听已选择的检验项目,自动更新检验项目文本并设置默认执行科室 // Bug #329/#466: 监听已选择的检验项目,自动更新检验项目文本并设置默认执行科室、标本类型
watch(() => selectedInspectionItems.value, async (newVal) => { watch(() => selectedInspectionItems.value, async (newVal) => {
if (newVal && newVal.length > 0) { if (newVal && newVal.length > 0) {
formData.inspectionItemsText = newVal.map(item => item.itemName).join('+') formData.inspectionItemsText = newVal.map(item => item.itemName).join('+')
// Bug #329: 如果执行科室为空,根据第一个检验项目的检验类型自动设置默认执行科室
if (!formData.executeDepartment) {
const firstItem = newVal[0] const firstItem = newVal[0]
// Bug #466: 如果标本类型为空或仍为初始化默认值,根据第一个检验项目的 sampleType 自动设置默认标本类型
if ((!formData.specimenName || formData.specimenName === '血液') && firstItem.sampleType) {
formData.specimenName = firstItem.sampleType
}
// Bug #329: 如果执行科室为空,根据第一个检验项目的检验类型自动设置默认执行科室
if (!formData.executeDepartment) {
// 根据检验项目的 inspectionTypeId 获取默认执行科室 // 根据检验项目的 inspectionTypeId 获取默认执行科室
if (firstItem.inspectionTypeId) { if (firstItem.inspectionTypeId) {
const defaultDeptCode = await getDefaultPerformDeptCode(firstItem.inspectionTypeId) const defaultDeptCode = await getDefaultPerformDeptCode(firstItem.inspectionTypeId)
@@ -2081,9 +2086,10 @@ watch(() => selectedInspectionItems.value, async (newVal) => {
} }
} }
} else { } else {
// Bug #329: 当项目被清空时,同时清空执行科室(下次选择项目时会重新自动设置) // Bug #329: 当项目被清空时,同时清空执行科室和标本类型(下次选择项目时会重新自动设置)
formData.inspectionItemsText = '' formData.inspectionItemsText = ''
formData.executeDepartment = '' formData.executeDepartment = ''
formData.specimenName = ''
} }
}, { deep: true }) }, { deep: true })

View File

@@ -246,7 +246,8 @@
<el-input-number :min="0" v-model="scope.row.doseQuantity" controls-position="right" <el-input-number :min="0" v-model="scope.row.doseQuantity" controls-position="right"
:controls="false" style="width: 70px; margin-right: 20px" :controls="false" style="width: 70px; margin-right: 20px"
:ref="(el) => (inputRefs.doseQuantity = el)" @input="convertValues(scope.row, scope.$index)" :ref="(el) => (inputRefs.doseQuantity = el)" @input="convertValues(scope.row, scope.$index)"
@keyup.enter.prevent="handleEnter('doseQuantity', scope.row, scope.$index)" /> @keyup.enter.prevent="handleEnter('doseQuantity', scope.row, scope.$index)"
@change="calculateTotalAmount(scope.row, scope.$index)"/>
</el-form-item> </el-form-item>
<!-- 剂量单位 --> <!-- 剂量单位 -->
<el-select v-model="scope.row.minUnitCode" style="width: 70px; margin-right: 20px" placeholder=" "> <el-select v-model="scope.row.minUnitCode" style="width: 70px; margin-right: 20px" placeholder=" ">
@@ -294,7 +295,8 @@
} }
// inputRefs.rateCode.blur(); // inputRefs.rateCode.blur();
} }
" :ref="(el) => (inputRefs.rateCode = el)"> " :ref="(el) => (inputRefs.rateCode = el)"
@change="calculateTotalAmount(scope.row, scope.$index)">
<el-option v-for="dict in rate_code" @click="() => (scope.row.rateCode_dictText = dict.label)" <el-option v-for="dict in rate_code" @click="() => (scope.row.rateCode_dictText = dict.label)"
:key="dict.value" :label="dict.label" :value="dict.value" /> :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
@@ -313,6 +315,7 @@
data-prop="dispensePerDuration"> data-prop="dispensePerDuration">
<el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1" <el-input-number v-model="scope.row.dispensePerDuration" style="width: 80px" :min="1"
controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)" controls-position="right" :controls="false" :ref="(el) => (inputRefs.dispensePerDuration = el)"
@change="calculateTotalAmount(scope.row, scope.$index)"
@keyup.enter.prevent=" @keyup.enter.prevent="
handleEnter('dispensePerDuration', scope.row, scope.$index) handleEnter('dispensePerDuration', scope.row, scope.$index)
"> ">

View File

@@ -56,137 +56,6 @@
<!-- 手术等级 --> <!-- 手术等级 -->
<el-table-column label="手术等级" align="center" prop="surgeryLevel_dictText" width="100" /> <el-table-column label="手术等级" align="center" prop="surgeryLevel_dictText" width="100" />
<!-- 手术室确认时间 -->
<el-table-column label="手术室确认时间" align="center" prop="confirmTime" width="180">
<template #default="scope">
{{ scope.row.confirmTime ? parseTime(scope.row.confirmTime, '{y}-{m}-{d} {h}:{i}:{s}') : '-' }}
</template>
</el-table-column>
<!-- 操作列 -->
<el-table-column label="操作" align="center" width="150" fixed="right">
<template #default="scope">
<el-button
type="primary"
link
size="small"
@click="handleView(scope.row)"
>
查看
</el-button>
<el-button
type="primary"
link
size="small"
@click="handleEdit(scope.row)"
:disabled="scope.row.status !== '0'"
>
修改
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { getSurgeryApplicationList, addSurgeryApplication, updateSurgeryApplication } from '@/api/doctorstation/surgery'
import { ElMessage, ElMessageBox } from 'element-plus'
const loading = ref(true)
const surgeryList = ref([])
// 查询手术申请列表
const getList = async () => {
try {
loading.value = true
const response = await getSurgeryApplicationList()
surgeryList.value = response.data || []
} catch (error) {
console.warn('获取手术申请列表失败', error)
surgeryList.value = []
} finally {
loading.value = false
}
}
// 新增手术申请
const handleAdd = () => {
// 跳转到新增页面或打开新增弹窗
// 这里需要根据实际路由配置调整
openSurgeryDialog()
}
// 编辑手术申请
const handleEdit = (row) => {
if(row.status !== '0') {
ElMessage.warning('该申请已提交,无法修改')
return
}
openSurgeryDialog(row)
}
// 查看手术申请详情
const handleView = (row) => {
openSurgeryDialog(row, true)
}
// 刷新列表
const handleRefresh = () => {
getList()
}
// 打开手术申请对话框
const openSurgeryDialog = (row, isView = false) => {
// 这里需要引入具体的对话框组件或跳转到详情页
// 示例代码,具体实现需要根据项目实际情况调整
console.log('打开手术申请对话框', row, isView)
}
// 获取行样式
const getRowClassName = ({ row }) => {
if (row.status === '1') {
return 'success-row'
} else if (row.status === '2') {
return 'warning-row'
}
return ''
}
onMounted(() => {
getList()
})
// 暴露方法给父组件调用,用于提交后刷新列表
defineExpose({
refreshList: getList
})
</script>
<style scoped>
.surgery-application-container {
padding: 20px;
}
.top-operation-bar {
margin-bottom: 16px;
}
.add-button,
.refresh-button {
margin-bottom: 10px;
}
/* 表格行状态样式 */
::v-deep(.success-row) {
background-color: #f0f9ff;
}
::v-deep(.warning-row) {
background-color: #fff7e6;
}
</style>
<el-table-column label="手术室确认时间" align="center" prop="operatingRoomConfirmTime" width="180"> <el-table-column label="手术室确认时间" align="center" prop="operatingRoomConfirmTime" width="180">
<template #default="scope"> <template #default="scope">
{{ scope.row.operatingRoomConfirmTime ? parseTime(scope.row.operatingRoomConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') : '-' }} {{ scope.row.operatingRoomConfirmTime ? parseTime(scope.row.operatingRoomConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') : '-' }}

View File

@@ -86,14 +86,14 @@ const tableColumns = computed<TableColumn[]>(() => [
* @param searchKey 搜索关键词 * @param searchKey 搜索关键词
*/ */
function refresh(adviceType: any, categoryCode: string, searchKey: string) { function refresh(adviceType: any, categoryCode: string, searchKey: string) {
// 有搜索词时跨类型搜索,避免用户输入"级护理"但因当前adviceType为药品而搜不到诊疗类护理项目 // 有搜索词时跨类型搜索,或adviceType为空时也跨类型搜索新行未选类型时默认搜全部避免用户输入"级护理"但因当前adviceType为药品而搜不到诊疗类护理项目
if (searchKey) { if (searchKey || adviceType === undefined || adviceType === '') {
queryParams.value.adviceTypes = '1,2,3,6'; queryParams.value.adviceTypes = '1,2,3,6';
queryParams.value.categoryCode = '';
} else { } else {
queryParams.value.adviceTypes = queryParams.value.adviceTypes = String(adviceType);
adviceType !== undefined && adviceType !== '' ? String(adviceType) : '1,2,3,6';
}
queryParams.value.categoryCode = categoryCode || ''; queryParams.value.categoryCode = categoryCode || '';
}
queryParams.value.searchKey = searchKey || ''; queryParams.value.searchKey = searchKey || '';
getList(); getList();
} }

View File

@@ -86,9 +86,13 @@
</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>{{ getItemName(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 prop="requesterId_dictText" label="申请者" width="120" /> <el-table-column prop="requesterId_dictText" label="申请者" width="120" />
<el-table-column label="申请单状态" width="120" align="center"> <el-table-column label="申请单状态" width="120" align="center">
<template #default="scope"> <template #default="scope">
@@ -159,7 +163,7 @@
currentDetail.patientName || '-' currentDetail.patientName || '-'
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="申请单名称">{{ <el-descriptions-item label="申请单名称">{{
currentDetail.name || '-' getItemName(currentDetail)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="申请单状态">{{ <el-descriptions-item label="申请单状态">{{
parseStatus(currentDetail.status) parseStatus(currentDetail.status)
@@ -167,7 +171,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="申请者">{{
@@ -223,6 +227,47 @@
<el-form-item label="申请单名称"> <el-form-item label="申请单名称">
<el-input v-model="editForm.name" /> <el-input v-model="editForm.name" />
</el-form-item> </el-form-item>
<el-form-item label="发往科室">
<el-tree-select
clearable
style="width: 100%"
v-model="editForm.targetDepartment"
filterable
:data="orgOptions"
:props="{
value: 'id',
label: 'name',
children: 'children',
}"
value-key="id"
check-strictly
placeholder="请选择科室"
/>
</el-form-item>
<el-form-item label="紧急程度">
<el-select v-model="editForm.urgencyLevel" placeholder="请选择紧急程度" clearable style="width: 100%">
<el-option label="普通" value="routine" />
<el-option label="急诊" value="emergency" />
</el-select>
</el-form-item>
<el-form-item label="过敏史">
<el-input v-model="editForm.allergyHistory" type="textarea" :rows="2" />
</el-form-item>
<el-form-item label="检查目的">
<el-input v-model="editForm.examinationPurpose" type="textarea" :rows="2" />
</el-form-item>
<el-form-item label="病史摘要">
<el-input v-model="editForm.medicalHistorySummary" type="textarea" :rows="2" />
</el-form-item>
<el-form-item label="期望检查时间">
<el-date-picker
v-model="editForm.expectedExaminationTime"
type="datetime"
placeholder="请选择期望检查时间"
style="width: 100%"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
<el-form-item label="临床诊断"> <el-form-item label="临床诊断">
<el-input v-model="editForm.clinicalDiagnosis" type="textarea" :rows="2" /> <el-input v-model="editForm.clinicalDiagnosis" type="textarea" :rows="2" />
</el-form-item> </el-form-item>
@@ -399,9 +444,36 @@ const parseStatus = (status) => {
return statusMap[String(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 = { const labelMap = {
categoryType: '项目类别', categoryType: '项目类别',
targetDepartment: '发往科室', targetDepartment: '发往科室',
urgencyLevel: '紧急程度',
allergyHistory: '过敏史',
examinationPurpose: '检查目的',
medicalHistorySummary: '病史摘要',
expectedExaminationTime: '期望检查时间',
symptom: '症状', symptom: '症状',
sign: '体征', sign: '体征',
clinicalDiagnosis: '临床诊断', clinicalDiagnosis: '临床诊断',
@@ -431,20 +503,27 @@ const getLocationInfo = () => {
}; };
const recursionFun = (targetDepartment) => { const recursionFun = (targetDepartment) => {
if (!targetDepartment) return '';
if (!Array.isArray(orgOptions.value) || orgOptions.value.length === 0) return '';
let name = ''; let name = '';
for (let index = 0; index < orgOptions.value.length; index++) { for (let index = 0; index < orgOptions.value.length; index++) {
const obj = orgOptions.value[index]; const obj = orgOptions.value[index];
if (obj.id == targetDepartment) { if (obj.id == targetDepartment) {
name = obj.name; name = obj.name;
break;
} }
const subObjArray = obj['children']; const subObjArray = obj['children'];
for (let index = 0; index < subObjArray.length; index++) { if (Array.isArray(subObjArray)) {
const item = subObjArray[index]; for (let i = 0; i < subObjArray.length; i++) {
const item = subObjArray[i];
if (item.id == targetDepartment) { if (item.id == targetDepartment) {
name = item.name; name = item.name;
break;
} }
} }
} }
if (name) break;
}
return name; return name;
}; };
@@ -456,7 +535,15 @@ const handleViewDetail = (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); if (obj.targetDepartment) {
const deptName = recursionFun(obj.targetDepartment);
obj.targetDepartment = deptName || obj.targetDepartment;
}
// 紧急程度转换为显示文本
const urgencyMap = { routine: '普通', emergency: '急诊' };
if (obj.urgencyLevel) {
obj.urgencyLevel = urgencyMap[obj.urgencyLevel] || obj.urgencyLevel;
}
descJsonData.value = obj; descJsonData.value = obj;
} catch (e) { } catch (e) {
console.error('解析 descJson 失败:', e); console.error('解析 descJson 失败:', e);
@@ -478,6 +565,12 @@ const handleEdit = (row) => {
if (row.descJson) { if (row.descJson) {
try { try {
const desc = JSON.parse(row.descJson); const desc = JSON.parse(row.descJson);
form.targetDepartment = desc.targetDepartment || '';
form.urgencyLevel = desc.urgencyLevel || '';
form.allergyHistory = desc.allergyHistory || '';
form.examinationPurpose = desc.examinationPurpose || '';
form.medicalHistorySummary = desc.medicalHistorySummary || '';
form.expectedExaminationTime = desc.expectedExaminationTime || '';
form.clinicalDiagnosis = desc.clinicalDiagnosis || ''; form.clinicalDiagnosis = desc.clinicalDiagnosis || '';
form.attention = desc.attention || ''; form.attention = desc.attention || '';
form.symptom = desc.symptom || ''; form.symptom = desc.symptom || '';
@@ -508,6 +601,12 @@ const handleSaveEdit = async () => {
name: editForm.value.name, name: editForm.value.name,
organizationId: editDetail.value.inHospitalOrgId || patientInfo.value?.inHospitalOrgId, organizationId: editDetail.value.inHospitalOrgId || patientInfo.value?.inHospitalOrgId,
descJson: JSON.stringify({ descJson: JSON.stringify({
targetDepartment: editForm.value.targetDepartment,
urgencyLevel: editForm.value.urgencyLevel,
allergyHistory: editForm.value.allergyHistory,
examinationPurpose: editForm.value.examinationPurpose,
medicalHistorySummary: editForm.value.medicalHistorySummary,
expectedExaminationTime: editForm.value.expectedExaminationTime,
clinicalDiagnosis: editForm.value.clinicalDiagnosis, clinicalDiagnosis: editForm.value.clinicalDiagnosis,
attention: editForm.value.attention, attention: editForm.value.attention,
symptom: editForm.value.symptom, symptom: editForm.value.symptom,
@@ -651,9 +750,9 @@ const buildPrintContent = (row) => {
return ` return `
<h2>检查申请单</h2> <h2>检查申请单</h2>
<div class="info-row"><span class="label">患者姓名:</span>${row.patientName || '-'}</div> <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.createTime || '-'}</div>
<div class="info-row"><span class="label">处方号:</span>${row.prescriptionNo || '-'}</div> <div class="info-row"><span class="label">申请单号:</span>${row.prescriptionNo || '-'}</div>
<div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div> <div class="info-row"><span class="label">申请者:</span>${row.requesterId_dictText || '-'}</div>
<div class="info-row"><span class="label">申请单状态:</span>${parseStatus(row.status)}</div> <div class="info-row"><span class="label">申请单状态:</span>${parseStatus(row.status)}</div>
${descHtml ? `<h3>申请单描述</h3>${descHtml}` : ''} ${descHtml ? `<h3>申请单描述</h3>${descHtml}` : ''}

View File

@@ -0,0 +1,20 @@
<!--
* 住院医生站 汇总发药申请复用药房发药汇总单能力
-->
<template>
<div class="summary-drug-application">
<MedicationSummary />
</div>
</template>
<script setup>
import MedicationSummary from '@/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue';
</script>
<style scoped>
.summary-drug-application {
height: 100%;
min-height: 400px;
overflow: auto;
}
</style>

View File

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

View File

@@ -176,6 +176,8 @@ const projectWithDepartment = (selectProjectIds, type) => {
}); });
arr.push(searchData); arr.push(searchData);
}); });
// 保存用户手动选择的发往科室(提交时需要保留)
const manualDept = type === 2 ? form.targetDepartment : '';
// 清空科室 // 清空科室
form.targetDepartment = ''; form.targetDepartment = '';
if (arr.length > 0) { if (arr.length > 0) {
@@ -194,12 +196,18 @@ const projectWithDepartment = (selectProjectIds, type) => {
// 选中项目中的执行科室id与全部科室数据做匹配 // 选中项目中的执行科室id与全部科室数据做匹配
const findItem = findTreeItem(orgOptions.value, obj.orgId); const findItem = findTreeItem(orgOptions.value, obj.orgId);
if (!findItem) { if (!findItem) {
// type=2(提交)时,若用户已手动选择发往科室,则允许提交
if (type === 2 && manualDept) {
form.targetDepartment = manualDept;
isRelease = true;
} else {
isRelease = false; isRelease = false;
ElMessage({ ElMessage({
type: 'error', type: 'error',
message: '未找到项目执行的科室', message: '未找到项目执行的科室',
}); });
} }
}
if (type == 1) { if (type == 1) {
if (isRelease) { if (isRelease) {
form.targetDepartment = findItem.id; form.targetDepartment = findItem.id;
@@ -232,7 +240,7 @@ const submit = () => {
unitCode: item.priceList[0].unitCode /** 请求单位编码 */, unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
unitPrice: item.priceList[0].price /** 单价 */, unitPrice: item.priceList[0].price /** 单价 */,
totalPrice: item.priceList[0].price /** 总价 */, totalPrice: item.priceList[0].price /** 总价 */,
positionId: item.positionId, //执行科室id positionId: item.positionId || form.targetDepartment, //执行科室id未配置时使用用户手动选择的科室
ybClassEnum: item.ybClassEnum, //类别医保编码 ybClassEnum: item.ybClassEnum, //类别医保编码
conditionId: item.conditionId, //诊断ID conditionId: item.conditionId, //诊断ID
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id

View File

@@ -42,6 +42,40 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="紧急程度" prop="urgencyLevel" style="width: 100%">
<el-select v-model="form.urgencyLevel" placeholder="请选择紧急程度" clearable style="width: 100%">
<el-option label="普通" value="routine" />
<el-option label="急诊" value="emergency" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="过敏史" prop="allergyHistory" style="width: 100%">
<el-input v-model="form.allergyHistory" autocomplete="off" type="textarea" placeholder="如:造影剂过敏史等" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检查目的" prop="examinationPurpose" style="width: 100%">
<el-input v-model="form.examinationPurpose" autocomplete="off" type="textarea" placeholder="请说明检查目的" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="病史摘要" prop="medicalHistorySummary" style="width: 100%">
<el-input v-model="form.medicalHistorySummary" autocomplete="off" type="textarea" placeholder="请简要描述患者病史" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="期望检查时间" prop="expectedExaminationTime" style="width: 100%">
<el-date-picker
v-model="form.expectedExaminationTime"
type="datetime"
placeholder="请选择期望检查时间"
style="width: 100%"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="症状" prop="symptom" style="width: 100%"> <el-form-item label="症状" prop="symptom" style="width: 100%">
<el-input v-model="form.symptom" autocomplete="off" type="textarea" /> <el-input v-model="form.symptom" autocomplete="off" type="textarea" />
@@ -145,6 +179,11 @@ const transferValue = ref([]);
const form = reactive({ const form = reactive({
// categoryType: '', // 项目类别 // categoryType: '', // 项目类别
targetDepartment: '', // 发往科室 targetDepartment: '', // 发往科室
urgencyLevel: '', // 紧急程度
allergyHistory: '', // 过敏史
examinationPurpose: '', // 检查目的
medicalHistorySummary: '', // 病史摘要
expectedExaminationTime: '', // 期望检查时间
symptom: '', // 症状 symptom: '', // 症状
sign: '', // 体征 sign: '', // 体征
clinicalDiagnosis: '', // 临床诊断 clinicalDiagnosis: '', // 临床诊断
@@ -242,13 +281,14 @@ const submit = () => {
accountId: patientInfo.value.accountId, // // 账户id accountId: patientInfo.value.accountId, // // 账户id
}; };
}); });
const itemNames = applicationListAllFilter.map(item => item.adviceName).filter(Boolean).join('、');
saveCheckd({ saveCheckd({
activityList: applicationListAllFilter, activityList: applicationListAllFilter,
patientId: patientInfo.value.patientId, //患者ID patientId: patientInfo.value.patientId, //患者ID
encounterId: patientInfo.value.encounterId, // 就诊ID encounterId: patientInfo.value.encounterId, // 就诊ID
organizationId: patientInfo.value.inHospitalOrgId, // 医疗机构ID organizationId: patientInfo.value.inHospitalOrgId, // 医疗机构ID
requestFormId: '', // 申请单ID requestFormId: '', // 申请单ID
name: '检查申请单', name: itemNames || '检查申请单',
descJson: JSON.stringify(form), descJson: JSON.stringify(form),
categoryEnum: '2', // 1 检验 2 检查 3 输血 4 手术 categoryEnum: '2', // 1 检验 2 检查 3 输血 4 手术
}).then((res) => { }).then((res) => {

View File

@@ -122,7 +122,6 @@
<el-table-column label="类型" align="center" prop="" width="120"> <el-table-column label="类型" align="center" prop="" width="120">
<template #default="scope"> <template #default="scope">
{{ console.log(scope.row, 1111) }}
<el-radio-group <el-radio-group
v-model="scope.row.therapyEnum" v-model="scope.row.therapyEnum"
size="small" size="small"
@@ -270,7 +269,6 @@
</el-table-column> </el-table-column>
<el-table-column label="频次/用法" align="center" prop="" width="180"> <el-table-column label="频次/用法" align="center" prop="" width="180">
<template #default="scope"> <template #default="scope">
{{ console.log(scope.row) }}
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right"> <span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
{{ {{
[ [
@@ -879,14 +877,12 @@ function handleDiagnosisChange(item) {
function handleFocus(row, index) { function handleFocus(row, index) {
rowIndex.value = index; rowIndex.value = index;
row.showPopover = true; row.showPopover = true;
// el-popover 懒渲染,需要等两帧组件才会挂载
const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType; const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
// 用 adviceType + categoryCode 组合查找匹配的选项 // 用 adviceType + categoryCode 组合查找匹配的选项
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType; const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType); const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
// 诊疗(3)和手术(6)没有categoryCode传空字符串给refresh由子组件转为undefined不发送 // 修复Bug #486当行没有显式选择医嘱类型时不传categoryCode让搜索在全药库中进行
// 药品(1)才有categoryCode如'1'=中成药,'2'=西药,'4'=中草药) const categoryCode = selectedItem ? selectedItem.categoryCode : (row.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
const searchKey = row.adviceName || ''; const searchKey = row.adviceName || '';
nextTick(() => { nextTick(() => {
@@ -923,8 +919,8 @@ function handleChange(value) {
// 用 adviceType + categoryCode 组合查找匹配的选项 // 用 adviceType + categoryCode 组合查找匹配的选项
const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType; const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType;
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType); const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
// 诊疗/手术的categoryCode为空字符串由子组件转为undefined不发送 // 修复Bug #486当行没有显式选择医嘱类型时不传categoryCode让搜索在全药库中进行
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || ''); const categoryCode = selectedItem ? selectedItem.categoryCode : (row?.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
tableRef.refresh(adviceType, categoryCode, value); tableRef.refresh(adviceType, categoryCode, value);
} }
} }
@@ -1214,12 +1210,8 @@ function handleSave() {
getListInfo(false); getListInfo(false);
bindMethod.value = {}; bindMethod.value = {};
nextId.value == 1; nextId.value == 1;
// 处方保存成功后,自动将医嘱信息同步至患者处置记录
// handleEmrTreatment();
} else { } else {
proxy.$modal.msgError(res.message); proxy.$modal.msgError(res.message);
conso;
isSaving.value = false; isSaving.value = false;
} }
}) })
@@ -1319,6 +1311,9 @@ function handleCancelEdit(row, index) {
function handleSaveSign(row, index) { function handleSaveSign(row, index) {
if (row.adviceType != 2) { if (row.adviceType != 2) {
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId; 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) => { getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
if (res.data.length == 0) { if (res.data.length == 0) {
return; return;
@@ -1336,6 +1331,7 @@ function handleSaveSign(row, index) {
} }
}); });
} }
}
// 更新UI状态 // 更新UI状态
row.isEdit = false; row.isEdit = false;

View File

@@ -17,13 +17,11 @@
</el-tab-pane> </el-tab-pane>
<!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> --> <!-- <el-tab-pane label="医技报告" name="fourth">Task</el-tab-pane> -->
<el-tab-pane label="检验申请" name="test"> <el-tab-pane label="检验申请" name="test">
<TestApplication ref="testApplicationRef" :show-status-column="true" /> <TestApplication ref="testApplicationRef" :show-status-column="false" />
</el-tab-pane> </el-tab-pane>
```vue
<el-tab-pane label="检查申请" name="examine"> <el-tab-pane label="检查申请" name="examine">
<ExamineApplication ref="examineApplicationRef" /> <ExamineApplication ref="examineApplicationRef" />
</el-tab-pane> </el-tab-pane>
```
<el-tab-pane label="汇总发药申请" name="summaryDrug"> <el-tab-pane label="汇总发药申请" name="summaryDrug">
<SummaryDrugApplication ref="summaryDrugApplicationRef" /> <SummaryDrugApplication ref="summaryDrugApplicationRef" />
</el-tab-pane> </el-tab-pane>
@@ -46,10 +44,11 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import {computed, onBeforeMount, onMounted, provide, reactive, ref, watch,} from 'vue'; import { computed, onBeforeMount, onMounted, provide, reactive, ref, watch } from 'vue';
import Emr from './emr/index.vue'; import Emr from './emr/index.vue';
import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue'; import inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
import SummaryDrugApplication from './components/applicationShow/summaryDrugApplication.vue';
import PatientList from '@/components/PatientList/patient-list.vue'; import PatientList from '@/components/PatientList/patient-list.vue';
import {localPatientInfo, updateLocalPatientInfo} from './store/localPatient'; import {localPatientInfo, updateLocalPatientInfo} from './store/localPatient';
import {patientInfo, updatePatientInfo} from './store/patient'; import {patientInfo, updatePatientInfo} from './store/patient';
@@ -84,6 +83,7 @@ const currentPatientInfo = ref({});
const testApplicationRef = ref(); const testApplicationRef = ref();
const examineApplicationRef = ref(); const examineApplicationRef = ref();
const surgeryApplicationRef = ref(); const surgeryApplicationRef = ref();
const summaryDrugApplicationRef = ref();
const bloodTtransfusionAapplicationRef = ref(); const bloodTtransfusionAapplicationRef = ref();
// 患者列表相关逻辑 // 患者列表相关逻辑

View File

@@ -181,7 +181,7 @@
v-for="dept in getFilteredOptions(scope.row, 'departmentOptions')" v-for="dept in getFilteredOptions(scope.row, 'departmentOptions')"
:key="dept.id" :key="dept.id"
:label="dept.name" :label="dept.name"
:value="dept.id" :value="String(dept.id)"
/> />
</el-select> </el-select>
<el-select <el-select
@@ -197,7 +197,7 @@
v-for="dept in getFilteredOptions(scope.row, 'locationOptions')" v-for="dept in getFilteredOptions(scope.row, 'locationOptions')"
:key="dept.value" :key="dept.value"
:label="dept.label" :label="dept.label"
:value="dept.value" :value="String(dept.value)"
/> />
</el-select> </el-select>
</template> </template>
@@ -280,8 +280,16 @@
style="width: 100%" style="width: 100%"
> >
<el-table-column type="index" label="序号" width="60" align="center" /> <el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column label="组套名称" prop="name" min-width="180" show-overflow-tooltip /> <el-table-column label="组套名称" min-width="180" show-overflow-tooltip>
<el-table-column label="使用范围" prop="rangeCode_dictText" width="100" align="center" /> <template #default="scope">
{{ scope.row.name || scope.row.Name || '' }}
</template>
</el-table-column>
<el-table-column label="使用范围" width="100" align="center">
<template #default="scope">
{{ getRangeText(scope.row) }}
</template>
</el-table-column>
<el-table-column label="明细数量" width="100" align="center"> <el-table-column label="明细数量" width="100" align="center">
<template #default="scope"> <template #default="scope">
{{ scope.row.detailList?.length || 0 }} 项 {{ scope.row.detailList?.length || 0 }} 项
@@ -481,10 +489,15 @@ watch(
// 加载科室选项 // 加载科室选项
function loadDepartmentOptions() { function loadDepartmentOptions() {
getOrgList().then((res) => { getOrgList()
.then((res) => {
if (res.data && res.data.records && res.data.records.length > 0) { if (res.data && res.data.records && res.data.records.length > 0) {
departmentOptions.value = res.data.records[0].children || []; departmentOptions.value = res.data.records[0].children || [];
} }
})
.catch(() => {
console.warn('科室列表加载失败(可能无权限)');
departmentOptions.value = [];
}); });
} }
@@ -504,9 +517,14 @@ function getAdviceBaseInfos() {
}); });
} }
function getDiseaseInitLoc() { function getDiseaseInitLoc() {
getDiseaseTreatmentInitLoc(16).then((response) => { getDiseaseTreatmentInitLoc(16)
.then((response) => {
console.log('Disease Treatment Init Loc:', response); console.log('Disease Treatment Init Loc:', response);
locationOptions.value = response.data.locationOptions; locationOptions.value = response.data.locationOptions;
})
.catch(() => {
console.warn('位置列表加载失败(可能无权限)');
locationOptions.value = [];
}); });
} }
// 下拉框模糊搜索过滤 // 下拉框模糊搜索过滤
@@ -603,15 +621,23 @@ function selectChange(row) {
const price = row.priceList?.[0]?.price || 0; const price = row.priceList?.[0]?.price || 0;
//获取大小单位 //获取大小单位
const uniqueUnitCodes = getUnitCodeOptions(row); const uniqueUnitCodes = getUnitCodeOptions(row);
// 设置默认执行科室/位置 // 设置默认单位:优先使用 minUnitCode小单位回退到 unitCode大单位
let defaultUnitCode = '';
if (row.minUnitCode) {
defaultUnitCode = String(row.minUnitCode);
} else if (row.unitCode) {
defaultUnitCode = String(row.unitCode);
}
// 设置默认执行科室/位置(统一转为字符串,避免 el-select 类型不匹配)
let defaultPositionId = undefined; let defaultPositionId = undefined;
if (row.adviceType === 3 && departmentOptions.value.length > 0) { if (row.adviceType === 3 && departmentOptions.value.length > 0) {
// 诊疗:优先使用患者所在科室,否则取第一个科室 // 诊疗:优先使用患者所在科室,否则取第一个科室
defaultPositionId = departmentOptions.value.find(d => d.id === props.patientInfo.organizationId)?.id const patientOrgId = props.patientInfo.organizationId;
|| departmentOptions.value[0]?.id; const matched = departmentOptions.value.find(d => String(d.id) === String(patientOrgId));
defaultPositionId = matched ? String(matched.id) : String(departmentOptions.value[0].id);
} else if (row.adviceType === 2 && locationOptions.value.length > 0) { } else if (row.adviceType === 2 && locationOptions.value.length > 0) {
// 耗材:默认取第一个药房/耗材房 // 耗材:默认取第一个药房/耗材房
defaultPositionId = locationOptions.value[0]?.value; defaultPositionId = String(locationOptions.value[0].value);
} }
//插入费用列表 //插入费用列表
feeItemsList.value.push({ feeItemsList.value.push({
@@ -619,8 +645,8 @@ function selectChange(row) {
uniqueUnitCodes: uniqueUnitCodes, uniqueUnitCodes: uniqueUnitCodes,
unitPrice: (price / (row.partPercent || 1)).toFixed(6), // 根据拆零比计算单价 unitPrice: (price / (row.partPercent || 1)).toFixed(6), // 根据拆零比计算单价
quantity: 1, quantity: 1,
positionId: defaultPositionId, // 默认执行科室/位置 positionId: defaultPositionId, // 默认执行科室/位置(字符串类型)
selectUnitCode: String(row.minUnitCode || ''), // 默认选择小单位,确保字符串类型 selectUnitCode: defaultUnitCode, // 默认选择小单位
}); });
} }
@@ -745,7 +771,7 @@ function openGroupSetDialog() {
function loadGroupSets() { function loadGroupSets() {
groupSetLoading.value = true; groupSetLoading.value = true;
getOrderGroup({ organizationId: orgId.value, searchKey: groupSetSearchText.value }) getOrderGroup({ organizationId: orgId.value })
.then((res) => { .then((res) => {
const data = res?.data || {}; const data = res?.data || {};
if (groupSetRange.value === 1) { if (groupSetRange.value === 1) {
@@ -765,6 +791,13 @@ function loadGroupSets() {
}); });
} }
function getRangeText(row) {
// 后端未返回rangeCode根据当前选中的范围标签显示
const rangeMap = { 1: '个人', 2: '科室', 3: '全院' };
if (row.rangeCode_dictText) return row.rangeCode_dictText;
return rangeMap[groupSetRange.value] || '';
}
function handleGroupSetSelect(row) { function handleGroupSetSelect(row) {
selectedGroupSet.value = row; selectedGroupSet.value = row;
} }

View File

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

View File

@@ -67,9 +67,6 @@
</el-button> </el-button>
</div> </div>
</div> </div>
</div>
</template>
</div>
<div <div
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto" style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
v-loading="loading" v-loading="loading"
@@ -232,7 +229,7 @@ import {adviceCancel, adviceExecute, adviceNoExecute, getPrescriptionList} from
import {patientInfoList} from '../../components/store/patient.js'; import {patientInfoList} from '../../components/store/patient.js';
import {lotNumberMatch} from '@/api/public'; import {lotNumberMatch} from '@/api/public';
import {formatDateStr} from '@/utils/index'; import {formatDateStr} from '@/utils/index';
import {getCurrentInstance, nextTick, ref} from 'vue'; import {getCurrentInstance, nextTick, ref, provide} from 'vue';
const activeNames = ref([]); const activeNames = ref([]);
const prescriptionList = ref([]); const prescriptionList = ref([]);
@@ -242,6 +239,8 @@ const therapyEnum = ref(undefined);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const loading = ref(false); const loading = ref(false);
const chooseAll = ref(false); const chooseAll = ref(false);
// 独立维护选中行ID集合避免el-table内部selection状态异常导致联动全选
const selectedRowIds = ref(new Set());
const props = defineProps({ const props = defineProps({
exeStatus: { exeStatus: {
type: Number, type: Number,
@@ -283,9 +282,10 @@ function handleGetPrescription() {
exeStatus: props.exeStatus, exeStatus: props.exeStatus,
requestStatus: props.requestStatus, requestStatus: props.requestStatus,
}).then((res) => { }).then((res) => {
// try { try {
const records = res?.data?.records || [];
// 根据encounterId分组 // 根据encounterId分组
const groupedPrescriptions = res.data.records.reduce((groups, prescription) => { const groupedPrescriptions = records.reduce((groups, prescription) => {
// 获取当前医嘱全部执行频次 // 获取当前医嘱全部执行频次
let rate; let rate;
let times; let times;
@@ -430,18 +430,26 @@ function handleGetPrescription() {
// 将分组结果转换为数组形式 // 将分组结果转换为数组形式
prescriptionList.value = Object.values(groupedPrescriptions); prescriptionList.value = Object.values(groupedPrescriptions);
loading.value = false;
// 默认选中全部行 // 默认选中全部行
nextTick(() => { nextTick(() => {
defaultSelectAllRows(); defaultSelectAllRows();
}); });
// } catch { } catch (error) {
// loading.value = false; console.error('医嘱执行-获取处方列表数据处理失败:', error);
// } prescriptionList.value = [];
} finally {
loading.value = false;
}
}).catch((error) => {
console.error('医嘱执行-获取处方列表接口失败:', error);
prescriptionList.value = [];
loading.value = false;
}); });
chooseAll.value = false; chooseAll.value = false;
} else { } else {
prescriptionList.value = []; prescriptionList.value = [];
selectedRowIds.value.clear();
loading.value = false;
// proxy.$message.warning('请选择患者'); // proxy.$message.warning('请选择患者');
} }
} }
@@ -461,11 +469,19 @@ function handleExecute() {
console.log(list, 'list'); console.log(list, 'list');
adviceExecute({ exeDate: exeDate.value, adviceExecuteDetailList: list }).then((res) => { adviceExecute({ exeDate: exeDate.value, adviceExecuteDetailList: list }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
proxy.$modal.msgSuccess(res.msg || '医嘱执行成功');
handleGetPrescription(); handleGetPrescription();
// 仅当选中医嘱中包含药品/耗材类医嘱时,才调用耗材批号匹配
const hasMedOrDevice = list.some(
(item) =>
item.adviceTable === 'med_medication_request' ||
String(item.adviceTable || '').includes('device'),
);
if (hasMedOrDevice) {
lotNumberMatch({ encounterIdList: encounterIds }, { skipErrorMsg: true }).catch((error) => { lotNumberMatch({ encounterIdList: encounterIds }, { skipErrorMsg: true }).catch((error) => {
console.warn('lotNumberMatch failed after adviceExecute:', error); console.warn('lotNumberMatch failed after adviceExecute:', error);
}); });
}
proxy.$modal.msgSuccess(res.msg || '医嘱执行成功');
} else { } else {
proxy.$modal.msgError(res.msg || '医嘱执行失败'); proxy.$modal.msgError(res.msg || '医嘱执行失败');
} }
@@ -500,23 +516,28 @@ function handleCancel() {
let list = getSelectRows(); let list = getSelectRows();
let producerIds = []; let producerIds = [];
list.forEach((item) => { list.forEach((item) => {
// 从 exePerformRecordList 直接提取 procedureId确保取消执行时数据完整 // 从 exePerformRecordList 直接提取 procedureId过滤空值避免后端SQL异常
const procedureIds = (item.exePerformRecordList || []).map((record) => record.procedureId); const procedureIds = (item.exePerformRecordList || [])
.map((record) => record.procedureId)
.filter((id) => id != null && id !== '');
if (procedureIds.length === 0 && (!item.procedureIds || item.procedureIds.length === 0)) { if (procedureIds.length === 0 && (!item.procedureIds || item.procedureIds.length === 0)) {
proxy.$modal.msgError('请选择已执行的医嘱记录'); proxy.$modal.msgError('请选择已执行的医嘱记录');
return; return;
} }
const ids = procedureIds.length > 0 ? procedureIds : item.procedureIds; const ids = procedureIds.length > 0 ? procedureIds : item.procedureIds;
producerIds.push( producerIds.push(
...ids.map((value) => { ...ids
.filter((value) => value != null && value !== '')
.map((value) => {
return { return {
procedureId: value, procedureId: value,
therapyEnum: item.therapyEnum, therapyEnum: Number(item.therapyEnum),
}; };
}) })
); );
}); });
if (producerIds.length === 0) { if (producerIds.length === 0) {
proxy.$modal.msgError('未找到有效的执行记录,无法取消执行');
return; return;
} }
adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => { adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => {
@@ -526,14 +547,20 @@ function handleCancel() {
} else { } else {
proxy.$modal.msgError(res.msg || '取消执行失败'); proxy.$modal.msgError(res.msg || '取消执行失败');
} }
}).catch(() => {
proxy.$modal.msgError('取消执行失败,请稍后重试');
}); });
} }
function getSelectRows() { function getSelectRows() {
// 获取选中的医嘱信息 // 优先从独立维护的selectedRowIds集合中获取选中行避免el-table内部selection状态异常
let list = []; const list = [];
prescriptionList.value.forEach((item, index) => { prescriptionList.value.forEach((item) => {
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()]; item.forEach((row) => {
if (selectedRowIds.value.has(row.requestId)) {
list.push(row);
}
});
}); });
return list; return list;
} }
@@ -609,12 +636,14 @@ function handelSwicthChange(value) {
if (value) { if (value) {
// 全选选中所有行并联动checkbox // 全选选中所有行并联动checkbox
item.forEach((row) => { item.forEach((row) => {
selectedRowIds.value.add(row.requestId);
tableRef[0].toggleRowSelection(row, true); tableRef[0].toggleRowSelection(row, true);
selectAllCheckboxesInRow(row); selectAllCheckboxesInRow(row);
}); });
} else { } else {
// 取消全选取消选中所有行并联动checkbox // 取消全选取消选中所有行并联动checkbox
item.forEach((row) => { item.forEach((row) => {
selectedRowIds.value.delete(row.requestId);
tableRef[0].toggleRowSelection(row, false); tableRef[0].toggleRowSelection(row, false);
unselectAllCheckboxesInRow(row); unselectAllCheckboxesInRow(row);
}); });
@@ -625,11 +654,14 @@ function handelSwicthChange(value) {
// 默认选中全部行 // 默认选中全部行
function defaultSelectAllRows() { function defaultSelectAllRows() {
// 清空并重建选中集合
selectedRowIds.value.clear();
prescriptionList.value.forEach((item, index) => { prescriptionList.value.forEach((item, index) => {
const tableRef = proxy.$refs['tableRef' + index]; const tableRef = proxy.$refs['tableRef' + index];
if (tableRef && tableRef[0]) { if (tableRef && tableRef[0]) {
// 选中该表格的所有行 // 选中该表格的所有行
item.forEach((row) => { item.forEach((row) => {
selectedRowIds.value.add(row.requestId);
tableRef[0].toggleRowSelection(row, true); tableRef[0].toggleRowSelection(row, true);
// 同时选中该行内部的所有checkbox // 同时选中该行内部的所有checkbox
selectAllCheckboxesInRow(row); selectAllCheckboxesInRow(row);
@@ -709,13 +741,14 @@ function checkAndToggleRowSelection(row) {
const tableRef = proxy.$refs['tableRef' + tableIndex]; const tableRef = proxy.$refs['tableRef' + tableIndex];
if (tableRef && tableRef[0]) { if (tableRef && tableRef[0]) {
const isAllSelected = isAllCheckboxesSelected(row); const isAllSelected = isAllCheckboxesSelected(row);
const selectedRows = tableRef[0].getSelectionRows(); const isCurrentlySelected = selectedRowIds.value.has(row.requestId);
const isCurrentlySelected = selectedRows.some((r) => r.requestId === row.requestId);
// 根据checkbox状态更新表格行选中状态 // 根据checkbox状态更新表格行选中状态
if (isAllSelected && !isCurrentlySelected) { if (isAllSelected && !isCurrentlySelected) {
selectedRowIds.value.add(row.requestId);
tableRef[0].toggleRowSelection(row, true); tableRef[0].toggleRowSelection(row, true);
} else if (!isAllSelected && isCurrentlySelected) { } else if (!isAllSelected && isCurrentlySelected) {
selectedRowIds.value.delete(row.requestId);
tableRef[0].toggleRowSelection(row, false); tableRef[0].toggleRowSelection(row, false);
} }
} }
@@ -728,9 +761,11 @@ function handleRowSelect(selection, row, tableIndex) {
const isSelected = selection.some((item) => item.requestId === row.requestId); const isSelected = selection.some((item) => item.requestId === row.requestId);
if (isSelected) { if (isSelected) {
selectedRowIds.value.add(row.requestId);
// 选中行时选中该行内部的所有checkbox // 选中行时选中该行内部的所有checkbox
selectAllCheckboxesInRow(row); selectAllCheckboxesInRow(row);
} else { } else {
selectedRowIds.value.delete(row.requestId);
// 取消选中行时取消选中该行内部的所有checkbox // 取消选中行时取消选中该行内部的所有checkbox
unselectAllCheckboxesInRow(row); unselectAllCheckboxesInRow(row);
} }
@@ -747,11 +782,13 @@ function handleSelectAll(selection, tableIndex) {
if (selection.length > 0) { if (selection.length > 0) {
// 全选时选中所有行内部的所有checkbox // 全选时选中所有行内部的所有checkbox
tableData.forEach((row) => { tableData.forEach((row) => {
selectedRowIds.value.add(row.requestId);
selectAllCheckboxesInRow(row); selectAllCheckboxesInRow(row);
}); });
} else { } else {
// 取消全选时取消选中所有行内部的所有checkbox // 取消全选时取消选中所有行内部的所有checkbox
tableData.forEach((row) => { tableData.forEach((row) => {
selectedRowIds.value.delete(row.requestId);
unselectAllCheckboxesInRow(row); unselectAllCheckboxesInRow(row);
}); });
} }
@@ -763,17 +800,13 @@ function handleSelectAll(selection, tableIndex) {
// 更新全选开关状态 // 更新全选开关状态
function updateChooseAllStatus() { function updateChooseAllStatus() {
let allSelected = true; let allSelected = true;
prescriptionList.value.forEach((item, index) => { prescriptionList.value.forEach((item) => {
const tableRef = proxy.$refs['tableRef' + index]; item.forEach((row) => {
if (tableRef && tableRef[0]) { if (!selectedRowIds.value.has(row.requestId)) {
const selectedRows = tableRef[0].getSelectionRows();
if (selectedRows.length !== item.length) {
allSelected = false;
}
} else {
allSelected = false; allSelected = false;
} }
}); });
});
chooseAll.value = allSelected; chooseAll.value = allSelected;
} }

View File

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

View File

@@ -181,7 +181,7 @@ function handleGetPrescription() {
getPrescriptionList({ getPrescriptionList({
encounterIds: encounterIds, encounterIds: encounterIds,
requestStatus: props.requestStatus, 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, pageSize: 10000,
pageNo: 1, pageNo: 1,
}).then((res) => { }).then((res) => {

View File

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

View File

@@ -1481,6 +1481,8 @@ function handleMedicalAdvice(row) {
const filteredItems = res.data.filter(item => { const filteredItems = res.data.filter(item => {
// 匹配 encounterId // 匹配 encounterId
if (item.encounterId !== row.visitId) return false; if (item.encounterId !== row.visitId) return false;
// 仅保留药品adviceType=1过滤耗材(2)和项目(3)
if (item.adviceType !== 1 && item.advice_type !== 1) return false;
// 过滤掉名称为空的项目 // 过滤掉名称为空的项目
const medicineName = item.adviceName || item.advice_name; const medicineName = item.adviceName || item.advice_name;
if (!medicineName || medicineName.trim() === '') return false; if (!medicineName || medicineName.trim() === '') return false;
@@ -1743,6 +1745,8 @@ function handleQuoteBilling() {
const filteredItems = res.data.filter(item => { const filteredItems = res.data.filter(item => {
// 匹配 encounterId // 匹配 encounterId
if (item.encounterId !== temporaryPatientInfo.value.visitId) return false; if (item.encounterId !== temporaryPatientInfo.value.visitId) return false;
// 仅保留药品adviceType=1过滤耗材(2)和项目(3)
if (item.adviceType !== 1 && item.advice_type !== 1) return false;
// 过滤掉名称为空的项目 // 过滤掉名称为空的项目
const medicineName = item.adviceName || item.advice_name; const medicineName = item.adviceName || item.advice_name;
return medicineName && medicineName.trim() !== ''; return medicineName && medicineName.trim() !== '';

View File

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