Compare commits
1 Commits
bug463-fix
...
bugfix/518
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae8f0bc06b |
@@ -728,12 +728,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理耗材请求
|
* 处理耗材请求
|
||||||
* 🔧 BugFix #443: 签发时跳过 handDevice,避免重复创建 DeviceDispense 并覆盖关键字段(如 performLocation)
|
|
||||||
* 签发时只需更新状态(下方 sign-advice 批量更新逻辑已处理)
|
|
||||||
*/
|
*/
|
||||||
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
|
this.handDevice(deviceList, curDate, adviceOpType);
|
||||||
this.handDevice(deviceList, curDate, adviceOpType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 签发时,把草稿状态的账单更新为待收费
|
// 签发时,把草稿状态的账单更新为待收费
|
||||||
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) {
|
if (AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType) && !adviceSaveList.isEmpty()) {
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -246,8 +243,7 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
EncounterDiagnosis encounterDiagnosis;
|
EncounterDiagnosis encounterDiagnosis;
|
||||||
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
for (SaveDiagnosisChildParam saveDiagnosisChildParam : diagnosisChildList) {
|
||||||
encounterDiagnosis = new EncounterDiagnosis();
|
encounterDiagnosis = new EncounterDiagnosis();
|
||||||
// 注意:不设置 encounterDiagnosisId,因为上面已经删除了所有记录
|
encounterDiagnosis.setId(saveDiagnosisChildParam.getEncounterDiagnosisId());
|
||||||
// 如果设置旧的 ID,saveOrUpdate 会尝试 UPDATE 不存在的记录导致失败或重复插入
|
|
||||||
encounterDiagnosis.setEncounterId(encounterId);
|
encounterDiagnosis.setEncounterId(encounterId);
|
||||||
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
encounterDiagnosis.setConditionId(saveDiagnosisChildParam.getConditionId());
|
||||||
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
encounterDiagnosis.setMaindiseFlag(saveDiagnosisChildParam.getMaindiseFlag());
|
||||||
@@ -602,25 +598,6 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
|||||||
InfectiousDiseaseReport infectiousDiseaseReport = new InfectiousDiseaseReport();
|
InfectiousDiseaseReport infectiousDiseaseReport = new InfectiousDiseaseReport();
|
||||||
BeanUtils.copyProperties(infectiousDiseaseReportDto, infectiousDiseaseReport);
|
BeanUtils.copyProperties(infectiousDiseaseReportDto, infectiousDiseaseReport);
|
||||||
|
|
||||||
// BeanUtils.copyProperties 不支持 LocalDate/LocalDateTime 到 java.util.Date 的类型转换,需手动处理
|
|
||||||
if (infectiousDiseaseReportDto.getOnsetDate() != null) {
|
|
||||||
infectiousDiseaseReport.setOnsetDate(
|
|
||||||
Date.from(infectiousDiseaseReportDto.getOnsetDate().atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
|
||||||
}
|
|
||||||
if (infectiousDiseaseReportDto.getDiagDate() != null) {
|
|
||||||
infectiousDiseaseReport.setDiagDate(
|
|
||||||
Date.from(infectiousDiseaseReportDto.getDiagDate().atZone(ZoneId.systemDefault()).toInstant()));
|
|
||||||
}
|
|
||||||
// deathDate / reportDate 同理
|
|
||||||
if (infectiousDiseaseReportDto.getDeathDate() != null) {
|
|
||||||
infectiousDiseaseReport.setDeathDate(
|
|
||||||
Date.from(infectiousDiseaseReportDto.getDeathDate().atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
|
||||||
}
|
|
||||||
if (infectiousDiseaseReportDto.getReportDate() != null) {
|
|
||||||
infectiousDiseaseReport.setReportDate(
|
|
||||||
Date.from(infectiousDiseaseReportDto.getReportDate().atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置创建人、删除状态、租户ID
|
* 设置创建人、删除状态、租户ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -96,9 +96,4 @@ public class DiagnosisQueryDto {
|
|||||||
*/
|
*/
|
||||||
private String diagnosisDoctor;
|
private String diagnosisDoctor;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否已有传染病报卡(0-无,1-有)
|
|
||||||
*/
|
|
||||||
private Integer hasInfectiousReport;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,38 +3,29 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.inventorymanage.appservice.impl;
|
package com.openhis.web.inventorymanage.appservice.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
import com.core.common.exception.ServiceException;
|
|
||||||
import com.core.common.utils.*;
|
import com.core.common.utils.*;
|
||||||
import com.core.common.utils.bean.BeanUtils;
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
import com.openhis.administration.domain.DeviceDefinition;
|
|
||||||
import com.openhis.administration.domain.Practitioner;
|
import com.openhis.administration.domain.Practitioner;
|
||||||
import com.openhis.administration.service.IDeviceDefinitionService;
|
|
||||||
import com.openhis.administration.service.IPractitionerService;
|
import com.openhis.administration.service.IPractitionerService;
|
||||||
import com.openhis.common.constant.CommonConstants;
|
import com.openhis.common.constant.CommonConstants;
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
import com.openhis.common.enums.*;
|
import com.openhis.common.enums.*;
|
||||||
import com.openhis.common.utils.EnumUtils;
|
import com.openhis.common.utils.EnumUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.medication.domain.MedicationDefinition;
|
|
||||||
import com.openhis.medication.service.IMedicationDefinitionService;
|
|
||||||
import com.openhis.web.common.dto.UnitDto;
|
import com.openhis.web.common.dto.UnitDto;
|
||||||
import com.openhis.web.inventorymanage.appservice.IRequisitionIssueAppService;
|
import com.openhis.web.inventorymanage.appservice.IRequisitionIssueAppService;
|
||||||
import com.openhis.web.inventorymanage.dto.*;
|
import com.openhis.web.inventorymanage.dto.*;
|
||||||
import com.openhis.web.inventorymanage.mapper.RequisitionIssueMapper;
|
import com.openhis.web.inventorymanage.mapper.RequisitionIssueMapper;
|
||||||
import com.openhis.workflow.domain.InventoryItem;
|
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import com.openhis.workflow.service.IInventoryItemService;
|
|
||||||
import com.openhis.workflow.service.ISupplyRequestService;
|
import com.openhis.workflow.service.ISupplyRequestService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -57,15 +48,6 @@ public class RequisitionIssueAppServiceImpl implements IRequisitionIssueAppServi
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPractitionerService practitionerService;
|
private IPractitionerService practitionerService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IInventoryItemService inventoryItemService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IMedicationDefinitionService medicationDefinitionService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IDeviceDefinitionService deviceDefinitionService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AssignSeqUtil assignSeqUtil;
|
private AssignSeqUtil assignSeqUtil;
|
||||||
|
|
||||||
@@ -185,10 +167,6 @@ public class RequisitionIssueAppServiceImpl implements IRequisitionIssueAppServi
|
|||||||
|
|
||||||
// 单据号取得
|
// 单据号取得
|
||||||
List<String> busNoList = requisitionIssueDtoList.stream().map(IssueDto::getBusNo).collect(Collectors.toList());
|
List<String> busNoList = requisitionIssueDtoList.stream().map(IssueDto::getBusNo).collect(Collectors.toList());
|
||||||
|
|
||||||
// 库存校验:领用数量不能超过源仓库实际库存
|
|
||||||
this.validateRequisitionStock(requisitionIssueDtoList);
|
|
||||||
|
|
||||||
// 请求数据取得
|
// 请求数据取得
|
||||||
List<SupplyRequest> requestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
List<SupplyRequest> requestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
||||||
if (!requestList.isEmpty()) {
|
if (!requestList.isEmpty()) {
|
||||||
@@ -350,73 +328,4 @@ public class RequisitionIssueAppServiceImpl implements IRequisitionIssueAppServi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 校验领用数量是否超过源仓库实际库存
|
|
||||||
*
|
|
||||||
* @param requisitionIssueDtoList 领用出库单据列表
|
|
||||||
*/
|
|
||||||
private void validateRequisitionStock(List<IssueDto> requisitionIssueDtoList) {
|
|
||||||
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
|
||||||
for (IssueDto issueDto : requisitionIssueDtoList) {
|
|
||||||
Long itemId = issueDto.getItemId();
|
|
||||||
String lotNumber = issueDto.getLotNumber();
|
|
||||||
Long sourceLocationId = issueDto.getSourceLocationId();
|
|
||||||
BigDecimal reqQuantity = issueDto.getItemQuantity();
|
|
||||||
String itemUnit = issueDto.getUnitCode();
|
|
||||||
String itemTable = issueDto.getItemTable();
|
|
||||||
|
|
||||||
// 根据物品类型查询定义信息(拆零比、常规单位、最小单位)
|
|
||||||
BigDecimal partPercent = BigDecimal.ONE;
|
|
||||||
String unitCode = itemUnit;
|
|
||||||
String minUnitCode = itemUnit;
|
|
||||||
|
|
||||||
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(itemTable)) {
|
|
||||||
MedicationDefinition medDef = medicationDefinitionService.getById(itemId);
|
|
||||||
if (medDef != null) {
|
|
||||||
unitCode = medDef.getUnitCode();
|
|
||||||
minUnitCode = medDef.getMinUnitCode();
|
|
||||||
if (medDef.getPartPercent() != null) {
|
|
||||||
partPercent = medDef.getPartPercent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(itemTable)) {
|
|
||||||
DeviceDefinition devDef = deviceDefinitionService.getById(itemId);
|
|
||||||
if (devDef != null) {
|
|
||||||
unitCode = devDef.getUnitCode();
|
|
||||||
minUnitCode = devDef.getMinUnitCode();
|
|
||||||
if (devDef.getPartPercent() != null) {
|
|
||||||
partPercent = devDef.getPartPercent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算领用数量折合最小单位的值
|
|
||||||
BigDecimal reqQuantityInMinUnit;
|
|
||||||
if (itemUnit.equals(unitCode)) {
|
|
||||||
// 领用单位 = 包装单位,需乘以拆零比
|
|
||||||
reqQuantityInMinUnit = reqQuantity.multiply(partPercent);
|
|
||||||
} else {
|
|
||||||
// 领用单位 = 最小单位,无需换算
|
|
||||||
reqQuantityInMinUnit = reqQuantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询源仓库实际库存(按物品编号、批号、仓库匹配)
|
|
||||||
List<InventoryItem> inventoryItemList = inventoryItemService.selectInventoryByItemId(
|
|
||||||
itemId, lotNumber, sourceLocationId, tenantId);
|
|
||||||
|
|
||||||
// 累加匹配批号的总库存(库存表quantity字段为最小单位)
|
|
||||||
BigDecimal totalStock = BigDecimal.ZERO;
|
|
||||||
for (InventoryItem inventoryItem : inventoryItemList) {
|
|
||||||
if (inventoryItem.getLocationId().equals(sourceLocationId)) {
|
|
||||||
totalStock = totalStock.add(inventoryItem.getQuantity());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 比较领用数量与库存
|
|
||||||
if (reqQuantityInMinUnit.compareTo(totalStock) > 0) {
|
|
||||||
throw new ServiceException("操作失败,库存数量不足");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,26 +90,18 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
|
|||||||
|
|
||||||
// 逐个校验activityList中的项目是否都配置了执行科室,并收集positionId供后续使用
|
// 逐个校验activityList中的项目是否都配置了执行科室,并收集positionId供后续使用
|
||||||
// 必须在任何数据库操作之前完成全部校验,避免部分保存后异常导致脏数据
|
// 必须在任何数据库操作之前完成全部校验,避免部分保存后异常导致脏数据
|
||||||
// 🔧 Bug #516: 优先使用前端传入的positionId(用户手动选择的发往科室),仅在未选择时使用配置的执行科室
|
|
||||||
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
List<ActivitySaveDto> activityList = requestFormSaveDto.getActivityList();
|
||||||
// 缓存校验结果,避免主循环中重复查询和可能出现的数据不一致
|
// 缓存校验结果,避免主循环中重复查询和可能出现的数据不一致
|
||||||
java.util.Map<Long, Long> activityIdToPositionIdMap = new java.util.HashMap<>();
|
java.util.Map<Long, Long> activityIdToPositionIdMap = new java.util.HashMap<>();
|
||||||
if (activityList != null && !activityList.isEmpty()) {
|
if (activityList != null && !activityList.isEmpty()) {
|
||||||
for (ActivitySaveDto activitySaveDto : activityList) {
|
for (ActivitySaveDto activitySaveDto : activityList) {
|
||||||
// 优先使用前端传入的positionId(用户手动选择的科室)
|
Long positionId = activityOrganizationConfig.stream()
|
||||||
Long frontendPositionId = activitySaveDto.getPositionId();
|
|
||||||
if (frontendPositionId != null) {
|
|
||||||
activityIdToPositionIdMap.put(activitySaveDto.getAdviceDefinitionId(), frontendPositionId);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 前端未传入时,使用配置的执行科室
|
|
||||||
Long configPositionId = activityOrganizationConfig.stream()
|
|
||||||
.filter(dto -> activitySaveDto.getAdviceDefinitionId().equals(dto.getActivityDefinitionId()))
|
.filter(dto -> activitySaveDto.getAdviceDefinitionId().equals(dto.getActivityDefinitionId()))
|
||||||
.map(ActivityOrganizationConfigDto::getOrganizationId).findFirst().orElse(null);
|
.map(ActivityOrganizationConfigDto::getOrganizationId).findFirst().orElse(null);
|
||||||
if (configPositionId == null) {
|
if (positionId == null) {
|
||||||
throw new ServiceException(activitySaveDto.getAdviceDefinitionName() + "未配置当前时间段的执行科室");
|
throw new ServiceException(activitySaveDto.getAdviceDefinitionName() + "未配置当前时间段的执行科室");
|
||||||
}
|
}
|
||||||
activityIdToPositionIdMap.put(activitySaveDto.getAdviceDefinitionId(), configPositionId);
|
activityIdToPositionIdMap.put(activitySaveDto.getAdviceDefinitionId(), positionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,15 +91,13 @@
|
|||||||
os.surgery_nature AS surgeryType,
|
os.surgery_nature AS surgeryType,
|
||||||
cs.incision_level AS incisionLevel,
|
cs.incision_level AS incisionLevel,
|
||||||
fc.contract_name AS feeType,
|
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 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 adm_encounter ae ON ae.id = os.visit_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 (
|
LEFT JOIN (
|
||||||
SELECT patient_id, identifier_no
|
SELECT patient_id, identifier_no
|
||||||
FROM (
|
FROM (
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
T5.package_name,
|
T5.package_name,
|
||||||
T6.name as sub_item_name
|
T6.name as sub_item_name
|
||||||
FROM wor_activity_definition T1
|
FROM wor_activity_definition T1
|
||||||
/* 价格表使用LEFT JOIN,避免因缺少价格记录导致搜索不到项目 */
|
/* 只JOIN必要的价格表,使用INNER JOIN避免笛卡尔积 */
|
||||||
LEFT JOIN adm_charge_item_definition T2
|
INNER JOIN adm_charge_item_definition T2
|
||||||
ON T1.id = T2.instance_id
|
ON T1.id = T2.instance_id
|
||||||
AND T2.instance_table = 'wor_activity_definition'
|
AND T2.instance_table = 'wor_activity_definition'
|
||||||
/* 检验类型关联 */
|
/* 检验类型关联 */
|
||||||
|
|||||||
@@ -134,11 +134,7 @@
|
|||||||
T2.yb_no,
|
T2.yb_no,
|
||||||
T1.onset_date AS onsetDate,
|
T1.onset_date AS onsetDate,
|
||||||
T1.diagnosis_time AS diagnosisTime,
|
T1.diagnosis_time AS diagnosisTime,
|
||||||
T1.doctor AS diagnosisDoctor,
|
T1.doctor AS diagnosisDoctor
|
||||||
CASE WHEN EXISTS (
|
|
||||||
SELECT 1 FROM infectious_card T4
|
|
||||||
WHERE T4.diag_id = T2.id AND T4.delete_flag = '0' AND T4.status >= 1
|
|
||||||
) THEN 1 ELSE 0 END AS hasInfectiousReport
|
|
||||||
FROM adm_encounter_diagnosis AS T1
|
FROM adm_encounter_diagnosis AS T1
|
||||||
LEFT JOIN cli_condition AS T2 ON T2.ID = T1.condition_id
|
LEFT JOIN cli_condition AS T2 ON T2.ID = T1.condition_id
|
||||||
AND T2.delete_flag = '0' AND T2.tcm_flag = 0
|
AND T2.delete_flag = '0' AND T2.tcm_flag = 0
|
||||||
|
|||||||
@@ -45,6 +45,18 @@
|
|||||||
<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 CASE
|
||||||
|
WHEN MIN(wsr.status_enum) = 1 THEN 0
|
||||||
|
WHEN MIN(wsr.status_enum) = 2 THEN 1
|
||||||
|
WHEN MIN(wsr.status_enum) = 3 AND MAX(CASE WHEN wsr.performer_check_id IS NOT NULL THEN 1 ELSE 0 END) = 1 THEN 2
|
||||||
|
WHEN MIN(wsr.status_enum) = 3 THEN 4
|
||||||
|
WHEN MIN(wsr.status_enum) = 4 THEN 3
|
||||||
|
WHEN MIN(wsr.status_enum) = 5 OR MIN(wsr.status_enum) = 6 OR MIN(wsr.status_enum) = 7 THEN 7
|
||||||
|
WHEN MIN(wsr.status_enum) = 8 THEN 6
|
||||||
|
ELSE NULL
|
||||||
|
END = #{status}::integer
|
||||||
|
</if>
|
||||||
<if test="keyword != null and keyword != ''">
|
<if test="keyword != null and keyword != ''">
|
||||||
AND (drf.prescription_no ILIKE '%' || #{keyword} || '%'
|
AND (drf.prescription_no ILIKE '%' || #{keyword} || '%'
|
||||||
OR EXISTS (
|
OR EXISTS (
|
||||||
@@ -60,19 +72,6 @@
|
|||||||
</if>
|
</if>
|
||||||
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
GROUP BY drf.id, drf.encounter_id, drf.prescription_no, drf.name, drf.desc_json,
|
||||||
drf.requester_id, drf.create_time, ap.name
|
drf.requester_id, drf.create_time, ap.name
|
||||||
<if test="status != null and status != ''">
|
|
||||||
HAVING CASE MIN(wsr.status_enum)
|
|
||||||
WHEN 1 THEN 0
|
|
||||||
WHEN 2 THEN 1
|
|
||||||
WHEN 3 THEN 4
|
|
||||||
WHEN 4 THEN 4
|
|
||||||
WHEN 5 THEN 5
|
|
||||||
WHEN 6 THEN 5
|
|
||||||
WHEN 7 THEN 5
|
|
||||||
WHEN 8 THEN 6
|
|
||||||
ELSE NULL
|
|
||||||
END = #{status}::integer
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
<select id="getRequestFormDetail" resultType="com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto">
|
||||||
|
|||||||
@@ -692,7 +692,6 @@ async function handleFoodDiseasesCheck() {
|
|||||||
/**
|
/**
|
||||||
* 传染病报告卡处理
|
* 传染病报告卡处理
|
||||||
* 通过诊断名称自动识别并勾选传染病报告卡中的疾病
|
* 通过诊断名称自动识别并勾选传染病报告卡中的疾病
|
||||||
* 修复 Bug #519:跳过已有已提交报卡的诊断
|
|
||||||
*/
|
*/
|
||||||
function handleInfectiousDiseaseReport() {
|
function handleInfectiousDiseaseReport() {
|
||||||
// 疾病名称到报卡编码的映射(根据传染病报告卡弹窗中的疾病列表)
|
// 疾病名称到报卡编码的映射(根据传染病报告卡弹窗中的疾病列表)
|
||||||
@@ -744,9 +743,8 @@ function handleInfectiousDiseaseReport() {
|
|||||||
'手足口病': '0311',
|
'手足口病': '0311',
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取所有诊断名称对应的报卡编码,但跳过已有已提交报卡的诊断
|
// 获取所有诊断名称对应的报卡编码
|
||||||
const allSelectedDiseases = form.value.diagnosisList
|
const allSelectedDiseases = form.value.diagnosisList
|
||||||
.filter(d => d.name && d.hasInfectiousReport !== 1)
|
|
||||||
.map(d => diseaseNameToCode[d.name] || null)
|
.map(d => diseaseNameToCode[d.name] || null)
|
||||||
.filter(code => code);
|
.filter(code => code);
|
||||||
|
|
||||||
@@ -754,9 +752,9 @@ function handleInfectiousDiseaseReport() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 优先使用主诊断(同样跳过已有报卡的)
|
// 优先使用主诊断
|
||||||
const mainDiagnosis = form.value.diagnosisList.find(d => d.maindiseFlag === 1 && d.hasInfectiousReport !== 1);
|
const mainDiagnosis = form.value.diagnosisList.find(d => d.maindiseFlag === 1);
|
||||||
const firstDiagnosis = form.value.diagnosisList.find(d => d.hasInfectiousReport !== 1) || form.value.diagnosisList[0];
|
const firstDiagnosis = form.value.diagnosisList[0];
|
||||||
|
|
||||||
const diagnosisToShow = {
|
const diagnosisToShow = {
|
||||||
...(mainDiagnosis || firstDiagnosis),
|
...(mainDiagnosis || firstDiagnosis),
|
||||||
|
|||||||
@@ -1226,18 +1226,22 @@ 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 => {
|
||||||
// 响应结构: Axios拦截器对code===200返回res.data(AjaxResult体)
|
// 响应结构判定:Axios拦截器对 code===200 返回 res.data(AjaxResult体),
|
||||||
// 结构为 { code: 200, data: examApply实体, items: [明细数组] }
|
// 但某些情况下可能返回完整 Axios 响应 {data: AjaxResult}。
|
||||||
const items = Array.isArray(res.items) ? res.items : [];
|
// 用 res.code 判定是否已是 AjaxResult 体,避免二次解包导致 items 丢失。
|
||||||
const dataObj = res.data || {};
|
const isAjaxResult = res && typeof res === 'object' && res.code !== undefined;
|
||||||
|
const ajaxBody = isAjaxResult ? res : (res.data || res);
|
||||||
|
|
||||||
// 先填充表单字段
|
// items 在 AjaxResult 顶层,data 字段是 ExamApply 实体
|
||||||
if (dataObj && typeof dataObj === 'object') Object.assign(form, dataObj);
|
const rawItems = Array.isArray(ajaxBody.items) ? ajaxBody.items : [];
|
||||||
|
const detailData = ajaxBody.data || {};
|
||||||
|
|
||||||
if (items.length > 0) {
|
if (detailData && typeof detailData === 'object') Object.assign(form, detailData);
|
||||||
|
|
||||||
|
if (rawItems.length > 0) {
|
||||||
try {
|
try {
|
||||||
// 为每个项目加载检查方法
|
// 为每个项目加载检查方法
|
||||||
const itemsWithMethods = await Promise.all(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,
|
||||||
@@ -1256,7 +1260,7 @@ function handleRowClick(row) {
|
|||||||
if (m.bodyPartCode) {
|
if (m.bodyPartCode) {
|
||||||
try {
|
try {
|
||||||
const methodRes = await searchCheckMethod({ checkType: m.bodyPartCode });
|
const methodRes = await searchCheckMethod({ checkType: m.bodyPartCode });
|
||||||
// 正确解析 API 返回结构
|
// Bug #384修复: 正确解析 API 返回结构
|
||||||
let methodData = methodRes?.data?.data || methodRes?.data || methodRes?.rows || methodRes;
|
let methodData = methodRes?.data?.data || methodRes?.data || methodRes?.rows || methodRes;
|
||||||
if (!Array.isArray(methodData) && methodRes?.data && Array.isArray(methodRes.data.data)) {
|
if (!Array.isArray(methodData) && methodRes?.data && Array.isArray(methodRes.data.data)) {
|
||||||
methodData = methodRes.data.data;
|
methodData = methodRes.data.data;
|
||||||
@@ -1266,15 +1270,16 @@ function handleRowClick(row) {
|
|||||||
id: md.id,
|
id: md.id,
|
||||||
name: md.name,
|
name: md.name,
|
||||||
code: md.code,
|
code: md.code,
|
||||||
price: m.itemFee || 0,
|
price: m.itemFee || 0, // fallback 到已保存的价格
|
||||||
packageName: md.packageName || '',
|
packageName: md.packageName || '',
|
||||||
packageId: md.packageId || null,
|
packageId: md.packageId || null,
|
||||||
packagePrice: md.packagePrice || null,
|
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 => String(md.id) === String(m.checkMethodId)) || null;
|
item.selectedMethod = item.methods.find(md => md.id === m.checkMethodId) || null;
|
||||||
|
// 从已保存的方法中获取套餐信息
|
||||||
if (item.selectedMethod?.packageId) {
|
if (item.selectedMethod?.packageId) {
|
||||||
item.isPackage = true;
|
item.isPackage = true;
|
||||||
item.packageId = item.selectedMethod.packageId;
|
item.packageId = item.selectedMethod.packageId;
|
||||||
@@ -1290,27 +1295,22 @@ function handleRowClick(row) {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('加载检查方法失败', err);
|
console.error('加载检查方法失败', err);
|
||||||
|
// 单个项目加载失败不影响其他项目,继续返回 item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
}));
|
}));
|
||||||
// Bug #408修复: 确保明细数据正确加载到selectedItems
|
|
||||||
selectedItems.value = itemsWithMethods;
|
selectedItems.value = itemsWithMethods;
|
||||||
// 加载套餐明细(单个失败不影响其他项目和明细显示)
|
|
||||||
for (const it of selectedItems.value) {
|
for (const it of selectedItems.value) {
|
||||||
if (getPackageCarrier(it)?.packageId) {
|
if (getPackageCarrier(it)?.packageId) {
|
||||||
try {
|
await loadPackageDetailsForItem(it);
|
||||||
await loadPackageDetailsForItem(it);
|
|
||||||
} catch (e) {
|
|
||||||
console.error('加载套餐明细失败:', it.name, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
it.expanded = !!getPackageCarrier(it)?.packageId;
|
it.expanded = !!getPackageCarrier(it)?.packageId;
|
||||||
}
|
}
|
||||||
syncCategoryChecked();
|
syncCategoryChecked();
|
||||||
// Bug #384修复: 回充后更新检查方法显示
|
// Bug #384修复: 回充后更新检查方法显示
|
||||||
updateMethodDisplay();
|
updateMethodDisplay();
|
||||||
// Bug #408修复: 加载申请单详情后自动切换到检查明细页签,确保已加载的明细数据可见
|
// 修复【#408】:加载申请单详情后自动切换到检查明细页签,确保已加载的明细数据可见
|
||||||
activeDetailTab.value = 'applyDetail';
|
activeDetailTab.value = 'applyDetail';
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('加载申请单详情失败', err);
|
console.error('加载申请单详情失败', err);
|
||||||
@@ -1362,9 +1362,8 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
existingItem.isPackage = true;
|
existingItem.isPackage = true;
|
||||||
existingItem.packageId = method.packageId;
|
existingItem.packageId = method.packageId;
|
||||||
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
|
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
|
||||||
existingItem.expanded = true; // #428修复: 有套餐时默认展开,展示套餐明细
|
|
||||||
// 预加载套餐明细
|
// 预加载套餐明细
|
||||||
await loadPackageDetailsForItem(existingItem);
|
loadPackageDetailsForItem(existingItem);
|
||||||
}
|
}
|
||||||
updateMethodDisplay();
|
updateMethodDisplay();
|
||||||
return;
|
return;
|
||||||
@@ -1400,10 +1399,9 @@ async function handleMethodSelect(checked, method, cat) {
|
|||||||
};
|
};
|
||||||
selectedItems.value.push(newItem);
|
selectedItems.value.push(newItem);
|
||||||
|
|
||||||
// 如果是套餐,预加载套餐明细并默认展开
|
// 如果是套餐,预加载套餐明细
|
||||||
if (newItem.isPackage && newItem.packageId) {
|
if (newItem.isPackage && newItem.packageId) {
|
||||||
newItem.expanded = true;
|
loadPackageDetailsForItem(newItem);
|
||||||
await loadPackageDetailsForItem(newItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自动回填执行科室
|
// 自动回填执行科室
|
||||||
@@ -1525,10 +1523,7 @@ async function handleItemSelect(checked, item, cat) {
|
|||||||
// Bug #384修复 + #426修复: 展开/收起项目卡片
|
// Bug #384修复 + #426修复: 展开/收起项目卡片
|
||||||
async function toggleItemExpand(item) {
|
async function toggleItemExpand(item) {
|
||||||
item.expanded = !item.expanded;
|
item.expanded = !item.expanded;
|
||||||
const carrier = getPackageCarrier(item);
|
if (item.expanded && (item.isPackage || item.packageName) && (!item.packageDetails || item.packageDetails.length === 0) && !item.packageDetailsLoading) {
|
||||||
const hasDetails = Array.isArray(item.packageDetailsDisplay) && item.packageDetailsDisplay.length > 0
|
|
||||||
|| Array.isArray(carrier?.packageDetails) && carrier.packageDetails.length > 0;
|
|
||||||
if (item.expanded && (item.isPackage || item.packageName) && !hasDetails && !item.packageDetailsLoading) {
|
|
||||||
await loadPackageDetailsForItem(item);
|
await loadPackageDetailsForItem(item);
|
||||||
}
|
}
|
||||||
if (item.expanded && shouldShowPackageBody(item)) {
|
if (item.expanded && shouldShowPackageBody(item)) {
|
||||||
@@ -1582,7 +1577,7 @@ async function loadMethodPackageDetails(item, method) {
|
|||||||
const packageId = packages[0].id;
|
const packageId = packages[0].id;
|
||||||
// 查询套餐明细
|
// 查询套餐明细
|
||||||
const detailRes = await request({
|
const detailRes = await request({
|
||||||
url: `/system/check-type/package/${packageId}/details`,
|
url: `/system/package/${packageId}/details`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
if (detailRes.code === 200 && detailRes.data) {
|
if (detailRes.code === 200 && detailRes.data) {
|
||||||
|
|||||||
@@ -289,62 +289,43 @@ function getList() {
|
|||||||
return obj;
|
return obj;
|
||||||
});
|
});
|
||||||
form.value.diagnosisList = datas;
|
form.value.diagnosisList = datas;
|
||||||
// 去重:按 conditionId 去重,防止后端重复插入导致重复记录
|
// form.value.diagnosisList = res.data;
|
||||||
deduplicateDiagnosisList();
|
|
||||||
emits('diagnosisSave', false);
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
||||||
console.log('getTcmDiagnosis=======>', JSON.stringify(res.data?.illness));
|
console.log('getTcmDiagnosis=======>', JSON.stringify(res.data.illness));
|
||||||
|
|
||||||
if (res.code == 200 && res.data?.illness?.length > 0) {
|
if (res.code == 200) {
|
||||||
diagnosisNetDatas.value = res.data.illness;
|
if (res.data.illness.length > 0) {
|
||||||
res.data.illness.forEach((item, index) => {
|
diagnosisNetDatas.value = res.data.illness;
|
||||||
newList.push({
|
res.data.illness.forEach((item, index) => {
|
||||||
name: item.name + '-' + (res.data.symptom?.[index]?.name || ''),
|
newList.push({
|
||||||
ybNo: item.ybNo,
|
name: item.name + '-' + (res.data.symptom[index]?.name || ''),
|
||||||
medTypeCode: item.medTypeCode,
|
ybNo: item.ybNo,
|
||||||
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
medTypeCode: item.medTypeCode,
|
||||||
diagnosisTime: new Date().toLocaleString('zh-CN')
|
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
|
||||||
|
diagnosisTime: new Date().toLocaleString('zh-CN')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// 将新数据添加到现有列表中
|
// 将新数据添加到现有列表中
|
||||||
form.value.diagnosisList.push(...newList);
|
form.value.diagnosisList.push(...newList);
|
||||||
|
|
||||||
// 重新排序整个列表
|
// 重新排序整个列表
|
||||||
form.value.diagnosisList.sort((a, b) => {
|
form.value.diagnosisList.sort((a, b) => {
|
||||||
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
const aNo = typeof a.diagSrtNo === 'number' ? a.diagSrtNo : 9999;
|
||||||
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
const bNo = typeof b.diagSrtNo === 'number' ? b.diagSrtNo : 9999;
|
||||||
return aNo - bNo;
|
return aNo - bNo;
|
||||||
});
|
});
|
||||||
// TCM 数据添加后也去重
|
}
|
||||||
deduplicateDiagnosisList();
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
emits('diagnosisSave', false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
getTree();
|
getTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 诊断列表去重:按 ybNo + name 组合去重,保留第一条记录
|
|
||||||
* 防止后端 saveOrUpdate 在删除后误 INSERT 导致重复
|
|
||||||
*/
|
|
||||||
function deduplicateDiagnosisList() {
|
|
||||||
const seen = new Set();
|
|
||||||
const dedupedList = [];
|
|
||||||
for (const item of form.value.diagnosisList) {
|
|
||||||
// 使用 ybNo 和 name 组合作为唯一标识(中医诊断没有 ybNo,用 name 去重)
|
|
||||||
const key = item.ybNo ? `${item.ybNo}` : `name_${item.name}`;
|
|
||||||
if (!seen.has(key)) {
|
|
||||||
seen.add(key);
|
|
||||||
dedupedList.push(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
form.value.diagnosisList = dedupedList;
|
|
||||||
}
|
|
||||||
|
|
||||||
init();
|
init();
|
||||||
function init() {
|
function init() {
|
||||||
diagnosisInit().then((res) => {
|
diagnosisInit().then((res) => {
|
||||||
@@ -622,18 +603,6 @@ function handleSaveDiagnosis() {
|
|||||||
return aNo - bNo;
|
return aNo - bNo;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 步骤1.5:确保每条诊断都有诊断医生和诊断时间(元数据补全)
|
|
||||||
const doctorName = props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name;
|
|
||||||
const now = new Date().toLocaleString('zh-CN');
|
|
||||||
sortedList.forEach((item) => {
|
|
||||||
if (!item.diagnosisDoctor) {
|
|
||||||
item.diagnosisDoctor = doctorName;
|
|
||||||
}
|
|
||||||
if (!item.diagnosisTime) {
|
|
||||||
item.diagnosisTime = now;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 步骤2:重新分配连续的序号(从1开始)
|
// 步骤2:重新分配连续的序号(从1开始)
|
||||||
sortedList.forEach((item, index) => {
|
sortedList.forEach((item, index) => {
|
||||||
item.diagSrtNo = index + 1; // 这里是关键!把”诊断排序”改成新顺序
|
item.diagSrtNo = index + 1; // 这里是关键!把”诊断排序”改成新顺序
|
||||||
|
|||||||
@@ -325,12 +325,7 @@ const projectWithDepartment = (selectProjectIds, type) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (findItem && isRelease) {
|
if (findItem && isRelease) {
|
||||||
// 提交时若用户已选「发往科室」,不得用项目默认执行科室覆盖
|
form.targetDepartment = findItem.id;
|
||||||
if (type === 2 && manualDept) {
|
|
||||||
form.targetDepartment = manualDept;
|
|
||||||
} else {
|
|
||||||
form.targetDepartment = findItem.id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isRelease;
|
return isRelease;
|
||||||
@@ -397,7 +392,7 @@ const submit = () => {
|
|||||||
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
||||||
unitPrice: item.priceList[0].price /** 单价 */,
|
unitPrice: item.priceList[0].price /** 单价 */,
|
||||||
totalPrice: item.priceList[0].price /** 总价 */,
|
totalPrice: item.priceList[0].price /** 总价 */,
|
||||||
positionId: form.targetDepartment || item.positionId, // 用户指定发往科室优先于项目默认执行科室
|
positionId: item.positionId || form.targetDepartment, //执行科室id,未配置时使用用户手动选择的科室
|
||||||
ybClassEnum: item.ybClassEnum, //类别医保编码
|
ybClassEnum: item.ybClassEnum, //类别医保编码
|
||||||
conditionId: item.conditionId, //诊断ID
|
conditionId: item.conditionId, //诊断ID
|
||||||
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
||||||
|
|||||||
@@ -1503,16 +1503,16 @@ function handleSaveBatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setValue(row) {
|
function setValue(row) {
|
||||||
// 构造单位列表,确保 value 始终为 String 类型,避免 el-select 值类型不匹配
|
// 构造单位列表
|
||||||
unitCodeList.value = [
|
unitCodeList.value = [
|
||||||
{ value: String(row.unitCode ?? ''), label: row.unitCode_dictText, type: 'unit' },
|
{ value: row.unitCode, label: row.unitCode_dictText, type: 'unit' },
|
||||||
{
|
{
|
||||||
value: String(row.doseUnitCode ?? ''),
|
value: row.doseUnitCode,
|
||||||
label: row.doseUnitCode_dictText,
|
label: row.doseUnitCode_dictText,
|
||||||
type: 'dose',
|
type: 'dose',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: String(row.minUnitCode ?? ''),
|
value: row.minUnitCode,
|
||||||
label: row.minUnitCode_dictText,
|
label: row.minUnitCode_dictText,
|
||||||
type: 'minUnit',
|
type: 'minUnit',
|
||||||
},
|
},
|
||||||
@@ -1577,9 +1577,9 @@ function setValue(row) {
|
|||||||
orgName: row.adviceType != 3 ? undefined : (findOrgName(row.orgId || row.positionId || patientInfo.value?.inHospitalOrgId) || row.orgName || patientInfo.value?.inHospitalOrgName || ''),
|
orgName: row.adviceType != 3 ? undefined : (findOrgName(row.orgId || row.positionId || patientInfo.value?.inHospitalOrgId) || row.orgName || patientInfo.value?.inHospitalOrgName || ''),
|
||||||
// dose: undefined, Removed to preserve dose value from group package
|
// dose: undefined, Removed to preserve dose value from group package
|
||||||
unitCodeList: unitCodeList.value,
|
unitCodeList: unitCodeList.value,
|
||||||
doseUnitCode: String(row.doseUnitCode ?? ''),
|
doseUnitCode: row.doseUnitCode,
|
||||||
minUnitCode: String(row.minUnitCode ?? ''),
|
minUnitCode: row.minUnitCode,
|
||||||
unitCode: row.partAttributeEnum == 1 ? String(row.minUnitCode ?? '') : String(row.unitCode ?? ''),
|
unitCode: row.partAttributeEnum == 1 ? row.minUnitCode : row.unitCode,
|
||||||
categoryEnum: row.categoryCode,
|
categoryEnum: row.categoryCode,
|
||||||
definitionId: row.chargeItemDefinitionId,
|
definitionId: row.chargeItemDefinitionId,
|
||||||
executeNum: 1,
|
executeNum: 1,
|
||||||
@@ -1595,10 +1595,6 @@ function setValue(row) {
|
|||||||
? new Decimal(selectedStock.price).div(row.partPercent).toFixed(6)
|
? new Decimal(selectedStock.price).div(row.partPercent).toFixed(6)
|
||||||
: prevRow.minUnitPrice,
|
: prevRow.minUnitPrice,
|
||||||
positionName: selectedStock?.locationName,
|
positionName: selectedStock?.locationName,
|
||||||
// 🔧 Bug #523 修复:初始化 totalPrice 为 0,避免总金额列显示为横杠
|
|
||||||
totalPrice: row.quantity
|
|
||||||
? new Decimal(row.quantity).mul(selectedStock?.price ?? 0).toFixed(6)
|
|
||||||
: '0',
|
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
|
|||||||
@@ -1057,8 +1057,8 @@ function confirmCharge() {
|
|||||||
params.recordingDate = formData.value.recordingDate || moment(new Date()).format('YYYY-MM-DD');
|
params.recordingDate = formData.value.recordingDate || moment(new Date()).format('YYYY-MM-DD');
|
||||||
|
|
||||||
addVitalSigns(params).then(res => {
|
addVitalSigns(params).then(res => {
|
||||||
|
console.log('保存成功:', res);
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.msgSuccess('保存成功');
|
|
||||||
// 保存成功后刷新列表
|
// 保存成功后刷新列表
|
||||||
getPatientList();
|
getPatientList();
|
||||||
// 清空表单
|
// 清空表单
|
||||||
@@ -1087,6 +1087,8 @@ function confirmCharge() {
|
|||||||
urineVolume: '',
|
urineVolume: '',
|
||||||
stoolVolume: '',
|
stoolVolume: '',
|
||||||
};
|
};
|
||||||
|
// 保存成功后关闭弹窗
|
||||||
|
closeDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1131,15 +1131,15 @@ function handleLocationClick(item, row, index) {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
const list = res.data || [];
|
const list = res.data || [];
|
||||||
const d = pickBestOrgQuantityRow(list);
|
const d = pickBestOrgQuantityRow(list);
|
||||||
|
const strictOk = d && Number(d.orgQuantity ?? 0) > 0;
|
||||||
// 严格批号查询有库存(orgQuantity > 0)
|
if (strictOk) {
|
||||||
if (d && Number(d.orgQuantity ?? 0) > 0) {
|
|
||||||
applyFromDto(d, false);
|
applyFromDto(d, false);
|
||||||
|
if (Number(r.totalQuantity) <= 0) {
|
||||||
|
proxy.$message.warning('仓库数量为0,无法调用!');
|
||||||
|
}
|
||||||
persistStore();
|
persistStore();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 严格查询无库存或数量为0 → 回退到非严格查询(查同仓库其他批号)
|
|
||||||
if (lotTrimmed) {
|
if (lotTrimmed) {
|
||||||
return runGet(false).then((res2) => {
|
return runGet(false).then((res2) => {
|
||||||
const list2 = res2.data || [];
|
const list2 = res2.data || [];
|
||||||
@@ -1157,8 +1157,6 @@ function handleLocationClick(item, row, index) {
|
|||||||
persistStore();
|
persistStore();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 没有指定批号,直接提示
|
|
||||||
r.totalQuantity = 0;
|
r.totalQuantity = 0;
|
||||||
r.price = 0;
|
r.price = 0;
|
||||||
proxy.$message.warning('仓库数量为0,无法调用!');
|
proxy.$message.warning('仓库数量为0,无法调用!');
|
||||||
|
|||||||
Reference in New Issue
Block a user