Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d19ceab70f | ||
|
|
753768a1f0 | ||
|
|
49889e9140 | ||
|
|
3c3428e0b1 | ||
|
|
db05a30795 | ||
|
|
e2feb4850c | ||
|
|
02f2a14178 | ||
|
|
1c87c39473 | ||
|
|
7c28a98d02 | ||
|
|
8e042cae93 | ||
|
|
415a76af49 | ||
|
|
6dc9788d8c | ||
|
|
319224cdac | ||
|
|
66d42f415a | ||
|
|
fd0132ba80 | ||
|
|
6907c7dbc8 | ||
|
|
487b05c845 | ||
|
|
71f99da69a | ||
|
|
15a65063a3 | ||
|
|
72fdafb032 | ||
|
|
56b8d0e98d | ||
|
|
f13734a19c | ||
|
|
6081412072 | ||
|
|
4a2f13cb19 | ||
|
|
522bc238aa | ||
|
|
bea2f27b15 | ||
|
|
95da4c2a57 | ||
|
|
53e3e9c4c0 | ||
|
|
55eba1a0b1 | ||
|
|
1525740ab5 | ||
|
|
96102e8b64 | ||
|
|
49df72121f | ||
|
|
65d1716ca9 | ||
|
|
509a0a788f | ||
|
|
6c4a8e3c14 | ||
|
|
7ada54510d | ||
|
|
1602615820 | ||
|
|
af15f2ae06 | ||
|
|
b1d5ae97b1 | ||
|
|
e5cd7bd792 | ||
|
|
294d7a5d11 | ||
|
|
e78a32a5ec | ||
|
|
dc9f47c534 | ||
|
|
5bf1e4151c | ||
|
|
b7365b6b06 | ||
|
|
c5c3bcae34 | ||
|
|
bacddc6d3f | ||
|
|
31cac09126 | ||
|
|
abc3bdd0c0 | ||
|
|
0f85e95d24 | ||
|
|
deb6ade97b | ||
|
|
2d7228ca5d | ||
|
|
a447e55d43 | ||
| 1be0dc2417 | |||
| a4b4d36d93 | |||
|
|
940fad5c7d | ||
|
|
ead3733aac | ||
|
|
28bf385ec2 | ||
|
|
31f7c4f32a | ||
|
|
480663f716 | ||
|
|
cc484d5f10 | ||
|
|
30f8cdbd80 | ||
|
|
f4c6c12ef8 | ||
|
|
8cf98008ae | ||
|
|
062c8d9dee | ||
|
|
ffdfebaacf | ||
|
|
9ed52b7c48 | ||
|
|
fc1ed6c4ce | ||
|
|
818564f5ba | ||
|
|
78adbddfde | ||
|
|
861db6b0f5 | ||
|
|
b7df71fd0b | ||
|
|
5bc8a8e517 | ||
| 0264fa9d58 | |||
| cd12dd7a22 | |||
|
|
bfddf87b2c | ||
|
|
84499d4ec1 | ||
|
|
01c5b62024 | ||
|
|
559821e4d3 | ||
|
|
0dd4c25c12 | ||
|
|
3590a18adc | ||
|
|
b96acc2402 | ||
|
|
e83c35c3f1 | ||
|
|
b5d876be36 | ||
|
|
5539d4cc03 | ||
|
|
982e905990 | ||
|
|
0d46f03e68 | ||
|
|
3cab8306c2 | ||
|
|
0600bbecbc | ||
|
|
ac57ac21e9 | ||
|
|
d38efd15b3 | ||
|
|
c7404e9d3f | ||
|
|
69b28c59f6 | ||
|
|
4e71b861ab | ||
|
|
7c471205a3 |
@@ -7,6 +7,7 @@ import com.core.common.utils.MessageUtils;
|
|||||||
import com.openhis.administration.domain.Location;
|
import com.openhis.administration.domain.Location;
|
||||||
import com.openhis.administration.domain.Organization;
|
import com.openhis.administration.domain.Organization;
|
||||||
import com.openhis.administration.domain.OrganizationLocation;
|
import com.openhis.administration.domain.OrganizationLocation;
|
||||||
|
import com.openhis.workflow.domain.ActivityDefinition;
|
||||||
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
import com.openhis.administration.mapper.OrganizationLocationMapper;
|
||||||
import com.openhis.administration.service.ILocationService;
|
import com.openhis.administration.service.ILocationService;
|
||||||
import com.openhis.administration.service.IOrganizationLocationService;
|
import com.openhis.administration.service.IOrganizationLocationService;
|
||||||
@@ -70,6 +71,7 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
|||||||
// 获取科室下拉选列表
|
// 获取科室下拉选列表
|
||||||
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null);
|
||||||
List<OrgLocInitDto.departmentOption> organizationOptions = organizationList.stream()
|
List<OrgLocInitDto.departmentOption> organizationOptions = organizationList.stream()
|
||||||
|
.filter(organization -> organization != null && organization.getName() != null)
|
||||||
.map(organization -> new OrgLocInitDto.departmentOption(organization.getId(), organization.getName()))
|
.map(organization -> new OrgLocInitDto.departmentOption(organization.getId(), organization.getName()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
initDto.setLocationFormOptions(chargeItemStatusOptions).setDepartmentOptions(organizationOptions);
|
initDto.setLocationFormOptions(chargeItemStatusOptions).setDepartmentOptions(organizationOptions);
|
||||||
@@ -131,12 +133,18 @@ public class OrganizationLocationAppServiceImpl implements IOrganizationLocation
|
|||||||
@Override
|
@Override
|
||||||
public R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto) {
|
public R<?> addOrEditOrgLoc(OrgLocQueryDto orgLocQueryDto) {
|
||||||
|
|
||||||
|
// Validate required fields before processing
|
||||||
|
if (orgLocQueryDto.getOrganizationId() == null) {
|
||||||
|
return R.fail("请选择执行科室");
|
||||||
|
}
|
||||||
|
|
||||||
OrganizationLocation orgLoc = new OrganizationLocation();
|
OrganizationLocation orgLoc = new OrganizationLocation();
|
||||||
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
BeanUtils.copyProperties(orgLocQueryDto, orgLoc);
|
||||||
|
|
||||||
Long activityDefinitionId = orgLoc.getActivityDefinitionId();
|
Long activityDefinitionId = orgLoc.getActivityDefinitionId();
|
||||||
String activityName = activityDefinitionId != null
|
ActivityDefinition activityDef = activityDefinitionId != null
|
||||||
? activityDefinitionMapper.selectById(activityDefinitionId).getName() : "";
|
? activityDefinitionMapper.selectById(activityDefinitionId) : null;
|
||||||
|
String activityName = activityDef != null ? activityDef.getName() : "";
|
||||||
|
|
||||||
List<OrganizationLocation> organizationLocationList =
|
List<OrganizationLocation> organizationLocationList =
|
||||||
organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
organizationLocationService.getOrgLocListByOrgIdAndActivityDefinitionId(orgLoc.getActivityDefinitionId());
|
||||||
|
|||||||
@@ -2,9 +2,13 @@ package com.openhis.web.clinicalmanage.controller;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.common.enums.ActivityDefCategory;
|
||||||
import com.openhis.web.clinicalmanage.appservice.ISurgicalScheduleAppService;
|
import com.openhis.web.clinicalmanage.appservice.ISurgicalScheduleAppService;
|
||||||
import com.openhis.web.clinicalmanage.dto.OpCreateScheduleDto;
|
import com.openhis.web.clinicalmanage.dto.OpCreateScheduleDto;
|
||||||
import com.openhis.web.clinicalmanage.dto.OpScheduleDto;
|
import com.openhis.web.clinicalmanage.dto.OpScheduleDto;
|
||||||
|
import com.openhis.web.regdoctorstation.appservice.IRequestFormManageAppService;
|
||||||
|
import com.openhis.web.regdoctorstation.dto.RequestFormDto;
|
||||||
|
import com.openhis.web.regdoctorstation.dto.RequestFormPageDto;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -26,6 +30,7 @@ import java.util.Map;
|
|||||||
public class SurgicalScheduleController {
|
public class SurgicalScheduleController {
|
||||||
|
|
||||||
private final ISurgicalScheduleAppService surgicalScheduleAppService;
|
private final ISurgicalScheduleAppService surgicalScheduleAppService;
|
||||||
|
private final IRequestFormManageAppService requestFormManageAppService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询手术安排列表
|
* 分页查询手术安排列表
|
||||||
@@ -87,6 +92,27 @@ public class SurgicalScheduleController {
|
|||||||
return surgicalScheduleAppService.deleteSurgerySchedule(scheduleId);
|
return surgicalScheduleAppService.deleteSurgerySchedule(scheduleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询待排期手术申请列表
|
||||||
|
*
|
||||||
|
* @param requestFormDto 查询条件
|
||||||
|
* @return 手术申请列表
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/apply-list")
|
||||||
|
public R<IPage<RequestFormPageDto>> getSurgeryApplyList(@RequestBody RequestFormDto requestFormDto) {
|
||||||
|
if (requestFormDto.getPageNo() == null) {
|
||||||
|
requestFormDto.setPageNo(1);
|
||||||
|
}
|
||||||
|
if (requestFormDto.getPageSize() == null) {
|
||||||
|
requestFormDto.setPageSize(10);
|
||||||
|
}
|
||||||
|
//虽然很想这么写,但是库里的手术申请单的type_code都是直接写的SURGERY
|
||||||
|
// requestFormDto.setTypeCode(ActivityDefCategory.PROCEDURE.getCode());
|
||||||
|
//只查询手术申请单
|
||||||
|
requestFormDto.setTypeCode("SURGERY");
|
||||||
|
return R.ok(requestFormManageAppService.getRequestFormPage(requestFormDto));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出手术安排列表
|
* 导出手术安排列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -59,6 +59,16 @@ public interface IDoctorStationAdviceAppService {
|
|||||||
*/
|
*/
|
||||||
R<?> getRequestBaseInfo(Long encounterId);
|
R<?> getRequestBaseInfo(Long encounterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询医嘱请求数据(支持按生成来源和来源单据号过滤)
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @param generateSourceEnum 生成来源(可选,如手术计费=6)
|
||||||
|
* @param sourceBillNo 来源业务单据号(可选)
|
||||||
|
* @return 医嘱请求数据
|
||||||
|
*/
|
||||||
|
R<?> getRequestBaseInfo(Long encounterId, Integer generateSourceEnum, String sourceBillNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门诊签退医嘱
|
* 门诊签退医嘱
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -228,8 +228,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
// 医嘱定义ID集合
|
// 医嘱定义ID集合
|
||||||
List<Long> adviceDefinitionIdList = adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId)
|
List<Long> adviceDefinitionIdList = adviceBaseDtoList.stream().map(AdviceBaseDto::getAdviceDefinitionId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
// 费用定价主表ID集合
|
// 费用定价主表ID集合(过滤null值,手术项目无定价定义)
|
||||||
List<Long> chargeItemDefinitionIdList = adviceBaseDtoList.stream().map(AdviceBaseDto::getChargeItemDefinitionId)
|
List<Long> chargeItemDefinitionIdList = adviceBaseDtoList.stream()
|
||||||
|
.map(AdviceBaseDto::getChargeItemDefinitionId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// 判断是否包含药品或耗材类型(只有这些类型才需要库存相关查询)
|
// 判断是否包含药品或耗材类型(只有这些类型才需要库存相关查询)
|
||||||
@@ -275,9 +277,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
medLocationConfig = Collections.emptyList();
|
medLocationConfig = Collections.emptyList();
|
||||||
allowedLocByCategory = Collections.emptyMap();
|
allowedLocByCategory = Collections.emptyMap();
|
||||||
}
|
}
|
||||||
// 费用定价子表信息 - 使用分批处理避免大量参数问题
|
// 费用定价子表信息 - 仅药品/耗材需要批次定价查询,手术/诊疗无库存概念不需要
|
||||||
List<AdvicePriceDto> childCharge = new ArrayList<>();
|
List<AdvicePriceDto> childCharge = new ArrayList<>();
|
||||||
if (chargeItemDefinitionIdList != null && !chargeItemDefinitionIdList.isEmpty()) {
|
if (hasMedOrDevice && chargeItemDefinitionIdList != null && !chargeItemDefinitionIdList.isEmpty()) {
|
||||||
// 分批处理,每批最多1000个ID,增加批次大小以减少查询次数
|
// 分批处理,每批最多1000个ID,增加批次大小以减少查询次数
|
||||||
int batchSize = 1000;
|
int batchSize = 1000;
|
||||||
for (int i = 0; i < chargeItemDefinitionIdList.size(); i += batchSize) {
|
for (int i = 0; i < chargeItemDefinitionIdList.size(); i += batchSize) {
|
||||||
@@ -957,11 +959,16 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||||
iMedicationRequestService.removeById(adviceSaveDto.getRequestId());
|
Long requestId = adviceSaveDto.getRequestId();
|
||||||
|
// 🔧 Bug #442: 跳过 requestId 为 null 的记录,避免删除不存在的药品请求
|
||||||
|
if (requestId == null) {
|
||||||
|
log.warn("BugFix#442: handMedication - 跳过 requestId 为 null 的删除请求");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
iMedicationRequestService.removeById(requestId);
|
||||||
// 删除已经产生的药品发放信息
|
// 删除已经产生的药品发放信息
|
||||||
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
iMedicationDispenseService.deleteMedicationDispense(adviceSaveDto.getRequestId());
|
||||||
// 🔧 Bug Fix #219: 删除费用项
|
// 🔧 Bug Fix #219: 删除费用项
|
||||||
Long requestId = adviceSaveDto.getRequestId();
|
|
||||||
String serviceTable = CommonConstants.TableName.MED_MEDICATION_REQUEST;
|
String serviceTable = CommonConstants.TableName.MED_MEDICATION_REQUEST;
|
||||||
// 直接删除费用项
|
// 直接删除费用项
|
||||||
iChargeItemService.deleteByServiceTableAndId(serviceTable, requestId);
|
iChargeItemService.deleteByServiceTableAndId(serviceTable, requestId);
|
||||||
@@ -1417,6 +1424,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
log.info("BugFix#219: handDevice - 开始删除循环, deleteList.size={}", deleteList.size());
|
log.info("BugFix#219: handDevice - 开始删除循环, deleteList.size={}", deleteList.size());
|
||||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||||
Long requestId = adviceSaveDto.getRequestId();
|
Long requestId = adviceSaveDto.getRequestId();
|
||||||
|
// 🔧 Bug #442: 跳过 requestId 为 null 的记录,避免删除不存在的耗材请求
|
||||||
|
if (requestId == null) {
|
||||||
|
log.warn("BugFix#442: handDevice - 跳过 requestId 为 null 的删除请求");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
log.info("BugFix#219: handDevice - 删除开始: requestId={}", requestId);
|
log.info("BugFix#219: handDevice - 删除开始: requestId={}", requestId);
|
||||||
|
|
||||||
// 1. 删除耗材请求
|
// 1. 删除耗材请求
|
||||||
@@ -1527,11 +1539,22 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
deviceRequest.setRequesterId(adviceSaveDto.getPractitionerId()); // 开方医生
|
deviceRequest.setRequesterId(adviceSaveDto.getPractitionerId()); // 开方医生
|
||||||
deviceRequest.setOrgId(adviceSaveDto.getFounderOrgId());// 开方人科室
|
deviceRequest.setOrgId(adviceSaveDto.getFounderOrgId());// 开方人科室
|
||||||
deviceRequest.setReqAuthoredTime(curDate); // 请求开始时间
|
deviceRequest.setReqAuthoredTime(curDate); // 请求开始时间
|
||||||
// 发放耗材房(若前端未传locationId,使用登录用户的科室作为默认值)
|
// 发放耗材房(若前端未传locationId,优先沿用已有DeviceRequest的performLocation,否则使用登录用户科室)
|
||||||
Long locId = adviceSaveDto.getLocationId();
|
Long locId = adviceSaveDto.getLocationId();
|
||||||
if (locId == null) {
|
if (locId == null) {
|
||||||
locId = SecurityUtils.getLoginUser().getOrgId();
|
// 尝试从已有DeviceRequest获取原始的performLocation
|
||||||
log.info("耗材locationId为空,使用登录用户科室作为默认值: locationId={}", locId);
|
if (adviceSaveDto.getRequestId() != null) {
|
||||||
|
DeviceRequest existingDevice = iDeviceRequestService.getById(adviceSaveDto.getRequestId());
|
||||||
|
if (existingDevice != null && existingDevice.getPerformLocation() != null) {
|
||||||
|
locId = existingDevice.getPerformLocation();
|
||||||
|
log.info("耗材locationId为空,使用已有DeviceRequest的performLocation: locationId={}", locId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果已有记录也没有performLocation,则使用登录用户科室作为兜底
|
||||||
|
if (locId == null) {
|
||||||
|
locId = SecurityUtils.getLoginUser().getOrgId();
|
||||||
|
log.info("耗材locationId为空且无已有记录,使用登录用户科室作为默认值: locationId={}", locId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
deviceRequest.setPerformLocation(locId);
|
deviceRequest.setPerformLocation(locId);
|
||||||
deviceRequest.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
deviceRequest.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
||||||
@@ -1721,12 +1744,17 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
for (AdviceSaveDto adviceSaveDto : deleteList) {
|
||||||
iServiceRequestService.removeById(adviceSaveDto.getRequestId());// 删除诊疗
|
Long requestId = adviceSaveDto.getRequestId();
|
||||||
|
// 🔧 Bug #442: 跳过 requestId 为 null 的记录,避免删除不存在的诊疗请求
|
||||||
|
if (requestId == null) {
|
||||||
|
log.warn("BugFix#442: handService - 跳过 requestId 为 null 的删除请求");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
iServiceRequestService.removeById(requestId);// 删除诊疗
|
||||||
iServiceRequestService.remove(
|
iServiceRequestService.remove(
|
||||||
new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getParentId,
|
new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getParentId,
|
||||||
adviceSaveDto.getRequestId()));// 删除诊疗套餐对应的子项
|
requestId));// 删除诊疗套餐对应的子项
|
||||||
// 🔧 Bug Fix #219: 删除费用项
|
// 🔧 Bug Fix #219: 删除费用项
|
||||||
Long requestId = adviceSaveDto.getRequestId();
|
|
||||||
String serviceTable = CommonConstants.TableName.WOR_SERVICE_REQUEST;
|
String serviceTable = CommonConstants.TableName.WOR_SERVICE_REQUEST;
|
||||||
// 直接删除费用项
|
// 直接删除费用项
|
||||||
iChargeItemService.deleteByServiceTableAndId(serviceTable, requestId);
|
iChargeItemService.deleteByServiceTableAndId(serviceTable, requestId);
|
||||||
@@ -1783,8 +1811,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
log.info("handService - 自动补全founderOrgId: founderOrgId={}", adviceSaveDto.getFounderOrgId());
|
log.info("handService - 自动补全founderOrgId: founderOrgId={}", adviceSaveDto.getFounderOrgId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug Fix #238: 诊疗项目执行科室非空校验
|
// 🔧 Bug Fix #238/#454: 诊疗项目执行科室非空校验(删除操作跳过校验)
|
||||||
if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == 3) {
|
if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == 3
|
||||||
|
&& !DbOpType.DELETE.getCode().equals(adviceSaveDto.getDbOpType())) {
|
||||||
Long effectiveOrgId = adviceSaveDto.getEffectiveOrgId();
|
Long effectiveOrgId = adviceSaveDto.getEffectiveOrgId();
|
||||||
if (effectiveOrgId == null) {
|
if (effectiveOrgId == null) {
|
||||||
throw new ServiceException("诊疗项目必须选择执行科室");
|
throw new ServiceException("诊疗项目必须选择执行科室");
|
||||||
@@ -1987,13 +2016,25 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<?> getRequestBaseInfo(Long encounterId) {
|
public R<?> getRequestBaseInfo(Long encounterId) {
|
||||||
|
return this.getRequestBaseInfo(encounterId, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getRequestBaseInfo(Long encounterId, Integer generateSourceEnum, String sourceBillNo) {
|
||||||
// 当前账号的参与者id
|
// 当前账号的参与者id
|
||||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||||
|
// 未指定generateSourceEnum时,默认只查询医生开立的医嘱
|
||||||
|
int sourceEnum = (generateSourceEnum != null) ? generateSourceEnum : GenerateSource.DOCTOR_PRESCRIPTION.getValue();
|
||||||
// 医嘱请求数据
|
// 医嘱请求数据
|
||||||
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, null,
|
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, null,
|
||||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode(),
|
||||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
sourceEnum, sourceBillNo);
|
||||||
|
// 手术计费场景:sourceBillNo 不为空时,只保留诊疗请求(3/6),过滤掉药品(1)和耗材(2)
|
||||||
|
if (sourceBillNo != null && !sourceBillNo.isEmpty()) {
|
||||||
|
requestBaseInfo.removeIf(dto -> dto.getAdviceType() != null
|
||||||
|
&& (dto.getAdviceType() == 1 || dto.getAdviceType() == 2));
|
||||||
|
}
|
||||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||||
// 请求状态
|
// 请求状态
|
||||||
requestBaseDto
|
requestBaseDto
|
||||||
@@ -2114,7 +2155,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, patientId,
|
List<RequestBaseDto> requestBaseInfo = doctorStationAdviceAppMapper.getRequestBaseInfo(encounterId, patientId,
|
||||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.YES.getCode(),
|
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.YES.getCode(),
|
||||||
GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
GenerateSource.DOCTOR_PRESCRIPTION.getValue(), null);
|
||||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||||
// 请求状态
|
// 请求状态
|
||||||
requestBaseDto
|
requestBaseDto
|
||||||
|
|||||||
@@ -580,7 +580,11 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
@Override
|
@Override
|
||||||
public R<?> saveInfectiousDiseaseReport(InfectiousDiseaseReportDto infectiousDiseaseReportDto) {
|
public R<?> saveInfectiousDiseaseReport(InfectiousDiseaseReportDto infectiousDiseaseReportDto) {
|
||||||
// 检查卡片编号唯一性(新增时检查,编辑时排除当前记录)
|
// 检查卡片编号唯一性(新增时检查,编辑时排除当前记录)
|
||||||
String cardNo = infectiousDiseaseReportDto.getCardNo().trim();
|
String cardNo = infectiousDiseaseReportDto.getCardNo();
|
||||||
|
if (cardNo == null || cardNo.trim().isEmpty()) {
|
||||||
|
return R.fail("卡片编号不能为空");
|
||||||
|
}
|
||||||
|
cardNo = cardNo.trim();
|
||||||
LambdaQueryWrapper<InfectiousDiseaseReport> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<InfectiousDiseaseReport> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(InfectiousDiseaseReport::getCardNo, cardNo);
|
queryWrapper.eq(InfectiousDiseaseReport::getCardNo, cardNo);
|
||||||
long count = iInfectiousDiseaseReportService.count(queryWrapper);
|
long count = iInfectiousDiseaseReportService.count(queryWrapper);
|
||||||
|
|||||||
@@ -274,27 +274,8 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
return R.fail("非就诊中患者不能完诊");
|
return R.fail("非就诊中患者不能完诊");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 获取 pool_id 和 slot_id:从 encounter → order_main → adm_schedule_slot 链路获取
|
// 2. 查找队列项(限定当天,避免复诊患者匹配到历史队列记录)
|
||||||
// 确保 div_log 中的值与排班主表一致,不依赖 triage_queue_item(队列项可能不存在或值错误)
|
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||||
Long divPoolId = null;
|
|
||||||
Long divSlotId = null;
|
|
||||||
if (encounter.getOrderId() != null) {
|
|
||||||
try {
|
|
||||||
Order order = iOrderService.getById(encounter.getOrderId());
|
|
||||||
if (order != null && order.getSlotId() != null) {
|
|
||||||
divSlotId = order.getSlotId();
|
|
||||||
ScheduleSlot slot = scheduleSlotMapper.selectById(divSlotId);
|
|
||||||
if (slot != null) {
|
|
||||||
divPoolId = slot.getPoolId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("获取完诊div_log的pool_id/slot_id失败,encounterId={}", encounterId, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 查找队列项(限定当天,避免复诊患者匹配到历史队列记录)
|
|
||||||
TriageQueueItem queueItem = triageQueueItemService.getOne(
|
TriageQueueItem queueItem = triageQueueItemService.getOne(
|
||||||
new LambdaQueryWrapper<TriageQueueItem>()
|
new LambdaQueryWrapper<TriageQueueItem>()
|
||||||
.eq(TriageQueueItem::getTenantId, tenantId)
|
.eq(TriageQueueItem::getTenantId, tenantId)
|
||||||
@@ -319,33 +300,67 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 3. 获取 pool_id 和 slot_id:优先使用 triage_queue_item(挂号时录入的号源信息,为权威来源)
|
||||||
|
// 队列项不存在或值缺失时,回退使用 encounter → order_main → adm_schedule_slot 链路
|
||||||
|
Long divPoolId = null;
|
||||||
|
Long divSlotId = null;
|
||||||
|
if (queueItem != null && queueItem.getPoolId() != null && queueItem.getSlotId() != null) {
|
||||||
|
divPoolId = queueItem.getPoolId();
|
||||||
|
divSlotId = queueItem.getSlotId();
|
||||||
|
}
|
||||||
|
// 队列项 poolId/slotId 缺失时,通过 encounter.orderId → order_main.slot_id → adm_schedule_slot.pool_id 回退获取
|
||||||
|
if ((divPoolId == null || divSlotId == null) && encounter.getOrderId() != null) {
|
||||||
|
try {
|
||||||
|
Order order = iOrderService.getById(encounter.getOrderId());
|
||||||
|
if (order != null && order.getSlotId() != null) {
|
||||||
|
ScheduleSlot slot = scheduleSlotMapper.selectById(order.getSlotId());
|
||||||
|
if (slot != null) {
|
||||||
|
divSlotId = slot.getId();
|
||||||
|
divPoolId = slot.getPoolId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("回退获取完诊div_log的pool_id/slot_id失败,encounterId={}", encounterId, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 如果队列项存在且未完成,更新队列状态为已完成
|
// 如果队列项存在且未完成,更新队列状态为已完成
|
||||||
// 使用排除法而非白名单:只要不是"已完成"就可以完诊,覆盖跳过、等待等非标准流转状态
|
// 使用排除法而非白名单:只要不是"已完成"就可以完诊,覆盖跳过、等待等非标准流转状态
|
||||||
if (queueItem != null &&
|
if (queueItem != null &&
|
||||||
!TriageQueueStatus.COMPLETED.getValue().equals(queueItem.getStatus())) {
|
!TriageQueueStatus.COMPLETED.getValue().equals(queueItem.getStatus())) {
|
||||||
java.time.LocalDateTime nowLocal = java.time.LocalDateTime.now().truncatedTo(ChronoUnit.SECONDS);
|
java.time.LocalDateTime nowLocal = java.time.LocalDateTime.now().truncatedTo(ChronoUnit.SECONDS);
|
||||||
queueItem.setStatus(TriageQueueStatus.COMPLETED.getValue());
|
// 使用 LambdaUpdateWrapper 直接更新,确保 status 字段必定写入数据库
|
||||||
queueItem.setUpdateTime(nowLocal);
|
boolean queueUpdate = triageQueueItemService.update(new LambdaUpdateWrapper<TriageQueueItem>()
|
||||||
triageQueueItemService.updateById(queueItem);
|
.eq(TriageQueueItem::getId, queueItem.getId())
|
||||||
|
.set(TriageQueueItem::getStatus, TriageQueueStatus.COMPLETED.getValue())
|
||||||
|
.set(TriageQueueItem::getUpdateTime, nowLocal));
|
||||||
|
if (!queueUpdate) {
|
||||||
|
log.error("完诊:triage_queue_item 状态更新失败,queueItemId={}", queueItem.getId());
|
||||||
|
}
|
||||||
} else if (queueItem == null) {
|
} else if (queueItem == null) {
|
||||||
log.error("完诊:未找到任何 triage_queue_item 记录,encounterId={}, tenantId={}",
|
log.error("完诊:未找到任何 triage_queue_item 记录,encounterId={}, tenantId={}",
|
||||||
encounterId, tenantId);
|
encounterId, tenantId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入 div_log 审计日志(独立于队列项,确保每次完诊都生成记录)
|
// 写入 div_log 审计日志(独立于队列项,确保每次完诊都生成记录)
|
||||||
try {
|
// 防重复:若队列项已是 COMPLETED 状态,说明护士站已处理过并写过分诊日志,不再重复写入
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
boolean queueAlreadyCompleted = queueItem != null
|
||||||
DivLog divLog = new DivLog()
|
&& TriageQueueStatus.COMPLETED.getValue().equals(queueItem.getStatus());
|
||||||
.setPoolId(divPoolId)
|
if (!queueAlreadyCompleted) {
|
||||||
.setSlotId(divSlotId)
|
try {
|
||||||
.setOpUserId(loginUser != null ? loginUser.getUserId() : null)
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
.setAction("COMPLETE")
|
DivLog divLog = new DivLog()
|
||||||
.setCreateTime(LocalDateTime.now())
|
.setPoolId(divPoolId)
|
||||||
.setUpdateAt(LocalDateTime.now())
|
.setSlotId(divSlotId)
|
||||||
.setCreatedAt(LocalDateTime.now());
|
.setOpUserId(loginUser != null ? loginUser.getUserId() : null)
|
||||||
divLogService.save(divLog);
|
.setAction("COMPLETE")
|
||||||
} catch (Exception e) {
|
.setCreateTime(LocalDateTime.now())
|
||||||
log.error("写入div_log审计日志失败", e);
|
.setUpdateAt(LocalDateTime.now())
|
||||||
|
.setCreatedAt(LocalDateTime.now());
|
||||||
|
divLogService.save(divLog);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("写入div_log审计日志失败", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. 更新状态、完成时间以及初复诊标识
|
// 4. 更新状态、完成时间以及初复诊标识
|
||||||
|
|||||||
@@ -112,11 +112,16 @@ public class DoctorStationAdviceController {
|
|||||||
* 查询医嘱请求数据
|
* 查询医嘱请求数据
|
||||||
*
|
*
|
||||||
* @param encounterId 就诊id
|
* @param encounterId 就诊id
|
||||||
|
* @param generateSourceEnum 生成来源(可选,用于按来源过滤,如手术计费=6)
|
||||||
|
* @param sourceBillNo 来源业务单据号(可选,用于按来源单据过滤)
|
||||||
* @return 医嘱请求数据
|
* @return 医嘱请求数据
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/request-base-info")
|
@GetMapping(value = "/request-base-info")
|
||||||
public R<?> getRequestBaseInfo(@RequestParam(required = false) Long encounterId) {
|
public R<?> getRequestBaseInfo(
|
||||||
return iDoctorStationAdviceAppService.getRequestBaseInfo(encounterId);
|
@RequestParam(required = false) Long encounterId,
|
||||||
|
@RequestParam(required = false) Integer generateSourceEnum,
|
||||||
|
@RequestParam(required = false) String sourceBillNo) {
|
||||||
|
return iDoctorStationAdviceAppService.getRequestBaseInfo(encounterId, generateSourceEnum, sourceBillNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ public interface DoctorStationAdviceAppMapper {
|
|||||||
@Param("MED_MEDICATION_REQUEST") String MED_MEDICATION_REQUEST,
|
@Param("MED_MEDICATION_REQUEST") String MED_MEDICATION_REQUEST,
|
||||||
@Param("WOR_DEVICE_REQUEST") String WOR_DEVICE_REQUEST,
|
@Param("WOR_DEVICE_REQUEST") String WOR_DEVICE_REQUEST,
|
||||||
@Param("WOR_SERVICE_REQUEST") String WOR_SERVICE_REQUEST, @Param("practitionerId") Long practitionerId,
|
@Param("WOR_SERVICE_REQUEST") String WOR_SERVICE_REQUEST, @Param("practitionerId") Long practitionerId,
|
||||||
@Param("historyFlag") String historyFlag, @Param("generateSourceEnum") Integer generateSourceEnum);
|
@Param("historyFlag") String historyFlag, @Param("generateSourceEnum") Integer generateSourceEnum,
|
||||||
|
@Param("sourceBillNo") String sourceBillNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询就诊费用性质
|
* 查询就诊费用性质
|
||||||
|
|||||||
@@ -178,15 +178,26 @@ public class AdviceUtils {
|
|||||||
// 生命提示信息集合
|
// 生命提示信息集合
|
||||||
List<String> tipsList = new ArrayList<>();
|
List<String> tipsList = new ArrayList<>();
|
||||||
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
|
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
|
||||||
// 聚合同一位置所有批次的库存总量
|
// 第一步:按 performLocation 匹配指定药房的库存
|
||||||
List<AdviceInventoryDto> matchedInventories = adviceInventory.stream()
|
List<AdviceInventoryDto> matchedInventories = adviceInventory.stream()
|
||||||
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
|
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
|
||||||
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
|
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
|
||||||
&& medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId())
|
&& (medicationRequestUseExe.getPerformLocation() == null
|
||||||
|
|| medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId()))
|
||||||
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
|
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
|
||||||
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|
||||||
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
|
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
// 第二步:如果指定药房没有匹配到库存,则放宽条件查询所有药房的库存
|
||||||
|
if (matchedInventories.isEmpty()) {
|
||||||
|
matchedInventories = adviceInventory.stream()
|
||||||
|
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
|
||||||
|
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
|
||||||
|
// 如果选择了具体的批次号,校验库存时需要加上批次号的匹配条件
|
||||||
|
&& (StringUtils.isEmpty(medicationRequestUseExe.getLotNumber())
|
||||||
|
|| medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber())))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
// 匹配到库存信息
|
// 匹配到库存信息
|
||||||
if (!matchedInventories.isEmpty()) {
|
if (!matchedInventories.isEmpty()) {
|
||||||
// 聚合所有批次的可用库存
|
// 聚合所有批次的可用库存
|
||||||
|
|||||||
@@ -43,6 +43,19 @@ public interface IRequestFormManageAppService {
|
|||||||
*/
|
*/
|
||||||
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate);
|
List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申请单(支持筛选+状态+关键字)
|
||||||
|
*
|
||||||
|
* @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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询申请单
|
* 分页查询申请单
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -341,6 +341,28 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 防重复保存:对所有医嘱进行去重(包括 INSERT 和 UPDATE 混合场景),避免签发单条医嘱时产生重复记录
|
||||||
|
Set<String> longUniqueKeySet = new HashSet<>();
|
||||||
|
List<RegAdviceSaveDto> longUniqueList = new ArrayList<>();
|
||||||
|
for (RegAdviceSaveDto adviceSaveDto : longInsertOrUpdateList) {
|
||||||
|
String uniqueKey = adviceSaveDto.getPatientId() + "_"
|
||||||
|
+ adviceSaveDto.getEncounterId() + "_"
|
||||||
|
+ adviceSaveDto.getAdviceDefinitionId() + "_"
|
||||||
|
+ adviceSaveDto.getDose() + "_"
|
||||||
|
+ adviceSaveDto.getMethodCode() + "_"
|
||||||
|
+ adviceSaveDto.getRateCode();
|
||||||
|
if (longUniqueKeySet.contains(uniqueKey)) {
|
||||||
|
log.warn("防重复保存:检测到重复长期医嘱(跨操作类型),跳过 - patientId={}, encounterId={}, adviceDefinitionId={}, dbOpType={}",
|
||||||
|
adviceSaveDto.getPatientId(), adviceSaveDto.getEncounterId(),
|
||||||
|
adviceSaveDto.getAdviceDefinitionId(), adviceSaveDto.getDbOpType());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
longUniqueKeySet.add(uniqueKey);
|
||||||
|
longUniqueList.add(adviceSaveDto);
|
||||||
|
}
|
||||||
|
log.info("防重复保存(长期):去重前{}条,去重后{}条", longInsertOrUpdateList.size(), longUniqueList.size());
|
||||||
|
longInsertOrUpdateList = longUniqueList;
|
||||||
|
|
||||||
for (RegAdviceSaveDto regAdviceSaveDto : longInsertOrUpdateList) {
|
for (RegAdviceSaveDto regAdviceSaveDto : longInsertOrUpdateList) {
|
||||||
boolean firstTimeSave = false;// 第一次保存
|
boolean firstTimeSave = false;// 第一次保存
|
||||||
longMedicationRequest = new MedicationRequest();
|
longMedicationRequest = new MedicationRequest();
|
||||||
@@ -406,6 +428,29 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
.getValue().equals(e.getTherapyEnum())
|
.getValue().equals(e.getTherapyEnum())
|
||||||
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
&& (DbOpType.INSERT.getCode().equals(e.getDbOpType()) || DbOpType.UPDATE.getCode().equals(e.getDbOpType())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 防重复保存:对所有医嘱进行去重(包括 INSERT 和 UPDATE 混合场景),避免签发时产生重复记录
|
||||||
|
Set<String> tempUniqueKeySet = new HashSet<>();
|
||||||
|
List<RegAdviceSaveDto> tempUniqueList = new ArrayList<>();
|
||||||
|
for (RegAdviceSaveDto adviceSaveDto : tempInsertOrUpdateList) {
|
||||||
|
String uniqueKey = adviceSaveDto.getPatientId() + "_"
|
||||||
|
+ adviceSaveDto.getEncounterId() + "_"
|
||||||
|
+ adviceSaveDto.getAdviceDefinitionId() + "_"
|
||||||
|
+ adviceSaveDto.getDose() + "_"
|
||||||
|
+ adviceSaveDto.getMethodCode() + "_"
|
||||||
|
+ adviceSaveDto.getRateCode();
|
||||||
|
if (tempUniqueKeySet.contains(uniqueKey)) {
|
||||||
|
log.warn("防重复保存:检测到重复临时医嘱(跨操作类型),跳过 - patientId={}, encounterId={}, adviceDefinitionId={}, dbOpType={}",
|
||||||
|
adviceSaveDto.getPatientId(), adviceSaveDto.getEncounterId(),
|
||||||
|
adviceSaveDto.getAdviceDefinitionId(), adviceSaveDto.getDbOpType());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
tempUniqueKeySet.add(uniqueKey);
|
||||||
|
tempUniqueList.add(adviceSaveDto);
|
||||||
|
}
|
||||||
|
log.info("防重复保存(临时):去重前{}条,去重后{}条", tempInsertOrUpdateList.size(), tempUniqueList.size());
|
||||||
|
tempInsertOrUpdateList = tempUniqueList;
|
||||||
|
|
||||||
for (RegAdviceSaveDto regAdviceSaveDto : tempInsertOrUpdateList) {
|
for (RegAdviceSaveDto regAdviceSaveDto : tempInsertOrUpdateList) {
|
||||||
boolean firstTimeSave = false;// 第一次保存
|
boolean firstTimeSave = false;// 第一次保存
|
||||||
tempMedicationRequest = new MedicationRequest();
|
tempMedicationRequest = new MedicationRequest();
|
||||||
@@ -665,11 +710,21 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
|||||||
|
|
||||||
// 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新)
|
// 批量更新诊疗医嘱状态(使用 update 确保状态字段必定更新)
|
||||||
if (!processedRequestIds.isEmpty()) {
|
if (!processedRequestIds.isEmpty()) {
|
||||||
iServiceRequestService.update(null,
|
// 🔧 Bug #487 修复:签发时额外设置 authoredTime,确保签发时间被记录
|
||||||
new LambdaUpdateWrapper<ServiceRequest>()
|
if (is_sign) {
|
||||||
.set(ServiceRequest::getStatusEnum,
|
iServiceRequestService.update(null,
|
||||||
is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue())
|
new LambdaUpdateWrapper<ServiceRequest>()
|
||||||
.in(ServiceRequest::getId, processedRequestIds));
|
.set(ServiceRequest::getStatusEnum, RequestStatus.ACTIVE.getValue())
|
||||||
|
.set(ServiceRequest::getAuthoredTime, authoredTime)
|
||||||
|
.set(ServiceRequest::getSignCode, signCode)
|
||||||
|
.in(ServiceRequest::getId, processedRequestIds));
|
||||||
|
log.info("签发诊疗医嘱成功,requestIds: {}, signCode: {}", processedRequestIds, signCode);
|
||||||
|
} else {
|
||||||
|
iServiceRequestService.update(null,
|
||||||
|
new LambdaUpdateWrapper<ServiceRequest>()
|
||||||
|
.set(ServiceRequest::getStatusEnum, RequestStatus.DRAFT.getValue())
|
||||||
|
.in(ServiceRequest::getId, processedRequestIds));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -75,12 +76,34 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public R<?> saveRequestForm(RequestFormSaveDto requestFormSaveDto, String typeCode) {
|
public R<?> saveRequestForm(RequestFormSaveDto requestFormSaveDto, String typeCode) {
|
||||||
|
// 申请单ID(前端空字符串可能反序列化为0L,需同时判0)
|
||||||
|
Long requestFormId = requestFormSaveDto.getRequestFormId();
|
||||||
|
boolean isEdit = requestFormId != null && requestFormId != 0L;
|
||||||
|
|
||||||
|
// 诊疗执行科室配置校验(必须在任何数据库操作之前)
|
||||||
|
List<ActivityOrganizationConfigDto> activityOrganizationConfig =
|
||||||
|
requestFormManageAppMapper.getActivityOrganizationConfig(typeCode);
|
||||||
|
if (activityOrganizationConfig.isEmpty()) {
|
||||||
|
throw new ServiceException("请先配置当前时间段的执行科室");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 逐个校验activityList中的项目是否都配置了执行科室,避免部分通过后在循环中抛异常导致事务复杂化
|
||||||
|
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
||||||
|
if (activityList != null && !activityList.isEmpty()) {
|
||||||
|
for (ActivitySaveDto activitySaveDto : activityList) {
|
||||||
|
Long positionId = activityOrganizationConfig.stream()
|
||||||
|
.filter(dto -> activitySaveDto.getAdviceDefinitionId().equals(dto.getActivityDefinitionId()))
|
||||||
|
.map(ActivityOrganizationConfigDto::getOrganizationId).findFirst().orElse(null);
|
||||||
|
if (positionId == null) {
|
||||||
|
throw new ServiceException(activitySaveDto.getAdviceDefinitionName() + "未配置当前时间段的执行科室");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 诊疗处方号
|
// 诊疗处方号
|
||||||
String prescriptionNo;
|
String prescriptionNo;
|
||||||
// 申请单ID
|
|
||||||
Long requestFormId = requestFormSaveDto.getRequestFormId();
|
|
||||||
// 编辑场景
|
// 编辑场景
|
||||||
if (requestFormId != null) {
|
if (isEdit) {
|
||||||
RequestForm requestFormInfo = iRequestFormService.getById(requestFormId);
|
RequestForm requestFormInfo = iRequestFormService.getById(requestFormId);
|
||||||
prescriptionNo = requestFormInfo.getPrescriptionNo();
|
prescriptionNo = requestFormInfo.getPrescriptionNo();
|
||||||
// 该申请单存在的待发送医嘱个数
|
// 该申请单存在的待发送医嘱个数
|
||||||
@@ -91,8 +114,10 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
return R.fail("无待签发的医嘱,该申请单不可编辑");
|
return R.fail("无待签发的医嘱,该申请单不可编辑");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 诊疗处方号
|
// 检查申请单号:JC(检查)+ Z(住院标识)+ yyMMdd(日期)+ 5位顺序号
|
||||||
prescriptionNo = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_PSYCHOTROPIC_NO.getPrefix(), 8);
|
String dateStr = new java.text.SimpleDateFormat("yyMMdd").format(new Date());
|
||||||
|
int seq = assignSeqUtil.getSeqNoByDay(AssignSeqEnum.CHECK_APPLY_NO.getPrefix());
|
||||||
|
prescriptionNo = "JCZ" + dateStr + String.format("%05d", seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前时间
|
// 当前时间
|
||||||
@@ -122,7 +147,7 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
iRequestFormService.saveOrUpdate(requestForm);
|
iRequestFormService.saveOrUpdate(requestForm);
|
||||||
|
|
||||||
// 编辑场景时,先删除掉原有诊疗项目及账单再新增
|
// 编辑场景时,先删除掉原有诊疗项目及账单再新增
|
||||||
if (requestFormId != null) {
|
if (isEdit) {
|
||||||
List<Long> serviceRequestIds = iServiceRequestService
|
List<Long> serviceRequestIds = iServiceRequestService
|
||||||
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo))
|
.list(new LambdaQueryWrapper<ServiceRequest>().eq(ServiceRequest::getPrescriptionNo, prescriptionNo))
|
||||||
.stream().map(ServiceRequest::getId).collect(Collectors.toList());
|
.stream().map(ServiceRequest::getId).collect(Collectors.toList());
|
||||||
@@ -136,15 +161,7 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
|
|
||||||
ServiceRequest serviceRequest;
|
ServiceRequest serviceRequest;
|
||||||
ChargeItem chargeItem;
|
ChargeItem chargeItem;
|
||||||
// 诊疗集合
|
|
||||||
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();
|
||||||
@@ -428,12 +445,28 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate) {
|
public List<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode, String startDate, String endDate) {
|
||||||
|
return getRequestForm(encounterId, typeCode, startDate, endDate, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申请单(支持筛选+状态+关键字)
|
||||||
|
*
|
||||||
|
* @param encounterId 就诊id
|
||||||
|
* @param typeCode 申请单类型
|
||||||
|
* @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, String keyword) {
|
||||||
// 检查参数
|
// 检查参数
|
||||||
if (encounterId == null) {
|
if (encounterId == null) {
|
||||||
return new java.util.ArrayList<>();
|
return new java.util.ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode, startDate, endDate,null,null);
|
List<RequestFormQueryDto> requestFormList = requestFormManageAppMapper.getRequestForm(encounterId, typeCode, startDate, endDate, status, keyword);
|
||||||
for (RequestFormQueryDto requestFormQueryDto : requestFormList) {
|
for (RequestFormQueryDto requestFormQueryDto : requestFormList) {
|
||||||
// 查询处方详情
|
// 查询处方详情
|
||||||
List<RequestFormDetailQueryDto> requestFormDetail =
|
List<RequestFormDetailQueryDto> requestFormDetail =
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,14 +82,23 @@ public class RequestFormManageController {
|
|||||||
* 查询检查申请单
|
* 查询检查申请单
|
||||||
*
|
*
|
||||||
* @param encounterId 就诊id
|
* @param encounterId 就诊id
|
||||||
|
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||||
|
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||||
|
* @param status 单据状态(可选)
|
||||||
|
* @param keyword 关键字(可选,申请单号/检查项目名称模糊匹配)
|
||||||
* @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,
|
||||||
|
@RequestParam(required = false) String keyword) {
|
||||||
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, keyword));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,6 +108,7 @@ public class RequestFormManageController {
|
|||||||
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
* @param startDate 开始日期(可选,格式:yyyy-MM-dd)
|
||||||
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
* @param endDate 结束日期(可选,格式:yyyy-MM-dd)
|
||||||
* @param status 单据状态(可选)
|
* @param status 单据状态(可选)
|
||||||
|
* @param keyword 关键字(可选,申请单号/检验项目模糊匹配)
|
||||||
* @return 检验申请单
|
* @return 检验申请单
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/get-inspection")
|
@GetMapping(value = "/get-inspection")
|
||||||
@@ -105,11 +116,12 @@ public class RequestFormManageController {
|
|||||||
@RequestParam(required = false) Long encounterId,
|
@RequestParam(required = false) Long encounterId,
|
||||||
@RequestParam(required = false) String startDate,
|
@RequestParam(required = false) String startDate,
|
||||||
@RequestParam(required = false) String endDate,
|
@RequestParam(required = false) String endDate,
|
||||||
@RequestParam(required = false) String status) {
|
@RequestParam(required = false) String status,
|
||||||
|
@RequestParam(required = false) String keyword) {
|
||||||
if (encounterId == null) {
|
if (encounterId == null) {
|
||||||
return R.fail("就诊ID不能为空");
|
return R.fail("就诊ID不能为空");
|
||||||
}
|
}
|
||||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode(), startDate, endDate));
|
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROOF.getCode(), startDate, endDate, status, keyword));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,6 +152,32 @@ public class RequestFormManageController {
|
|||||||
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode()));
|
return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode()));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
* 分页查询手术申请单(全局,不需要encounterId,用于门诊手术安排查找弹窗)
|
||||||
|
*
|
||||||
|
* @param surgeryNo 手术单号(模糊查询,可选)
|
||||||
|
* @param applyTimeStart 申请时间起始(可选)
|
||||||
|
* @param applyTimeEnd 申请时间截止(可选)
|
||||||
|
* @param mainDoctorId 主刀医生ID(可选)
|
||||||
|
* @param applyDeptId 申请科室ID(可选)
|
||||||
|
* @param pageNo 页码,默认1
|
||||||
|
* @param pageSize 每页数量,默认10
|
||||||
|
* @return 分页手术申请单列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/get-surgery-page")
|
||||||
|
public R<IPage<RequestFormPageDto>> getSurgeryRequestFormPage(
|
||||||
|
@RequestParam(required = false) String surgeryNo,
|
||||||
|
@RequestParam(required = false) LocalDate applyTimeStart,
|
||||||
|
@RequestParam(required = false) LocalDate applyTimeEnd,
|
||||||
|
@RequestParam(required = false) Long mainDoctorId,
|
||||||
|
@RequestParam(required = false) Long applyDeptId,
|
||||||
|
@RequestParam(defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||||
|
RequestFormDto dto = new RequestFormDto(surgeryNo, ActivityDefCategory.PROCEDURE.getCode(), applyTimeStart, applyTimeEnd,
|
||||||
|
mainDoctorId, applyDeptId, pageNo, pageSize);
|
||||||
|
return R.ok(iRequestFormManageAppService.getRequestFormPage(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* 分页查询申请单
|
* 分页查询申请单
|
||||||
* @return 申请单
|
* @return 申请单
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ public class RequestFormDto {
|
|||||||
* 手术单号
|
* 手术单号
|
||||||
*/
|
*/
|
||||||
private String surgeryNo;
|
private String surgeryNo;
|
||||||
|
/**
|
||||||
|
* 申请单类型编码
|
||||||
|
*/
|
||||||
|
private String typeCode;
|
||||||
/**
|
/**
|
||||||
* 申请时间开始
|
* 申请时间开始
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -138,4 +138,12 @@ public class CurrentDayEncounterTencentDto {
|
|||||||
*/
|
*/
|
||||||
private String englishName;
|
private String englishName;
|
||||||
|
|
||||||
|
/** 号源池ID(用于分诊队列 div_log 审计日志) */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long poolId;
|
||||||
|
|
||||||
|
/** 号源槽位ID(用于分诊队列 div_log 审计日志) */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long slotId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
WHEN T1.context_enum = 6 AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
WHEN T1.context_enum = 6 AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
||||||
WHEN T1.context_enum = 6 THEN T2."name"
|
WHEN T1.context_enum = 6 THEN T2."name"
|
||||||
WHEN T1.context_enum = #{activity} AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
WHEN T1.context_enum = #{activity} AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
||||||
|
WHEN T1.context_enum = #{activity} AND T1.service_table = 'wor_service_request' THEN COALESCE(T9.surgery_name, wsr.content_json::json->>'surgeryName', wsr.content_json::json->>'adviceName', T2."name")
|
||||||
WHEN T1.context_enum = #{activity} THEN COALESCE(wsr.content_json::json->>'surgeryName', wsr.content_json::json->>'adviceName', T2."name")
|
WHEN T1.context_enum = #{activity} THEN COALESCE(wsr.content_json::json->>'surgeryName', wsr.content_json::json->>'adviceName', T2."name")
|
||||||
WHEN T1.context_enum = #{medication} THEN T3."name"
|
WHEN T1.context_enum = #{medication} THEN T3."name"
|
||||||
WHEN T1.context_enum = #{device} THEN T4."name"
|
WHEN T1.context_enum = #{device} THEN T4."name"
|
||||||
@@ -225,6 +226,7 @@
|
|||||||
WHEN T1.context_enum = 6 AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
WHEN T1.context_enum = 6 AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
||||||
WHEN T1.context_enum = 6 THEN T2."name"
|
WHEN T1.context_enum = 6 THEN T2."name"
|
||||||
WHEN T1.context_enum = #{activity} AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
WHEN T1.context_enum = #{activity} AND T1.product_id = 0 AND T1.service_table = 'wor_service_request' THEN COALESCE(wsr.content_json::json->>'adviceName', T2."name")
|
||||||
|
WHEN T1.context_enum = #{activity} AND T1.service_table = 'wor_service_request' THEN COALESCE(T9.surgery_name, wsr.content_json::json->>'surgeryName', wsr.content_json::json->>'adviceName', T2."name")
|
||||||
WHEN T1.context_enum = #{activity} THEN COALESCE(wsr.content_json::json->>'surgeryName', wsr.content_json::json->>'adviceName', T2."name")
|
WHEN T1.context_enum = #{activity} THEN COALESCE(wsr.content_json::json->>'surgeryName', wsr.content_json::json->>'adviceName', T2."name")
|
||||||
WHEN T1.context_enum = #{medication} THEN T3."name"
|
WHEN T1.context_enum = #{medication} THEN T3."name"
|
||||||
WHEN T1.context_enum = #{device} THEN T4."name"
|
WHEN T1.context_enum = #{device} THEN T4."name"
|
||||||
|
|||||||
@@ -89,15 +89,12 @@
|
|||||||
cs.apply_doctor_name AS apply_doctor_name,
|
cs.apply_doctor_name AS apply_doctor_name,
|
||||||
drf.create_time AS apply_time,
|
drf.create_time AS apply_time,
|
||||||
os.surgery_nature AS surgeryType,
|
os.surgery_nature AS surgeryType,
|
||||||
fc.contract_name AS feeType,
|
os.fee_type AS feeType,
|
||||||
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifierNo
|
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifierNo
|
||||||
FROM op_schedule os
|
FROM op_schedule os
|
||||||
LEFT JOIN adm_patient ap ON os.patient_id = ap.id
|
LEFT JOIN adm_patient ap ON os.patient_id = ap.id
|
||||||
INNER JOIN cli_surgery cs ON os.oper_code = cs.surgery_no AND cs.delete_flag = '0'
|
INNER JOIN cli_surgery cs ON os.oper_code = cs.surgery_no AND cs.delete_flag = '0'
|
||||||
LEFT JOIN adm_organization o ON cs.org_id = o.id
|
LEFT JOIN adm_organization o ON cs.org_id = o.id
|
||||||
LEFT JOIN adm_encounter ae ON ae.id = cs.encounter_id AND ae.delete_flag = '0'
|
|
||||||
LEFT JOIN adm_account aa ON aa.encounter_id = ae.id AND aa.delete_flag = '0'
|
|
||||||
LEFT JOIN fin_contract fc ON fc.bus_no = aa.contract_no AND fc.delete_flag = '0'
|
|
||||||
LEFT JOIN doc_request_form drf ON drf.prescription_no=cs.surgery_no
|
LEFT JOIN doc_request_form drf ON drf.prescription_no=cs.surgery_no
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT patient_id, identifier_no
|
SELECT patient_id, identifier_no
|
||||||
|
|||||||
@@ -239,7 +239,7 @@
|
|||||||
NULL AS activity_type_dictText,
|
NULL AS activity_type_dictText,
|
||||||
-- 前端"包装单位"列:显示使用单位(permitted_unit_code)
|
-- 前端"包装单位"列:显示使用单位(permitted_unit_code)
|
||||||
T1.permitted_unit_code AS unit_code,
|
T1.permitted_unit_code AS unit_code,
|
||||||
'' AS min_unit_code,
|
T1.permitted_unit_code AS min_unit_code,
|
||||||
'' AS volume,
|
'' AS volume,
|
||||||
'' AS method_code,
|
'' AS method_code,
|
||||||
'' AS rate_code,
|
'' AS rate_code,
|
||||||
@@ -527,6 +527,9 @@
|
|||||||
LEFT JOIN cli_condition AS cc ON cc.id = T1.condition_id AND cc.delete_flag = '0'
|
LEFT JOIN cli_condition AS cc ON cc.id = T1.condition_id AND cc.delete_flag = '0'
|
||||||
LEFT JOIN cli_condition_definition AS ccd ON ccd.id = cc.definition_id
|
LEFT JOIN cli_condition_definition AS ccd ON ccd.id = cc.definition_id
|
||||||
WHERE T1.delete_flag = '0' AND T1.tcm_flag = 0
|
WHERE T1.delete_flag = '0' AND T1.tcm_flag = 0
|
||||||
|
<if test="generateSourceEnum != null">
|
||||||
|
AND T1.generate_source_enum = #{generateSourceEnum}
|
||||||
|
</if>
|
||||||
<if test="historyFlag == '0'.toString()">
|
<if test="historyFlag == '0'.toString()">
|
||||||
AND T1.encounter_id = #{encounterId}
|
AND T1.encounter_id = #{encounterId}
|
||||||
</if>
|
</if>
|
||||||
@@ -541,9 +544,9 @@
|
|||||||
CI.service_id AS request_id,
|
CI.service_id AS request_id,
|
||||||
CI.service_id || '-ci-dev' AS unique_key,
|
CI.service_id || '-ci-dev' AS unique_key,
|
||||||
'' AS prescription_no,
|
'' AS prescription_no,
|
||||||
CI.enterer_id AS requester_id,
|
COALESCE(DR.requester_id, CI.enterer_id) AS requester_id,
|
||||||
CI.entered_date AS request_time,
|
CI.entered_date AS request_time,
|
||||||
CASE WHEN CI.enterer_id = #{practitionerId} THEN '1' ELSE '0' END AS biz_request_flag,
|
CASE WHEN COALESCE(DR.requester_id, CI.enterer_id) = #{practitionerId} THEN '1' ELSE '0' END AS biz_request_flag,
|
||||||
DR.content_json AS content_json,
|
DR.content_json AS content_json,
|
||||||
NULL AS skin_test_flag,
|
NULL AS skin_test_flag,
|
||||||
NULL AS inject_flag,
|
NULL AS inject_flag,
|
||||||
@@ -695,6 +698,9 @@
|
|||||||
-- based_on_table='med_medication_request' → 输液/皮试执行记录,应排除
|
-- based_on_table='med_medication_request' → 输液/皮试执行记录,应排除
|
||||||
-- based_on_table='exam_apply'/'lab_apply' → 申请单原始医嘱,应保留
|
-- based_on_table='exam_apply'/'lab_apply' → 申请单原始医嘱,应保留
|
||||||
AND (T1.based_on_id IS NULL OR T1.based_on_table IS NULL OR T1.based_on_table NOT IN ('med_medication_request', 'med_medication_dispense'))
|
AND (T1.based_on_id IS NULL OR T1.based_on_table IS NULL OR T1.based_on_table NOT IN ('med_medication_request', 'med_medication_dispense'))
|
||||||
|
<if test="sourceBillNo != null and sourceBillNo != ''">
|
||||||
|
AND T1.prescription_no = #{sourceBillNo}
|
||||||
|
</if>
|
||||||
<if test="historyFlag == '0'.toString()">
|
<if test="historyFlag == '0'.toString()">
|
||||||
AND T1.encounter_id = #{encounterId}
|
AND T1.encounter_id = #{encounterId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -231,7 +231,7 @@
|
|||||||
ae.priority_enum,
|
ae.priority_enum,
|
||||||
ae.organization_id,
|
ae.organization_id,
|
||||||
ae.start_time AS in_hos_time,
|
ae.start_time AS in_hos_time,
|
||||||
bed.start_time,
|
COALESCE(bed.start_time, ae.start_time) AS start_time,
|
||||||
bed.location_id AS bed_id,
|
bed.location_id AS bed_id,
|
||||||
bed.location_name AS bed_name,
|
bed.location_name AS bed_name,
|
||||||
house.location_id AS house_id,
|
house.location_id AS house_id,
|
||||||
|
|||||||
@@ -155,7 +155,7 @@
|
|||||||
ii.performer_check_id,
|
ii.performer_check_id,
|
||||||
ii.category_code,
|
ii.category_code,
|
||||||
ii.dispense_status
|
ii.dispense_status
|
||||||
FROM (( SELECT T1.encounter_id,
|
FROM (( SELECT DISTINCT T1.encounter_id,
|
||||||
T1.tenant_id,
|
T1.tenant_id,
|
||||||
#{medMedicationRequest} AS advice_table,
|
#{medMedicationRequest} AS advice_table,
|
||||||
T1.id AS request_id,
|
T1.id AS request_id,
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
T1.sort_number,
|
T1.sort_number,
|
||||||
T1.group_id )
|
T1.group_id )
|
||||||
UNION
|
UNION
|
||||||
( SELECT T1.encounter_id,
|
( SELECT DISTINCT T1.encounter_id,
|
||||||
T1.tenant_id,
|
T1.tenant_id,
|
||||||
#{worServiceRequest} AS advice_table,
|
#{worServiceRequest} AS advice_table,
|
||||||
T1.id AS request_id,
|
T1.id AS request_id,
|
||||||
|
|||||||
@@ -288,7 +288,7 @@
|
|||||||
AND T1.refund_device_id IS NULL
|
AND T1.refund_device_id IS NULL
|
||||||
ORDER BY T1.status_enum)
|
ORDER BY T1.status_enum)
|
||||||
UNION ALL
|
UNION ALL
|
||||||
(SELECT CASE WHEN T1.category_enum = 4 THEN 6 ELSE COALESCE(T1.category_enum, 3) END AS advice_type,
|
(SELECT CASE WHEN T1.category_enum = 4 THEN 6 ELSE 3 END AS advice_type,
|
||||||
T1.id AS request_id,
|
T1.id AS request_id,
|
||||||
T1.id || '-3' AS unique_key,
|
T1.id || '-3' AS unique_key,
|
||||||
T1.requester_id AS requester_id,
|
T1.requester_id AS requester_id,
|
||||||
@@ -373,4 +373,4 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -12,12 +12,15 @@
|
|||||||
drf.desc_json,
|
drf.desc_json,
|
||||||
drf.requester_id,
|
drf.requester_id,
|
||||||
drf.create_time,
|
drf.create_time,
|
||||||
ap.NAME AS patient_name
|
ap.NAME AS patient_name,
|
||||||
|
drf.status
|
||||||
FROM doc_request_form AS drf
|
FROM doc_request_form AS drf
|
||||||
LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id
|
LEFT JOIN adm_encounter AS ae ON ae.ID = drf.encounter_id
|
||||||
AND ae.delete_flag = '0'
|
AND ae.delete_flag = '0'
|
||||||
LEFT JOIN adm_patient AS ap ON ap.ID = ae.patient_id
|
LEFT JOIN adm_patient AS ap ON ap.ID = ae.patient_id
|
||||||
AND ap.delete_flag = '0'
|
AND ap.delete_flag = '0'
|
||||||
|
LEFT JOIN wor_service_request AS wsr ON wsr.prescription_no = drf.prescription_no
|
||||||
|
AND wsr.delete_flag = '0'
|
||||||
WHERE drf.delete_flag = '0'
|
WHERE drf.delete_flag = '0'
|
||||||
AND drf.encounter_id = #{encounterId}
|
AND drf.encounter_id = #{encounterId}
|
||||||
AND drf.type_code = #{typeCode}
|
AND drf.type_code = #{typeCode}
|
||||||
@@ -27,6 +30,24 @@
|
|||||||
<if test="endDate != null and endDate != ''">
|
<if test="endDate != null and endDate != ''">
|
||||||
AND drf.create_time <= (#{endDate}::date + INTERVAL '1 day' - INTERVAL '1 second')
|
AND drf.create_time <= (#{endDate}::date + INTERVAL '1 day' - INTERVAL '1 second')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
AND drf.status = #{status}::integer
|
||||||
|
</if>
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
AND (drf.prescription_no ILIKE '%' || #{keyword} || '%'
|
||||||
|
OR EXISTS (
|
||||||
|
SELECT 1 FROM wor_service_request wsr2
|
||||||
|
WHERE wsr2.prescription_no = drf.prescription_no
|
||||||
|
AND wsr2.delete_flag = '0'
|
||||||
|
AND wsr2.activity_id IN (
|
||||||
|
SELECT id FROM wor_activity_definition wad
|
||||||
|
WHERE wad.delete_flag = '0'
|
||||||
|
AND wad.name ILIKE '%' || #{keyword} || '%'
|
||||||
|
)
|
||||||
|
))
|
||||||
|
</if>
|
||||||
|
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
||||||
|
drf.requester_id, drf.create_time, ap.name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||||
@@ -122,6 +143,9 @@
|
|||||||
<if test="requestFormDto.surgeryNo != null and requestFormDto.surgeryNo != ''">
|
<if test="requestFormDto.surgeryNo != null and requestFormDto.surgeryNo != ''">
|
||||||
AND drf.prescription_no LIKE CONCAT('%', #{requestFormDto.surgeryNo}, '%')
|
AND drf.prescription_no LIKE CONCAT('%', #{requestFormDto.surgeryNo}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="requestFormDto.typeCode != null and requestFormDto.typeCode != ''">
|
||||||
|
AND drf.type_code = #{requestFormDto.typeCode}
|
||||||
|
</if>
|
||||||
<if test="requestFormDto.applyTimeStart != null">
|
<if test="requestFormDto.applyTimeStart != null">
|
||||||
AND drf.create_time >= #{requestFormDto.applyTimeStart}
|
AND drf.create_time >= #{requestFormDto.applyTimeStart}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -27,7 +27,9 @@
|
|||||||
T9.payment_id,
|
T9.payment_id,
|
||||||
T9.picture_url,
|
T9.picture_url,
|
||||||
T9.birth_date,
|
T9.birth_date,
|
||||||
t9.english_name
|
t9.english_name,
|
||||||
|
t9.slot_id,
|
||||||
|
t9.pool_id
|
||||||
from (
|
from (
|
||||||
SELECT T1.tenant_id AS tenant_id,
|
SELECT T1.tenant_id AS tenant_id,
|
||||||
T1.id AS encounter_id,
|
T1.id AS encounter_id,
|
||||||
@@ -51,7 +53,9 @@
|
|||||||
T13.id AS payment_id,
|
T13.id AS payment_id,
|
||||||
ai.picture_url AS picture_url,
|
ai.picture_url AS picture_url,
|
||||||
T8.birth_date AS birth_date,
|
T8.birth_date AS birth_date,
|
||||||
tx.staff_english_name AS english_name
|
tx.staff_english_name AS english_name,
|
||||||
|
om_slot.slot_id AS slot_id,
|
||||||
|
om_slot.pool_id AS pool_id
|
||||||
FROM adm_encounter AS T1
|
FROM adm_encounter AS T1
|
||||||
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
||||||
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
||||||
@@ -91,6 +95,8 @@
|
|||||||
AND T13.status_enum = ${paymentStatus}
|
AND T13.status_enum = ${paymentStatus}
|
||||||
LEFT JOIN adm_invoice AS ai
|
LEFT JOIN adm_invoice AS ai
|
||||||
ON ai.reconciliation_id = T13.id AND ai.delete_flag = '0'
|
ON ai.reconciliation_id = T13.id AND ai.delete_flag = '0'
|
||||||
|
LEFT JOIN order_main AS om ON T1.order_id = om.id AND om.delete_flag = '0'
|
||||||
|
LEFT JOIN adm_schedule_slot AS om_slot ON om.slot_id = om_slot.id
|
||||||
WHERE T1.delete_flag = '0'
|
WHERE T1.delete_flag = '0'
|
||||||
AND T1.class_enum = #{classEnum}
|
AND T1.class_enum = #{classEnum}
|
||||||
AND T10.context_enum = #{register}
|
AND T10.context_enum = #{register}
|
||||||
|
|||||||
@@ -270,6 +270,10 @@ public enum AssignSeqEnum {
|
|||||||
* 诊疗处方号
|
* 诊疗处方号
|
||||||
*/
|
*/
|
||||||
ACTIVITY_PSYCHOTROPIC_NO("62", "诊疗处方号", "PAR"),
|
ACTIVITY_PSYCHOTROPIC_NO("62", "诊疗处方号", "PAR"),
|
||||||
|
/**
|
||||||
|
* 检查申请单号(住院)
|
||||||
|
*/
|
||||||
|
CHECK_APPLY_NO("72", "检查申请单号", "JCZ"),
|
||||||
/**
|
/**
|
||||||
* b 病历文书
|
* b 病历文书
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -193,6 +193,9 @@ public class OpSchedule extends HisBaseEntity {
|
|||||||
/** 外请专家姓名 */
|
/** 外请专家姓名 */
|
||||||
private String externalExpertName;
|
private String externalExpertName;
|
||||||
|
|
||||||
|
/** 费用类别 */
|
||||||
|
private String feeType;
|
||||||
|
|
||||||
/** 备注信息 */
|
/** 备注信息 */
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS triage_queue_item (
|
|||||||
patient_name VARCHAR(255),
|
patient_name VARCHAR(255),
|
||||||
healthcare_name VARCHAR(255),
|
healthcare_name VARCHAR(255),
|
||||||
practitioner_name VARCHAR(255),
|
practitioner_name VARCHAR(255),
|
||||||
status VARCHAR(50) NOT NULL, -- WAITING/CALLING/SKIPPED/COMPLETED
|
status INTEGER NOT NULL DEFAULT 0, -- 分诊队列状态: 0=WAITING(等待), 10=CALLING(叫号中), 20=IN_CLINIC(诊中), 30=COMPLETED(已完成), 40=SKIPPED(已跳过)
|
||||||
queue_order INTEGER NOT NULL,
|
queue_order INTEGER NOT NULL,
|
||||||
create_time TIMESTAMP,
|
create_time TIMESTAMP,
|
||||||
update_time TIMESTAMP,
|
update_time TIMESTAMP,
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
-- Bug #400 修复:triage_queue_item.status 字段类型修正
|
||||||
|
-- 原 DDL 将 status 定义为 VARCHAR(50),但 Java 实体 TriageQueueItem.status 为 Integer 类型,
|
||||||
|
-- 应用层使用 TriageQueueStatus 枚举值(0/10/20/30/40)写入,类型不匹配导致 MyBatis-Plus
|
||||||
|
-- 无法正确映射 status 字段,完诊时 status 更新为 30 失败。
|
||||||
|
--
|
||||||
|
-- 注意:必须在后端实际连接的 schema 中执行(dev=hisdev, test=histest, prd=hisprd)
|
||||||
|
-- 执行前请先确认:SET search_path TO hisdev; (或对应的 schema)
|
||||||
|
|
||||||
|
-- 1. 先将已有的字符串值转换为对应的整数值
|
||||||
|
-- 如果之前写入的是枚举 code(如 'waiting'、'completed'),需要先转换
|
||||||
|
UPDATE triage_queue_item
|
||||||
|
SET status = CASE
|
||||||
|
WHEN status IN ('0', 'waiting', 'WAITING') THEN 0
|
||||||
|
WHEN status IN ('10', 'calling', 'CALLING') THEN 10
|
||||||
|
WHEN status IN ('20', 'in-clinic', 'IN_CLINIC', 'in-clinic') THEN 20
|
||||||
|
WHEN status IN ('30', 'completed', 'COMPLETED') THEN 30
|
||||||
|
WHEN status IN ('40', 'skipped', 'SKIPPED') THEN 40
|
||||||
|
WHEN status IN ('50', 'refunded', 'REFUNDED') THEN 50
|
||||||
|
WHEN status IN ('60', 'follow', 'FOLLOW') THEN 60
|
||||||
|
ELSE 0
|
||||||
|
END
|
||||||
|
WHERE status IS NOT NULL AND status !~ '^[0-9]+$';
|
||||||
|
|
||||||
|
-- 2. 修改字段类型为 INTEGER
|
||||||
|
ALTER TABLE triage_queue_item
|
||||||
|
ALTER COLUMN status TYPE INTEGER USING status::INTEGER;
|
||||||
|
|
||||||
|
-- 3. 设置默认值
|
||||||
|
ALTER TABLE triage_queue_item
|
||||||
|
ALTER COLUMN status SET DEFAULT 0;
|
||||||
@@ -163,7 +163,7 @@ export function updateCheckPart(data) {
|
|||||||
// 查询检查套餐列表
|
// 查询检查套餐列表
|
||||||
export function listCheckPackage(query) {
|
export function listCheckPackage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/check-package/list',
|
url: '/system/package/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -226,8 +226,14 @@ function getList() {
|
|||||||
getDiagnosisTreatmentList(queryParams.value).then((res) => {
|
getDiagnosisTreatmentList(queryParams.value).then((res) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
catagoryList.value = res.data.records.map(record => {
|
catagoryList.value = res.data.records.map(record => {
|
||||||
// 为每一行初始化 filteredOptions,确保显示框能正确显示项目名称
|
|
||||||
const filteredOptions = allImplementDepartmentList.value.slice(0, 100);
|
const filteredOptions = allImplementDepartmentList.value.slice(0, 100);
|
||||||
|
// 确保后端返回的项目名称选项存在于 filteredOptions 中,避免 el-select 因找不到选项而回显为 ID
|
||||||
|
if (record.activityDefinitionId && !filteredOptions.some(o => o.value === record.activityDefinitionId)) {
|
||||||
|
filteredOptions.push({
|
||||||
|
value: record.activityDefinitionId,
|
||||||
|
label: record.activityDefinitionId_dictText || record.activityDefinitionId
|
||||||
|
});
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
...record,
|
...record,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|||||||
@@ -372,7 +372,6 @@ import {
|
|||||||
} from './diagnosistreatment';
|
} from './diagnosistreatment';
|
||||||
import PopoverList from '@/components/OpenHis/popoverList/index.vue';
|
import PopoverList from '@/components/OpenHis/popoverList/index.vue';
|
||||||
import medicineList from './medicineList.vue';
|
import medicineList from './medicineList.vue';
|
||||||
import MedicineList from '../components/medicineList.vue';
|
|
||||||
import {getCurrentInstance, nextTick, watch} from 'vue';
|
import {getCurrentInstance, nextTick, watch} from 'vue';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
@@ -467,16 +466,24 @@ function calculateTotalPrice() {
|
|||||||
try {
|
try {
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
treatmentItems.value.forEach((item) => {
|
treatmentItems.value.forEach((item) => {
|
||||||
if (item.adviceDefinitionId && item.retailPrice && item.childrenRequestNum) {
|
if (item.adviceDefinitionId && item.adviceDefinitionId !== '') {
|
||||||
const price = parseFloat(item.retailPrice) || 0;
|
const price = Number(item.retailPrice) || 0;
|
||||||
const count = parseInt(item.childrenRequestNum) || 0;
|
const count = Number(item.childrenRequestNum) || 0;
|
||||||
sum += price * count;
|
sum += price * count;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
totalPrice.value = sum.toFixed(2);
|
totalPrice.value = sum.toFixed(2);
|
||||||
// Bug #464: 零售价与诊疗子项合计总价实时同步
|
// Bug #464: 零售价与诊疗子项合计总价实时同步
|
||||||
if (treatmentItems.value.length > 0 && treatmentItems.value[0].adviceDefinitionId !== '') {
|
const hasValidItem = treatmentItems.value.some(
|
||||||
form.value.retailPrice = parseFloat(totalPrice.value);
|
(item) => item.adviceDefinitionId && item.adviceDefinitionId !== ''
|
||||||
|
);
|
||||||
|
if (hasValidItem) {
|
||||||
|
// 使用 nextTick 确保总价更新后零售价才更新,避免 Vue 响应式时序问题
|
||||||
|
nextTick(() => {
|
||||||
|
form.value.retailPrice = parseFloat(totalPrice.value) || 0;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
form.value.retailPrice = undefined;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
totalPrice.value = '0.00';
|
totalPrice.value = '0.00';
|
||||||
@@ -486,7 +493,7 @@ function calculateTotalPrice() {
|
|||||||
|
|
||||||
// 添加表单项
|
// 添加表单项
|
||||||
function addItem() {
|
function addItem() {
|
||||||
treatmentItems.value.push({ adviceDefinitionId: '', childrenRequestNum: 1, retailPrice: 0 });
|
treatmentItems.value.push({ adviceDefinitionId: '', childrenRequestNum: 1, name: '', retailPrice: 0 });
|
||||||
// 使用nextTick确保DOM更新后再计算
|
// 使用nextTick确保DOM更新后再计算
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
calculateTotalPrice();
|
calculateTotalPrice();
|
||||||
@@ -560,15 +567,16 @@ function edit() {
|
|||||||
form.value.pricingFlag = 1;
|
form.value.pricingFlag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理子项数据,确保包含retailPrice字段
|
// 处理子项数据,确保包含retailPrice和name字段
|
||||||
if (props.item.childrenJson) {
|
if (props.item.childrenJson) {
|
||||||
const parsedItems = JSON.parse(props.item.childrenJson);
|
const parsedItems = JSON.parse(props.item.childrenJson);
|
||||||
treatmentItems.value = parsedItems.map((item) => ({
|
treatmentItems.value = parsedItems.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
|
name: item.name || '',
|
||||||
retailPrice: item.retailPrice || 0,
|
retailPrice: item.retailPrice || 0,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
treatmentItems.value = [{ adviceDefinitionId: '', childrenRequestNum: 1, retailPrice: 0 }];
|
treatmentItems.value = [{ adviceDefinitionId: '', childrenRequestNum: 1, name: '', retailPrice: 0 }];
|
||||||
}
|
}
|
||||||
form.value.permittedUnitCode = form.value.permittedUnitCode
|
form.value.permittedUnitCode = form.value.permittedUnitCode
|
||||||
? form.value.permittedUnitCode.toString()
|
? form.value.permittedUnitCode.toString()
|
||||||
@@ -613,7 +621,7 @@ function reset() {
|
|||||||
chrgitmLv: undefined, //医保等级
|
chrgitmLv: undefined, //医保等级
|
||||||
pricingFlag: 1, // 划价标记,默认允许划价
|
pricingFlag: 1, // 划价标记,默认允许划价
|
||||||
};
|
};
|
||||||
treatmentItems.value = [{ adviceDefinitionId: '', childrenRequestNum: 1, retailPrice: 0 }];
|
treatmentItems.value = [{ adviceDefinitionId: '', childrenRequestNum: 1, name: '', retailPrice: 0 }];
|
||||||
totalPrice.value = '0.00';
|
totalPrice.value = '0.00';
|
||||||
proxy.resetForm('diagnosisTreatmentRef');
|
proxy.resetForm('diagnosisTreatmentRef');
|
||||||
}
|
}
|
||||||
@@ -647,12 +655,15 @@ async function submitForm() {
|
|||||||
form.value.ybMatchFlag ? (form.value.ybMatchFlag = 1) : (form.value.ybMatchFlag = 0);
|
form.value.ybMatchFlag ? (form.value.ybMatchFlag = 1) : (form.value.ybMatchFlag = 0);
|
||||||
form.value.ruleId ? (form.value.ruleId = 1) : (form.value.ruleId = 0);
|
form.value.ruleId ? (form.value.ruleId = 1) : (form.value.ruleId = 0);
|
||||||
form.value.childrenJson =
|
form.value.childrenJson =
|
||||||
treatmentItems.value.length > 0 && treatmentItems.value[0].adviceDefinitionId != ''
|
treatmentItems.value.some((item) => item.adviceDefinitionId != '' && item.adviceDefinitionId)
|
||||||
? JSON.stringify(treatmentItems.value)
|
? JSON.stringify(treatmentItems.value)
|
||||||
: undefined;
|
: undefined;
|
||||||
// Bug #464 修复:零售价自动与诊疗子项合计总价同步
|
// Bug #464 修复:零售价自动与诊疗子项合计总价同步
|
||||||
// 当有子项时,零售价自动设置为子项合计总价
|
// 当有子项时,零售价自动设置为子项合计总价
|
||||||
if (treatmentItems.value.length > 0 && treatmentItems.value[0].adviceDefinitionId != '') {
|
const hasValidItem = treatmentItems.value.some(
|
||||||
|
(item) => item.adviceDefinitionId && item.adviceDefinitionId !== ''
|
||||||
|
);
|
||||||
|
if (hasValidItem) {
|
||||||
form.value.retailPrice = parseFloat(totalPrice.value) || 0;
|
form.value.retailPrice = parseFloat(totalPrice.value) || 0;
|
||||||
}
|
}
|
||||||
proxy.$refs['diagnosisTreatmentRef'].validate(async (valid) => {
|
proxy.$refs['diagnosisTreatmentRef'].validate(async (valid) => {
|
||||||
@@ -752,7 +763,10 @@ function selectRow(row, index) {
|
|||||||
treatmentItems.value[index].adviceDefinitionId = row.id;
|
treatmentItems.value[index].adviceDefinitionId = row.id;
|
||||||
treatmentItems.value[index].retailPrice = row.retailPrice || 0;
|
treatmentItems.value[index].retailPrice = row.retailPrice || 0;
|
||||||
medicineSearchKey.value = '';
|
medicineSearchKey.value = '';
|
||||||
calculateTotalPrice();
|
// 使用 nextTick 确保 DOM 更新后再计算总价
|
||||||
|
nextTick(() => {
|
||||||
|
calculateTotalPrice();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清空诊疗子项
|
// 清空诊疗子项
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const emit = defineEmits(['selectRow']);
|
|||||||
const diagnosisTreatmentList = ref([]); // 原始数据列表
|
const diagnosisTreatmentList = ref([]); // 原始数据列表
|
||||||
const filteredList = ref([]); // 过滤后的数据列表
|
const filteredList = ref([]); // 过滤后的数据列表
|
||||||
const hasLoaded = ref(false); // 标记是否已加载数据
|
const hasLoaded = ref(false); // 标记是否已加载数据
|
||||||
|
const isLoading = ref(false); // 标记是否正在加载
|
||||||
|
|
||||||
// 获取诊疗项目列表
|
// 获取诊疗项目列表
|
||||||
function getList() {
|
function getList() {
|
||||||
@@ -53,7 +54,7 @@ function getList() {
|
|||||||
getDiagnosisTreatmentList({ statusEnum: 2, pageSize: 1000, pageNo: 1 })
|
getDiagnosisTreatmentList({ statusEnum: 2, pageSize: 1000, pageNo: 1 })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
diagnosisTreatmentList.value =
|
diagnosisTreatmentList.value =
|
||||||
res.data?.records?.filter((item) => item.childrenJson == null) || [];
|
res.data?.records?.filter((item) => item.childrenJson == null || item.childrenJson === '') || [];
|
||||||
filterList(); // 初始化过滤
|
filterList(); // 初始化过滤
|
||||||
hasLoaded.value = true; // 标记为已加载
|
hasLoaded.value = true; // 标记为已加载
|
||||||
})
|
})
|
||||||
@@ -62,6 +63,47 @@ function getList() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 服务端搜索(当用户输入搜索关键词时)
|
||||||
|
function searchList(searchKey) {
|
||||||
|
if (!searchKey || searchKey.trim() === '') return;
|
||||||
|
isLoading.value = true;
|
||||||
|
// 使用较大的pageSize确保搜索结果尽可能多
|
||||||
|
getDiagnosisTreatmentList({ statusEnum: 2, searchKey: searchKey.trim(), pageSize: 5000, pageNo: 1 })
|
||||||
|
.then((res) => {
|
||||||
|
diagnosisTreatmentList.value =
|
||||||
|
res.data?.records?.filter((item) => item.childrenJson == null || item.childrenJson === '') || [];
|
||||||
|
filterList();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error('搜索诊疗项目数据失败:', err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
isLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取预加载数据(不带搜索关键词时使用)
|
||||||
|
function loadPreloadedData() {
|
||||||
|
if (props.preloadedData && props.preloadedData.length > 0) {
|
||||||
|
diagnosisTreatmentList.value = props.preloadedData;
|
||||||
|
filterList();
|
||||||
|
hasLoaded.value = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasLoaded.value) return;
|
||||||
|
getDiagnosisTreatmentList({ statusEnum: 2, pageSize: 1000, pageNo: 1 })
|
||||||
|
.then((res) => {
|
||||||
|
diagnosisTreatmentList.value =
|
||||||
|
res.data?.records?.filter((item) => item.childrenJson == null || item.childrenJson === '') || [];
|
||||||
|
filterList();
|
||||||
|
hasLoaded.value = true;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error('获取诊疗项目数据失败:', err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 监听shouldLoadData属性变化,仅在首次为true时加载数据
|
// 监听shouldLoadData属性变化,仅在首次为true时加载数据
|
||||||
watch(
|
watch(
|
||||||
() => props.shouldLoadData,
|
() => props.shouldLoadData,
|
||||||
@@ -86,11 +128,17 @@ watch(
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
// 监听搜索关键词变化,实时过滤数据
|
// 监听搜索关键词变化,有搜索词时走服务端搜索,否则走本地过滤
|
||||||
watch(
|
watch(
|
||||||
() => props.searchKey,
|
() => props.searchKey,
|
||||||
() => {
|
(newVal) => {
|
||||||
filterList();
|
if (newVal && newVal.trim() !== '') {
|
||||||
|
// 有搜索关键词,走服务端搜索
|
||||||
|
searchList(newVal);
|
||||||
|
} else {
|
||||||
|
// 搜索词为空,使用预加载数据
|
||||||
|
loadPreloadedData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -69,13 +69,14 @@ const throttledGetList = throttle(
|
|||||||
watch(
|
watch(
|
||||||
() => props.adviceQueryParams,
|
() => props.adviceQueryParams,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
// 只有在弹窗打开时才响应 adviceQueryParams 的变化,避免选择项目后弹窗关闭时触发不必要的请求
|
// 始终同步参数到 queryParams,避免弹窗打开时使用旧参数
|
||||||
if (!props.popoverVisible) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
queryParams.value.searchKey = newValue?.searchKey;
|
queryParams.value.searchKey = newValue?.searchKey;
|
||||||
queryParams.value.adviceType = newValue?.adviceType;
|
queryParams.value.adviceType = newValue?.adviceType;
|
||||||
queryParams.value.categoryCode = newValue?.categoryCode;
|
queryParams.value.categoryCode = newValue?.categoryCode;
|
||||||
|
// 只有在弹窗打开时才触发 API 请求
|
||||||
|
if (!props.popoverVisible) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
throttledGetList();
|
throttledGetList();
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
@@ -114,22 +115,44 @@ function getList() {
|
|||||||
console.log('[adviceBaseList] getList() 跳过:未选择患者');
|
console.log('[adviceBaseList] getList() 跳过:未选择患者');
|
||||||
return; // 不执行API调用
|
return; // 不执行API调用
|
||||||
}
|
}
|
||||||
|
|
||||||
// 只有在弹窗打开时才执行查询
|
// 只有在弹窗打开时才执行查询
|
||||||
if (!props.popoverVisible) {
|
if (!props.popoverVisible) {
|
||||||
console.log('[adviceBaseList] getList() 跳过:弹窗未打开');
|
console.log('[adviceBaseList] getList() 跳过:弹窗未打开');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
queryParams.value.organizationId = props.patientInfo.orgId;
|
// 🔧 Bug #448 修复:显式构建请求参数,确保 adviceType 正确传递
|
||||||
console.log('[adviceBaseList] getList() 请求参数:', JSON.stringify(queryParams.value));
|
// 不直接使用 queryParams.value,避免 undefined 值被发送到后端导致过滤失效
|
||||||
|
const requestParams = {
|
||||||
getAdviceBaseInfo(queryParams.value).then((res) => {
|
pageSize: queryParams.value.pageSize,
|
||||||
|
pageNum: queryParams.value.pageNum,
|
||||||
|
organizationId: props.patientInfo.orgId,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 只在 adviceType 有值时添加(0 是无效值,undefined/null 会导致后端查询所有类型)
|
||||||
|
if (queryParams.value.adviceType != null && queryParams.value.adviceType !== 0) {
|
||||||
|
requestParams.adviceType = queryParams.value.adviceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只在 categoryCode 有值时添加
|
||||||
|
if (queryParams.value.categoryCode) {
|
||||||
|
requestParams.categoryCode = queryParams.value.categoryCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只在 searchKey 有值时添加
|
||||||
|
if (queryParams.value.searchKey) {
|
||||||
|
requestParams.searchKey = queryParams.value.searchKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('[adviceBaseList] getList() 请求参数:', JSON.stringify(requestParams));
|
||||||
|
|
||||||
|
getAdviceBaseInfo(requestParams).then((res) => {
|
||||||
console.log('[adviceBaseList] getList() 响应数据:', {
|
console.log('[adviceBaseList] getList() 响应数据:', {
|
||||||
total: res.data?.total,
|
total: res.data?.total,
|
||||||
recordsCount: res.data?.records?.length || 0,
|
recordsCount: res.data?.records?.length || 0,
|
||||||
firstRecord: res.data?.records?.[0]?.adviceName || '无数据',
|
firstRecord: res.data?.records?.[0]?.adviceName || '无数据',
|
||||||
adviceType: queryParams.value.adviceType
|
adviceType: requestParams.adviceType
|
||||||
});
|
});
|
||||||
adviceBaseList.value = res.data.records || [];
|
adviceBaseList.value = res.data.records || [];
|
||||||
total.value = res.data.total || 0;
|
total.value = res.data.total || 0;
|
||||||
|
|||||||
@@ -58,10 +58,17 @@ export function singOut(data) {
|
|||||||
/**
|
/**
|
||||||
* 获取患者本次就诊处方
|
* 获取患者本次就诊处方
|
||||||
*/
|
*/
|
||||||
export function getPrescriptionList(encounterId) {
|
export function getPrescriptionList(encounterId, generateSourceEnum, sourceBillNo) {
|
||||||
// Add timestamp to bypass browser caching and ensure fresh data is loaded
|
let url = '/doctor-station/advice/request-base-info?encounterId=' + encounterId
|
||||||
|
if (generateSourceEnum != null) {
|
||||||
|
url += '&generateSourceEnum=' + generateSourceEnum
|
||||||
|
}
|
||||||
|
if (sourceBillNo != null) {
|
||||||
|
url += '&sourceBillNo=' + encodeURIComponent(sourceBillNo)
|
||||||
|
}
|
||||||
|
url += '&t=' + Date.now()
|
||||||
return request({
|
return request({
|
||||||
url: '/doctor-station/advice/request-base-info?encounterId=' + encounterId + '&t=' + Date.now(),
|
url: url,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,6 +381,14 @@ const props = defineProps({
|
|||||||
activeTab: {
|
activeTab: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
generateSourceEnum: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
sourceBillNo: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const isAdding = ref(false);
|
const isAdding = ref(false);
|
||||||
const isSaving = ref(false); // #437 防重复提交锁
|
const isSaving = ref(false); // #437 防重复提交锁
|
||||||
@@ -468,7 +476,11 @@ watch(
|
|||||||
|
|
||||||
function getListInfo(addNewRow) {
|
function getListInfo(addNewRow) {
|
||||||
isAdding.value = false;
|
isAdding.value = false;
|
||||||
getPrescriptionList(props.patientInfo.encounterId).then((res) => {
|
getPrescriptionList(
|
||||||
|
props.patientInfo.encounterId,
|
||||||
|
props.generateSourceEnum ?? undefined,
|
||||||
|
props.sourceBillNo ?? undefined,
|
||||||
|
).then((res) => {
|
||||||
// 为每行数据添加 adviceTypeValue 字段,用于类型下拉框显示
|
// 为每行数据添加 adviceTypeValue 字段,用于类型下拉框显示
|
||||||
prescriptionList.value = (res.data || []).map(item => {
|
prescriptionList.value = (res.data || []).map(item => {
|
||||||
// 根据 adviceType 和 categoryCode 找到对应的 adviceTypeValue
|
// 根据 adviceType 和 categoryCode 找到对应的 adviceTypeValue
|
||||||
@@ -868,19 +880,27 @@ function handleDelete() {
|
|||||||
proxy.$modal.msgWarning('请选择要删除的项目');
|
proxy.$modal.msgWarning('请选择要删除的项目');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let deleteList = groupIndexList.value.map((index) => {
|
let deleteList = groupIndexList.value.map((index) => {
|
||||||
const item = prescriptionList.value[index];
|
const item = prescriptionList.value[index];
|
||||||
// 只删除待签发且未收费的项目
|
// 只删除待签发且未收费的项目
|
||||||
if (item.statusEnum != 1 || item.chargeStatus == 5) {
|
if (item.statusEnum != 1 || item.chargeStatus == 5) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// 🔧 Bug #442: 非本人创建的医嘱不允许删除(与签发/签退逻辑保持一致)
|
||||||
|
if (Number(item.bizRequestFlag) !== 1 && item.bizRequestFlag) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 🔧 Bug #442: 已保存的行必须有有效的 requestId,否则跳过(避免后端删除不存在的记录)
|
||||||
|
if (item.requestId == null || item.requestId === undefined || item.requestId === '') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
requestId: item.requestId,
|
requestId: item.requestId,
|
||||||
dbOpType: '3',
|
dbOpType: '3',
|
||||||
adviceType: item.adviceType,
|
adviceType: item.adviceType,
|
||||||
};
|
};
|
||||||
}).filter(item => item !== null); // 过滤掉已签发或已收费的项目
|
}).filter(item => item !== null); // 过滤掉已签发、已收费、非本人创建或无 requestId 的项目
|
||||||
|
|
||||||
if (deleteList.length == 0) {
|
if (deleteList.length == 0) {
|
||||||
proxy.$modal.msgWarning('只能删除待签发且未收费的项目');
|
proxy.$modal.msgWarning('只能删除待签发且未收费的项目');
|
||||||
@@ -1016,6 +1036,14 @@ function handleSave() {
|
|||||||
requestId: item.requestId,
|
requestId: item.requestId,
|
||||||
dbOpType: '1',
|
dbOpType: '1',
|
||||||
groupId: item.groupId,
|
groupId: item.groupId,
|
||||||
|
// 🔧 Bug #443: 补充顶层关键字段(这些不在 contentJson 中,需从 API 响应顶层提取)
|
||||||
|
encounterId: item.encounterId,
|
||||||
|
patientId: item.patientId,
|
||||||
|
locationId: item.positionId,
|
||||||
|
adviceType: item.adviceType,
|
||||||
|
adviceTableName: item.adviceTableName,
|
||||||
|
adviceDefinitionId: item.adviceDefinitionId,
|
||||||
|
chargeItemId: item.chargeItemId,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
savePrescriptionSign({
|
savePrescriptionSign({
|
||||||
|
|||||||
@@ -1243,11 +1243,14 @@ async function show(diagnosisData) {
|
|||||||
const res = await getNextCardNo(orgCode);
|
const res = await getNextCardNo(orgCode);
|
||||||
if (res.code === 200 && res.data && res.data.length >= 12) {
|
if (res.code === 200 && res.data && res.data.length >= 12) {
|
||||||
cardNo = res.data;
|
cardNo = res.data;
|
||||||
|
} else {
|
||||||
|
// API返回失败或不合规时,生成临时卡号避免保存时 cardNo 为空导致后端校验失败
|
||||||
|
cardNo = 'TEMP_' + Date.now();
|
||||||
}
|
}
|
||||||
// API失败或返回不合规时保持为空字符串,由用户手动填写或后端自动生成
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('获取卡片编号失败:', err);
|
console.error('获取卡片编号失败:', err);
|
||||||
// 保持为空,不使用不合规的临时值
|
// API调用异常时,生成临时卡号
|
||||||
|
cardNo = 'TEMP_' + Date.now();
|
||||||
}
|
}
|
||||||
|
|
||||||
form.value = {
|
form.value = {
|
||||||
@@ -1318,7 +1321,11 @@ async function show(diagnosisData) {
|
|||||||
// 系统关联信息
|
// 系统关联信息
|
||||||
encounterId: patientInfo.encounterId || '', // 就诊ID
|
encounterId: patientInfo.encounterId || '', // 就诊ID
|
||||||
patientId: patientInfo.patientId || '', // 患者ID
|
patientId: patientInfo.patientId || '', // 患者ID
|
||||||
diagnosisId: diagnosisData?.conditionId || diagnosisData?.definitionId || '', // 诊断ID
|
diagnosisId: (diagnosisData?.conditionId != null && diagnosisData?.conditionId !== '')
|
||||||
|
? diagnosisData.conditionId
|
||||||
|
: (diagnosisData?.definitionId != null && diagnosisData?.definitionId !== '')
|
||||||
|
? diagnosisData.definitionId
|
||||||
|
: '', // 诊断ID
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更新selectedDiseases数组
|
// 更新selectedDiseases数组
|
||||||
@@ -1359,6 +1366,9 @@ async function buildSubmitData() {
|
|||||||
} else if (formData.otherDisease) {
|
} else if (formData.otherDisease) {
|
||||||
// 其他传染病使用自定义编码
|
// 其他传染病使用自定义编码
|
||||||
diseaseCode = 'OTHER';
|
diseaseCode = 'OTHER';
|
||||||
|
} else if (formData.selectedDiseases && formData.selectedDiseases.length > 0) {
|
||||||
|
// 兜底:如果 ClassA/B/C 都为空但 selectedDiseases 有值,取第一个作为 diseaseCode
|
||||||
|
diseaseCode = formData.selectedDiseases[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转换年龄单位:岁=1, 月=2, 天=3
|
// 转换年龄单位:岁=1, 月=2, 天=3
|
||||||
@@ -1373,7 +1383,7 @@ async function buildSubmitData() {
|
|||||||
const submitData = {
|
const submitData = {
|
||||||
cardNo: formData.cardNo,
|
cardNo: formData.cardNo,
|
||||||
visitId: props.patientInfo?.encounterId || formData.encounterId || null,
|
visitId: props.patientInfo?.encounterId || formData.encounterId || null,
|
||||||
diagId: formData.diagnosisId || null,
|
diagId: formData.diagnosisId ? Number(formData.diagnosisId) : null,
|
||||||
patId: formData.patientId || null,
|
patId: formData.patientId || null,
|
||||||
idType: 1, // 默认身份证
|
idType: 1, // 默认身份证
|
||||||
idNo: formData.idNo,
|
idNo: formData.idNo,
|
||||||
@@ -1426,8 +1436,8 @@ async function buildSubmitData() {
|
|||||||
function validateFormManually() {
|
function validateFormManually() {
|
||||||
const errors = [];
|
const errors = [];
|
||||||
|
|
||||||
// 卡片编号验证(至少12位,后端自动生成16位编号)
|
// 卡片编号验证(至少12位,后端自动生成16位编号;临时卡号 TEMP_ 开头允许通过)
|
||||||
if (form.value.cardNo && form.value.cardNo.length < 12) {
|
if (form.value.cardNo && !form.value.cardNo.startsWith('TEMP_') && form.value.cardNo.length < 12) {
|
||||||
errors.push('卡片编号至少12位');
|
errors.push('卡片编号至少12位');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1539,6 +1549,12 @@ async function handleSubmit() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查诊断ID是否有效(后端 @NotNull 校验要求)
|
||||||
|
if (!form.value.diagnosisId) {
|
||||||
|
proxy.$modal.msgError('诊断信息不完整,请重新选择诊断后重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 开始加载状态,防止重复提交
|
// 开始加载状态,防止重复提交
|
||||||
submitLoading.value = true;
|
submitLoading.value = true;
|
||||||
|
|
||||||
@@ -1762,6 +1778,33 @@ defineExpose({ show, showReport, close: handleClose });
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 输入框下划线样式(与 underline-select 保持一致) */
|
||||||
|
.underline-input :deep(.el-input__wrapper) {
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
border-radius: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-input :deep(.el-input__wrapper:hover) {
|
||||||
|
border-bottom-color: #c0c4cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-input :deep(.el-input__wrapper.is-focus) {
|
||||||
|
border-bottom-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-input :deep(.el-input__inner) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline-input :deep(.el-input__inner::placeholder) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
/* 街道下拉框下划线样式 */
|
/* 街道下拉框下划线样式 */
|
||||||
.underline-select {
|
.underline-select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -3,15 +3,56 @@
|
|||||||
<!-- ====== 顶部卡片:申请单列表 ====== -->
|
<!-- ====== 顶部卡片:申请单列表 ====== -->
|
||||||
<div class="top-section">
|
<div class="top-section">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<span class="section-title">检查项目 ({{ applicationList.length }})</span>
|
<span class="section-title">检查项目 ({{ filteredApplicationList.length }})</span>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button type="primary" @click="handleAdd" icon="Plus">新增</el-button>
|
<el-button type="primary" @click="handleAdd" icon="Plus">新增</el-button>
|
||||||
<el-button type="success" @click="handleSave" icon="Finished">保存</el-button>
|
<el-button type="success" @click="handleSave" icon="Finished">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Bug #499: 查询过滤工具栏 -->
|
||||||
|
<div class="search-toolbar">
|
||||||
|
<el-form :inline="true" size="small">
|
||||||
|
<el-form-item label="日期范围">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="searchForm.dateRange"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-select v-model="searchForm.applyStatus" placeholder="全部" clearable style="width: 140px">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in statusOptions"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关键字">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.keyword"
|
||||||
|
placeholder="申请单号 / 检查项目"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter="handleSearch"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="handleSearch" icon="Search">搜索</el-button>
|
||||||
|
<el-button @click="handleResetSearch" icon="Refresh">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="applicationList"
|
:data="filteredApplicationList"
|
||||||
:max-height="200"
|
:max-height="200"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
@@ -316,6 +357,7 @@
|
|||||||
<span class="cat-title">{{ cat.categoryName }}</span>
|
<span class="cat-title">{{ cat.categoryName }}</span>
|
||||||
<span v-if="categoryLoadingSet.has(cat.typeId)" class="loading-dot"></span>
|
<span v-if="categoryLoadingSet.has(cat.typeId)" class="loading-dot"></span>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 检查项目(部位/项目列表) -->
|
||||||
<div
|
<div
|
||||||
v-for="item in cat.items"
|
v-for="item in cat.items"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -333,6 +375,28 @@
|
|||||||
<div v-if="categoryLoadingSet.has(cat.typeId)" class="category-loading-hint">
|
<div v-if="categoryLoadingSet.has(cat.typeId)" class="category-loading-hint">
|
||||||
加载中...
|
加载中...
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Bug #428修复: 渲染分类联动加载的检查方法列表 -->
|
||||||
|
<!-- Bug #500修复: v-if 改为 v-show,避免方法列表加载时 DOM 突然插入导致高度跳变 -->
|
||||||
|
<div
|
||||||
|
v-show="cat.methods && cat.methods.length > 0"
|
||||||
|
class="method-section"
|
||||||
|
>
|
||||||
|
<div class="method-section-title">检查方法</div>
|
||||||
|
<div
|
||||||
|
v-for="method in cat.methods"
|
||||||
|
:key="method.id"
|
||||||
|
class="method-row"
|
||||||
|
>
|
||||||
|
<el-checkbox
|
||||||
|
:model-value="isMethodSelected(method, cat)"
|
||||||
|
@change="(val) => handleMethodSelect(val, method, cat)"
|
||||||
|
class="method-checkbox"
|
||||||
|
>
|
||||||
|
{{ method.name }}
|
||||||
|
</el-checkbox>
|
||||||
|
<span class="method-price-tag">¥{{ method.packagePrice || method.price || 0 }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</div>
|
</div>
|
||||||
@@ -380,6 +444,21 @@
|
|||||||
<span class="method-price">¥{{ method.packagePrice || item.price }}</span>
|
<span class="method-price">¥{{ method.packagePrice || item.price }}</span>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 选中方法后,显示对应的套餐明细 -->
|
||||||
|
<div v-if="item.selectedMethod && item.methodPackageDetails && item.methodPackageDetails.length > 0" class="method-package-details">
|
||||||
|
<div class="method-package-header">
|
||||||
|
<span class="method-package-title">套餐明细 - {{ item.selectedMethod.name }}</span>
|
||||||
|
</div>
|
||||||
|
<div v-for="detail in item.methodPackageDetails" :key="detail.id" class="method-option">
|
||||||
|
<el-checkbox v-model="detail.checked">
|
||||||
|
<span class="method-name">{{ detail.name }}</span>
|
||||||
|
<span class="method-price">数量: {{ detail.quantity }} ¥{{ detail.price }}</span>
|
||||||
|
</el-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="item.selectedMethod && item.methodPackageLoading" class="method-package-loading">
|
||||||
|
加载套餐明细中...
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -397,7 +476,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
|
|||||||
import { Printer, Delete, ArrowDown, ArrowUp, Close } from '@element-plus/icons-vue';
|
import { Printer, Delete, ArrowDown, ArrowUp, Close } from '@element-plus/icons-vue';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { listCheckMethod, searchCheckMethod } from '@/api/system/checkType';
|
import { listCheckMethod, searchCheckMethod, listCheckPackage } from '@/api/system/checkType';
|
||||||
import { getEncounterDiagnosis } from '../api.js';
|
import { getEncounterDiagnosis } from '../api.js';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -415,6 +494,74 @@ const activeDetailTab = ref('applyForm');
|
|||||||
const applicationList = ref([]);
|
const applicationList = ref([]);
|
||||||
const selectedItems = ref([]);
|
const selectedItems = ref([]);
|
||||||
|
|
||||||
|
// Bug #499: 查询过滤状态
|
||||||
|
const searchForm = reactive({
|
||||||
|
dateRange: [],
|
||||||
|
applyStatus: '',
|
||||||
|
keyword: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
// 申请单状态选项
|
||||||
|
const statusOptions = [
|
||||||
|
{ label: '已开单', value: 0 },
|
||||||
|
{ label: '已收费', value: 1 },
|
||||||
|
{ label: '已预约', value: 2 },
|
||||||
|
{ label: '已签到', value: 3 },
|
||||||
|
{ label: '部分报告', value: 4 },
|
||||||
|
{ label: '已完告', value: 5 },
|
||||||
|
{ label: '已作废', value: 6 }
|
||||||
|
];
|
||||||
|
|
||||||
|
// Bug #499: 过滤后的申请单列表
|
||||||
|
const filteredApplicationList = computed(() => {
|
||||||
|
let result = applicationList.value;
|
||||||
|
|
||||||
|
// 日期范围过滤
|
||||||
|
if (searchForm.dateRange && searchForm.dateRange.length === 2) {
|
||||||
|
const start = searchForm.dateRange[0];
|
||||||
|
const end = searchForm.dateRange[1];
|
||||||
|
result = result.filter(item => {
|
||||||
|
const d = item.applyTime;
|
||||||
|
if (!d) return false;
|
||||||
|
const dateStr = d.length > 10 ? d.substring(0, 10) : d;
|
||||||
|
return dateStr >= start && dateStr <= end;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态过滤
|
||||||
|
if (searchForm.applyStatus !== '' && searchForm.applyStatus !== null && searchForm.applyStatus !== undefined) {
|
||||||
|
result = result.filter(item => item.applyStatus === searchForm.applyStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关键字过滤(申请单号、申检部位、检查项目名)
|
||||||
|
if (searchForm.keyword) {
|
||||||
|
const kw = searchForm.keyword.toLowerCase();
|
||||||
|
result = result.filter(item => {
|
||||||
|
return (item.applyNo || '').toLowerCase().includes(kw)
|
||||||
|
|| (item.inspectionArea || '').toLowerCase().includes(kw);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Bug #499: 搜索与重置
|
||||||
|
function handleSearch() {
|
||||||
|
// 过滤逻辑由 computed 自动处理
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleResetSearch() {
|
||||||
|
const now = new Date();
|
||||||
|
const end = now.toISOString().substring(0, 10);
|
||||||
|
const start = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000).toISOString().substring(0, 10);
|
||||||
|
searchForm.dateRange = [start, end];
|
||||||
|
searchForm.applyStatus = '';
|
||||||
|
searchForm.keyword = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化默认日期范围为近一周
|
||||||
|
handleResetSearch();
|
||||||
|
|
||||||
// 🔧 BugFix#426: 懒加载套餐明细
|
// 🔧 BugFix#426: 懒加载套餐明细
|
||||||
async function loadPackageDetails(row, treeNode, resolve) {
|
async function loadPackageDetails(row, treeNode, resolve) {
|
||||||
if (!row.isPackage || !row.packageId) {
|
if (!row.isPackage || !row.packageId) {
|
||||||
@@ -423,7 +570,7 @@ async function loadPackageDetails(row, treeNode, resolve) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: `/exam/package/${row.packageId}/details`,
|
url: `/system/package/${row.packageId}/details`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
@@ -445,14 +592,28 @@ async function loadPackageDetails(row, treeNode, resolve) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #428: 为已选择项目加载套餐明细
|
// #428修复: 为已选择项目加载套餐明细(通过packageId或packageName查询)
|
||||||
async function loadPackageDetailsForItem(item) {
|
async function loadPackageDetailsForItem(item) {
|
||||||
if (!item.isPackage || !item.packageId) {
|
if (!item.isPackage || (!item.packageId && !item.packageName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
let packageId = item.packageId;
|
||||||
|
if (!packageId && item.packageName) {
|
||||||
|
// CheckPart 没有 packageId 字段,需要通过 packageName 查询获取
|
||||||
|
const pkgRes = await listCheckPackage({ packageName: item.packageName });
|
||||||
|
let packages = pkgRes?.data || [];
|
||||||
|
if (!Array.isArray(packages)) {
|
||||||
|
packages = packages.records || packages.data || [];
|
||||||
|
}
|
||||||
|
if (packages.length === 0) {
|
||||||
|
item.packageDetails = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
packageId = packages[0].id;
|
||||||
|
}
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: `/exam/package/${item.packageId}/details`,
|
url: `/system/package/${packageId}/details`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
@@ -460,7 +621,7 @@ async function loadPackageDetailsForItem(item) {
|
|||||||
...detail,
|
...detail,
|
||||||
name: detail.name || detail.itemName,
|
name: detail.name || detail.itemName,
|
||||||
unit: detail.unit || '次',
|
unit: detail.unit || '次',
|
||||||
price: detail.price || detail.itemPrice || 0,
|
price: detail.price || detail.unitPrice || 0,
|
||||||
quantity: detail.quantity || 1
|
quantity: detail.quantity || 1
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
@@ -522,7 +683,7 @@ const categoryList = ref([]); // 原始分类+项目数据
|
|||||||
const dictSearchKey = ref('');
|
const dictSearchKey = ref('');
|
||||||
const activeNames = ref(''); // 当前展开的折叠项
|
const activeNames = ref(''); // 当前展开的折叠项
|
||||||
const categoryLoadingSet = ref(new Set()); // Bug #500: 正在加载方法的分类集合
|
const categoryLoadingSet = ref(new Set()); // Bug #500: 正在加载方法的分类集合
|
||||||
const isAnimating = ref(false); // Bug #500: 防止快速切换时折叠动画重叠导致抖动
|
const currentActiveCategory = ref(null); // Bug #500: 记录当前激活的分类,忽略过期请求响应
|
||||||
|
|
||||||
const allMethods = ref([]);
|
const allMethods = ref([]);
|
||||||
|
|
||||||
@@ -639,15 +800,18 @@ const availableMethods = computed(() => {
|
|||||||
// 当可选方法列表改变时,如果当前选中的方法不在新列表中,则清空
|
// 当可选方法列表改变时,如果当前选中的方法不在新列表中,则清空
|
||||||
// #428: 分类展开时联动加载检查方法
|
// #428: 分类展开时联动加载检查方法
|
||||||
// Bug #500: 使用 categoryLoadingSet 替代 dictLoading,避免切换分类时整个区域闪烁
|
// Bug #500: 使用 categoryLoadingSet 替代 dictLoading,避免切换分类时整个区域闪烁
|
||||||
|
// Bug #500: 添加 currentActiveCategory 守卫,忽略过期请求响应,防止快速切换时数据闪烁
|
||||||
async function handleCategoryExpand(cat) {
|
async function handleCategoryExpand(cat) {
|
||||||
if (!cat || !cat.typeName) return;
|
if (!cat || !cat.typeName) return;
|
||||||
|
|
||||||
// 如果已加载过或正在加载中,跳过
|
|
||||||
if ((cat.methods && cat.methods.length > 0) || categoryLoadingSet.value.has(cat.typeId)) return;
|
if ((cat.methods && cat.methods.length > 0) || categoryLoadingSet.value.has(cat.typeId)) return;
|
||||||
|
|
||||||
categoryLoadingSet.value.add(cat.typeId);
|
categoryLoadingSet.value.add(cat.typeId);
|
||||||
|
currentActiveCategory.value = cat.typeId;
|
||||||
try {
|
try {
|
||||||
const res = await searchCheckMethod({ checkType: cat.typeName });
|
const res = await searchCheckMethod({ checkType: cat.typeName });
|
||||||
|
// 忽略过期请求:用户已切换到其他分类,丢弃当前响应
|
||||||
|
if (currentActiveCategory.value !== cat.typeId) return;
|
||||||
let data = res?.data?.data || res?.data || res?.rows || res;
|
let data = res?.data?.data || res?.data || res?.rows || res;
|
||||||
if (!Array.isArray(data) && res?.data && Array.isArray(res.data.data)) {
|
if (!Array.isArray(data) && res?.data && Array.isArray(res.data.data)) {
|
||||||
data = res.data.data;
|
data = res.data.data;
|
||||||
@@ -660,25 +824,27 @@ async function handleCategoryExpand(cat) {
|
|||||||
code: m.code,
|
code: m.code,
|
||||||
price: m.price || 0,
|
price: m.price || 0,
|
||||||
packageName: m.packageName || '',
|
packageName: m.packageName || '',
|
||||||
|
packageId: m.packageId || null,
|
||||||
packagePrice: m.packagePrice || null,
|
packagePrice: m.packagePrice || null,
|
||||||
serviceFee: m.serviceFee || null
|
serviceFee: m.serviceFee || null
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
if (currentActiveCategory.value !== cat.typeId) return;
|
||||||
console.error('加载分类检查方法失败', err);
|
console.error('加载分类检查方法失败', err);
|
||||||
} finally {
|
} finally {
|
||||||
categoryLoadingSet.value.delete(cat.typeId);
|
categoryLoadingSet.value.delete(cat.typeId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Bug #500: 添加防抖逻辑,快速切换时跳过中间状态的动画,避免高度跳变和白屏闪烁
|
// Bug #500修复: 不阻塞 accordion 状态更新,仅防止重复加载同一分类的方法
|
||||||
function handleCollapseChange(activeName) {
|
function handleCollapseChange(activeName) {
|
||||||
if (isAnimating.value) return; // 动画进行中,忽略后续点击
|
// 始终记录当前激活的分类,确保 handleCategoryExpand 能正确忽略过期请求
|
||||||
|
currentActiveCategory.value = activeName || null;
|
||||||
isAnimating.value = true;
|
|
||||||
setTimeout(() => { isAnimating.value = false; }, 300); // 与 CSS 过渡时长一致
|
|
||||||
|
|
||||||
if (activeName) {
|
if (activeName) {
|
||||||
const cat = filteredCategoryList.value.find(c => c.typeId == activeName);
|
// Bug #428修复: 直接从 categoryList(原始响应式数组)查找分类,
|
||||||
|
// 确保后续 handleCategoryExpand 对 cat.methods 的赋值能正确触发 Vue 响应式更新
|
||||||
|
const cat = categoryList.value.find(c => c.typeId == activeName);
|
||||||
if (cat && (!cat.methods || cat.methods.length === 0)) {
|
if (cat && (!cat.methods || cat.methods.length === 0)) {
|
||||||
handleCategoryExpand(cat); // 异步加载,不 await
|
handleCategoryExpand(cat); // 异步加载,不 await
|
||||||
}
|
}
|
||||||
@@ -970,12 +1136,20 @@ function handleRowClick(row) {
|
|||||||
selectedItems.value = [];
|
selectedItems.value = [];
|
||||||
activeDetailTab.value = 'applyForm';
|
activeDetailTab.value = 'applyForm';
|
||||||
request({ url: `/exam/apply/${row.applyNo}`, method: 'get' }).then(async res => {
|
request({ url: `/exam/apply/${row.applyNo}`, method: 'get' }).then(async res => {
|
||||||
const d = res.data || res;
|
const resp = res.data || res;
|
||||||
if (d.data) Object.assign(form, d.data);
|
// Bug #408修复: items 在 AjaxResult 顶层(res.items / resp.items),不在 ExamApply 对象内
|
||||||
if (d.items && Array.isArray(d.items)) {
|
// 防御性提取:优先取顶层 items,兼容嵌套在 resp.data.items 的情况
|
||||||
|
let rawItems = res.items || resp.items;
|
||||||
|
if (!rawItems && resp.data && typeof resp.data === 'object') {
|
||||||
|
rawItems = resp.data.items;
|
||||||
|
}
|
||||||
|
rawItems = rawItems || [];
|
||||||
|
const d = resp.data || resp;
|
||||||
|
if (d) Object.assign(form, d);
|
||||||
|
if (Array.isArray(rawItems) && rawItems.length > 0) {
|
||||||
try {
|
try {
|
||||||
// 为每个项目加载检查方法
|
// 为每个项目加载检查方法
|
||||||
const itemsWithMethods = await Promise.all(d.items.map(async m => {
|
const itemsWithMethods = await Promise.all(rawItems.map(async m => {
|
||||||
const item = {
|
const item = {
|
||||||
id: m.itemCode, name: m.itemName,
|
id: m.itemCode, name: m.itemName,
|
||||||
price: m.itemFee || 0, quantity: 1,
|
price: m.itemFee || 0, quantity: 1,
|
||||||
@@ -1003,12 +1177,18 @@ function handleRowClick(row) {
|
|||||||
code: md.code,
|
code: md.code,
|
||||||
price: m.itemFee || 0, // fallback 到已保存的价格
|
price: m.itemFee || 0, // fallback 到已保存的价格
|
||||||
packageName: md.packageName || '',
|
packageName: md.packageName || '',
|
||||||
|
packageId: md.packageId || null,
|
||||||
packagePrice: md.packagePrice || null, // Bug #384修复: 套餐价格
|
packagePrice: md.packagePrice || null, // Bug #384修复: 套餐价格
|
||||||
serviceFee: md.serviceFee || null
|
serviceFee: md.serviceFee || null
|
||||||
}));
|
}));
|
||||||
// 如果有已保存的检查方法信息,尝试匹配
|
// 如果有已保存的检查方法信息,尝试匹配
|
||||||
if (m.checkMethodId) {
|
if (m.checkMethodId) {
|
||||||
item.selectedMethod = item.methods.find(md => md.id === m.checkMethodId) || null;
|
item.selectedMethod = item.methods.find(md => md.id === m.checkMethodId) || null;
|
||||||
|
// 从已保存的方法中获取套餐信息
|
||||||
|
if (item.selectedMethod?.packageId) {
|
||||||
|
item.isPackage = true;
|
||||||
|
item.packageId = item.selectedMethod.packageId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -1047,6 +1227,93 @@ function handleDelete(row) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bug #428修复: 判断某个检查方法是否已被选中(任意项目关联了该方法)
|
||||||
|
function isMethodSelected(method, cat) {
|
||||||
|
return selectedItems.value.some(item =>
|
||||||
|
item.selectedMethod?.id === method.id && item.checkType === cat.typeName
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bug #428修复: 勾选检查方法
|
||||||
|
async function handleMethodSelect(checked, method, cat) {
|
||||||
|
if (checked) {
|
||||||
|
// 找到该方法所属的第一个检查项目
|
||||||
|
const targetItem = cat.items[0];
|
||||||
|
if (!targetItem) {
|
||||||
|
// 如果分类下没有项目,尝试从其他分类找同名项目或创建
|
||||||
|
console.warn('分类下没有检查项目,无法关联方法');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果该项目已存在,只更新 selectedMethod
|
||||||
|
const existingItem = selectedItems.value.find(s => s.id === targetItem.id);
|
||||||
|
if (existingItem) {
|
||||||
|
existingItem.selectedMethod = method;
|
||||||
|
// 从方法中获取套餐信息
|
||||||
|
if (method.packageId) {
|
||||||
|
existingItem.isPackage = true;
|
||||||
|
existingItem.packageId = method.packageId;
|
||||||
|
// 预加载套餐明细
|
||||||
|
loadPackageDetailsForItem(existingItem);
|
||||||
|
}
|
||||||
|
updateMethodDisplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果该项目不存在,创建一个并关联方法
|
||||||
|
if (selectedItems.value.length > 0) {
|
||||||
|
const currentCategory = selectedItems.value[0].checkType;
|
||||||
|
// Bug #428修复: 使用 cat.typeName 进行比较(与 newItem.checkType 保持一致)
|
||||||
|
const newCategory = cat.typeName || '';
|
||||||
|
if (currentCategory !== newCategory) {
|
||||||
|
ElMessage.warning('一个检查单不能同时选择多个项目类型的检查项目');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const newItem = {
|
||||||
|
id: targetItem.id, name: targetItem.name,
|
||||||
|
price: targetItem.price, quantity: 1,
|
||||||
|
serviceFee: targetItem.serviceFee || 0,
|
||||||
|
unit: targetItem.unit || '次',
|
||||||
|
applyPart: targetItem.name,
|
||||||
|
checkType: cat.typeName,
|
||||||
|
nationalCode: targetItem.nationalCode || '',
|
||||||
|
checked: true,
|
||||||
|
methods: [method],
|
||||||
|
selectedMethod: method,
|
||||||
|
expanded: false,
|
||||||
|
// 从方法中获取套餐信息(优先级高于项目本身的 packageName)
|
||||||
|
isPackage: !!method.packageId || !!targetItem.packageName,
|
||||||
|
packageId: method.packageId || targetItem.packageId || null
|
||||||
|
};
|
||||||
|
selectedItems.value.push(newItem);
|
||||||
|
|
||||||
|
// 如果是套餐,预加载套餐明细
|
||||||
|
if (newItem.isPackage && newItem.packageId) {
|
||||||
|
loadPackageDetailsForItem(newItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自动回填执行科室
|
||||||
|
if (selectedItems.value.length === 1 && cat?.performDeptName) {
|
||||||
|
form.performDeptCode = cat.performDeptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同时勾选左侧项目的 checkbox
|
||||||
|
targetItem.checked = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 取消选择方法:将 selectedItems 中关联该方法的项的 selectedMethod 清空
|
||||||
|
const itemsWithMethod = selectedItems.value.filter(
|
||||||
|
item => item.selectedMethod?.id === method.id
|
||||||
|
);
|
||||||
|
for (const item of itemsWithMethod) {
|
||||||
|
item.selectedMethod = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateMethodDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
// ====== 勾选逻辑 ======
|
// ====== 勾选逻辑 ======
|
||||||
async function handleItemSelect(checked, item, cat) {
|
async function handleItemSelect(checked, item, cat) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
@@ -1070,6 +1337,7 @@ async function handleItemSelect(checked, item, cat) {
|
|||||||
code: m.code,
|
code: m.code,
|
||||||
price: m.price || item.price, // fallback 到项目价格
|
price: m.price || item.price, // fallback 到项目价格
|
||||||
packageName: m.packageName || '',
|
packageName: m.packageName || '',
|
||||||
|
packageId: m.packageId || null,
|
||||||
packagePrice: m.packagePrice || null, // Bug #384修复: 套餐价格
|
packagePrice: m.packagePrice || null, // Bug #384修复: 套餐价格
|
||||||
serviceFee: m.serviceFee || null // Bug #384修复: 服务费
|
serviceFee: m.serviceFee || null // Bug #384修复: 服务费
|
||||||
}));
|
}));
|
||||||
@@ -1081,7 +1349,8 @@ async function handleItemSelect(checked, item, cat) {
|
|||||||
|
|
||||||
if (selectedItems.value.length > 0) {
|
if (selectedItems.value.length > 0) {
|
||||||
const currentCategory = selectedItems.value[0].checkType;
|
const currentCategory = selectedItems.value[0].checkType;
|
||||||
const newCategory = cat.typeCode || '';
|
// Bug #428修复: 使用 cat.typeName 进行比较(与 effectiveCheckType 保持一致)
|
||||||
|
const newCategory = cat.typeName || '';
|
||||||
if (currentCategory !== newCategory) {
|
if (currentCategory !== newCategory) {
|
||||||
ElMessage.warning('一个检查单不能同时选择多个项目类型的检查项目');
|
ElMessage.warning('一个检查单不能同时选择多个项目类型的检查项目');
|
||||||
item.checked = false;
|
item.checked = false;
|
||||||
@@ -1102,6 +1371,7 @@ async function handleItemSelect(checked, item, cat) {
|
|||||||
selectedMethod: null,
|
selectedMethod: null,
|
||||||
expanded: false, // Bug #384修复: 新增展开状态,默认不展开
|
expanded: false, // Bug #384修复: 新增展开状态,默认不展开
|
||||||
isPackage: !!item.packageName, // Bug #428修复: 标记是否为套餐
|
isPackage: !!item.packageName, // Bug #428修复: 标记是否为套餐
|
||||||
|
packageName: item.packageName || null, // Bug #426修复: 套餐名称,用于查找packageId
|
||||||
packageId: item.packageId || null // Bug #428修复: 套餐ID
|
packageId: item.packageId || null // Bug #428修复: 套餐ID
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1134,21 +1404,68 @@ async function toggleItemExpand(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bug #384修复: 勾选框选择检查方法(单选逻辑)
|
// Bug #384修复: 勾选框选择检查方法(单选逻辑)
|
||||||
function selectMethodCheckbox(checked, item, method) {
|
async function selectMethodCheckbox(checked, item, method) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
item.selectedMethod = method;
|
item.selectedMethod = method;
|
||||||
|
// 动态加载该方法对应的套餐明细
|
||||||
|
await loadMethodPackageDetails(item, method);
|
||||||
} else {
|
} else {
|
||||||
item.selectedMethod = null;
|
item.selectedMethod = null;
|
||||||
|
item.methodPackageDetails = [];
|
||||||
}
|
}
|
||||||
// 联动更新表单检查方法显示字段
|
// 联动更新表单检查方法显示字段
|
||||||
updateMethodDisplay();
|
updateMethodDisplay();
|
||||||
|
|
||||||
// #430: 套餐金额实时同步到申请单
|
// #430: 套餐金额实时同步到申请单
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
form.totalAmount = totalAmountCalc.value;
|
form.totalAmount = totalAmountCalc.value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据检查方法的packageName加载对应的套餐明细
|
||||||
|
async function loadMethodPackageDetails(item, method) {
|
||||||
|
item.methodPackageLoading = true;
|
||||||
|
item.methodPackageDetails = [];
|
||||||
|
try {
|
||||||
|
if (!method.packageName) {
|
||||||
|
item.methodPackageLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 通过packageName查询套餐获取packageId
|
||||||
|
const pkgRes = await listCheckPackage({ packageName: method.packageName });
|
||||||
|
let packages = pkgRes?.data || [];
|
||||||
|
if (!Array.isArray(packages)) {
|
||||||
|
packages = packages.records || packages.data || [];
|
||||||
|
}
|
||||||
|
if (packages.length === 0) {
|
||||||
|
item.methodPackageLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const packageId = packages[0].id;
|
||||||
|
// 查询套餐明细
|
||||||
|
const detailRes = await request({
|
||||||
|
url: `/system/package/${packageId}/details`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
if (detailRes.code === 200 && detailRes.data) {
|
||||||
|
item.methodPackageDetails = detailRes.data.map(d => ({
|
||||||
|
id: d.id,
|
||||||
|
name: d.itemName || d.name,
|
||||||
|
quantity: d.quantity || 1,
|
||||||
|
unit: d.unit || '次',
|
||||||
|
price: d.unitPrice || d.price || 0,
|
||||||
|
amount: d.amount || d.total || 0,
|
||||||
|
checked: true // 默认勾选
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('加载方法套餐明细失败:', err);
|
||||||
|
item.methodPackageDetails = [];
|
||||||
|
} finally {
|
||||||
|
item.methodPackageLoading = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Bug #384修复: 更新检查方法显示字段(联动)
|
// Bug #384修复: 更新检查方法显示字段(联动)
|
||||||
function updateMethodDisplay() {
|
function updateMethodDisplay() {
|
||||||
// 找到第一个有选中检查方法的项目
|
// 找到第一个有选中检查方法的项目
|
||||||
@@ -1238,6 +1555,19 @@ defineExpose({ getList });
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Bug #499: 查询过滤工具栏 */
|
||||||
|
.search-toolbar {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 8px 0;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
.search-toolbar :deep(.el-form-item) {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.search-toolbar :deep(.el-form-item__label) {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 底部区域:左表单 + 右分类 */
|
/* 底部区域:左表单 + 右分类 */
|
||||||
.bottom-section {
|
.bottom-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1315,6 +1645,7 @@ defineExpose({ getList });
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden; /* Bug #500: 防止切换时水平方向溢出导致抖动 */
|
overflow-x: hidden; /* Bug #500: 防止切换时水平方向溢出导致抖动 */
|
||||||
|
min-height: 120px; /* Bug #500: 固定最小高度,避免分类切换时 flex 容器高度突变 */
|
||||||
}
|
}
|
||||||
.empty-hint {
|
.empty-hint {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
@@ -1367,6 +1698,53 @@ defineExpose({ getList });
|
|||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Bug #428修复: 分类下检查方法区域样式 */
|
||||||
|
.method-section {
|
||||||
|
padding: 6px 8px;
|
||||||
|
background: #f0f7ff;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-section-title {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #409eff;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
border-bottom: 1px dashed #d9ecff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 3px 4px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-row:hover {
|
||||||
|
background: #e8f4ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-checkbox {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-checkbox :deep(.el-checkbox__label) {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-price-tag {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #e6a23c;
|
||||||
|
font-weight: 500;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 已选择 tags */
|
/* 已选择 tags */
|
||||||
.selected-panel {
|
.selected-panel {
|
||||||
width: 140px; /* Bug #384修复: 加宽以适应展开内容 */
|
width: 140px; /* Bug #384修复: 加宽以适应展开内容 */
|
||||||
@@ -1438,6 +1816,41 @@ defineExpose({ getList });
|
|||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Bug #428修复: 套餐明细列表样式 */
|
||||||
|
.package-details-list {
|
||||||
|
padding: 6px 10px;
|
||||||
|
background: #fffbe6;
|
||||||
|
border-top: 1px solid #ffe58f;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 11px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-row:hover {
|
||||||
|
background: #fff9e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-name {
|
||||||
|
color: #303133;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-info {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
/* Bug #384修复: 检查方法勾选框列表 */
|
/* Bug #384修复: 检查方法勾选框列表 */
|
||||||
.method-list {
|
.method-list {
|
||||||
padding: 6px 10px;
|
padding: 6px 10px;
|
||||||
@@ -1472,6 +1885,29 @@ defineExpose({ getList });
|
|||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 选中方法后显示的套餐明细 */
|
||||||
|
.method-package-details {
|
||||||
|
margin-top: 4px;
|
||||||
|
padding: 4px 0;
|
||||||
|
border-top: 1px dashed #dcdfe6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-package-header {
|
||||||
|
padding: 2px 0 4px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-package-title {
|
||||||
|
font-size: 10px;
|
||||||
|
color: #909399;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method-package-loading {
|
||||||
|
padding: 4px 0 4px 24px;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #c0c4cc;
|
||||||
|
}
|
||||||
|
|
||||||
/* 折叠组件细节 */
|
/* 折叠组件细节 */
|
||||||
:deep(.el-collapse) {
|
:deep(.el-collapse) {
|
||||||
border: none;
|
border: none;
|
||||||
@@ -1482,10 +1918,10 @@ defineExpose({ getList });
|
|||||||
height: auto;
|
height: auto;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
/* Bug #500: 折叠内容添加平滑过渡动画,避免切换时高度跳变 */
|
/* Bug #500修复: 折叠内容使用明确属性过渡,避免 transition: all 导致子元素意外动画 */
|
||||||
:deep(.el-collapse-item__content) {
|
:deep(.el-collapse-item__content) {
|
||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
transition: all 0.3s ease;
|
transition: height 0.3s ease, max-height 0.3s ease;
|
||||||
}
|
}
|
||||||
/* Bug #500: 折叠面板动画容器,添加 overflow:hidden 防止展开时内容溢出导致闪烁 */
|
/* Bug #500: 折叠面板动画容器,添加 overflow:hidden 防止展开时内容溢出导致闪烁 */
|
||||||
:deep(.el-collapse-item__wrap) {
|
:deep(.el-collapse-item__wrap) {
|
||||||
|
|||||||
@@ -589,36 +589,46 @@ function handleUseOrderGroup(row) {
|
|||||||
minUnitPrice: orderDetail.minUnitPrice,
|
minUnitPrice: orderDetail.minUnitPrice,
|
||||||
inventoryList: orderDetail.inventoryList || [],
|
inventoryList: orderDetail.inventoryList || [],
|
||||||
priceList: orderDetail.priceList || [],
|
priceList: orderDetail.priceList || [],
|
||||||
partPercent: orderDetail.partPercent || 1,
|
partPercent: orderDetail.partPercent ?? 1,
|
||||||
|
partAttributeEnum: orderDetail.partAttributeEnum,
|
||||||
|
unitConversionRatio: orderDetail.unitConversionRatio,
|
||||||
// 🔧 Bug #218 修复:positionId 可能存储在 item 本身,优先使用 item.positionId
|
// 🔧 Bug #218 修复:positionId 可能存储在 item 本身,优先使用 item.positionId
|
||||||
positionId: item.positionId || orderDetail.positionId,
|
positionId: item.positionId ?? orderDetail.positionId,
|
||||||
defaultLotNumber: orderDetail.defaultLotNumber,
|
defaultLotNumber: orderDetail.defaultLotNumber,
|
||||||
|
|
||||||
// 单位信息
|
// 单位信息
|
||||||
unitCode: item.unitCode || orderDetail.unitCode,
|
unitCode: item.unitCode ?? orderDetail.unitCode,
|
||||||
|
categoryCode: item.categoryCode ?? orderDetail.categoryCode,
|
||||||
unitCodeName: item.unitCodeName || orderDetail.unitCode_dictText,
|
unitCodeName: item.unitCodeName || orderDetail.unitCode_dictText,
|
||||||
minUnitCode: orderDetail.minUnitCode,
|
minUnitCode: orderDetail.minUnitCode,
|
||||||
doseUnitCode: orderDetail.doseUnitCode,
|
doseUnitCode: orderDetail.doseUnitCode,
|
||||||
|
|
||||||
// 合并后的完整对象(用于 setValue)
|
// 合并后的完整对象(用于 setValue)
|
||||||
|
// 先展开 orderDetail 获取所有药品基础字段(categoryCode、minUnitCode、doseUnitCode、
|
||||||
|
// partPercent、partAttributeEnum、unitConversionRatio、defaultLotNumber 等),
|
||||||
|
// 再用组套用户覆盖值覆盖,确保单次剂量/频次/用法/用药天数/总量等不被丢失
|
||||||
mergedDetail: {
|
mergedDetail: {
|
||||||
...orderDetail,
|
...orderDetail,
|
||||||
adviceName: orderDetail.adviceName || item.orderDefinitionName || '未知项目',
|
adviceName: orderDetail.adviceName || item.orderDefinitionName || '未知项目',
|
||||||
adviceType: orderDetail.adviceType,
|
adviceType: orderDetail.adviceType,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
unitCode: item.unitCode || orderDetail.unitCode,
|
unitCode: item.unitCode ?? orderDetail.unitCode,
|
||||||
|
categoryCode: item.categoryCode ?? orderDetail.categoryCode,
|
||||||
unitCodeName: item.unitCodeName,
|
unitCodeName: item.unitCodeName,
|
||||||
dose: item.dose || orderDetail.dose,
|
dose: item.dose ?? orderDetail.dose,
|
||||||
rateCode: item.rateCode || orderDetail.rateCode,
|
rateCode: item.rateCode ?? orderDetail.rateCode,
|
||||||
methodCode: item.methodCode || orderDetail.methodCode,
|
methodCode: item.methodCode ?? orderDetail.methodCode,
|
||||||
dispensePerDuration: item.dispensePerDuration || orderDetail.dispensePerDuration,
|
dispensePerDuration: item.dispensePerDuration ?? orderDetail.dispensePerDuration,
|
||||||
doseQuantity: item.doseQuantity,
|
doseQuantity: item.doseQuantity ?? orderDetail.doseQuantity,
|
||||||
inventoryList: orderDetail.inventoryList || [],
|
// 🔧 Bug #218 / #403 修复:positionId 可能存储在 item 本身,优先使用 item.positionId
|
||||||
priceList: orderDetail.priceList || [],
|
positionId: item.positionId ?? orderDetail.positionId,
|
||||||
partPercent: orderDetail.partPercent || 1,
|
// 执行科室:优先使用组套明细中保存的 orgId
|
||||||
// 🔧 Bug #218 修复:positionId 可能存储在 item 本身,优先使用 item.positionId
|
orgId: item.orgId ?? orderDetail.orgId,
|
||||||
positionId: item.positionId || orderDetail.positionId,
|
orgName: item.orgName ?? orderDetail.orgName,
|
||||||
defaultLotNumber: orderDetail.defaultLotNumber,
|
// 组号(保留组套中的分组信息)
|
||||||
|
groupId: item.groupId,
|
||||||
|
groupOrder: item.groupOrder,
|
||||||
|
therapyEnum: item.therapyEnum ?? orderDetail.therapyEnum ?? '1',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1013,15 +1013,29 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
|||||||
if (type === 2 && adviceTableName === 'adm_device_definition') {
|
if (type === 2 && adviceTableName === 'adm_device_definition') {
|
||||||
return '耗材';
|
return '耗材';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug Fix: 处理检查类型(adviceType=23)
|
// 🔧 Bug Fix: 处理检查类型(adviceType=23)
|
||||||
// 检查类型属于诊疗类,应该显示为"检查"
|
// 检查类型属于诊疗类,应该显示为"检查"
|
||||||
if (type === 23) {
|
if (type === 23) {
|
||||||
return '检查';
|
return '检查';
|
||||||
}
|
}
|
||||||
|
|
||||||
const found = adviceTypeList.value.find((item) => item.value === type);
|
const found = adviceTypeList.value.find((item) => item.value === type);
|
||||||
return found ? found.label : '';
|
if (found) {
|
||||||
|
return found.label;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失时的兜底,避免保存后"医嘱类型"列显示为空
|
||||||
|
if (adviceTableName === 'wor_activity_definition' || adviceTableName === 'wor_service_request') {
|
||||||
|
if (type === 6) return '手术';
|
||||||
|
if (type === 4) return '手术';
|
||||||
|
if (type === 1) return '检验';
|
||||||
|
if (type === 2) return '检查';
|
||||||
|
if (type === 5) return '其他';
|
||||||
|
return '诊疗';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 西药处方管理相关变量
|
// 西药处方管理相关变量
|
||||||
@@ -3312,9 +3326,13 @@ function syncGroupFields(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 同步执行科室
|
// 同步执行科室
|
||||||
|
// 🔧 Bug #455: 诊疗类医嘱(adviceType=3)不使用项目配置的执行科室,
|
||||||
|
// 避免配置ID不在机构树中导致显示原始ID,保持患者就诊科室即可
|
||||||
if (row.orgId || row.positionId) {
|
if (row.orgId || row.positionId) {
|
||||||
// 🔧 修复:优先使用项目所属科室(orgId),其次positionId
|
if (Number(row.adviceType) != 3) {
|
||||||
prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId;
|
// 🔧 修复:优先使用项目所属科室(orgId),其次positionId
|
||||||
|
prescriptionList.value[rowIndex.value].orgId = row.orgId || row.positionId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 同步皮试标记
|
// 同步皮试标记
|
||||||
@@ -3398,8 +3416,11 @@ async function setValue(row) {
|
|||||||
showPopover: false, // 确保查询框关闭
|
showPopover: false, // 确保查询框关闭
|
||||||
};
|
};
|
||||||
console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
|
console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
|
||||||
// 🔧 Bug #455: 执行科室默认逻辑:使用positionId(诊疗执行科室配置) → 患者就诊科室,不再使用row.orgId(项目所属科室)
|
// 🔧 Bug #455: 诊疗医嘱(adviceType=3)的执行科室默认使用患者就诊科室,
|
||||||
prescriptionList.value[rowIndex.value].orgId = row.positionId || props.patientInfo?.orgId;
|
// 不使用positionId(诊疗目录配置的执行科室),避免配置ID不在机构树中导致显示原始ID
|
||||||
|
if (Number(row.adviceType) != 3) {
|
||||||
|
prescriptionList.value[rowIndex.value].orgId = row.positionId || props.patientInfo?.orgId;
|
||||||
|
}
|
||||||
prescriptionList.value[rowIndex.value].dose = row.dose || row.doseQuantity;
|
prescriptionList.value[rowIndex.value].dose = row.dose || row.doseQuantity;
|
||||||
prescriptionList.value[rowIndex.value].quantity = row.quantity || 1;
|
prescriptionList.value[rowIndex.value].quantity = row.quantity || 1;
|
||||||
prescriptionList.value[rowIndex.value].unitCodeList = unitCodeList.value;
|
prescriptionList.value[rowIndex.value].unitCodeList = unitCodeList.value;
|
||||||
|
|||||||
@@ -626,14 +626,19 @@ function getList() {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getSurgeryPage({
|
getSurgeryPage({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
encounterId: props.patientInfo.encounterId
|
encounterId: props.patientInfo.encounterId
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
surgeryList.value = res.data.records || []
|
if (res.code === 200) {
|
||||||
|
surgeryList.value = res.data?.records || []
|
||||||
|
} else {
|
||||||
|
proxy.$modal.msgError(res.msg || '数据加载失败,请稍后重试')
|
||||||
|
surgeryList.value = []
|
||||||
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error('获取手术列表失败:', error)
|
console.error('获取手术列表失败:', error)
|
||||||
proxy.$modal.msgError('数据加载失败,请稍后重试')
|
proxy.$modal.msgError('数据加载失败,请稍后重试')
|
||||||
@@ -1133,13 +1138,17 @@ function submitForm() {
|
|||||||
// 新增手术
|
// 新增手术
|
||||||
addSurgery(form.value).then((res) => {
|
addSurgery(form.value).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$modal.msgSuccess(res.msg || '手术申请提交成功!')
|
proxy.$modal.msgSuccess('手术申请提交成功!')
|
||||||
// 保存麻醉方式
|
// 保存麻醉方式
|
||||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||||
open.value = false
|
open.value = false
|
||||||
emit('saved') // 通知父组件刷新医嘱列表
|
emit('saved') // 通知父组件刷新医嘱列表
|
||||||
// 刷新手术申请列表
|
// 刷新手术申请列表,使用 nextTick 确保数据一致性
|
||||||
getList()
|
proxy.$nextTick(() => {
|
||||||
|
if (props.patientInfo?.encounterId) {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
||||||
}
|
}
|
||||||
@@ -1151,13 +1160,17 @@ function submitForm() {
|
|||||||
// 修改手术
|
// 修改手术
|
||||||
updateSurgery(form.value).then((res) => {
|
updateSurgery(form.value).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$modal.msgSuccess(res.msg || '手术申请修改成功!')
|
proxy.$modal.msgSuccess('手术申请修改成功!')
|
||||||
// 保存麻醉方式
|
// 保存麻醉方式
|
||||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||||
open.value = false
|
open.value = false
|
||||||
emit('saved') // 通知父组件刷新医嘱列表
|
emit('saved') // 通知父组件刷新医嘱列表
|
||||||
// 刷新手术申请列表
|
// 刷新手术申请列表,使用 nextTick 确保数据一致性
|
||||||
getList()
|
proxy.$nextTick(() => {
|
||||||
|
if (props.patientInfo?.encounterId) {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
|
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,8 @@
|
|||||||
@saved="() => prescriptionRef?.getListInfo()" />
|
@saved="() => prescriptionRef?.getListInfo()" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="手术申请" name="surgery">
|
<el-tab-pane label="手术申请" name="surgery">
|
||||||
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
|
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
|
||||||
@saved="() => prescriptionRef?.getListInfo()" />
|
@saved="() => { prescriptionRef?.getListInfo(); surgeryRef?.getList() }" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="电子处方" name="eprescription">
|
<el-tab-pane label="电子处方" name="eprescription">
|
||||||
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const currentSelectRow = ref<any>({});
|
|||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
adviceTypes: '1,2,3,6',
|
adviceTypes: [1, 2, 3, 6],
|
||||||
searchKey: '',
|
searchKey: '',
|
||||||
organizationId: '',
|
organizationId: '',
|
||||||
categoryCode: '',
|
categoryCode: '',
|
||||||
@@ -88,10 +88,10 @@ const tableColumns = computed<TableColumn[]>(() => [
|
|||||||
function refresh(adviceType: any, categoryCode: string, searchKey: string) {
|
function refresh(adviceType: any, categoryCode: string, searchKey: string) {
|
||||||
// 有搜索词时跨类型搜索,避免用户输入"级护理"但因当前adviceType为药品而搜不到诊疗类护理项目
|
// 有搜索词时跨类型搜索,避免用户输入"级护理"但因当前adviceType为药品而搜不到诊疗类护理项目
|
||||||
if (searchKey) {
|
if (searchKey) {
|
||||||
queryParams.value.adviceTypes = '1,2,3,6';
|
queryParams.value.adviceTypes = [1, 2, 3, 6];
|
||||||
} else {
|
} else {
|
||||||
queryParams.value.adviceTypes =
|
queryParams.value.adviceTypes =
|
||||||
adviceType !== undefined && adviceType !== '' ? String(adviceType) : '1,2,3,6';
|
adviceType !== undefined && adviceType !== '' ? [parseInt(adviceType)] : [1, 2, 3, 6];
|
||||||
}
|
}
|
||||||
queryParams.value.categoryCode = categoryCode || '';
|
queryParams.value.categoryCode = categoryCode || '';
|
||||||
queryParams.value.searchKey = searchKey || '';
|
queryParams.value.searchKey = searchKey || '';
|
||||||
|
|||||||
@@ -44,6 +44,17 @@ export function getSurgery(queryParams) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询手术申请单(全局,不需要encounterId,用于门诊手术安排查找弹窗)
|
||||||
|
*/
|
||||||
|
export function getSurgeryPage(queryParams) {
|
||||||
|
return request({
|
||||||
|
url: '/reg-doctorstation/request-form/get-surgery-page',
|
||||||
|
method: 'get',
|
||||||
|
params: queryParams,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询护理医嘱信息
|
* 查询护理医嘱信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -49,6 +49,15 @@
|
|||||||
<el-option label="已作废" value="7" />
|
<el-option label="已作废" value="7" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="关键字">
|
||||||
|
<el-input
|
||||||
|
v-model="filterForm.keyword"
|
||||||
|
placeholder="申请单号 / 检查项目名称"
|
||||||
|
clearable
|
||||||
|
style="width: 220px"
|
||||||
|
@keyup.enter="handleSearch"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleSearch" :loading="loading">
|
<el-button type="primary" @click="handleSearch" :loading="loading">
|
||||||
<el-icon><Search /></el-icon>
|
<el-icon><Search /></el-icon>
|
||||||
@@ -79,16 +88,50 @@
|
|||||||
<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 prop="name" label="申请单名称" width="140" />
|
||||||
<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">
|
||||||
<span>{{ parseStatus(scope.row.status) }}</span>
|
<span>{{ parseStatus(scope.row.status) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" fixed="right">
|
<el-table-column label="操作" width="280" align="center" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
<!-- 待签发:详情、修改、删除 -->
|
||||||
|
<template v-if="scope.row.status === '0' || scope.row.status === 0">
|
||||||
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button link type="primary" @click="handleModify(scope.row)">修改</el-button>
|
||||||
|
<el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
<!-- 已签发:详情、撤回 -->
|
||||||
|
<template v-else-if="scope.row.status === '1' || scope.row.status === 1">
|
||||||
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button link type="warning" @click="handleWithdraw(scope.row)">撤回</el-button>
|
||||||
|
</template>
|
||||||
|
<!-- 已校对/待接收:详情、打印 -->
|
||||||
|
<template v-else-if="scope.row.status === '2' || scope.row.status === 2 || scope.row.status === '3' || scope.row.status === 3">
|
||||||
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
||||||
|
</template>
|
||||||
|
<!-- 已接收/已检查:详情、看报告 -->
|
||||||
|
<template v-else-if="scope.row.status === '4' || scope.row.status === 4 || scope.row.status === '5' || scope.row.status === 5">
|
||||||
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button link type="success" @click="handleViewReport(scope.row)">看报告</el-button>
|
||||||
|
</template>
|
||||||
|
<!-- 已出报告:详情、打印、看报告 -->
|
||||||
|
<template v-else-if="scope.row.status === '6' || scope.row.status === 6">
|
||||||
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button link type="primary" @click="handlePrint(scope.row)">打印</el-button>
|
||||||
|
<el-button link type="success" @click="handleViewReport(scope.row)">看报告</el-button>
|
||||||
|
</template>
|
||||||
|
<!-- 已作废:详情 -->
|
||||||
|
<template v-else-if="scope.row.status === '7' || scope.row.status === 7">
|
||||||
|
<el-button link type="info" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
</template>
|
||||||
|
<!-- 其他/未知状态:仅详情 -->
|
||||||
|
<template v-else>
|
||||||
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -118,7 +161,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="申请者">{{
|
||||||
@@ -137,7 +180,7 @@
|
|||||||
<el-descriptions title="申请单描述" :column="2">
|
<el-descriptions title="申请单描述" :column="2">
|
||||||
<template v-for="(value, key) in descJsonData" :key="key">
|
<template v-for="(value, key) in descJsonData" :key="key">
|
||||||
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
<el-descriptions-item v-if="isFieldMatched(key)" :label="getFieldLabel(key)">
|
||||||
{{ value || '-' }}
|
{{ transformField(key, value) || '-' }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</template>
|
</template>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
@@ -167,8 +210,8 @@
|
|||||||
import {computed, getCurrentInstance, ref, watch} from 'vue';
|
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 {getCheck} from './api';
|
import {getCheck, deleteRequestForm, withdrawRequestForm, getTestResult} from './api';
|
||||||
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
import {getDepartmentList} from '@/api/public.js';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
@@ -179,10 +222,19 @@ const currentDetail = ref(null);
|
|||||||
const descJsonData = ref(null);
|
const descJsonData = ref(null);
|
||||||
const orgOptions = ref([]);
|
const orgOptions = ref([]);
|
||||||
|
|
||||||
|
// 获取近7天的日期范围作为默认值
|
||||||
|
const getDefaultDateRange = () => {
|
||||||
|
const now = new Date();
|
||||||
|
const endDate = now.toISOString().split('T')[0];
|
||||||
|
const startDate = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0];
|
||||||
|
return [startDate, endDate];
|
||||||
|
};
|
||||||
|
|
||||||
// 筛选表单数据
|
// 筛选表单数据
|
||||||
const filterForm = ref({
|
const filterForm = ref({
|
||||||
dateRange: [], // [startDate, endDate]
|
dateRange: getDefaultDateRange(), // 默认近一周
|
||||||
status: '', // 申请单状态
|
status: '', // 申请单状态
|
||||||
|
keyword: '', // 关键字搜索
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
@@ -207,6 +259,11 @@ const fetchData = async () => {
|
|||||||
params.status = filterForm.value.status;
|
params.status = filterForm.value.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加关键字搜索
|
||||||
|
if (filterForm.value.keyword && filterForm.value.keyword.trim()) {
|
||||||
|
params.keyword = filterForm.value.keyword.trim();
|
||||||
|
}
|
||||||
|
|
||||||
const res = await getCheck(params);
|
const res = await getCheck(params);
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
const raw = res.data?.records || res.data;
|
const raw = res.data?.records || res.data;
|
||||||
@@ -243,8 +300,9 @@ const handleSearch = async () => {
|
|||||||
* 重置按钮处理
|
* 重置按钮处理
|
||||||
*/
|
*/
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
filterForm.value.dateRange = [];
|
filterForm.value.dateRange = getDefaultDateRange();
|
||||||
filterForm.value.status = '';
|
filterForm.value.status = '';
|
||||||
|
filterForm.value.keyword = '';
|
||||||
fetchData();
|
fetchData();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -270,6 +328,12 @@ const parseStatus = (status) => {
|
|||||||
const labelMap = {
|
const labelMap = {
|
||||||
categoryType: '项目类别',
|
categoryType: '项目类别',
|
||||||
targetDepartment: '发往科室',
|
targetDepartment: '发往科室',
|
||||||
|
urgencyLevel: '紧急程度',
|
||||||
|
allergyHistory: '过敏史',
|
||||||
|
examinationPurpose: '检查目的',
|
||||||
|
expectedExaminationTime: '期望检查时间',
|
||||||
|
medicalHistorySummary: '病史摘要',
|
||||||
|
allergyConfirmed: '过敏确认',
|
||||||
symptom: '症状',
|
symptom: '症状',
|
||||||
sign: '体征',
|
sign: '体征',
|
||||||
clinicalDiagnosis: '临床诊断',
|
clinicalDiagnosis: '临床诊断',
|
||||||
@@ -278,6 +342,17 @@ const labelMap = {
|
|||||||
attention: '注意事项',
|
attention: '注意事项',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Fields that need value transformation before display
|
||||||
|
const transformField = (key, value) => {
|
||||||
|
if (key === 'urgencyLevel') {
|
||||||
|
return value === 'emergency' ? '急诊' : '普通';
|
||||||
|
}
|
||||||
|
if (key === 'allergyConfirmed') {
|
||||||
|
return value === true || value === 'true' ? '已口头确认' : '未确认';
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
const isFieldMatched = (key) => {
|
const isFieldMatched = (key) => {
|
||||||
return key in labelMap;
|
return key in labelMap;
|
||||||
};
|
};
|
||||||
@@ -292,39 +367,45 @@ const hasMatchedFields = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/** 查询科室 */
|
/** 查询科室 */
|
||||||
const getLocationInfo = () => {
|
const getLocationInfo = async () => {
|
||||||
getOrgList().then((res) => {
|
try {
|
||||||
orgOptions.value = res.data.records;
|
const res = await getDepartmentList();
|
||||||
});
|
orgOptions.value = Array.isArray(res.data) ? res.data : [];
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('科室列表加载失败:', e.message);
|
||||||
|
orgOptions.value = [];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const recursionFun = (targetDepartment) => {
|
// 递归查找树形科室节点
|
||||||
let name = '';
|
const findTreeItem = (list, id) => {
|
||||||
for (let index = 0; index < orgOptions.value.length; index++) {
|
if (!list || list.length === 0) return null;
|
||||||
const obj = orgOptions.value[index];
|
for (const item of list) {
|
||||||
if (obj.id == targetDepartment) {
|
if (item.id == id) return item;
|
||||||
name = obj.name;
|
if (item.children && item.children.length > 0) {
|
||||||
}
|
const found = findTreeItem(item.children, id);
|
||||||
const subObjArray = obj['children'];
|
if (found) return found;
|
||||||
for (let index = 0; index < subObjArray.length; index++) {
|
|
||||||
const item = subObjArray[index];
|
|
||||||
if (item.id == targetDepartment) {
|
|
||||||
name = item.name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return name;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
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;
|
currentDetail.value = row;
|
||||||
// 解析 descJson
|
// 解析 descJson
|
||||||
if (row.descJson) {
|
if (row.descJson) {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(row.descJson);
|
const obj = JSON.parse(row.descJson);
|
||||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
// 将发往科室 ID 转换为名称
|
||||||
|
if (obj.targetDepartment) {
|
||||||
|
const deptItem = findTreeItem(orgOptions.value, obj.targetDepartment);
|
||||||
|
obj.targetDepartment = deptItem ? deptItem.name : obj.targetDepartment;
|
||||||
|
}
|
||||||
descJsonData.value = obj;
|
descJsonData.value = obj;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('解析 descJson 失败:', e);
|
console.error('解析 descJson 失败:', e);
|
||||||
@@ -336,6 +417,91 @@ const handleViewDetail = (row) => {
|
|||||||
detailDialogVisible.value = true;
|
detailDialogVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改申请单(仅待签发状态)
|
||||||
|
*/
|
||||||
|
const handleModify = (row) => {
|
||||||
|
proxy.$modal?.msgWarning?.('修改功能需后端支持,请联系管理员');
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申请单(仅待签发状态)
|
||||||
|
*/
|
||||||
|
const handleDelete = (row) => {
|
||||||
|
proxy.$confirm?.('确认删除该检查申请单吗?删除后不可恢复。', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}).then(async () => {
|
||||||
|
try {
|
||||||
|
const res = await deleteRequestForm({ requestFormId: row.requestFormId || row.id });
|
||||||
|
if (res?.code === 200) {
|
||||||
|
proxy.$modal?.msgSuccess?.('删除成功');
|
||||||
|
await fetchData();
|
||||||
|
} else {
|
||||||
|
proxy.$modal?.msgError?.(res?.msg || '删除失败');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('删除申请单失败(可能后端未实现):', e.message);
|
||||||
|
proxy.$modal?.msgError?.('删除失败,后端服务可能未支持此功能');
|
||||||
|
}
|
||||||
|
}).catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回申请单(已签发状态撤回至待签发)
|
||||||
|
*/
|
||||||
|
const handleWithdraw = (row) => {
|
||||||
|
proxy.$confirm?.('确认撤回该检查申请单吗?撤回后状态将变为待签发。', '撤回确认', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}).then(async () => {
|
||||||
|
try {
|
||||||
|
const res = await withdrawRequestForm({ requestFormId: row.requestFormId || row.id });
|
||||||
|
if (res?.code === 200) {
|
||||||
|
proxy.$modal?.msgSuccess?.('撤回成功');
|
||||||
|
await fetchData();
|
||||||
|
} else {
|
||||||
|
proxy.$modal?.msgError?.(res?.msg || '撤回失败');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('撤回申请单失败(可能后端未实现):', e.message);
|
||||||
|
proxy.$modal?.msgError?.('撤回失败,后端服务可能未支持此功能');
|
||||||
|
}
|
||||||
|
}).catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印申请单
|
||||||
|
*/
|
||||||
|
const handlePrint = (row) => {
|
||||||
|
// 使用浏览器原生打印功能
|
||||||
|
window.print();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看检查报告
|
||||||
|
*/
|
||||||
|
const handleViewReport = async (row) => {
|
||||||
|
try {
|
||||||
|
const res = await getTestResult({ encounterId: row.encounterId || patientInfo.value?.encounterId });
|
||||||
|
if (res?.code === 200 && res.data) {
|
||||||
|
const reportUrl = Array.isArray(res.data) ? res.data[0]?.reportUrl : res.data?.reportUrl;
|
||||||
|
if (reportUrl) {
|
||||||
|
window.open(reportUrl, '_blank');
|
||||||
|
} else {
|
||||||
|
proxy.$modal?.msgWarning?.('暂无检查报告');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
proxy.$modal?.msgWarning?.('暂无检查报告');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('查看检查报告失败:', e.message);
|
||||||
|
proxy.$modal?.msgError?.('获取检查报告失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => patientInfo.value?.encounterId,
|
() => patientInfo.value?.encounterId,
|
||||||
(val) => {
|
(val) => {
|
||||||
@@ -344,8 +510,9 @@ watch(
|
|||||||
getLocationInfo();
|
getLocationInfo();
|
||||||
} else {
|
} else {
|
||||||
tableData.value = [];
|
tableData.value = [];
|
||||||
filterForm.value.dateRange = [];
|
filterForm.value.dateRange = getDefaultDateRange();
|
||||||
filterForm.value.status = '';
|
filterForm.value.status = '';
|
||||||
|
filterForm.value.keyword = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
|||||||
@@ -41,8 +41,6 @@
|
|||||||
<el-option label="全部" value="" />
|
<el-option label="全部" value="" />
|
||||||
<el-option label="待签发" value="0" />
|
<el-option label="待签发" value="0" />
|
||||||
<el-option label="已签发" value="1" />
|
<el-option label="已签发" value="1" />
|
||||||
<el-option label="已采集" value="2" />
|
|
||||||
<el-option label="已收样" value="3" />
|
|
||||||
<el-option label="报告已出" value="4" />
|
<el-option label="报告已出" value="4" />
|
||||||
<el-option label="已作废" value="5" />
|
<el-option label="已作废" value="5" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -84,7 +82,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
<el-table-column prop="patientName" label="患者姓名" width="120" />
|
||||||
<el-table-column prop="name" label="申请单名称" width="140" />
|
<el-table-column label="申请单名称" width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ buildApplicationName(scope.row) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" label="创建时间" width="160" />
|
<el-table-column prop="createTime" label="创建时间" width="160" />
|
||||||
<el-table-column prop="prescriptionNo" label="申请单号" width="140" />
|
<el-table-column prop="prescriptionNo" label="申请单号" width="140" />
|
||||||
<el-table-column label="单据状态" width="100" align="center">
|
<el-table-column label="单据状态" width="100" align="center">
|
||||||
@@ -105,11 +107,11 @@
|
|||||||
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
<el-table-column prop="requesterId_dictText" label="申请者" width="120" />
|
||||||
<el-table-column label="操作" align="center" fixed="right" width="160">
|
<el-table-column label="操作" align="center" fixed="right" width="160">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="scope.row.billStatus == 0 || scope.row.status == 0">
|
<template v-if="scope.row.status == 0">
|
||||||
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
|
<el-button link type="primary" @click="handleEdit(scope.row)">修改</el-button>
|
||||||
<el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
<el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="scope.row.billStatus == 1 || scope.row.status == 1">
|
<template v-else-if="scope.row.status == 1">
|
||||||
<el-button link type="warning" @click="handleWithdraw(scope.row)">撤回</el-button>
|
<el-button link type="warning" @click="handleWithdraw(scope.row)">撤回</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
<el-button link type="primary" @click="handleViewDetail(scope.row)">详情</el-button>
|
||||||
@@ -139,7 +141,7 @@
|
|||||||
<el-descriptions-item label="创建时间">{{
|
<el-descriptions-item label="创建时间">{{
|
||||||
currentDetail.createTime || '-'
|
currentDetail.createTime || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="处方号">{{
|
<el-descriptions-item label="申请单号">{{
|
||||||
currentDetail.prescriptionNo || '-'
|
currentDetail.prescriptionNo || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="申请者">{{
|
<el-descriptions-item label="申请者">{{
|
||||||
@@ -189,7 +191,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, deleteRequestForm, withdrawRequestForm} from './api';
|
import {getInspection, deleteRequestForm, withdrawRequestForm} from './api';
|
||||||
import {getOrgList} from '@/views/doctorstation/components/api.js';
|
import {getDepartmentList} from '@/api/public.js';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
@@ -287,6 +289,9 @@ const labelMap = {
|
|||||||
otherDiagnosis: '其他诊断',
|
otherDiagnosis: '其他诊断',
|
||||||
relatedResult: '相关结果',
|
relatedResult: '相关结果',
|
||||||
attention: '注意事项',
|
attention: '注意事项',
|
||||||
|
applicationType: '申请类型',
|
||||||
|
specimenName: '标本类型',
|
||||||
|
executeTime: '执行时间',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -298,8 +303,6 @@ const parseBillStatus = (status) => {
|
|||||||
const statusMap = {
|
const statusMap = {
|
||||||
'0': '待签发',
|
'0': '待签发',
|
||||||
'1': '已签发',
|
'1': '已签发',
|
||||||
'2': '已采集',
|
|
||||||
'3': '已收样',
|
|
||||||
'4': '报告已出',
|
'4': '报告已出',
|
||||||
'5': '已作废',
|
'5': '已作废',
|
||||||
};
|
};
|
||||||
@@ -315,8 +318,8 @@ const parsePriorityCode = (descJson) => {
|
|||||||
if (!descJson) return '-';
|
if (!descJson) return '-';
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(descJson);
|
const obj = JSON.parse(descJson);
|
||||||
// priorityCode: 0-普通, 1-急
|
// applicationType: 0-普通, 1-急诊
|
||||||
return obj.priorityCode === 1 ? '急' : '普通';
|
return obj.applicationType === 1 ? '急' : '普通';
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('解析 descJson 失败:', e);
|
console.error('解析 descJson 失败:', e);
|
||||||
return '-';
|
return '-';
|
||||||
@@ -340,6 +343,24 @@ const parseSpecimenType = (descJson) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据申请单详情构建申请单名称
|
||||||
|
* 单一项目:显示项目名称+数量
|
||||||
|
* 多个项目:显示首个项目名称+数量+"等X项"
|
||||||
|
*/
|
||||||
|
const buildApplicationName = (row) => {
|
||||||
|
const details = row.requestFormDetailList;
|
||||||
|
if (!details || details.length === 0) {
|
||||||
|
return row.name || '-';
|
||||||
|
}
|
||||||
|
if (details.length === 1) {
|
||||||
|
const item = details[0];
|
||||||
|
return `${item.adviceName}${item.quantity || ''}`;
|
||||||
|
}
|
||||||
|
const first = details[0];
|
||||||
|
return `${first.adviceName}${first.quantity || ''}等${details.length}项`;
|
||||||
|
};
|
||||||
|
|
||||||
const isFieldMatched = (key) => {
|
const isFieldMatched = (key) => {
|
||||||
return key in labelMap;
|
return key in labelMap;
|
||||||
};
|
};
|
||||||
@@ -395,6 +416,9 @@ const handleViewDetail = async (row) => {
|
|||||||
try {
|
try {
|
||||||
const obj = JSON.parse(row.descJson);
|
const obj = JSON.parse(row.descJson);
|
||||||
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
obj.targetDepartment = recursionFun(obj.targetDepartment);
|
||||||
|
// 转换申请类型编码为可读文本
|
||||||
|
if (obj.applicationType === 0) obj.applicationType = '普通';
|
||||||
|
else if (obj.applicationType === 1) obj.applicationType = '急诊';
|
||||||
descJsonData.value = obj;
|
descJsonData.value = obj;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('解析 descJson 失败:', e);
|
console.error('解析 descJson 失败:', e);
|
||||||
|
|||||||
@@ -72,6 +72,45 @@
|
|||||||
<el-input v-model="form.attention" autocomplete="off" type="textarea" />
|
<el-input v-model="form.attention" autocomplete="off" type="textarea" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- 申请类型 -->
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="申请类型" prop="applicationType" style="width: 100%">
|
||||||
|
<el-radio-group v-model="form.applicationType">
|
||||||
|
<el-radio :value="0">普通</el-radio>
|
||||||
|
<el-radio :value="1">急诊</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- 标本类型 -->
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="标本类型" prop="specimenName" style="width: 100%">
|
||||||
|
<el-select v-model="form.specimenName" placeholder="请选择标本类型" style="width: 100%">
|
||||||
|
<el-option label="血液" value="血液" />
|
||||||
|
<el-option label="尿液" value="尿液" />
|
||||||
|
<el-option label="粪便" value="粪便" />
|
||||||
|
<el-option label="痰液" value="痰液" />
|
||||||
|
<el-option label="咽拭子" value="咽拭子" />
|
||||||
|
<el-option label="脑脊液" value="脑脊液" />
|
||||||
|
<el-option label="胸腹水" value="胸腹水" />
|
||||||
|
<el-option label="关节液" value="关节液" />
|
||||||
|
<el-option label="分泌物" value="分泌物" />
|
||||||
|
<el-option label="其他" value="其他" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- 执行时间 -->
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="执行时间" prop="executeTime" style="width: 100%">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.executeTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择执行时间"
|
||||||
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -105,42 +144,56 @@ const applicationListAll = ref();
|
|||||||
const applicationList = ref();
|
const applicationList = ref();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const orgOptions = ref([]); // 科室选项
|
const orgOptions = ref([]); // 科室选项
|
||||||
const getList = () => {
|
const getList = async () => {
|
||||||
if (!patientInfo.value?.inHospitalOrgId) {
|
if (!patientInfo.value?.inHospitalOrgId) {
|
||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getApplicationList({
|
try {
|
||||||
pageSize: 9999,
|
const allRecords = [];
|
||||||
pageNum: 1,
|
let currentPage = 1;
|
||||||
categoryCode: '22',
|
const pageSize = 500;
|
||||||
organizationId: patientInfo.value.inHospitalOrgId,
|
|
||||||
adviceTypes: [3], //1 药品 2耗材 3诊疗
|
// 分页拉取全部数据(后端单页最多500条)
|
||||||
})
|
while (true) {
|
||||||
.then((res) => {
|
const res = await getApplicationList({
|
||||||
if (res.code === 200) {
|
pageSize,
|
||||||
applicationListAll.value = res.data.records;
|
pageNo: currentPage,
|
||||||
applicationList.value = res.data.records.map((item) => {
|
categoryCode: '22',
|
||||||
const priceInfo = item.priceList?.[0] || {};
|
organizationId: patientInfo.value.inHospitalOrgId,
|
||||||
const price = priceInfo.price != null ? Number(priceInfo.price).toFixed(2) : '0.00';
|
adviceTypes: [3], // 1 药品 2 耗材 3 诊疗
|
||||||
const unit = item.unitCode_dictText || item.unitCode || '';
|
});
|
||||||
return {
|
if (res.code !== 200) {
|
||||||
adviceDefinitionId: item.adviceDefinitionId,
|
|
||||||
orgId: item.orgId,
|
|
||||||
label: item.adviceName + ' (¥' + price + '/' + unit + ')',
|
|
||||||
key: item.adviceDefinitionId,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
console.log('applicationList========>', JSON.stringify(res.data.records));
|
|
||||||
} else {
|
|
||||||
proxy.$message.error(res.message);
|
proxy.$message.error(res.message);
|
||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
})
|
const records = res.data?.records || [];
|
||||||
.finally(() => {
|
allRecords.push(...records);
|
||||||
loading.value = false;
|
// 当前页不足 pageSize 或已无数据,说明已全部拉取
|
||||||
|
if (records.length < pageSize) break;
|
||||||
|
currentPage++;
|
||||||
|
}
|
||||||
|
|
||||||
|
applicationListAll.value = allRecords;
|
||||||
|
applicationList.value = allRecords.map((item) => {
|
||||||
|
const priceInfo = item.priceList?.[0] || {};
|
||||||
|
const price = priceInfo.price != null ? Number(priceInfo.price).toFixed(2) : '0.00';
|
||||||
|
const unit = item.unitCode_dictText || item.unitCode || '';
|
||||||
|
return {
|
||||||
|
adviceDefinitionId: item.adviceDefinitionId,
|
||||||
|
orgId: item.orgId,
|
||||||
|
label: item.adviceName + ' (¥' + price + '/' + unit + ')',
|
||||||
|
key: item.adviceDefinitionId,
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
proxy.$message.error('获取检验项目列表失败');
|
||||||
|
applicationList.value = [];
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const transferValue = ref([]);
|
const transferValue = ref([]);
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
@@ -152,6 +205,9 @@ const form = reactive({
|
|||||||
otherDiagnosis: '', // 其他诊断
|
otherDiagnosis: '', // 其他诊断
|
||||||
relatedResult: '', // 相关结果
|
relatedResult: '', // 相关结果
|
||||||
attention: '', // 注意事项
|
attention: '', // 注意事项
|
||||||
|
applicationType: 0, // 申请类型 0-普通 1-急诊
|
||||||
|
specimenName: '血液', // 标本类型
|
||||||
|
executeTime: null, // 执行时间
|
||||||
primaryDiagnosisList: [], //主诊断目录
|
primaryDiagnosisList: [], //主诊断目录
|
||||||
otherDiagnosisList: [], //其他断目录
|
otherDiagnosisList: [], //其他断目录
|
||||||
});
|
});
|
||||||
@@ -164,7 +220,7 @@ onMounted(() => {
|
|||||||
* type(1:watch监听类型 2:点击保存类型)
|
* type(1:watch监听类型 2:点击保存类型)
|
||||||
* selectProjectIds(选中项目的id数组)
|
* selectProjectIds(选中项目的id数组)
|
||||||
* */
|
* */
|
||||||
const projectWithDepartment = (selectProjectIds) => {
|
const projectWithDepartment = (selectProjectIds, type) => {
|
||||||
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
//1.获取选中的项目 2.判断项目的执行科室是否相同 3.判断执行科室是否配置 4.将项目的执行科室复值到执行科室下拉选位置
|
||||||
let isRelease = true;
|
let isRelease = true;
|
||||||
// 选中项目的数组
|
// 选中项目的数组
|
||||||
@@ -200,12 +256,16 @@ const projectWithDepartment = (selectProjectIds) => {
|
|||||||
if (type === 2 && manualDept) {
|
if (type === 2 && manualDept) {
|
||||||
form.targetDepartment = manualDept;
|
form.targetDepartment = manualDept;
|
||||||
isRelease = true;
|
isRelease = true;
|
||||||
} else {
|
} else if (type === 2 && !manualDept) {
|
||||||
|
// 提交时用户未手动选择科室,才提示错误
|
||||||
isRelease = false;
|
isRelease = false;
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: '未找到项目执行的科室',
|
message: '未找到项目执行的科室',
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// type=1(选择项目变化)时,不弹窗,仅清空科室让用户自行选择
|
||||||
|
isRelease = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (findItem && isRelease) {
|
if (findItem && isRelease) {
|
||||||
|
|||||||
@@ -483,7 +483,10 @@ const submit = () => {
|
|||||||
encounterId: patientInfo.value.encounterId,
|
encounterId: patientInfo.value.encounterId,
|
||||||
organizationId: patientInfo.value.inHospitalOrgId,
|
organizationId: patientInfo.value.inHospitalOrgId,
|
||||||
requestFormId: '',
|
requestFormId: '',
|
||||||
name: '检查申请单',
|
name: transferValue.value.map(id => {
|
||||||
|
const item = applicationListAll.value?.find(i => i.adviceDefinitionId === id);
|
||||||
|
return item?.adviceName || '';
|
||||||
|
}).filter(Boolean).join('、'),
|
||||||
descJson: JSON.stringify(submitForm),
|
descJson: JSON.stringify(submitForm),
|
||||||
categoryEnum: '2',
|
categoryEnum: '2',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@@ -5,16 +5,14 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="surgery-container">
|
<div class="surgery-container">
|
||||||
<div class="transfer-wrapper">
|
<div v-loading="loading" class="transfer-wrapper" style="min-height: 300px;">
|
||||||
<div v-loading="loading" style="min-height: 300px;">
|
<el-transfer
|
||||||
<el-transfer
|
v-model="transferValue"
|
||||||
v-model="transferValue"
|
:data="applicationList"
|
||||||
:data="applicationList"
|
filter-placeholder="项目代码/名称"
|
||||||
filter-placeholder="项目代码/名称"
|
filterable
|
||||||
filterable
|
:titles="['未选择', '已选择']"
|
||||||
:titles="['未选择', '已选择']"
|
/>
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="bloodTransfusion-form">
|
<div class="bloodTransfusion-form">
|
||||||
<el-form :model="form" :rules="rules" ref="formRef" label-width="120px" class="demo-ruleForm">
|
<el-form :model="form" :rules="rules" ref="formRef" label-width="120px" class="demo-ruleForm">
|
||||||
@@ -88,6 +86,9 @@ import {getApplicationList, saveSurgery} from './api';
|
|||||||
import {ElMessage} from 'element-plus';
|
import {ElMessage} from 'element-plus';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
|
// 模块级缓存:避免每次打开弹窗都重新请求手术项目列表
|
||||||
|
let surgeryRecordsCache = null; // 原始 API 记录
|
||||||
|
let surgeryMappedCache = null; // 映射后的 el-transfer 数据
|
||||||
// 递归查找树形科室节点
|
// 递归查找树形科室节点
|
||||||
const findTreeItem = (list, id) => {
|
const findTreeItem = (list, id) => {
|
||||||
if (!list || list.length === 0) return null;
|
if (!list || list.length === 0) return null;
|
||||||
@@ -103,8 +104,8 @@ const findTreeItem = (list, id) => {
|
|||||||
const emits = defineEmits(['submitOk']);
|
const emits = defineEmits(['submitOk']);
|
||||||
const props = defineProps({});
|
const props = defineProps({});
|
||||||
const state = reactive({});
|
const state = reactive({});
|
||||||
const applicationListAll = ref([]);
|
const applicationListAll = ref();
|
||||||
const applicationList = ref([]);
|
const applicationList = ref();
|
||||||
const orgOptions = ref([]); // 科室选项
|
const orgOptions = ref([]); // 科室选项
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
@@ -112,6 +113,12 @@ const getList = () => {
|
|||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 命中缓存时直接使用,避免重复请求导致加载缓慢
|
||||||
|
if (surgeryMappedCache && surgeryMappedCache.length > 0) {
|
||||||
|
applicationList.value = surgeryMappedCache;
|
||||||
|
applicationListAll.value = surgeryRecordsCache;
|
||||||
|
return;
|
||||||
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getApplicationList({
|
getApplicationList({
|
||||||
pageSize: 500,
|
pageSize: 500,
|
||||||
@@ -134,6 +141,9 @@ const getList = () => {
|
|||||||
key: item.adviceDefinitionId,
|
key: item.adviceDefinitionId,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
// 写入模块缓存,后续打开弹窗直接复用
|
||||||
|
surgeryRecordsCache = res.data.records;
|
||||||
|
surgeryMappedCache = applicationList.value;
|
||||||
} else {
|
} else {
|
||||||
console.warn('获取手术项目列表失败:', res.message);
|
console.warn('获取手术项目列表失败:', res.message);
|
||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
|
|||||||
@@ -197,6 +197,7 @@
|
|||||||
style="width: 62%"
|
style="width: 62%"
|
||||||
v-model="scope.row.adviceName"
|
v-model="scope.row.adviceName"
|
||||||
placeholder="请选择项目"
|
placeholder="请选择项目"
|
||||||
|
@input="handleChange"
|
||||||
@click="handleFocus(scope.row, scope.$index)"
|
@click="handleFocus(scope.row, scope.$index)"
|
||||||
@keyup.enter.stop="handleFocus(scope.row, scope.$index)"
|
@keyup.enter.stop="handleFocus(scope.row, scope.$index)"
|
||||||
@keydown="
|
@keydown="
|
||||||
@@ -532,6 +533,7 @@ const statusOption = [
|
|||||||
let loadingInstance = undefined;
|
let loadingInstance = undefined;
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.addEventListener('keydown', escKeyListener);
|
document.addEventListener('keydown', escKeyListener);
|
||||||
|
getList();
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -572,7 +574,6 @@ function handleTotalAmount() {
|
|||||||
}
|
}
|
||||||
}, new Decimal(0));
|
}, new Decimal(0));
|
||||||
}
|
}
|
||||||
getList();
|
|
||||||
function getList() {
|
function getList() {
|
||||||
getDiagnosisDefinitionList(queryParams.value).then((res) => {
|
getDiagnosisDefinitionList(queryParams.value).then((res) => {
|
||||||
// prescriptionList.value = res.data.records;
|
// prescriptionList.value = res.data.records;
|
||||||
@@ -584,6 +585,11 @@ function refresh() {
|
|||||||
}
|
}
|
||||||
// 获取列表信息
|
// 获取列表信息
|
||||||
function getListInfo(addNewRow) {
|
function getListInfo(addNewRow) {
|
||||||
|
// 守护:未选择患者时不发起 API 请求,避免页面加载时循环报错
|
||||||
|
if (!patientInfo.value || !patientInfo.value.encounterId) {
|
||||||
|
console.warn('⚠️ getListInfo 跳过:未选择患者');
|
||||||
|
return;
|
||||||
|
}
|
||||||
loadingInstance = ElLoading.service({ fullscreen: true });
|
loadingInstance = ElLoading.service({ fullscreen: true });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
loadingInstance.close();
|
loadingInstance.close();
|
||||||
@@ -709,9 +715,17 @@ function loadConfiguredCategories() {
|
|||||||
// 数据过滤
|
// 数据过滤
|
||||||
const filterPrescriptionList = computed(() => {
|
const filterPrescriptionList = computed(() => {
|
||||||
const pList = prescriptionList.value.filter((item) => {
|
const pList = prescriptionList.value.filter((item) => {
|
||||||
|
// 修复 Bug #488:orderClassCode 可能是复合值 '1-2',需提取 adviceType 部分进行比较
|
||||||
|
let matchAdviceType = true;
|
||||||
|
if (orderClassCode.value) {
|
||||||
|
const filterAdviceType = String(orderClassCode.value).includes('-')
|
||||||
|
? parseInt(String(orderClassCode.value).split('-')[0])
|
||||||
|
: orderClassCode.value;
|
||||||
|
matchAdviceType = filterAdviceType == item.adviceType;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
(!therapyEnum.value || therapyEnum.value == item.therapyEnum) &&
|
(!therapyEnum.value || therapyEnum.value == item.therapyEnum) &&
|
||||||
(!orderClassCode.value || orderClassCode.value == item.adviceType) &&
|
matchAdviceType &&
|
||||||
(!orderStatus.value || (orderStatus.value == item.statusEnum && item.requestId))
|
(!orderStatus.value || (orderStatus.value == item.statusEnum && item.requestId))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -739,12 +753,28 @@ function getRowDisabled(row) {
|
|||||||
/**
|
/**
|
||||||
* 将行的 adviceType + categoryCode 映射为 el-select 的选中值
|
* 将行的 adviceType + categoryCode 映射为 el-select 的选中值
|
||||||
* 药品子分类使用复合值如 '1-2'(adviceType-categoryCode),诊疗/手术/全部使用原始值
|
* 药品子分类使用复合值如 '1-2'(adviceType-categoryCode),诊疗/手术/全部使用原始值
|
||||||
|
* 修复 Bug #488:当行的 adviceType 在当前配置中找不到匹配选项时,返回最接近的可用值,避免回显为纯数字
|
||||||
*/
|
*/
|
||||||
function getRowSelectValue(row) {
|
function getRowSelectValue(row) {
|
||||||
if (row.adviceType == 1 && row.categoryCode) {
|
if (row.adviceType == 1 && row.categoryCode) {
|
||||||
return '1-' + row.categoryCode;
|
const compositeValue = '1-' + row.categoryCode;
|
||||||
|
// 检查复合值是否在选项列表中
|
||||||
|
if (adviceTypeList.value.some(item => item.value === compositeValue)) {
|
||||||
|
return compositeValue;
|
||||||
|
}
|
||||||
|
// 配置的 categoryCode 已变更,回退到第一个药品选项
|
||||||
|
const firstPharmacy = adviceTypeList.value.find(item => String(item.value).startsWith('1-'));
|
||||||
|
if (firstPharmacy) {
|
||||||
|
return firstPharmacy.value;
|
||||||
|
}
|
||||||
|
return row.adviceType;
|
||||||
}
|
}
|
||||||
return row.adviceType;
|
// 诊疗/手术等非药品类型,检查其值是否在选项列表中
|
||||||
|
if (adviceTypeList.value.some(item => item.value === row.adviceType)) {
|
||||||
|
return row.adviceType;
|
||||||
|
}
|
||||||
|
// 不在选项中的值(如已废弃的 adviceType),返回 undefined 让 el-select 显示为空
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增医嘱
|
// 新增医嘱
|
||||||
@@ -801,8 +831,8 @@ function clickRowDb(row, column, event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row.showPopover = false;
|
row.showPopover = false;
|
||||||
// “待签发(已保存 requestId存在)”不允许再编辑;仅“待保存(无requestId)”允许编辑
|
// 仅”待签发(statusEnum==1)”允许编辑;”已签发(statusEnum==2)”及之后状态不允许编辑
|
||||||
if (row.statusEnum == 1 && !row.requestId) {
|
if (row.statusEnum == 1) {
|
||||||
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
||||||
row.therapyEnum = String(row.therapyEnum ?? '1');
|
row.therapyEnum = String(row.therapyEnum ?? '1');
|
||||||
row.isEdit = true;
|
row.isEdit = true;
|
||||||
@@ -1181,19 +1211,27 @@ function handleSave() {
|
|||||||
});
|
});
|
||||||
// 此处签发处方和单行保存处方传参相同,后台已经将传参存为JSON字符串,此处直接转换为JSON即可
|
// 此处签发处方和单行保存处方传参相同,后台已经将传参存为JSON字符串,此处直接转换为JSON即可
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
let list = saveList.map((item) => {
|
let list = [];
|
||||||
const parsedContent = JSON.parse(item.contentJson);
|
try {
|
||||||
return {
|
list = saveList.map((item) => {
|
||||||
...parsedContent,
|
const parsedContent = item.contentJson ? JSON.parse(item.contentJson) || {} : {};
|
||||||
adviceType: item.adviceType,
|
return {
|
||||||
requestId: item.requestId,
|
...parsedContent,
|
||||||
dbOpType: '1',
|
adviceType: item.adviceType,
|
||||||
groupId: item.groupId,
|
requestId: item.requestId,
|
||||||
uniqueKey: undefined,
|
dbOpType: '1',
|
||||||
// 确保 therapyEnum 被正确传递
|
groupId: item.groupId,
|
||||||
therapyEnum: parsedContent.therapyEnum || item.therapyEnum || '1',
|
uniqueKey: undefined,
|
||||||
};
|
// 确保 therapyEnum 被正确传递
|
||||||
});
|
therapyEnum: parsedContent.therapyEnum || item.therapyEnum || '1',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
loading.value = false;
|
||||||
|
isSaving.value = false;
|
||||||
|
proxy.$modal.msgError('医嘱内容解析失败,请检查待签发医嘱');
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 保存签发按钮
|
// 保存签发按钮
|
||||||
isSaving.value = true;
|
isSaving.value = true;
|
||||||
console.log('签发处方参数:', {
|
console.log('签发处方参数:', {
|
||||||
@@ -1208,9 +1246,16 @@ function handleSave() {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$modal.msgSuccess('签发成功');
|
proxy.$modal.msgSuccess('签发成功');
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
|
// 乐观更新:立即将已签发医嘱的状态设为"已签发",确保列表实时刷新
|
||||||
|
saveList.forEach((item) => {
|
||||||
|
const row = prescriptionList.value.find((r) => r.requestId && r.requestId === item.requestId);
|
||||||
|
if (row) {
|
||||||
|
row.statusEnum = 2;
|
||||||
|
}
|
||||||
|
});
|
||||||
getListInfo(false);
|
getListInfo(false);
|
||||||
bindMethod.value = {};
|
bindMethod.value = {};
|
||||||
nextId.value == 1;
|
nextId.value = 1;
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.message);
|
proxy.$modal.msgError(res.message);
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
@@ -1311,11 +1356,12 @@ function handleCancelEdit(row, index) {
|
|||||||
|
|
||||||
function handleSaveSign(row, index) {
|
function handleSaveSign(row, index) {
|
||||||
if (row.adviceType != 2) {
|
if (row.adviceType != 2) {
|
||||||
|
// 修复 Bug #488:严格校验 itemNo,确保非空且为有效字符串才发起请求
|
||||||
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
let itemNo = row.adviceType == 1 ? row.methodCode : row.adviceDefinitionId;
|
||||||
if (!itemNo) {
|
if (!itemNo || String(itemNo).trim() === '') {
|
||||||
console.warn('绑定设备检查跳过:itemNo为空(adviceType=' + row.adviceType + ', adviceName=' + row.adviceName + ')');
|
console.warn('绑定设备检查跳过:itemNo为空(adviceType=' + row.adviceType + ', adviceName=' + row.adviceName + ')');
|
||||||
} else {
|
} else {
|
||||||
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
getBindDevice({ typeCode: row.adviceType, itemNo: String(itemNo) }).then((res) => {
|
||||||
if (res.data.length == 0) {
|
if (res.data.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1376,13 +1422,21 @@ function handleSaveSign(row, index) {
|
|||||||
savePrescription({ regAdviceSaveList: [row] }).then((res) => {
|
savePrescription({ regAdviceSaveList: [row] }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$modal.msgSuccess('保存成功');
|
proxy.$modal.msgSuccess('保存成功');
|
||||||
nextId.value == 1;
|
nextId.value = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (prescriptionList.value[0].adviceName) {
|
// 新增行:调用保存接口将数据持久化到后端
|
||||||
handleAddPrescription();
|
row.dbOpType = '1';
|
||||||
}
|
savePrescription({ regAdviceSaveList: [row] }).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
proxy.$modal.msgSuccess('保存成功');
|
||||||
|
nextId.value = 1;
|
||||||
|
// 保存成功后刷新列表,确保后端返回的数据带 requestId
|
||||||
|
getListInfo(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 不需要再添加空行,保存成功后由 getListInfo 处理
|
||||||
}
|
}
|
||||||
adviceQueryParams.value.adviceType = undefined;
|
adviceQueryParams.value.adviceType = undefined;
|
||||||
}
|
}
|
||||||
@@ -1429,12 +1483,13 @@ function handleSaveBatch() {
|
|||||||
if (row) row.isEdit = false;
|
if (row) row.isEdit = false;
|
||||||
});
|
});
|
||||||
getListInfo(false);
|
getListInfo(false);
|
||||||
nextId.value == 1;
|
nextId.value = 1;
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
isSaving.value = false;
|
isSaving.value = false;
|
||||||
|
proxy.$modal.msgError(error?.msg || '保存失败,请重试');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1562,17 +1617,21 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
// 🔥 新版组件已经预处理了数据,优先使用 mergedDetail
|
// 🔥 新版组件已经预处理了数据,优先使用 mergedDetail
|
||||||
const mergedDetail = item.mergedDetail || {
|
const mergedDetail = item.mergedDetail || {
|
||||||
...(item.orderDetailInfos || {}),
|
...(item.orderDetailInfos || {}),
|
||||||
adviceName: item.orderDetailInfos?.adviceName || item.orderDefinitionName || '未知项目',
|
adviceName: item.orderDefinitionName || item.orderDetailInfos?.adviceName || '未知项目',
|
||||||
adviceType: item.orderDetailInfos?.adviceType,
|
adviceType: item.orderDetailInfos?.adviceType,
|
||||||
adviceDefinitionId: item.orderDefinitionId || item.orderDetailInfos?.adviceDefinitionId,
|
adviceDefinitionId: item.orderDefinitionId || item.orderDetailInfos?.adviceDefinitionId,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
unitCode: item.unitCode || item.orderDetailInfos?.unitCode,
|
unitCode: item.unitCode || item.orderDetailInfos?.unitCode,
|
||||||
unitCodeName: item.unitCodeName,
|
unitCodeName: item.unitCodeName,
|
||||||
dose: item.dose || item.orderDetailInfos?.dose,
|
// 🔧 Bug #403 修复:dose/doseQuantity/dispensePerDuration 需用 null 检查,
|
||||||
|
// 避免组套中值为 null 时回退到医嘱库的 orderDetailInfos
|
||||||
|
dose: item.dose !== undefined && item.dose !== null ? item.dose : item.orderDetailInfos?.dose,
|
||||||
rateCode: item.rateCode || item.orderDetailInfos?.rateCode,
|
rateCode: item.rateCode || item.orderDetailInfos?.rateCode,
|
||||||
methodCode: item.methodCode || item.orderDetailInfos?.methodCode,
|
methodCode: item.methodCode || item.orderDetailInfos?.methodCode,
|
||||||
dispensePerDuration: item.dispensePerDuration || item.orderDetailInfos?.dispensePerDuration,
|
dispensePerDuration: item.dispensePerDuration !== undefined && item.dispensePerDuration !== null
|
||||||
doseQuantity: item.doseQuantity,
|
? item.dispensePerDuration : item.orderDetailInfos?.dispensePerDuration,
|
||||||
|
doseQuantity: item.doseQuantity !== undefined && item.doseQuantity !== null
|
||||||
|
? item.doseQuantity : item.orderDetailInfos?.doseQuantity,
|
||||||
inventoryList: item.orderDetailInfos?.inventoryList || [],
|
inventoryList: item.orderDetailInfos?.inventoryList || [],
|
||||||
priceList: item.orderDetailInfos?.priceList || [],
|
priceList: item.orderDetailInfos?.priceList || [],
|
||||||
partPercent: item.orderDetailInfos?.partPercent || 1,
|
partPercent: item.orderDetailInfos?.partPercent || 1,
|
||||||
@@ -1591,20 +1650,15 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
setValue(mergedDetail);
|
setValue(mergedDetail);
|
||||||
|
|
||||||
// 创建新的处方项目
|
// 创建新的处方项目
|
||||||
|
// 🔧 Bug #403 修复:关键字段使用 null-safe 回退到 mergedDetail(已由 setValue 填充完整数据)
|
||||||
|
// 先取 setValue 填充的行数据作为基础
|
||||||
|
const baseRow = prescriptionList.value[rowIndex.value];
|
||||||
const newRow = {
|
const newRow = {
|
||||||
...prescriptionList.value[rowIndex.value],
|
...baseRow,
|
||||||
patientId: patientInfo.value.patientId,
|
patientId: patientInfo.value.patientId,
|
||||||
encounterId: patientInfo.value.encounterId,
|
encounterId: patientInfo.value.encounterId,
|
||||||
accountId: accountId.value,
|
accountId: accountId.value,
|
||||||
quantity: item.quantity,
|
|
||||||
methodCode: item.methodCode,
|
|
||||||
rateCode: item.rateCode,
|
|
||||||
dispensePerDuration: item.dispensePerDuration,
|
|
||||||
dose: item.dose,
|
|
||||||
doseQuantity: item.doseQuantity,
|
|
||||||
executeNum: 1,
|
executeNum: 1,
|
||||||
unitCode: item.unitCode,
|
|
||||||
unitCode_dictText: item.unitCodeName || '',
|
|
||||||
statusEnum: 1,
|
statusEnum: 1,
|
||||||
orgId: resolveOrgId(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
orgId: resolveOrgId(item.orderDetailInfos?.orgId || mergedDetail.orgId || patientInfo.value?.inHospitalOrgId) || '',
|
||||||
// 🔧 修复:同时保存 orgName,确保树匹配不到时仍有中文名称可显示
|
// 🔧 修复:同时保存 orgName,确保树匹配不到时仍有中文名称可显示
|
||||||
@@ -1613,19 +1667,33 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
conditionId: conditionId.value,
|
conditionId: conditionId.value,
|
||||||
conditionDefinitionId: conditionDefinitionId.value,
|
conditionDefinitionId: conditionDefinitionId.value,
|
||||||
encounterDiagnosisId: encounterDiagnosisId.value,
|
encounterDiagnosisId: encounterDiagnosisId.value,
|
||||||
therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || '1',
|
therapyEnum: baseRow?.therapyEnum || '1',
|
||||||
};
|
};
|
||||||
|
// 覆盖关键字段:优先使用 item 的值,其次 mergedDetail(已由 setValue 填充),最后 baseRow
|
||||||
|
newRow.quantity = item.quantity ?? mergedDetail.quantity ?? baseRow.quantity;
|
||||||
|
newRow.methodCode = item.methodCode ?? mergedDetail.methodCode ?? baseRow.methodCode;
|
||||||
|
newRow.rateCode = item.rateCode ?? mergedDetail.rateCode ?? baseRow.rateCode;
|
||||||
|
newRow.dispensePerDuration = item.dispensePerDuration ?? mergedDetail.dispensePerDuration ?? baseRow.dispensePerDuration;
|
||||||
|
newRow.dose = item.dose ?? mergedDetail.dose ?? baseRow.dose;
|
||||||
|
newRow.doseQuantity = item.doseQuantity ?? mergedDetail.doseQuantity ?? baseRow.doseQuantity;
|
||||||
|
newRow.unitCode = item.unitCode ?? mergedDetail.unitCode ?? baseRow.unitCode;
|
||||||
|
newRow.unitCode_dictText = item.unitCodeName || mergedDetail.unitCodeName || baseRow.unitCode_dictText || '';
|
||||||
|
|
||||||
// 计算价格和总量
|
// 计算价格和总量
|
||||||
const unitInfo = unitCodeList.value.find((k) => k.value == item.unitCode);
|
// 🔧 Bug #403 修复:使用 newRow.unitCode(已由 setValue 填充)而非 item.unitCode
|
||||||
|
// 使用 ?? 替代 || 计算 partPercent,确保值为 0 时不会被错误替换
|
||||||
|
const finalUnitCode = newRow.unitCode;
|
||||||
|
const unitInfo = unitCodeList.value.find((k) => k.value == finalUnitCode);
|
||||||
|
const finalQuantity = newRow.quantity;
|
||||||
|
const partPercent = item.orderDetailInfos?.partPercent ?? mergedDetail.partPercent ?? baseRow.partPercent ?? 1;
|
||||||
if (unitInfo && unitInfo.type == 'minUnit') {
|
if (unitInfo && unitInfo.type == 'minUnit') {
|
||||||
newRow.price = newRow.minUnitPrice;
|
newRow.price = newRow.minUnitPrice;
|
||||||
newRow.totalPrice = (item.quantity * newRow.minUnitPrice).toFixed(6);
|
newRow.totalPrice = ((finalQuantity || 0) * newRow.minUnitPrice).toFixed(6);
|
||||||
newRow.minUnitQuantity = item.quantity;
|
newRow.minUnitQuantity = finalQuantity || 0;
|
||||||
} else {
|
} else {
|
||||||
newRow.price = newRow.unitPrice;
|
newRow.price = newRow.unitPrice;
|
||||||
newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6);
|
newRow.totalPrice = ((finalQuantity || 0) * newRow.unitPrice).toFixed(6);
|
||||||
newRow.minUnitQuantity = item.quantity * (item.orderDetailInfos?.partPercent || mergedDetail.partPercent || 1);
|
newRow.minUnitQuantity = (finalQuantity || 0) * partPercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
newRow.contentJson = JSON.stringify(newRow);
|
newRow.contentJson = JSON.stringify(newRow);
|
||||||
|
|||||||
@@ -296,6 +296,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<el-empty v-if="!groupSetLoading && groupSetList.length === 0" description="暂无划价组套数据" :image-size="80" />
|
||||||
<div style="margin-top: 15px; text-align: right">
|
<div style="margin-top: 15px; text-align: right">
|
||||||
<el-button @click="groupSetDialogVisible = false">取消</el-button>
|
<el-button @click="groupSetDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="applyGroupSet" :disabled="!selectedGroupSet">应用</el-button>
|
<el-button type="primary" @click="applyGroupSet" :disabled="!selectedGroupSet">应用</el-button>
|
||||||
@@ -481,18 +482,53 @@ watch(
|
|||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
executeTime.value = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
|
executeTime.value = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
|
||||||
|
// 弹窗打开时重新加载科室和位置选项,确保数据最新
|
||||||
|
loadDepartmentOptions();
|
||||||
|
getDiseaseInitLoc(16);
|
||||||
} else {
|
} else {
|
||||||
resetData();
|
resetData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 监听科室选项加载完成,为已添加的诊疗项目设置默认执行科室
|
||||||
|
watch(
|
||||||
|
() => departmentOptions.value,
|
||||||
|
(depts) => {
|
||||||
|
if (!depts || depts.length === 0) return;
|
||||||
|
feeItemsList.value.forEach(item => {
|
||||||
|
if (item.adviceType === 3 && !item.positionId) {
|
||||||
|
const patientOrgId = props.patientInfo.organizationId;
|
||||||
|
const matched = depts.find(d => String(d.id) === String(patientOrgId));
|
||||||
|
item.positionId = matched ? String(matched.id) : String(depts[0].id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 监听位置选项加载完成,为已添加的耗材项目设置默认位置
|
||||||
|
watch(
|
||||||
|
() => locationOptions.value,
|
||||||
|
(locs) => {
|
||||||
|
if (!locs || locs.length === 0) return;
|
||||||
|
feeItemsList.value.forEach(item => {
|
||||||
|
if (item.adviceType === 2 && !item.positionId) {
|
||||||
|
item.positionId = String(locs[0].value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 加载科室选项
|
// 加载科室选项
|
||||||
function loadDepartmentOptions() {
|
function loadDepartmentOptions() {
|
||||||
getOrgList()
|
getOrgList()
|
||||||
.then((res) => {
|
.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 || [];
|
const firstRecord = res.data.records[0];
|
||||||
|
// 优先使用 children(树形结构),回退到 records 本身(扁平结构)
|
||||||
|
departmentOptions.value = (firstRecord.children && firstRecord.children.length > 0)
|
||||||
|
? firstRecord.children
|
||||||
|
: res.data.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@@ -527,23 +563,27 @@ function getDiseaseInitLoc() {
|
|||||||
locationOptions.value = [];
|
locationOptions.value = [];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 下拉框模糊搜索过滤
|
// 下拉框模糊搜索过滤(自定义filter-method,配合element-plus filterable使用)
|
||||||
function filterOptions(val, row, optionsKey) {
|
function filterOptions(val, row, optionsKey) {
|
||||||
const key = row.adviceDefinitionId + '_' + optionsKey;
|
const key = row.adviceDefinitionId + '_' + optionsKey;
|
||||||
filterKeywords.value[key] = val;
|
if (!val || val.trim() === '') {
|
||||||
|
delete filterKeywords.value[key];
|
||||||
|
} else {
|
||||||
|
filterKeywords.value[key] = val.toLowerCase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function getFilteredOptions(row, optionsKey) {
|
function getFilteredOptions(row, optionsKey) {
|
||||||
const key = row.adviceDefinitionId + '_' + optionsKey;
|
const key = row.adviceDefinitionId + '_' + optionsKey;
|
||||||
const keyword = filterKeywords.value[key];
|
const keyword = filterKeywords.value[key];
|
||||||
const options = optionsKey === 'departmentOptions' ? departmentOptions.value : locationOptions.value;
|
const options = optionsKey === 'departmentOptions' ? departmentOptions.value : locationOptions.value;
|
||||||
if (!keyword || keyword.trim() === '') {
|
if (!keyword) {
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
const lower = keyword.toLowerCase();
|
|
||||||
return options.filter(item => {
|
return options.filter(item => {
|
||||||
const name = (item.name || item.label || '').toLowerCase();
|
const name = (item.name || item.label || '').toLowerCase();
|
||||||
const id = String(item.id || item.value || '').toLowerCase();
|
const id = String(item.id || item.value || '').toLowerCase();
|
||||||
return name.includes(lower) || id.includes(lower);
|
const py = (item.pyStr || '').toLowerCase();
|
||||||
|
return name.includes(keyword) || id.includes(keyword) || py.includes(keyword);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 获取组套类型文本
|
// 获取组套类型文本
|
||||||
@@ -553,9 +593,9 @@ function getItemType_Text(type) {
|
|||||||
}
|
}
|
||||||
function getUnitCodeOptions(row) {
|
function getUnitCodeOptions(row) {
|
||||||
const unitCodes = [
|
const unitCodes = [
|
||||||
{ code: row.unitCode, codeText: row.unitCode_dictText },
|
{ code: String(row.unitCode), codeText: row.unitCode_dictText },
|
||||||
{ code: row.minUnitCode, codeText: row.minUnitCode_dictText },
|
{ code: String(row.minUnitCode), codeText: row.minUnitCode_dictText },
|
||||||
];
|
].filter(item => item.code);
|
||||||
// 使用 Set 来跟踪已经存在的 code
|
// 使用 Set 来跟踪已经存在的 code
|
||||||
const seenCodes = new Set();
|
const seenCodes = new Set();
|
||||||
const uniqueUnitCodes = unitCodes.filter((item) => {
|
const uniqueUnitCodes = unitCodes.filter((item) => {
|
||||||
@@ -575,11 +615,11 @@ function unitCodeChange(row) {
|
|||||||
// 获取价格
|
// 获取价格
|
||||||
const price = row.priceList?.[0]?.price || 0;
|
const price = row.priceList?.[0]?.price || 0;
|
||||||
|
|
||||||
// 根据选择的单位调整单价
|
// 根据选择的单位调整单价(统一用字符串比较)
|
||||||
if (row.selectUnitCode === row.unitCode) {
|
if (String(row.selectUnitCode) === String(row.unitCode)) {
|
||||||
// 如果选择的是大单位 (如 "盒")
|
// 如果选择的是大单位 (如 "盒")
|
||||||
row.unitPrice = price.toFixed(6); // 单价就是原价
|
row.unitPrice = price.toFixed(6); // 单价就是原价
|
||||||
} else if (row.selectUnitCode === row.minUnitCode) {
|
} else if (String(row.selectUnitCode) === String(row.minUnitCode)) {
|
||||||
// 如果选择的是小单位 (如 "个")
|
// 如果选择的是小单位 (如 "个")
|
||||||
row.unitPrice = (price / (row.partPercent || 1)).toFixed(6); // 单价 = 原价 / 拆零比
|
row.unitPrice = (price / (row.partPercent || 1)).toFixed(6); // 单价 = 原价 / 拆零比
|
||||||
}
|
}
|
||||||
@@ -763,6 +803,7 @@ function resetData() {
|
|||||||
|
|
||||||
// 划价组套相关功能
|
// 划价组套相关功能
|
||||||
function openGroupSetDialog() {
|
function openGroupSetDialog() {
|
||||||
|
console.log('openGroupSetDialog called');
|
||||||
groupSetDialogVisible.value = true;
|
groupSetDialogVisible.value = true;
|
||||||
groupSetSearchText.value = '';
|
groupSetSearchText.value = '';
|
||||||
selectedGroupSet.value = null;
|
selectedGroupSet.value = null;
|
||||||
@@ -771,19 +812,37 @@ function openGroupSetDialog() {
|
|||||||
|
|
||||||
function loadGroupSets() {
|
function loadGroupSets() {
|
||||||
groupSetLoading.value = true;
|
groupSetLoading.value = true;
|
||||||
getOrderGroup({ organizationId: orgId.value })
|
const params = { organizationId: orgId.value };
|
||||||
|
// 传递搜索关键字,后端 /group-package-for-order 虽不直接支持 searchKey,
|
||||||
|
// 但保持参数传递以便后续扩展
|
||||||
|
if (groupSetSearchText.value && groupSetSearchText.value.trim()) {
|
||||||
|
params.searchKey = groupSetSearchText.value.trim();
|
||||||
|
}
|
||||||
|
getOrderGroup(params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res?.data || {};
|
const data = res?.data || {};
|
||||||
|
let rawList = [];
|
||||||
if (groupSetRange.value === 1) {
|
if (groupSetRange.value === 1) {
|
||||||
groupSetList.value = data.personalList || [];
|
rawList = data.personalList || [];
|
||||||
} else if (groupSetRange.value === 2) {
|
} else if (groupSetRange.value === 2) {
|
||||||
groupSetList.value = data.organizationList || [];
|
rawList = data.organizationList || [];
|
||||||
} else {
|
} else {
|
||||||
groupSetList.value = data.hospitalList || [];
|
rawList = data.hospitalList || [];
|
||||||
|
}
|
||||||
|
// 客户端过滤:根据搜索关键字过滤组套名称
|
||||||
|
const keyword = groupSetSearchText.value?.trim()?.toLowerCase();
|
||||||
|
if (keyword) {
|
||||||
|
groupSetList.value = rawList.filter(item => {
|
||||||
|
const name = (item.name || item.Name || '').toLowerCase();
|
||||||
|
return name.includes(keyword);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
groupSetList.value = rawList;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((err) => {
|
||||||
console.warn('组套列表加载失败(可能无权限)');
|
console.warn('组套列表加载失败(可能无权限):', err);
|
||||||
|
ElMessage.warning('组套列表加载失败,当前暂无可用组套');
|
||||||
groupSetList.value = [];
|
groupSetList.value = [];
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export function getOrgList() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/base-data-manage/organization/organization',
|
url: '/base-data-manage/organization/organization',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
params: { pageSize: 100, pageNum: 1 },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -302,6 +302,29 @@ function getSelectRows() {
|
|||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getTableRef(index) {
|
||||||
|
return proxy.$refs['tableRef' + index]?.[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectAllRows() {
|
||||||
|
prescriptionList.value.forEach((item, index) => {
|
||||||
|
const tableRef = getTableRef(index);
|
||||||
|
if (!tableRef) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.forEach((row) => {
|
||||||
|
tableRef.toggleRowSelection(row, true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearSelection() {
|
||||||
|
prescriptionList.value.forEach((item, index) => {
|
||||||
|
getTableRef(index)?.clearSelection();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function handleRateChange(value, item, row) {
|
function handleRateChange(value, item, row) {
|
||||||
// 拼接当前选中时间
|
// 拼接当前选中时间
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -319,6 +342,8 @@ function handleRateChange(value, item, row) {
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
handleGetPrescription,
|
handleGetPrescription,
|
||||||
handleMedicineSummary,
|
handleMedicineSummary,
|
||||||
|
selectAllRows,
|
||||||
|
clearSelection,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -66,13 +66,21 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 1,
|
default: 1,
|
||||||
},
|
},
|
||||||
|
therapyEnum: {
|
||||||
|
type: Number,
|
||||||
|
default: undefined,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
handleGetPrescription();
|
handleGetPrescription();
|
||||||
function handleGetPrescription() {
|
function handleGetPrescription() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
|
let encounterIds = patientInfoList.value.map((i) => i.encounterId).join(',');
|
||||||
getMedicineSummary({}).then((res) => {
|
const params = {};
|
||||||
|
if (props.therapyEnum !== undefined) {
|
||||||
|
params.therapyEnum = props.therapyEnum;
|
||||||
|
}
|
||||||
|
getMedicineSummary(params).then((res) => {
|
||||||
medicineSummaryFormList.value = res.data.records;
|
medicineSummaryFormList.value = res.data.records;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -69,7 +69,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="descriptions-item-label">全选:</span>
|
<span class="descriptions-item-label">全选:</span>
|
||||||
<el-switch v-model="chooseAll" @change="handelSwicthChange" />
|
<el-switch
|
||||||
|
v-model="chooseAll"
|
||||||
|
:disabled="isDetails != '1'"
|
||||||
|
@change="handelSwicthChange"
|
||||||
|
/>
|
||||||
<el-button class="ml20 mr20" type="primary" @click="handleExecute"> 汇总领药 </el-button>
|
<el-button class="ml20 mr20" type="primary" @click="handleExecute"> 汇总领药 </el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,7 +85,7 @@
|
|||||||
:deadline="deadline"
|
:deadline="deadline"
|
||||||
:therapyEnum="therapyEnum"
|
:therapyEnum="therapyEnum"
|
||||||
/>
|
/>
|
||||||
<SummaryMedicineList v-else />
|
<SummaryMedicineList v-else ref="summaryMedicineRefs" :therapyEnum="therapyEnum" />
|
||||||
<!-- <el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleClick">
|
<!-- <el-tabs v-model="activeName" class="demo-tabs centered-tabs" @tab-change="handleClick">
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="tab in prescriptionTabs"
|
v-for="tab in prescriptionTabs"
|
||||||
@@ -125,6 +129,7 @@ const therapyEnum = ref(undefined);
|
|||||||
|
|
||||||
// 存储子组件引用的对象
|
// 存储子组件引用的对象
|
||||||
const prescriptionRefs = ref();
|
const prescriptionRefs = ref();
|
||||||
|
const summaryMedicineRefs = ref();
|
||||||
|
|
||||||
const navigationButtons = inpatientNurseNavs;
|
const navigationButtons = inpatientNurseNavs;
|
||||||
|
|
||||||
@@ -160,24 +165,35 @@ function handleClick(tabName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleGetPrescription() {
|
function handleGetPrescription() {
|
||||||
prescriptionRefs.value.handleGetPrescription();
|
chooseAll.value = false;
|
||||||
|
if (isDetails.value == '1') {
|
||||||
|
prescriptionRefs.value?.handleGetPrescription();
|
||||||
|
} else {
|
||||||
|
summaryMedicineRefs.value?.handleGetPrescription();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handelSwicthChange() {
|
function handelSwicthChange(value) {
|
||||||
if (chooseAll.value) {
|
if (!prescriptionRefs.value) {
|
||||||
proxy.$refs['prescriptionRefs'].selectAllRows();
|
chooseAll.value = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value) {
|
||||||
|
prescriptionRefs.value.selectAllRows();
|
||||||
} else {
|
} else {
|
||||||
proxy.$refs['prescriptionRefs'].clearSelection();
|
prescriptionRefs.value.clearSelection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleRadioChange(value) {
|
function handleRadioChange(value) {
|
||||||
|
chooseAll.value = false;
|
||||||
if (value == '1') {
|
if (value == '1') {
|
||||||
handleGetPrescription();
|
handleGetPrescription();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleTherapyChange() {
|
function handleTherapyChange() {
|
||||||
|
chooseAll.value = false;
|
||||||
handleGetPrescription();
|
handleGetPrescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,4 +232,4 @@ provide('handleGetPrescription', (value) => {
|
|||||||
:deep(.el-tabs__header) {
|
:deep(.el-tabs__header) {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -453,6 +453,10 @@ const loadPatientInfo = () => {
|
|||||||
interventionForm.value.startTime = dayjs(res.data.startTime).format(
|
interventionForm.value.startTime = dayjs(res.data.startTime).format(
|
||||||
'YYYY-MM-DD HH:mm:ss'
|
'YYYY-MM-DD HH:mm:ss'
|
||||||
);
|
);
|
||||||
|
} else if (res.data.inHosTime) {
|
||||||
|
interventionForm.value.startTime = dayjs(res.data.inHosTime).format(
|
||||||
|
'YYYY-MM-DD HH:mm:ss'
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
interventionForm.value.startTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
|
interventionForm.value.startTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -471,11 +471,13 @@ 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) {
|
||||||
// 仅当选中医嘱中包含耗材类医嘱时,才调用耗材批号匹配(排除纯药品医嘱场景)
|
// 仅当选中医嘱中包含诊疗类医嘱(可能绑定耗材)时,才调用耗材批号匹配
|
||||||
const hasDevice = list.some((item) =>
|
// adviceTable 取值为 med_medication_request(药品)或 wor_service_request(诊疗/耗材)
|
||||||
String(item.adviceTable || '').includes('device'),
|
// 原代码用 includes('device') 判断有误,两个表名均不含 "device" 字符串
|
||||||
|
const hasServiceRequest = list.some((item) =>
|
||||||
|
String(item.adviceTable || '') === 'wor_service_request',
|
||||||
);
|
);
|
||||||
if (hasDevice) {
|
if (hasServiceRequest) {
|
||||||
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);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -803,7 +803,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 手术计费弹窗 -->
|
<!-- 手术计费弹窗 -->
|
||||||
<el-dialog :title="chargeDialogTitle" v-model="showChargeDialog" width="1400px" @close="closeChargeDialog" append-to-body>
|
<el-dialog :title="chargeDialogTitle" v-model="showChargeDialog" width="1400px" @close="closeChargeDialog" append-to-body destroy-on-close>
|
||||||
<div style="display: flex; justify-content: space-between; height: 80vh">
|
<div style="display: flex; justify-content: space-between; height: 80vh">
|
||||||
<div style="width: 100%; border: 1px solid #eee; position: relative">
|
<div style="width: 100%; border: 1px solid #eee; position: relative">
|
||||||
<div style="padding: 10px; border: 1px solid #eee; height: 50px; border-left: 0">
|
<div style="padding: 10px; border: 1px solid #eee; height: 50px; border-left: 0">
|
||||||
@@ -829,7 +829,9 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding: 10px">
|
<div style="padding: 10px">
|
||||||
<prescriptionlist v-if="showChargeDialog" :patientInfo="chargePatientInfo" ref="prescriptionRef" />
|
<prescriptionlist :patientInfo="chargePatientInfo" ref="prescriptionRef"
|
||||||
|
:generateSourceEnum="1"
|
||||||
|
:sourceBillNo="chargePatientInfo.sourceBillNo" />
|
||||||
<div class="overlay" v-if="disabled"></div>
|
<div class="overlay" v-if="disabled"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -872,16 +874,59 @@ import { Loading } from '@element-plus/icons-vue' // 🔧 新增:导入 Loadin
|
|||||||
import { getPrescriptionList } from '@/views/clinicmanagement/bargain/component/api'
|
import { getPrescriptionList } from '@/views/clinicmanagement/bargain/component/api'
|
||||||
|
|
||||||
// API 导入
|
// API 导入
|
||||||
import { getSurgerySchedulePage, addSurgerySchedule, updateSurgerySchedule, deleteSurgerySchedule, getSurgeryScheduleDetail } from '@/api/surgicalschedule'
|
import {
|
||||||
import { listUser } from '@/api/system/user'
|
getSurgerySchedulePage,
|
||||||
import { deptTreeSelect } from '@/api/system/user'
|
addSurgerySchedule,
|
||||||
import { listOperatingRoom } from '@/api/operatingroom'
|
updateSurgerySchedule,
|
||||||
import { getSurgery} from '@/views/inpatientDoctor/home/components/applicationShow/api.js'
|
deleteSurgerySchedule,
|
||||||
import { getTenantPage } from '@/api/system/tenant'
|
getSurgeryScheduleDetail
|
||||||
|
} from '@/api/surgicalschedule'
|
||||||
|
import { getSurgeryPage} from '@/views/inpatientDoctor/home/components/applicationShow/api.js'
|
||||||
import { getContract } from '@/views/inpatientDoctor/home/components/api.js'
|
import { getContract } from '@/views/inpatientDoctor/home/components/api.js'
|
||||||
|
import request from '@/utils/request'
|
||||||
import SurgeryCharge from '../charge/surgerycharge/index.vue'
|
import SurgeryCharge from '../charge/surgerycharge/index.vue'
|
||||||
import TemporaryMedical from './temporaryMedical.vue'
|
import TemporaryMedical from './temporaryMedical.vue'
|
||||||
|
|
||||||
|
// 静默获取字典列表(跳过拦截器错误提示,手术室护士等角色可能无此权限)
|
||||||
|
function getTenantPageSilent(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/tenant/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
skipErrorMsg: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 静默获取科室树(跳过拦截器错误提示)
|
||||||
|
function deptTreeSelectSilent(params = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/base-data-manage/organization/organization',
|
||||||
|
method: 'get',
|
||||||
|
params: { typeEnum: 2, ...params },
|
||||||
|
skipErrorMsg: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 静默获取用户列表(跳过拦截器错误提示)
|
||||||
|
function listUserSilent(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base-data-manage/practitioner/user-practitioner-page',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
skipErrorMsg: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 静默获取手术室列表(跳过拦截器错误提示)
|
||||||
|
function listOperatingRoomSilent(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base-data-manage/operating-room/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
skipErrorMsg: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
@@ -1110,7 +1155,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
// 加载卫生机构列表
|
// 加载卫生机构列表
|
||||||
function loadOrgList() {
|
function loadOrgList() {
|
||||||
getTenantPage({ pageNo: 1, pageSize: 1000 })
|
getTenantPageSilent({ pageNo: 1, pageSize: 1000 })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const records = res.data?.records || res.data || []
|
const records = res.data?.records || res.data || []
|
||||||
@@ -1130,7 +1175,7 @@ function loadOrgList() {
|
|||||||
|
|
||||||
// 加载科室列表
|
// 加载科室列表
|
||||||
function loadDeptList() {
|
function loadDeptList() {
|
||||||
deptTreeSelect()
|
deptTreeSelectSilent()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const tree = res.data?.records || res.data || []
|
const tree = res.data?.records || res.data || []
|
||||||
@@ -1150,7 +1195,7 @@ function loadDeptList() {
|
|||||||
|
|
||||||
// 加载医生列表
|
// 加载医生列表
|
||||||
function loadDoctorList() {
|
function loadDoctorList() {
|
||||||
listUser({ pageNo: 1, pageSize: 1000 })
|
listUserSilent({ pageNo: 1, pageSize: 1000 })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const records = res.data?.records || []
|
const records = res.data?.records || []
|
||||||
@@ -1170,7 +1215,7 @@ function loadDoctorList() {
|
|||||||
|
|
||||||
// 加载护士列表
|
// 加载护士列表
|
||||||
function loadNurseList() {
|
function loadNurseList() {
|
||||||
listUser({ pageNo: 1, pageSize: 1000 })
|
listUserSilent({ pageNo: 1, pageSize: 1000 })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const records = res.data?.records || []
|
const records = res.data?.records || []
|
||||||
@@ -1190,7 +1235,7 @@ function loadNurseList() {
|
|||||||
|
|
||||||
// 加载手术室列表
|
// 加载手术室列表
|
||||||
function loadOperatingRoomList() {
|
function loadOperatingRoomList() {
|
||||||
listOperatingRoom({ pageNo: 1, pageSize: 1000, statusEnum: 1 })
|
listOperatingRoomSilent({ pageNo: 1, pageSize: 1000, statusEnum: 1 })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const records = res.data?.records || []
|
const records = res.data?.records || []
|
||||||
@@ -1388,8 +1433,8 @@ async function handleChargeCharge(row) {
|
|||||||
orgId: userStore.organizationId || userStore.orgId || userStore.tenantId || 1,
|
orgId: userStore.organizationId || userStore.orgId || userStore.tenantId || 1,
|
||||||
// 添加账户ID
|
// 添加账户ID
|
||||||
accountId: accountId,
|
accountId: accountId,
|
||||||
// 添加手术申请单号用于追溯
|
// 添加手术单号用于关联对应的手术医嘱
|
||||||
sourceBillNo: row.applyId,
|
sourceBillNo: row.operCode,
|
||||||
//添加计费标志手术计费
|
//添加计费标志手术计费
|
||||||
generateSourceEnum: 6
|
generateSourceEnum: 6
|
||||||
}
|
}
|
||||||
@@ -1411,11 +1456,15 @@ async function handleChargeCharge(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 关闭计费弹窗
|
// 关闭计费弹窗
|
||||||
function closeChargeDialog() {
|
async function closeChargeDialog() {
|
||||||
// 先关闭 prescriptionlist 内所有已打开的项目字典 popover
|
// 先关闭 prescriptionlist 内所有已打开的项目字典 popover
|
||||||
if (prescriptionRef.value && prescriptionRef.value.closeAllPopovers) {
|
if (prescriptionRef.value && prescriptionRef.value.closeAllPopovers) {
|
||||||
prescriptionRef.value.closeAllPopovers()
|
prescriptionRef.value.closeAllPopovers()
|
||||||
}
|
}
|
||||||
|
// 等待 Vue 完成 popover 可见性更新的 DOM 操作,
|
||||||
|
// 因为 el-popover 通过 teleport 渲染在 body 上,需要在 dialog 卸载前完成清理
|
||||||
|
await nextTick()
|
||||||
|
// 清空数据,避免下次打开时使用缓存
|
||||||
showChargeDialog.value = false
|
showChargeDialog.value = false
|
||||||
chargePatientInfo.value = {}
|
chargePatientInfo.value = {}
|
||||||
chargeSurgeryInfo.value = {}
|
chargeSurgeryInfo.value = {}
|
||||||
@@ -1447,7 +1496,8 @@ function handleMedicalAdvice(row) {
|
|||||||
role: userStore.roles[0],
|
role: userStore.roles[0],
|
||||||
effectiveOrgId : row.effectiveOrgId,
|
effectiveOrgId : row.effectiveOrgId,
|
||||||
orgId: userStore.orgId,
|
orgId: userStore.orgId,
|
||||||
positionId: userStore.orgId
|
positionId: userStore.orgId,
|
||||||
|
applyId: row.applyId // 手术申请单ID,用于过滤关联医嘱
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 关键修复:如果已有提交的医嘱数据,并且是同一个患者的就诊,则使用保存的数据
|
// 🔧 关键修复:如果已有提交的医嘱数据,并且是同一个患者的就诊,则使用保存的数据
|
||||||
@@ -1493,6 +1543,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) 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;
|
||||||
@@ -1745,16 +1797,18 @@ function handleQuoteBilling() {
|
|||||||
// 重新拉取计费药品数据
|
// 重新拉取计费药品数据
|
||||||
if (temporaryPatientInfo.value.visitId) {
|
if (temporaryPatientInfo.value.visitId) {
|
||||||
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
||||||
getPrescriptionList(temporaryPatientInfo.value.visitId).then((res) => {
|
getPrescriptionList(temporaryPatientInfo.value.visitId, 6, temporaryPatientInfo.value.operCode).then((res) => {
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
// 🔧 修复:先清空旧数据,避免数据累积
|
// 🔧 修复:先清空旧数据,避免数据累积
|
||||||
temporaryBillingMedicines.value = []
|
temporaryBillingMedicines.value = []
|
||||||
temporaryAdvices.value = []
|
temporaryAdvices.value = []
|
||||||
|
|
||||||
// 🔧 修复:显示所有药品请求数据,不管有没有计费项目
|
// 只保留药品类型(adviceType=1),过滤掉耗材(2)和诊疗项目(3)
|
||||||
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) return false;
|
||||||
// 过滤掉名称为空的项目
|
// 过滤掉名称为空的项目
|
||||||
const medicineName = item.adviceName || item.advice_name;
|
const medicineName = item.adviceName || item.advice_name;
|
||||||
return medicineName && medicineName.trim() !== '';
|
return medicineName && medicineName.trim() !== '';
|
||||||
@@ -2020,7 +2074,7 @@ function handleFindApply() {
|
|||||||
getSurgicalScheduleList()
|
getSurgicalScheduleList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取手术申请列表(用于“查找”弹窗)
|
// 获取手术申请列表(用于”查找”弹窗)
|
||||||
function getSurgicalScheduleList() {
|
function getSurgicalScheduleList() {
|
||||||
applyLoading.value = true
|
applyLoading.value = true
|
||||||
const params = { ...applyQueryParams }
|
const params = { ...applyQueryParams }
|
||||||
@@ -2029,8 +2083,7 @@ function getSurgicalScheduleList() {
|
|||||||
params.applyTimeEnd = params.applyTimeRange[1]
|
params.applyTimeEnd = params.applyTimeRange[1]
|
||||||
delete params.applyTimeRange
|
delete params.applyTimeRange
|
||||||
}
|
}
|
||||||
getSurgery(params).then((res) => {
|
getSurgeryPage(params).then((res) => {
|
||||||
// Check if data is nested under data.data or directly under data
|
|
||||||
const responseData = res.data.data || res.data
|
const responseData = res.data.data || res.data
|
||||||
applyList.value = responseData.records || []
|
applyList.value = responseData.records || []
|
||||||
applyTotal.value = responseData.total || 0
|
applyTotal.value = responseData.total || 0
|
||||||
@@ -2279,4 +2332,4 @@ function getRowClassName({ row, rowIndex }) {
|
|||||||
border-bottom: 1px solid #d9ecff !important;
|
border-bottom: 1px solid #d9ecff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -312,6 +312,13 @@ const getMethodCodeDict = computed(() => {
|
|||||||
|
|
||||||
// 响应式数据 - isSigned 从父组件传入的 prop 初始化
|
// 响应式数据 - isSigned 从父组件传入的 prop 初始化
|
||||||
const isSigned = ref(props.isSignedProp)
|
const isSigned = ref(props.isSignedProp)
|
||||||
|
|
||||||
|
// 🔧 修复 Bug #446: 同步父组件 isSignedProp 的变化到本地 isSigned
|
||||||
|
// ref(props.isSignedProp) 只在初始化时读取一次,父组件后续更新不会自动同步
|
||||||
|
watch(() => props.isSignedProp, (newVal) => {
|
||||||
|
isSigned.value = newVal
|
||||||
|
})
|
||||||
|
|
||||||
const signatureTime = ref('')
|
const signatureTime = ref('')
|
||||||
const showSignDialog = ref(false)
|
const showSignDialog = ref(false)
|
||||||
const signPassword = ref('')
|
const signPassword = ref('')
|
||||||
|
|||||||
5
sql/bug_434_add_incision_level_to_op_schedule.sql
Normal file
5
sql/bug_434_add_incision_level_to_op_schedule.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
-- Bug #434 修复:为 op_schedule 表添加 incision_level 字段
|
||||||
|
-- 手术安排表需要存储切口类型,以便在编辑弹窗中正确回显和保存
|
||||||
|
ALTER TABLE op_schedule ADD COLUMN IF NOT EXISTS incision_level INT2;
|
||||||
|
|
||||||
|
COMMENT ON COLUMN op_schedule.incision_level IS '手术切口等级 1-I级切口 2-II级切口 3-III级切口 4-IV级切口';
|
||||||
Reference in New Issue
Block a user