Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
777ba71c7d | ||
|
|
c3dfd3eb21 | ||
|
|
8093f8acda | ||
|
|
8fae6fe3d5 | ||
|
|
5af86494dd | ||
|
|
c5820fcec2 | ||
|
|
fbe7f4f41f | ||
|
|
f9ab4c5688 | ||
|
|
861129c9d4 | ||
|
|
78a2dfa3fe | ||
|
|
98e5a0b984 | ||
| e5c944069b | |||
| a68ffbfec4 | |||
| 14f8a8b0a3 | |||
| 0f1e57227b | |||
|
|
98a370f3a2 | ||
| b2ce368749 | |||
| c691f82958 | |||
|
|
d2bfde7230 | ||
|
|
62a09a8b94 | ||
|
|
10b2c58a3e | ||
|
|
abc995523b | ||
|
|
c0438c0288 | ||
|
|
13731c2373 | ||
|
|
d63b00fd33 | ||
|
|
c60cd6878e | ||
|
|
cf50f8968a | ||
|
|
94fac8e257 | ||
|
|
f162134156 | ||
|
|
d866d898df | ||
|
|
6725cef643 | ||
|
|
7790a64eab | ||
|
|
49fa1c9b90 | ||
|
|
e0a035204e | ||
|
|
349b0453c8 | ||
|
|
3ddd74d679 | ||
|
|
9829843b3e | ||
|
|
0d95cc1341 | ||
|
|
1dfceeaf46 | ||
|
|
1b79df4f93 | ||
|
|
f62a280dfc | ||
|
|
e5d949a740 |
@@ -135,7 +135,8 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
||||
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
||||
|
||||
Long activityDefinitionId = orgLoc.getActivityDefinitionId();
|
||||
String activityName = activityDefinitionId != null ? activityDefinitionMapper.selectById(activityDefinitionId).getName() : "";
|
||||
String activityName = activityDefinitionId != null
|
||||
? activityDefinitionMapper.selectById(activityDefinitionId).getName() : "";
|
||||
|
||||
List<OrganizationLocation> organizationLocationList =
|
||||
organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
||||
@@ -147,8 +148,8 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
||||
for (OrganizationLocation organizationLocation : organizationLocationList)
|
||||
if (DateTimeUtils.isOverlap(organizationLocation.getStartTime(), organizationLocation.getEndTime(),
|
||||
orgLoc.getStartTime(), orgLoc.getEndTime())) {
|
||||
String organizationName =
|
||||
organizationService.getById(organizationLocation.getOrganizationId()).getName();
|
||||
Organization org = organizationService.getById(organizationLocation.getOrganizationId());
|
||||
String organizationName = org != null ? org.getName() : "未知科室";
|
||||
return R.fail("当前诊疗:" + activityName + CommonConstants.Common.DASH + orgLoc.getStartTime()
|
||||
+ CommonConstants.Common.DASH + orgLoc.getEndTime() + "与" + organizationName + "时间冲突");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
|
||||
// 清除相关缓存
|
||||
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);
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"手术信息"}));
|
||||
return R.ok(null, "手术申请修改成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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() + "】未匹配到库存信息");
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface IRequestFormManageAppService {
|
||||
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode);
|
||||
|
||||
/**
|
||||
* 查询申请单(支持筛选)
|
||||
* 查询申请单(支持日期和状态筛选)
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param typeCode 申请单类型
|
||||
@@ -44,6 +44,19 @@ public interface IRequestFormManageAppService {
|
||||
*/
|
||||
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate, String status);
|
||||
|
||||
/**
|
||||
* 查询申请单(支持日期、状态和关键字筛选)
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param typeCode 申请单类型
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @param keyword 关键字(可选,申请单号/检查项目名称模糊匹配)
|
||||
* @return 申请单列表
|
||||
*/
|
||||
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate, String status, String keyword);
|
||||
|
||||
/**
|
||||
* 分页查询申请单
|
||||
*
|
||||
@@ -51,4 +64,20 @@ public interface IRequestFormManageAppService {
|
||||
* @return 申请单
|
||||
*/
|
||||
IPage<RequestFormPageDto> getRequestFormPage(RequestFormDto requestFormDto);
|
||||
|
||||
/**
|
||||
* 删除申请单(仅待签发状态可删除)
|
||||
*
|
||||
* @param requestFormId 申请单ID
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> deleteRequestForm(Long requestFormId);
|
||||
|
||||
/**
|
||||
* 撤回申请单(已签发状态撤回至待签发)
|
||||
*
|
||||
* @param requestFormId 申请单ID
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> withdrawRequestForm(Long requestFormId);
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
@@ -414,7 +415,7 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
@Override
|
||||
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode) {
|
||||
// 调用重载方法,不传筛选参数
|
||||
return getRequestForm(encounterId, typeCode, null, null, null);
|
||||
return getRequestForm(encounterId, typeCode, null, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -425,16 +426,17 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @param keyword 关键字(可选,申请单号/检查项目名称模糊匹配)
|
||||
* @return 申请单列表
|
||||
*/
|
||||
@Override
|
||||
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate, String status) {
|
||||
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate, String status, String keyword) {
|
||||
// 检查参数
|
||||
if (encounterId == null) {
|
||||
return new java.util.ArrayList<>(); // 返回空列表而不是查询数据库
|
||||
}
|
||||
|
||||
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode, startDate, endDate, status);
|
||||
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode, startDate, endDate, status, keyword);
|
||||
for (RequestFormQueryDto requestFormQueryDto : requestFormList) {
|
||||
// 查询处方详情
|
||||
List<RequestFormDetailQueryDto> requestFormDetail =
|
||||
@@ -456,4 +458,68 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
||||
return requestFormManageAppMapper.getRequestFormPage(requestFormDto, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除申请单(仅待签发状态可删除)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> deleteRequestForm(Long requestFormId) {
|
||||
if (requestFormId == null) {
|
||||
return R.fail("申请单ID不能为空");
|
||||
}
|
||||
RequestForm requestForm = iRequestFormService.getById(requestFormId);
|
||||
if (requestForm == null) {
|
||||
return R.fail("申请单不存在");
|
||||
}
|
||||
if (!Integer.valueOf(0).equals(requestForm.getStatus())) {
|
||||
return R.fail("仅待签发状态的申请单可删除");
|
||||
}
|
||||
// 删除申请单
|
||||
iRequestFormService.removeById(requestFormId);
|
||||
// 删除关联的诊疗项目及账单
|
||||
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||
List<Long> serviceRequestIds = iServiceRequestService
|
||||
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo))
|
||||
.stream().map(ServiceRequest::getId).collect(Collectors.toList());
|
||||
for (Long serviceRequestId : serviceRequestIds) {
|
||||
iServiceRequestService.removeById(serviceRequestId);
|
||||
iChargeItemService.deleteByServiceTableAndId(CommonConstants.TableName.WOR_SERVICE_REQUEST, serviceRequestId);
|
||||
}
|
||||
return R.ok(null, "删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回申请单(已签发状态撤回至待签发)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> withdrawRequestForm(Long requestFormId) {
|
||||
if (requestFormId == null) {
|
||||
return R.fail("申请单ID不能为空");
|
||||
}
|
||||
RequestForm requestForm = iRequestFormService.getById(requestFormId);
|
||||
if (requestForm == null) {
|
||||
return R.fail("申请单不存在");
|
||||
}
|
||||
if (!Integer.valueOf(1).equals(requestForm.getStatus())) {
|
||||
return R.fail("仅已签发状态的申请单可撤回");
|
||||
}
|
||||
// 将申请单状态回滚至待签发
|
||||
RequestForm updateForm = new RequestForm();
|
||||
updateForm.setId(requestFormId);
|
||||
updateForm.setStatus(0);
|
||||
iRequestFormService.updateById(updateForm);
|
||||
// 将关联的诊疗项目状态回滚至DRAFT
|
||||
String prescriptionNo = requestForm.getPrescriptionNo();
|
||||
List<ServiceRequest> serviceRequests = iServiceRequestService
|
||||
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo));
|
||||
for (ServiceRequest serviceRequest : serviceRequests) {
|
||||
ServiceRequest updateService = new ServiceRequest();
|
||||
updateService.setId(serviceRequest.getId());
|
||||
updateService.setStatusEnum(RequestStatus.DRAFT.getValue());
|
||||
iServiceRequestService.updateById(updateService);
|
||||
}
|
||||
return R.ok(null, "撤回成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -81,14 +81,23 @@ public class RequestFormManageController {
|
||||
* 查询检查申请单
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @param keyword 关键字(可选,申请单号/检查项目名称模糊匹配)
|
||||
* @return 检查申请单
|
||||
*/
|
||||
@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,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
if (encounterId == null) {
|
||||
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, keyword));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,6 +107,7 @@ public class RequestFormManageController {
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @param keyword 关键字(可选,申请单号/检验项目名称模糊匹配)
|
||||
* @return 检验申请单
|
||||
*/
|
||||
@GetMapping(value = "/get-inspection")
|
||||
@@ -105,11 +115,12 @@ public class RequestFormManageController {
|
||||
@RequestParam(required = false) Long encounterId,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate,
|
||||
@RequestParam(required = false) String status) {
|
||||
@RequestParam(required = false) String status,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
if (encounterId == null) {
|
||||
return R.fail("就诊ID不能为空");
|
||||
}
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode(), startDate, endDate, status));
|
||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode(), startDate, endDate, status, keyword));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,13 +37,15 @@ public interface RequestFormManageAppMapper {
|
||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||
* @param status 单据状态(可选)
|
||||
* @param keyword 关键字(可选,申请单号/检查项目名称模糊匹配)
|
||||
* @return 申请单列表
|
||||
*/
|
||||
List<RequestFormQueryDto> getRequestForm(@Param("encounterId") Long encounterId,
|
||||
@Param("typeCode") String typeCode,
|
||||
@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate,
|
||||
@Param("status") String status);
|
||||
@Param("status") String status,
|
||||
@Param("keyword") String keyword);
|
||||
|
||||
/**
|
||||
* 查询申请单详情
|
||||
|
||||
@@ -331,12 +331,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
) t
|
||||
WHERE rn = 1
|
||||
) 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
|
||||
<where>
|
||||
s.delete_flag = '0'
|
||||
<!-- 只显示未生成医嘱的手术 -->
|
||||
AND sr.id IS NULL
|
||||
<if test="ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
<!-- 补充 encounter_id 替换,修复多表关联时字段歧义。注释不能放进 OGNL 表达式内部。 -->
|
||||
<![CDATA[
|
||||
|
||||
@@ -31,6 +31,16 @@
|
||||
<if test="status != null and status != ''">
|
||||
AND drf.status = #{status}::integer
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (drf.prescription_no LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR EXISTS (
|
||||
SELECT 1 FROM wor_service_request wsr_kw
|
||||
LEFT JOIN wor_activity_definition wad_kw ON wad_kw.id = wsr_kw.activity_id
|
||||
WHERE wsr_kw.prescription_no = drf.prescription_no
|
||||
AND wsr_kw.delete_flag = '0'
|
||||
AND wad_kw.name LIKE CONCAT('%', #{keyword}, '%')
|
||||
))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||
|
||||
@@ -59,4 +59,9 @@ public class RequestForm extends HisBaseEntity {
|
||||
*/
|
||||
private String typeCode;
|
||||
|
||||
/**
|
||||
* 单据状态 0=待签发 1=已签发 2=已校对 3=待接收 4=已接收 5=已检查 6=已出报告 7=已作废
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -38,7 +38,6 @@ export function listAdviceTypes(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
/**
|
||||
* 查询手术室详细
|
||||
|
||||
@@ -1146,7 +1146,13 @@ function calculateTotalPrice(row, index) {
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({ getListInfo });
|
||||
function closeAllPopovers() {
|
||||
prescriptionList.value.forEach(row => {
|
||||
row.showPopover = false;
|
||||
});
|
||||
}
|
||||
|
||||
defineExpose({ getListInfo, closeAllPopovers });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -41,43 +41,9 @@
|
||||
</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">
|
||||
<el-col :span="12" class="form-item">
|
||||
<span class="form-label">工作单位(学校)</span>
|
||||
<el-input v-model="form.workplace" class="underline-input" />
|
||||
</el-col>
|
||||
@@ -522,7 +488,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, getCurrentInstance, watch } from 'vue';
|
||||
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 { useDict } from '@/utils/dict';
|
||||
|
||||
@@ -1237,7 +1203,7 @@ function calculateAge() {
|
||||
* 显示对话框并初始化表单数据
|
||||
* @param {Object} diagnosisData - 诊断数据,包含已选疾病和地址信息
|
||||
*/
|
||||
function show(diagnosisData) {
|
||||
async function show(diagnosisData) {
|
||||
dialogVisible.value = true;
|
||||
|
||||
// 重置地址选择器状态
|
||||
@@ -1267,12 +1233,24 @@ function show(diagnosisData) {
|
||||
});
|
||||
}
|
||||
|
||||
// 生成默认卡片编号:医疗机构编码+当前年月日+4位流水
|
||||
// 生成默认卡片编号:调用后端接口获取
|
||||
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 = {
|
||||
// 卡片编号:单位自编,与网络直报一致
|
||||
cardNo: '',
|
||||
cardNo: cardNo,
|
||||
|
||||
// 患者基本信息
|
||||
patName: patientInfo.patientName || patientInfo.name || '', // 患者姓名
|
||||
|
||||
@@ -522,6 +522,7 @@ const categoryList = ref([]); // 原始分类+项目数据
|
||||
const dictSearchKey = ref('');
|
||||
const activeNames = ref(''); // 当前展开的折叠项
|
||||
const categoryLoadingSet = ref(new Set()); // Bug #500: 正在加载方法的分类集合
|
||||
const isAnimating = ref(false); // Bug #500: 防止快速切换时折叠动画重叠导致抖动
|
||||
|
||||
const allMethods = ref([]);
|
||||
|
||||
@@ -669,8 +670,13 @@ async function handleCategoryExpand(cat) {
|
||||
categoryLoadingSet.value.delete(cat.typeId);
|
||||
}
|
||||
}
|
||||
// Bug #500: 改为非 async 函数,避免 el-collapse 的 @change 等待异步完成导致抖动
|
||||
// Bug #500: 添加防抖逻辑,快速切换时跳过中间状态的动画,避免高度跳变和白屏闪烁
|
||||
function handleCollapseChange(activeName) {
|
||||
if (isAnimating.value) return; // 动画进行中,忽略后续点击
|
||||
|
||||
isAnimating.value = true;
|
||||
setTimeout(() => { isAnimating.value = false; }, 300); // 与 CSS 过渡时长一致
|
||||
|
||||
if (activeName) {
|
||||
const cat = filteredCategoryList.value.find(c => c.typeId == activeName);
|
||||
if (cat && (!cat.methods || cat.methods.length === 0)) {
|
||||
@@ -1307,6 +1313,7 @@ defineExpose({ getList });
|
||||
.collapse-scroll {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden; /* Bug #500: 防止切换时水平方向溢出导致抖动 */
|
||||
}
|
||||
.empty-hint {
|
||||
color: #909399;
|
||||
@@ -1479,10 +1486,10 @@ defineExpose({ getList });
|
||||
padding-bottom: 4px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
/* Bug #500: 折叠面板展开/收起动画使用 will-change 优化性能 */
|
||||
/* Bug #500: 折叠面板动画容器,添加 overflow:hidden 防止展开时内容溢出导致闪烁 */
|
||||
:deep(.el-collapse-item__wrap) {
|
||||
border: none;
|
||||
will-change: height;
|
||||
overflow: hidden;
|
||||
}
|
||||
:deep(.el-collapse-item) {
|
||||
transition: margin 0.2s ease;
|
||||
|
||||
@@ -246,7 +246,8 @@
|
||||
<el-input-number :min="0" v-model="scope.row.doseQuantity" controls-position="right"
|
||||
:controls="false" style="width: 70px; margin-right: 20px"
|
||||
: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-select v-model="scope.row.minUnitCode" style="width: 70px; margin-right: 20px" placeholder=" ">
|
||||
@@ -294,7 +295,8 @@
|
||||
}
|
||||
// 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)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
@@ -313,6 +315,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)
|
||||
">
|
||||
|
||||
@@ -56,137 +56,6 @@
|
||||
<!-- 手术等级 -->
|
||||
<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">
|
||||
<template #default="scope">
|
||||
{{ scope.row.operatingRoomConfirmTime ? parseTime(scope.row.operatingRoomConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') : '-' }}
|
||||
|
||||
@@ -175,10 +175,9 @@ const hasMatchedFields = computed(() => {
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
const getLocationInfo = async () => {
|
||||
const res = await getOrgList();
|
||||
orgOptions.value = res.data.records;
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
@@ -199,7 +198,12 @@ const recursionFun = (targetDepartment) => {
|
||||
return name;
|
||||
};
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
const handleViewDetail = async (row) => {
|
||||
// 确保科室数据已加载,以便将 ID 解析为名称
|
||||
if (!orgOptions.value || orgOptions.value.length === 0) {
|
||||
await getLocationInfo();
|
||||
}
|
||||
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
if (row.descJson) {
|
||||
@@ -220,10 +224,9 @@ const handleViewDetail = (row) => {
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
async (val) => {
|
||||
if (val) {
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
await Promise.all([fetchData(), getLocationInfo()]);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
|
||||
@@ -86,9 +86,13 @@
|
||||
</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="prescriptionNo" label="申请单号" width="140" />
|
||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||
<el-table-column label="申请单状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
@@ -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)
|
||||
@@ -167,7 +171,7 @@
|
||||
<el-descriptions-item label="创建时间">{{
|
||||
currentDetail.createTime || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="处方号">{{
|
||||
<el-descriptions-item label="申请单号">{{
|
||||
currentDetail.prescriptionNo || '-'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请者">{{
|
||||
@@ -223,6 +227,47 @@
|
||||
<el-form-item label="申请单名称">
|
||||
<el-input v-model="editForm.name" />
|
||||
</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-input v-model="editForm.clinicalDiagnosis" type="textarea" :rows="2" />
|
||||
</el-form-item>
|
||||
@@ -399,9 +444,36 @@ 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: '发往科室',
|
||||
urgencyLevel: '紧急程度',
|
||||
allergyHistory: '过敏史',
|
||||
examinationPurpose: '检查目的',
|
||||
medicalHistorySummary: '病史摘要',
|
||||
expectedExaminationTime: '期望检查时间',
|
||||
symptom: '症状',
|
||||
sign: '体征',
|
||||
clinicalDiagnosis: '临床诊断',
|
||||
@@ -424,39 +496,58 @@ const hasMatchedFields = computed(() => {
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
const getLocationInfo = async () => {
|
||||
const res = await getOrgList();
|
||||
orgOptions.value = res.data.records;
|
||||
};
|
||||
|
||||
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 (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
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;
|
||||
};
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
const handleViewDetail = async (row) => {
|
||||
console.log('targetDepartment========>', JSON.stringify(row));
|
||||
|
||||
// 确保科室数据已加载,以便将 ID 解析为名称
|
||||
if (!orgOptions.value || orgOptions.value.length === 0) {
|
||||
await getLocationInfo();
|
||||
}
|
||||
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
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;
|
||||
}
|
||||
// 紧急程度转换为显示文本
|
||||
const urgencyMap = { routine: '普通', emergency: '急诊' };
|
||||
if (obj.urgencyLevel) {
|
||||
obj.urgencyLevel = urgencyMap[obj.urgencyLevel] || obj.urgencyLevel;
|
||||
}
|
||||
descJsonData.value = obj;
|
||||
} catch (e) {
|
||||
console.error('解析 descJson 失败:', e);
|
||||
@@ -478,6 +569,12 @@ const handleEdit = (row) => {
|
||||
if (row.descJson) {
|
||||
try {
|
||||
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.attention = desc.attention || '';
|
||||
form.symptom = desc.symptom || '';
|
||||
@@ -508,6 +605,12 @@ const handleSaveEdit = async () => {
|
||||
name: editForm.value.name,
|
||||
organizationId: editDetail.value.inHospitalOrgId || patientInfo.value?.inHospitalOrgId,
|
||||
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,
|
||||
attention: editForm.value.attention,
|
||||
symptom: editForm.value.symptom,
|
||||
@@ -651,9 +754,9 @@ 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.prescriptionNo || '-'}</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>
|
||||
${descHtml ? `<h3>申请单描述</h3>${descHtml}` : ''}
|
||||
@@ -681,10 +784,9 @@ const handleViewReport = async (row) => {
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
async (val) => {
|
||||
if (val) {
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
await Promise.all([fetchData(), getLocationInfo()]);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
filterForm.value.dateRange = getDefaultDateRange();
|
||||
|
||||
@@ -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>
|
||||
@@ -181,10 +181,9 @@ const hasMatchedFields = computed(() => {
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
const getLocationInfo = async () => {
|
||||
const res = await getOrgList();
|
||||
orgOptions.value = res.data.records;
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
@@ -205,7 +204,12 @@ const recursionFun = (targetDepartment) => {
|
||||
return name;
|
||||
};
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
const handleViewDetail = async (row) => {
|
||||
// 确保科室数据已加载,以便将 ID 解析为名称
|
||||
if (!orgOptions.value || orgOptions.value.length === 0) {
|
||||
await getLocationInfo();
|
||||
}
|
||||
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
if (row.descJson) {
|
||||
@@ -226,10 +230,9 @@ const handleViewDetail = (row) => {
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
async (val) => {
|
||||
if (val) {
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
await Promise.all([fetchData(), getLocationInfo()]);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
}
|
||||
|
||||
@@ -47,6 +47,15 @@
|
||||
<el-option label="已作废" value="5" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字">
|
||||
<el-input
|
||||
v-model="filterForm.keyword"
|
||||
placeholder="申请单号/检验项目"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearch" :loading="loading">
|
||||
<el-icon><Search /></el-icon>
|
||||
@@ -173,7 +182,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();
|
||||
|
||||
@@ -188,6 +197,7 @@ const orgOptions = ref([]);
|
||||
const filterForm = ref({
|
||||
dateRange: [], // [startDate, endDate]
|
||||
status: '', // 单据状态
|
||||
keyword: '', // 关键字搜索
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
@@ -212,6 +222,11 @@ const fetchData = async () => {
|
||||
params.status = filterForm.value.status;
|
||||
}
|
||||
|
||||
// 添加关键字搜索
|
||||
if (filterForm.value.keyword && filterForm.value.keyword.trim()) {
|
||||
params.keyword = filterForm.value.keyword.trim();
|
||||
}
|
||||
|
||||
const res = await getInspection(params);
|
||||
if (res.code === 200 && res.data) {
|
||||
const raw = res.data?.records || res.data;
|
||||
@@ -251,6 +266,7 @@ const handleReset = () => {
|
||||
// 重置筛选条件为默认值
|
||||
filterForm.value.dateRange = [];
|
||||
filterForm.value.status = '';
|
||||
filterForm.value.keyword = '';
|
||||
// 重新加载数据
|
||||
fetchData();
|
||||
};
|
||||
@@ -331,10 +347,9 @@ const hasMatchedFields = computed(() => {
|
||||
});
|
||||
|
||||
/** 查询科室 */
|
||||
const getLocationInfo = () => {
|
||||
getOrgList().then((res) => {
|
||||
orgOptions.value = res.data.records;
|
||||
});
|
||||
const getLocationInfo = async () => {
|
||||
const res = await getDepartmentList();
|
||||
orgOptions.value = res.data || [];
|
||||
};
|
||||
|
||||
const recursionFun = (targetDepartment) => {
|
||||
@@ -345,17 +360,24 @@ const recursionFun = (targetDepartment) => {
|
||||
name = obj.name;
|
||||
}
|
||||
const subObjArray = obj['children'];
|
||||
for (let index = 0; index < subObjArray.length; index++) {
|
||||
const item = subObjArray[index];
|
||||
if (item.id == targetDepartment) {
|
||||
name = item.name;
|
||||
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;
|
||||
};
|
||||
|
||||
const handleViewDetail = (row) => {
|
||||
const handleViewDetail = async (row) => {
|
||||
// 确保科室数据已加载,以便将 ID 解析为名称
|
||||
if (!orgOptions.value || orgOptions.value.length === 0) {
|
||||
await getLocationInfo();
|
||||
}
|
||||
|
||||
currentDetail.value = row;
|
||||
// 解析 descJson
|
||||
if (row.descJson) {
|
||||
@@ -376,7 +398,7 @@ const handleViewDetail = (row) => {
|
||||
|
||||
watch(
|
||||
() => patientInfo.value?.encounterId,
|
||||
(val) => {
|
||||
async (val) => {
|
||||
if (val) {
|
||||
// 设置默认日期范围为近7天
|
||||
const today = new Date();
|
||||
@@ -396,13 +418,13 @@ watch(
|
||||
formatDate(today)
|
||||
];
|
||||
|
||||
fetchData();
|
||||
getLocationInfo();
|
||||
await Promise.all([fetchData(), getLocationInfo()]);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
// 重置筛选条件
|
||||
filterForm.value.dateRange = [];
|
||||
filterForm.value.status = '';
|
||||
filterForm.value.keyword = '';
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
|
||||
@@ -176,6 +176,8 @@ const projectWithDepartment = (selectProjectIds, type) => {
|
||||
});
|
||||
arr.push(searchData);
|
||||
});
|
||||
// 保存用户手动选择的发往科室(提交时需要保留)
|
||||
const manualDept = type === 2 ? form.targetDepartment : '';
|
||||
// 清空科室
|
||||
form.targetDepartment = '';
|
||||
if (arr.length > 0) {
|
||||
@@ -194,11 +196,17 @@ const projectWithDepartment = (selectProjectIds, type) => {
|
||||
// 选中项目中的执行科室id与全部科室数据做匹配
|
||||
const findItem = findTreeItem(orgOptions.value, obj.orgId);
|
||||
if (!findItem) {
|
||||
isRelease = false;
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '未找到项目执行的科室',
|
||||
});
|
||||
// type=2(提交)时,若用户已手动选择发往科室,则允许提交
|
||||
if (type === 2 && manualDept) {
|
||||
form.targetDepartment = manualDept;
|
||||
isRelease = true;
|
||||
} else {
|
||||
isRelease = false;
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '未找到项目执行的科室',
|
||||
});
|
||||
}
|
||||
}
|
||||
if (type == 1) {
|
||||
if (isRelease) {
|
||||
@@ -232,7 +240,7 @@ const submit = () => {
|
||||
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
||||
unitPrice: item.priceList[0].price /** 单价 */,
|
||||
totalPrice: item.priceList[0].price /** 总价 */,
|
||||
positionId: item.positionId, //执行科室id
|
||||
positionId: item.positionId || form.targetDepartment, //执行科室id,未配置时使用用户手动选择的科室
|
||||
ybClassEnum: item.ybClassEnum, //类别医保编码
|
||||
conditionId: item.conditionId, //诊断ID
|
||||
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
||||
|
||||
@@ -42,6 +42,40 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</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-form-item label="症状" prop="symptom" style="width: 100%">
|
||||
<el-input v-model="form.symptom" autocomplete="off" type="textarea" />
|
||||
@@ -145,6 +179,11 @@ const transferValue = ref([]);
|
||||
const form = reactive({
|
||||
// categoryType: '', // 项目类别
|
||||
targetDepartment: '', // 发往科室
|
||||
urgencyLevel: '', // 紧急程度
|
||||
allergyHistory: '', // 过敏史
|
||||
examinationPurpose: '', // 检查目的
|
||||
medicalHistorySummary: '', // 病史摘要
|
||||
expectedExaminationTime: '', // 期望检查时间
|
||||
symptom: '', // 症状
|
||||
sign: '', // 体征
|
||||
clinicalDiagnosis: '', // 临床诊断
|
||||
|
||||
@@ -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">
|
||||
{{
|
||||
[
|
||||
@@ -879,14 +877,13 @@ function handleDiagnosisChange(item) {
|
||||
function handleFocus(row, index) {
|
||||
rowIndex.value = index;
|
||||
row.showPopover = true;
|
||||
// el-popover 懒渲染,需要等两帧组件才会挂载
|
||||
const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
|
||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||
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);
|
||||
// 诊疗(3)和手术(6)没有categoryCode,传空字符串给refresh,由子组件转为undefined不发送
|
||||
// 药品(1)才有categoryCode(如'1'=中成药,'2'=西药,'4'=中草药)
|
||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
|
||||
// 修复Bug #486:当行没有显式选择医嘱类型时(row.adviceType为undefined),
|
||||
// 不传categoryCode,让搜索在全药库中进行;只有行已选择类型时才用对应categoryCode过滤
|
||||
const categoryCode = row.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : '';
|
||||
const searchKey = row.adviceName || '';
|
||||
|
||||
nextTick(() => {
|
||||
@@ -923,8 +920,9 @@ function handleChange(value) {
|
||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||
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);
|
||||
// 诊疗/手术的categoryCode为空字符串,由子组件转为undefined不发送
|
||||
const categoryCode = selectedItem ? selectedItem.categoryCode : (adviceQueryParams.value.categoryCode || '');
|
||||
// 修复Bug #486:当行没有显式选择医嘱类型时(row?.adviceType为undefined),
|
||||
// 不传categoryCode,让搜索在全药库中进行;只有行已选择类型时才用对应categoryCode过滤
|
||||
const categoryCode = row?.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : '';
|
||||
tableRef.refresh(adviceType, categoryCode, value);
|
||||
}
|
||||
}
|
||||
@@ -1214,12 +1212,8 @@ function handleSave() {
|
||||
getListInfo(false);
|
||||
bindMethod.value = {};
|
||||
nextId.value == 1;
|
||||
|
||||
// 处方保存成功后,自动将医嘱信息同步至患者处置记录
|
||||
// handleEmrTreatment();
|
||||
} else {
|
||||
proxy.$modal.msgError(res.message);
|
||||
conso;
|
||||
isSaving.value = false;
|
||||
}
|
||||
})
|
||||
@@ -1319,22 +1313,26 @@ function handleCancelEdit(row, index) {
|
||||
function handleSaveSign(row, index) {
|
||||
if (row.adviceType != 2) {
|
||||
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
||||
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
||||
if (res.data.length == 0) {
|
||||
return;
|
||||
}
|
||||
let openBindDialog = localStorage.getItem('doctor' + userStore.id);
|
||||
if (!JSON.parse(openBindDialog)) {
|
||||
proxy.$refs['orderBindInfoRef'].open(res.data);
|
||||
} else {
|
||||
// 如果弹窗不提示带出的项目,自动带出
|
||||
// 如果有未签发的项目,并且当前的项目没有带出过绑定项目,则自动带出
|
||||
if (!bindMethod.value[itemNo]) {
|
||||
handleOrderBindInfo(res.data);
|
||||
bindMethod.value[itemNo] = true;
|
||||
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;
|
||||
}
|
||||
}
|
||||
});
|
||||
let openBindDialog = localStorage.getItem('doctor' + userStore.id);
|
||||
if (!JSON.parse(openBindDialog)) {
|
||||
proxy.$refs['orderBindInfoRef'].open(res.data);
|
||||
} else {
|
||||
// 如果弹窗不提示带出的项目,自动带出
|
||||
// 如果有未签发的项目,并且当前的项目没有带出过绑定项目,则自动带出
|
||||
if (!bindMethod.value[itemNo]) {
|
||||
handleOrderBindInfo(res.data);
|
||||
bindMethod.value[itemNo] = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 更新UI状态
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
</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" />
|
||||
<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>
|
||||
@@ -46,10 +44,11 @@
|
||||
</div>
|
||||
</template>
|
||||
<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 inPatientBarDoctorFold from '@/components/patientBar/inPatientBarDoctorFold.vue';
|
||||
import SummaryDrugApplication from './components/applicationShow/summaryDrugApplication.vue';
|
||||
import PatientList from '@/components/PatientList/patient-list.vue';
|
||||
import {localPatientInfo, updateLocalPatientInfo} from './store/localPatient';
|
||||
import {patientInfo, updatePatientInfo} from './store/patient';
|
||||
@@ -84,6 +83,7 @@ const currentPatientInfo = ref({});
|
||||
const testApplicationRef = ref();
|
||||
const examineApplicationRef = ref();
|
||||
const surgeryApplicationRef = ref();
|
||||
const summaryDrugApplicationRef = ref();
|
||||
const bloodTtransfusionAapplicationRef = ref();
|
||||
|
||||
// 患者列表相关逻辑
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
v-for="dept in getFilteredOptions(scope.row, 'departmentOptions')"
|
||||
:key="dept.id"
|
||||
:label="dept.name"
|
||||
:value="dept.id"
|
||||
:value="String(dept.id)"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
@@ -197,7 +197,7 @@
|
||||
v-for="dept in getFilteredOptions(scope.row, 'locationOptions')"
|
||||
:key="dept.value"
|
||||
:label="dept.label"
|
||||
:value="dept.value"
|
||||
:value="String(dept.value)"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
@@ -280,8 +280,16 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<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="使用范围" prop="rangeCode_dictText" width="100" align="center" />
|
||||
<el-table-column label="组套名称" min-width="180" show-overflow-tooltip>
|
||||
<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">
|
||||
<template #default="scope">
|
||||
{{ scope.row.detailList?.length || 0 }} 项
|
||||
@@ -481,11 +489,16 @@ watch(
|
||||
|
||||
// 加载科室选项
|
||||
function loadDepartmentOptions() {
|
||||
getOrgList().then((res) => {
|
||||
if (res.data && res.data.records && res.data.records.length > 0) {
|
||||
departmentOptions.value = res.data.records[0].children || [];
|
||||
}
|
||||
});
|
||||
getOrgList()
|
||||
.then((res) => {
|
||||
if (res.data && res.data.records && res.data.records.length > 0) {
|
||||
departmentOptions.value = res.data.records[0].children || [];
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn('科室列表加载失败(可能无权限)');
|
||||
departmentOptions.value = [];
|
||||
});
|
||||
}
|
||||
|
||||
// 加载收费组套数据
|
||||
@@ -504,10 +517,15 @@ function getAdviceBaseInfos() {
|
||||
});
|
||||
}
|
||||
function getDiseaseInitLoc() {
|
||||
getDiseaseTreatmentInitLoc(16).then((response) => {
|
||||
console.log('Disease Treatment Init Loc:', response);
|
||||
locationOptions.value = response.data.locationOptions;
|
||||
});
|
||||
getDiseaseTreatmentInitLoc(16)
|
||||
.then((response) => {
|
||||
console.log('Disease Treatment Init Loc:', response);
|
||||
locationOptions.value = response.data.locationOptions;
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn('位置列表加载失败(可能无权限)');
|
||||
locationOptions.value = [];
|
||||
});
|
||||
}
|
||||
// 下拉框模糊搜索过滤
|
||||
function filterOptions(val, row, optionsKey) {
|
||||
@@ -603,15 +621,23 @@ function selectChange(row) {
|
||||
const price = row.priceList?.[0]?.price || 0;
|
||||
//获取大小单位
|
||||
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;
|
||||
if (row.adviceType === 3 && departmentOptions.value.length > 0) {
|
||||
// 诊疗:优先使用患者所在科室,否则取第一个科室
|
||||
defaultPositionId = departmentOptions.value.find(d => d.id === props.patientInfo.organizationId)?.id
|
||||
|| departmentOptions.value[0]?.id;
|
||||
const patientOrgId = props.patientInfo.organizationId;
|
||||
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) {
|
||||
// 耗材:默认取第一个药房/耗材房
|
||||
defaultPositionId = locationOptions.value[0]?.value;
|
||||
defaultPositionId = String(locationOptions.value[0].value);
|
||||
}
|
||||
//插入费用列表
|
||||
feeItemsList.value.push({
|
||||
@@ -619,8 +645,8 @@ function selectChange(row) {
|
||||
uniqueUnitCodes: uniqueUnitCodes,
|
||||
unitPrice: (price / (row.partPercent || 1)).toFixed(6), // 根据拆零比计算单价
|
||||
quantity: 1,
|
||||
positionId: defaultPositionId, // 默认执行科室/位置
|
||||
selectUnitCode: String(row.minUnitCode || ''), // 默认选择小单位,确保字符串类型
|
||||
positionId: defaultPositionId, // 默认执行科室/位置(字符串类型)
|
||||
selectUnitCode: defaultUnitCode, // 默认选择小单位
|
||||
});
|
||||
}
|
||||
|
||||
@@ -745,7 +771,7 @@ function openGroupSetDialog() {
|
||||
|
||||
function loadGroupSets() {
|
||||
groupSetLoading.value = true;
|
||||
getOrderGroup({ organizationId: orgId.value, searchKey: groupSetSearchText.value })
|
||||
getOrderGroup({ organizationId: orgId.value })
|
||||
.then((res) => {
|
||||
const data = res?.data || {};
|
||||
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) {
|
||||
selectedGroupSet.value = row;
|
||||
}
|
||||
|
||||
@@ -273,8 +273,9 @@ function handleSearch() {
|
||||
// 清除缓存(搜索时需要重新加载)
|
||||
patientDataCache.value.clear();
|
||||
|
||||
// 重新加载所有已展开病区的患者列表
|
||||
reloadAllPatients();
|
||||
// 通过递增 key 强制重新渲染树组件,触发重新加载所有病区患者列表
|
||||
// 此时 searchKey 已有值,loadPatientList 会将 searchKey 传给后端进行过滤
|
||||
treeKey.value += 1;
|
||||
}
|
||||
|
||||
// 暴露方法供外部调用
|
||||
|
||||
@@ -67,9 +67,6 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div
|
||||
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
|
||||
v-loading="loading"
|
||||
@@ -232,7 +229,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 +239,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 +282,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 +430,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('请选择患者');
|
||||
}
|
||||
}
|
||||
@@ -500,23 +508,28 @@ function handleCancel() {
|
||||
let list = getSelectRows();
|
||||
let producerIds = [];
|
||||
list.forEach((item) => {
|
||||
// 从 exePerformRecordList 直接提取 procedureId,确保取消执行时数据完整
|
||||
const procedureIds = (item.exePerformRecordList || []).map((record) => record.procedureId);
|
||||
// 从 exePerformRecordList 直接提取 procedureId,过滤空值避免后端SQL异常
|
||||
const procedureIds = (item.exePerformRecordList || [])
|
||||
.map((record) => record.procedureId)
|
||||
.filter((id) => id != null && id !== '');
|
||||
if (procedureIds.length === 0 && (!item.procedureIds || item.procedureIds.length === 0)) {
|
||||
proxy.$modal.msgError('请选择已执行的医嘱记录');
|
||||
return;
|
||||
}
|
||||
const ids = procedureIds.length > 0 ? procedureIds : item.procedureIds;
|
||||
producerIds.push(
|
||||
...ids.map((value) => {
|
||||
return {
|
||||
procedureId: value,
|
||||
therapyEnum: item.therapyEnum,
|
||||
};
|
||||
})
|
||||
...ids
|
||||
.filter((value) => value != null && value !== '')
|
||||
.map((value) => {
|
||||
return {
|
||||
procedureId: value,
|
||||
therapyEnum: Number(item.therapyEnum),
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
if (producerIds.length === 0) {
|
||||
proxy.$modal.msgError('未找到有效的执行记录,无法取消执行');
|
||||
return;
|
||||
}
|
||||
adviceCancel({ adviceExecuteDetailList: producerIds }).then((res) => {
|
||||
@@ -526,14 +539,20 @@ function handleCancel() {
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '取消执行失败');
|
||||
}
|
||||
}).catch(() => {
|
||||
proxy.$modal.msgError('取消执行失败,请稍后重试');
|
||||
});
|
||||
}
|
||||
|
||||
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 +628,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 +646,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 +733,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 +753,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 +774,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,16 +792,12 @@ 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) {
|
||||
prescriptionList.value.forEach((item) => {
|
||||
item.forEach((row) => {
|
||||
if (!selectedRowIds.value.has(row.requestId)) {
|
||||
allSelected = false;
|
||||
}
|
||||
} else {
|
||||
allSelected = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
chooseAll.value = allSelected;
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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: '',
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user