Compare commits
32 Commits
赵云-fix-476
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 51ae3aad29 | |||
| d984b89967 | |||
|
|
b9aabd53ce | ||
|
|
73ed5e1d33 | ||
|
|
d3cd122656 | ||
|
|
0930fbae93 | ||
|
|
cace025d14 | ||
|
|
91f29bf693 | ||
| a6337ae397 | |||
|
|
c2e089c0d2 | ||
|
|
e65f12125b | ||
|
|
12d0733c0c | ||
|
|
610fff704a | ||
|
|
0aa7dd9b82 | ||
|
|
5946c1ea4b | ||
|
|
8d905c9844 | ||
|
|
49fc905316 | ||
|
|
3ee09b22c7 | ||
|
|
6b4f897b9c | ||
|
|
848a55cf23 | ||
|
|
4ae4421827 | ||
|
|
4138dc39f6 | ||
|
|
718e7a90c5 | ||
|
|
68c682ad49 | ||
|
|
c7368db889 | ||
|
|
e64370bb67 | ||
|
|
078439245b | ||
|
|
1124b1010d | ||
|
|
f41b86a143 | ||
|
|
d3310ade51 | ||
|
|
1dbf7859ea | ||
|
|
4e7e79d9c0 |
@@ -1,10 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
# ============================================================
|
|
||||||
# Husky Pre-commit Hook - HIS项目
|
|
||||||
# 配置: 关羽 | 日期: 2026-04-24
|
|
||||||
# 功能: 提交前检查(已禁用)
|
|
||||||
# ============================================================
|
|
||||||
|
|
||||||
# 🔧 已禁用所有检查,直接允许提交
|
|
||||||
echo "⏭️ [Pre-commit] 检查已禁用,允许提交"
|
|
||||||
exit 0
|
|
||||||
@@ -83,6 +83,9 @@ public class InfectiousCardDto {
|
|||||||
/** 病例分类 */
|
/** 病例分类 */
|
||||||
private String diseaseType;
|
private String diseaseType;
|
||||||
|
|
||||||
|
/** 病例分类 */
|
||||||
|
private Integer caseClass;
|
||||||
|
|
||||||
/** 发病日期 */
|
/** 发病日期 */
|
||||||
private LocalDate onsetDate;
|
private LocalDate onsetDate;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.core.common.core.domain.R;
|
|||||||
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
||||||
import com.openhis.web.doctorstation.dto.AdviceSaveParam;
|
import com.openhis.web.doctorstation.dto.AdviceSaveParam;
|
||||||
import com.openhis.web.doctorstation.dto.OrderBindInfoDto;
|
import com.openhis.web.doctorstation.dto.OrderBindInfoDto;
|
||||||
|
import com.openhis.web.doctorstation.dto.SurgeryItemDto;
|
||||||
import com.openhis.web.doctorstation.dto.UpdateGroupIdParam;
|
import com.openhis.web.doctorstation.dto.UpdateGroupIdParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -134,4 +135,18 @@ public interface IDoctorStationAdviceAppService {
|
|||||||
* @return 已配置的药品类别编码列表
|
* @return 已配置的药品类别编码列表
|
||||||
*/
|
*/
|
||||||
R<?> getConfiguredCategories(Long organizationId);
|
R<?> getConfiguredCategories(Long organizationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术项目专用分页查询(仅手术 + 定价,无库存/草稿库存/取药科室等无关逻辑)
|
||||||
|
*
|
||||||
|
* @param organizationId 科室ID(可选)
|
||||||
|
* @param pageNo 当前页
|
||||||
|
* @param pageSize 每页条数
|
||||||
|
* @param searchKey 模糊查询关键字(可选)
|
||||||
|
* @return 手术项目分页数据(含价格信息)
|
||||||
|
*/
|
||||||
|
IPage<SurgeryItemDto> getSurgeryPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey);
|
||||||
|
|
||||||
|
IPage<SurgeryItemDto> getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()) {
|
||||||
@@ -1111,7 +1107,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
if (is_save) {
|
if (is_save) {
|
||||||
medicationRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
medicationRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||||
}
|
}
|
||||||
medicationRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
medicationRequest.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
medicationRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
medicationRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||||
medicationRequest.setExecuteNum(adviceSaveDto.getExecuteNum()); // 执行次数
|
medicationRequest.setExecuteNum(adviceSaveDto.getExecuteNum()); // 执行次数
|
||||||
medicationRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
medicationRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||||
@@ -1157,7 +1155,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id
|
chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id
|
||||||
chargeItem.setStatusEnum(2); // 已生成医嘱
|
chargeItem.setStatusEnum(2); // 已生成医嘱
|
||||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo()));
|
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo()));
|
||||||
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
chargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号
|
chargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号
|
||||||
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
||||||
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
|
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
|
||||||
@@ -1251,7 +1251,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
deviceRequest.setCreateBy(currentUsername);
|
deviceRequest.setCreateBy(currentUsername);
|
||||||
deviceRequest.setCreateTime(curDate);
|
deviceRequest.setCreateTime(curDate);
|
||||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
||||||
deviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
deviceRequest.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||||
deviceRequest.setQuantity(boundDevice.getQuantity());
|
deviceRequest.setQuantity(boundDevice.getQuantity());
|
||||||
deviceRequest.setUnitCode(boundDevice.getUnitCode());
|
deviceRequest.setUnitCode(boundDevice.getUnitCode());
|
||||||
deviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum());
|
deviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum());
|
||||||
@@ -1317,7 +1319,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
deviceChargeItem.setCreateTime(curDate);
|
deviceChargeItem.setCreateTime(curDate);
|
||||||
deviceChargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());
|
deviceChargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());
|
||||||
deviceChargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(deviceRequest.getBusNo()));
|
deviceChargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(deviceRequest.getBusNo()));
|
||||||
deviceChargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
deviceChargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue());
|
||||||
deviceChargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号,与药品一致
|
deviceChargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号,与药品一致
|
||||||
deviceChargeItem.setPatientId(adviceSaveDto.getPatientId());
|
deviceChargeItem.setPatientId(adviceSaveDto.getPatientId());
|
||||||
deviceChargeItem.setContextEnum(ChargeItemContext.DEVICE.getValue()); // 耗材类型
|
deviceChargeItem.setContextEnum(ChargeItemContext.DEVICE.getValue()); // 耗材类型
|
||||||
@@ -1546,7 +1550,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
if (is_save) {
|
if (is_save) {
|
||||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4));
|
||||||
}
|
}
|
||||||
deviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
deviceRequest.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
deviceRequest.setPrescriptionNo(adviceSaveDto.getSourceBillNo()); // 来源业务单据号(手术单号)
|
deviceRequest.setPrescriptionNo(adviceSaveDto.getSourceBillNo()); // 来源业务单据号(手术单号)
|
||||||
deviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
deviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||||
deviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
deviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||||
@@ -1609,7 +1615,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
chargeItem.setCreateTime(curDate); // 补全创建时间
|
chargeItem.setCreateTime(curDate); // 补全创建时间
|
||||||
chargeItem.setStatusEnum(2); // 已生成医嘱
|
chargeItem.setStatusEnum(2); // 已生成医嘱
|
||||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(deviceRequest.getBusNo()));
|
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(deviceRequest.getBusNo()));
|
||||||
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
||||||
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
|
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
|
||||||
chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
||||||
@@ -1910,7 +1918,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
if (is_save) {
|
if (is_save) {
|
||||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4));
|
||||||
}
|
}
|
||||||
serviceRequest.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
serviceRequest.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
serviceRequest.setPrescriptionNo(adviceSaveDto.getSourceBillNo()); // 来源业务单据号(手术单号)
|
serviceRequest.setPrescriptionNo(adviceSaveDto.getSourceBillNo()); // 来源业务单据号(手术单号)
|
||||||
serviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
serviceRequest.setQuantity(adviceSaveDto.getQuantity()); // 请求数量
|
||||||
serviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
serviceRequest.setUnitCode(adviceSaveDto.getUnitCode()); // 请求单位编码
|
||||||
@@ -1961,7 +1971,9 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
chargeItem.setCreateTime(curDate); // 补全创建时间
|
chargeItem.setCreateTime(curDate); // 补全创建时间
|
||||||
chargeItem.setStatusEnum(2); // 已生成医嘱
|
chargeItem.setStatusEnum(2); // 已生成医嘱
|
||||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(serviceRequest.getBusNo()));
|
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(serviceRequest.getBusNo()));
|
||||||
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum() != null
|
||||||
|
? adviceSaveDto.getGenerateSourceEnum()
|
||||||
|
: GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源
|
||||||
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
|
||||||
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
|
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
|
||||||
chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
chargeItem.setEncounterId(adviceSaveDto.getEncounterId()); // 就诊id
|
||||||
@@ -2107,9 +2119,11 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
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(),
|
||||||
sourceEnum, sourceBillNo);
|
sourceEnum, sourceBillNo);
|
||||||
// 🔧 修复 Bug #444: 移除手术计费场景的药品过滤。
|
// 手术计费场景:sourceBillNo 不为空时,过滤掉药品(1),保留耗材(2)和诊疗(3/6)
|
||||||
// 原过滤会导致门诊手术医嘱界面无法获取手术计费创建的药品记录。
|
if (sourceBillNo != null && !sourceBillNo.isEmpty()) {
|
||||||
// 前端各组件已根据自身业务逻辑做了正确的 adviceType 过滤。
|
requestBaseInfo.removeIf(dto -> dto.getAdviceType() != null
|
||||||
|
&& dto.getAdviceType() == 1);
|
||||||
|
}
|
||||||
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
for (RequestBaseDto requestBaseDto : requestBaseInfo) {
|
||||||
// 请求状态
|
// 请求状态
|
||||||
requestBaseDto
|
requestBaseDto
|
||||||
@@ -2442,4 +2456,30 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
|||||||
return R.ok(categoryCodes);
|
return R.ok(categoryCodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术项目专用分页查询(仅手术 + 定价,无库存/草稿库存/取药科室等无关逻辑)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<SurgeryItemDto> getSurgeryPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey) {
|
||||||
|
log.info("getSurgeryPage 开始: orgId={}, page={}/{}, searchKey={}", organizationId, pageNo, pageSize, searchKey);
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
IPage<SurgeryItemDto> result = doctorStationAdviceAppMapper.getSurgeryPage(
|
||||||
|
new Page<>(pageNo, pageSize),
|
||||||
|
PublicationStatus.ACTIVE.getValue(),
|
||||||
|
organizationId,
|
||||||
|
searchKey);
|
||||||
|
log.info("getSurgeryPage 完成: {}ms, total={}, records={}", System.currentTimeMillis() - start, result.getTotal(), result.getRecords().size());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<SurgeryItemDto> getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey) {
|
||||||
|
IPage<SurgeryItemDto> result = doctorStationAdviceAppMapper.getExaminationPage(
|
||||||
|
new Page<>(pageNo, pageSize),
|
||||||
|
PublicationStatus.ACTIVE.getValue(),
|
||||||
|
organizationId,
|
||||||
|
searchKey);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,8 +246,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());
|
||||||
|
|||||||
@@ -203,4 +203,31 @@ public class DoctorStationAdviceController {
|
|||||||
return iDoctorStationAdviceAppService.getConfiguredCategories(organizationId);
|
return iDoctorStationAdviceAppService.getConfiguredCategories(organizationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术项目专用分页查询(仅手术 + 定价,无库存/草稿库存/取药科室等无关逻辑)
|
||||||
|
*
|
||||||
|
* @param organizationId 科室ID(可选)
|
||||||
|
* @param pageNo 当前页
|
||||||
|
* @param pageSize 每页条数
|
||||||
|
* @param searchKey 模糊查询关键字(可选)
|
||||||
|
* @return 手术项目分页数据(含价格信息)
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/surgery-page")
|
||||||
|
public R<?> getSurgeryPage(
|
||||||
|
@RequestParam(value = "organizationId", required = false) Long organizationId,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "500") Integer pageSize,
|
||||||
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey) {
|
||||||
|
return R.ok(iDoctorStationAdviceAppService.getSurgeryPage(organizationId, pageNo, pageSize, searchKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/examination-page")
|
||||||
|
public R<?> getExaminationPage(
|
||||||
|
@RequestParam(value = "organizationId", required = false) Long organizationId,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "500") Integer pageSize,
|
||||||
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey) {
|
||||||
|
return R.ok(iDoctorStationAdviceAppService.getExaminationPage(organizationId, pageNo, pageSize, searchKey));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,12 +112,15 @@ public class InfectiousDiseaseReportDto {
|
|||||||
private Integer caseClass;
|
private Integer caseClass;
|
||||||
|
|
||||||
/** 发病日期(默认诊断时间,病原携带者填初检日期) */
|
/** 发病日期(默认诊断时间,病原携带者填初检日期) */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate onsetDate;
|
private LocalDate onsetDate;
|
||||||
|
|
||||||
/** 诊断日期(精确到小时) */
|
/** 诊断日期(精确到小时) */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||||
private LocalDateTime diagDate;
|
private LocalDateTime diagDate;
|
||||||
|
|
||||||
/** 死亡日期(死亡病例必填) */
|
/** 死亡日期(死亡病例必填) */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate deathDate;
|
private LocalDate deathDate;
|
||||||
|
|
||||||
/** 订正病名(订正报告必填) */
|
/** 订正病名(订正报告必填) */
|
||||||
@@ -136,6 +139,7 @@ public class InfectiousDiseaseReportDto {
|
|||||||
private String reportDoc;
|
private String reportDoc;
|
||||||
|
|
||||||
/** 填卡日期 */
|
/** 填卡日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate reportDate;
|
private LocalDate reportDate;
|
||||||
|
|
||||||
/** 报卡名称代码 1-中华人民共和国传染病报告卡 */
|
/** 报卡名称代码 1-中华人民共和国传染病报告卡 */
|
||||||
@@ -160,4 +164,4 @@ public class InfectiousDiseaseReportDto {
|
|||||||
/** 医生ID */
|
/** 医生ID */
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long doctorId;
|
private Long doctorId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.openhis.web.doctorstation.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术项目选择器专用 DTO(不含 @Dict 注解,绕过 DictAspect 的 Redis 字典翻译)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SurgeryItemDto {
|
||||||
|
|
||||||
|
/** 医嘱定义ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long adviceDefinitionId;
|
||||||
|
|
||||||
|
/** 手术名称 */
|
||||||
|
private String adviceName;
|
||||||
|
|
||||||
|
/** 所属科室ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/** 执行科室ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long positionId;
|
||||||
|
|
||||||
|
/** 费用定价主表ID(用于提交时关联价格) */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long chargeItemDefinitionId;
|
||||||
|
|
||||||
|
/** 单价(直接从定价主表取,无需嵌套 priceList) */
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/** 单位编码 */
|
||||||
|
private String unitCode;
|
||||||
|
|
||||||
|
/** 单位编码字典文本(前端用于显示单位) */
|
||||||
|
private String unitCodeDictText;
|
||||||
|
}
|
||||||
@@ -185,4 +185,23 @@ public interface DoctorStationAdviceAppMapper {
|
|||||||
*/
|
*/
|
||||||
Long getDefaultAccountId(@Param("encounterId") Long encounterId);
|
Long getDefaultAccountId(@Param("encounterId") Long encounterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术项目专用分页查询(仅手术 + 定价,无库存/草稿库存/取药科室等无关逻辑)
|
||||||
|
*
|
||||||
|
* @param page 分页参数
|
||||||
|
* @param statusEnum 启用状态
|
||||||
|
* @param organizationId 科室ID(可选,用于过滤已配置的手术项目)
|
||||||
|
* @param searchKey 模糊查询关键字(可选)
|
||||||
|
* @return 手术项目分页数据
|
||||||
|
*/
|
||||||
|
IPage<SurgeryItemDto> getSurgeryPage(@Param("page") Page<SurgeryItemDto> page,
|
||||||
|
@Param("statusEnum") Integer statusEnum,
|
||||||
|
@Param("organizationId") Long organizationId,
|
||||||
|
@Param("searchKey") String searchKey);
|
||||||
|
|
||||||
|
IPage<SurgeryItemDto> getExaminationPage(@Param("page") Page<SurgeryItemDto> page,
|
||||||
|
@Param("statusEnum") Integer statusEnum,
|
||||||
|
@Param("organizationId") Long organizationId,
|
||||||
|
@Param("searchKey") String searchKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,8 +178,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
inpatientAdviceParam.setEncounterIds(null);
|
inpatientAdviceParam.setEncounterIds(null);
|
||||||
Integer exeStatus = inpatientAdviceParam.getExeStatus();
|
Integer exeStatus = inpatientAdviceParam.getExeStatus();
|
||||||
inpatientAdviceParam.setExeStatus(null);
|
inpatientAdviceParam.setExeStatus(null);
|
||||||
// requestStatus由前端tab控制,后端SQL已通过CASE条件处理校对状态过滤,无需再作为SQL条件
|
// requestStatus由前端tab传入,通过QueryWrapper自动添加到SQL外层WHERE过滤
|
||||||
inpatientAdviceParam.setRequestStatus(null);
|
|
||||||
// 构建查询条件
|
// 构建查询条件
|
||||||
QueryWrapper<InpatientAdviceParam> queryWrapper
|
QueryWrapper<InpatientAdviceParam> queryWrapper
|
||||||
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
= HisQueryUtils.buildQueryWrapper(inpatientAdviceParam, null, null, null);
|
||||||
@@ -368,7 +367,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
|||||||
.in(MedicationDispense::getMedReqId, medReqIds)
|
.in(MedicationDispense::getMedReqId, medReqIds)
|
||||||
.eq(MedicationDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue()));
|
.eq(MedicationDispense::getStatusEnum, DispenseStatus.COMPLETED.getValue()));
|
||||||
if (!dispenseList.isEmpty()) {
|
if (!dispenseList.isEmpty()) {
|
||||||
return R.fail("该医嘱已发药,无法退回");
|
return R.fail("该药品已由药房发放,请先执行退药处理,不可直接退回");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ public class InpatientAdviceDto {
|
|||||||
/**
|
/**
|
||||||
* 药品/服务类型
|
* 药品/服务类型
|
||||||
*/
|
*/
|
||||||
private Integer categoryCode;
|
private String categoryCode;
|
||||||
/**
|
/**
|
||||||
* 执行科室
|
* 执行科室
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -90,16 +90,13 @@
|
|||||||
drf.create_time AS apply_time,
|
drf.create_time AS apply_time,
|
||||||
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,
|
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'
|
||||||
/* 检验类型关联 */
|
/* 检验类型关联 */
|
||||||
|
|||||||
@@ -811,4 +811,54 @@
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 手术项目专用分页查询:仅查手术 + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||||
|
<select id="getSurgeryPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||||
|
SELECT
|
||||||
|
t1.ID AS advice_definition_id,
|
||||||
|
t1.NAME AS advice_name,
|
||||||
|
t1.org_id AS org_id,
|
||||||
|
t1.org_id AS position_id,
|
||||||
|
t2.ID AS charge_item_definition_id,
|
||||||
|
t2.price AS price,
|
||||||
|
t1.permitted_unit_code AS unit_code,
|
||||||
|
t1.permitted_unit_code AS unit_code_dict_text
|
||||||
|
FROM wor_activity_definition t1
|
||||||
|
LEFT JOIN adm_charge_item_definition t2
|
||||||
|
ON t2.instance_id = t1.ID
|
||||||
|
AND t2.delete_flag = '0'
|
||||||
|
AND t2.status_enum = #{statusEnum}
|
||||||
|
AND t2.instance_table = 'wor_activity_definition'
|
||||||
|
WHERE t1.delete_flag = '0'
|
||||||
|
AND (t1.category_code = '手术' OR t1.category_code = '24')
|
||||||
|
<if test="searchKey != null and searchKey != ''">
|
||||||
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
|
</if>
|
||||||
|
ORDER BY t1.name ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 检查项目专用分页查询:仅查检查(23) + 定价,无库存/草稿库存/取药科室等无关逻辑 -->
|
||||||
|
<select id="getExaminationPage" resultType="com.openhis.web.doctorstation.dto.SurgeryItemDto">
|
||||||
|
SELECT
|
||||||
|
t1.ID AS advice_definition_id,
|
||||||
|
t1.NAME AS advice_name,
|
||||||
|
t1.org_id AS org_id,
|
||||||
|
t1.org_id AS position_id,
|
||||||
|
t2.ID AS charge_item_definition_id,
|
||||||
|
t2.price AS price,
|
||||||
|
t1.permitted_unit_code AS unit_code,
|
||||||
|
t1.permitted_unit_code AS unit_code_dict_text
|
||||||
|
FROM wor_activity_definition t1
|
||||||
|
LEFT JOIN adm_charge_item_definition t2
|
||||||
|
ON t2.instance_id = t1.ID
|
||||||
|
AND t2.delete_flag = '0'
|
||||||
|
AND t2.status_enum = #{statusEnum}
|
||||||
|
AND t2.instance_table = 'wor_activity_definition'
|
||||||
|
WHERE t1.delete_flag = '0'
|
||||||
|
AND t1.category_code = '23'
|
||||||
|
<if test="searchKey != null and searchKey != ''">
|
||||||
|
AND (t1.name ILIKE '%' || #{searchKey} || '%' OR t1.py_str ILIKE '%' || #{searchKey} || '%')
|
||||||
|
</if>
|
||||||
|
ORDER BY t1.name ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -305,28 +305,28 @@
|
|||||||
T1.occurrence_end_time AS end_time,
|
T1.occurrence_end_time AS end_time,
|
||||||
T1.requester_id AS requester_id,
|
T1.requester_id AS requester_id,
|
||||||
T1.create_time AS request_time,
|
T1.create_time AS request_time,
|
||||||
NULL AS skin_test_flag,
|
NULL::integer AS skin_test_flag,
|
||||||
NULL AS inject_flag,
|
NULL::integer AS inject_flag,
|
||||||
NULL AS group_id,
|
NULL::bigint AS group_id,
|
||||||
T1.performer_check_id,
|
T1.performer_check_id,
|
||||||
T2."name" AS advice_name,
|
T2."name" AS advice_name,
|
||||||
T2.id AS item_id,
|
T2.id AS item_id,
|
||||||
NULL AS volume,
|
NULL::varchar AS volume,
|
||||||
NULL AS lot_number,
|
NULL::varchar AS lot_number,
|
||||||
T1.quantity AS quantity,
|
T1.quantity AS quantity,
|
||||||
T1.unit_code AS unit_code,
|
T1.unit_code AS unit_code,
|
||||||
T1.status_enum AS request_status,
|
T1.status_enum AS request_status,
|
||||||
NULL AS method_code,
|
NULL::varchar AS method_code,
|
||||||
NULL AS rate_code,
|
NULL::varchar AS rate_code,
|
||||||
NULL AS dose,
|
NULL::numeric AS dose,
|
||||||
NULL AS dose_unit_code,
|
NULL::varchar AS dose_unit_code,
|
||||||
ao1.id AS position_id,
|
ao1.id AS position_id,
|
||||||
ao1."name" AS position_name,
|
ao1."name" AS position_name,
|
||||||
NULL AS dispense_per_duration,
|
NULL::integer AS dispense_per_duration,
|
||||||
1 AS part_percent,
|
1::numeric AS part_percent,
|
||||||
ccd."name" AS condition_definition_name,
|
ccd."name" AS condition_definition_name,
|
||||||
T1.therapy_enum AS therapy_enum,
|
T1.therapy_enum AS therapy_enum,
|
||||||
NULL AS sort_number,
|
NULL::integer AS sort_number,
|
||||||
T1.quantity AS execute_num,
|
T1.quantity AS execute_num,
|
||||||
af.day_times,
|
af.day_times,
|
||||||
ae.bus_no,
|
ae.bus_no,
|
||||||
@@ -341,7 +341,7 @@
|
|||||||
personal_account.balance_amount,
|
personal_account.balance_amount,
|
||||||
personal_account.id AS account_id,
|
personal_account.id AS account_id,
|
||||||
T2.category_code,
|
T2.category_code,
|
||||||
NULL AS dispense_status
|
NULL::integer AS dispense_status
|
||||||
FROM wor_service_request AS T1
|
FROM wor_service_request AS T1
|
||||||
LEFT JOIN wor_activity_definition AS T2
|
LEFT JOIN wor_activity_definition AS T2
|
||||||
ON T2.id = T1.activity_id
|
ON T2.id = T1.activity_id
|
||||||
|
|||||||
@@ -44,7 +44,9 @@
|
|||||||
sdd.dict_label AS unit_code_name,
|
sdd.dict_label AS unit_code_name,
|
||||||
togpd.dose AS dose,
|
togpd.dose AS dose,
|
||||||
togpd.rate_code AS rate_code,
|
togpd.rate_code AS rate_code,
|
||||||
|
rate_d.dict_label AS rate_code_dictText,
|
||||||
togpd.method_code AS method_code,
|
togpd.method_code AS method_code,
|
||||||
|
method_d.dict_label AS method_code_dictText,
|
||||||
togpd.dose_quantity AS dose_quantity,
|
togpd.dose_quantity AS dose_quantity,
|
||||||
togpd.group_id,
|
togpd.group_id,
|
||||||
togpd.group_order AS group_order,
|
togpd.group_order AS group_order,
|
||||||
@@ -67,8 +69,9 @@
|
|||||||
AND togpd.order_definition_id = adm.ID
|
AND togpd.order_definition_id = adm.ID
|
||||||
LEFT JOIN wor_activity_definition AS wor ON togpd.order_definition_table = 'wor_activity_definition'
|
LEFT JOIN wor_activity_definition AS wor ON togpd.order_definition_table = 'wor_activity_definition'
|
||||||
AND togpd.order_definition_id = wor.ID
|
AND togpd.order_definition_id = wor.ID
|
||||||
LEFT JOIN sys_dict_data AS sdd ON sdd.dict_value = togpd.unit_code AND sdd.dict_type = 'unit_code' AND
|
LEFT JOIN sys_dict_data AS sdd ON sdd.dict_value = togpd.unit_code AND sdd.dict_type = 'unit_code' AND sdd.status = '0'
|
||||||
sdd.status = '0'
|
LEFT JOIN sys_dict_data AS rate_d ON rate_d.dict_value = togpd.rate_code AND rate_d.dict_type = 'rate_code' AND rate_d.status = '0'
|
||||||
|
LEFT JOIN sys_dict_data AS method_d ON method_d.dict_value = togpd.method_code AND method_d.dict_type = 'method_code' AND method_d.status = '0'
|
||||||
WHERE togpd.delete_flag = '0'
|
WHERE togpd.delete_flag = '0'
|
||||||
<if test="groupPackageIds != null and !groupPackageIds.isEmpty()">
|
<if test="groupPackageIds != null and !groupPackageIds.isEmpty()">
|
||||||
AND togpd.group_package_id IN
|
AND togpd.group_package_id IN
|
||||||
|
|||||||
@@ -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,23 +72,11 @@
|
|||||||
</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">
|
||||||
SELECT wsr.quantity,
|
SELECT wsr.activity_id AS activity_id,
|
||||||
|
wsr.quantity,
|
||||||
wsr.unit_code,
|
wsr.unit_code,
|
||||||
COALESCE(wad.NAME, wsr.content_json::jsonb->>'surgeryName') AS advice_name,
|
COALESCE(wad.NAME, wsr.content_json::jsonb->>'surgeryName') AS advice_name,
|
||||||
aci.total_price
|
aci.total_price
|
||||||
@@ -148,9 +148,9 @@
|
|||||||
fc.contract_name AS fee_type,
|
fc.contract_name AS fee_type,
|
||||||
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifier_no
|
COALESCE(pi.identifier_no, ap.bus_no, '') AS identifier_no
|
||||||
FROM doc_request_form drf
|
FROM doc_request_form drf
|
||||||
LEFT JOIN cli_surgery cs ON cs.surgery_no = drf.prescription_no AND cs.delete_flag = '0'
|
INNER JOIN cli_surgery cs ON cs.surgery_no = drf.prescription_no AND cs.delete_flag = '0'
|
||||||
LEFT JOIN adm_patient ap ON ap.id = cs.patient_id AND ap.delete_flag = '0'
|
INNER JOIN adm_patient ap ON ap.id = cs.patient_id AND ap.delete_flag = '0'
|
||||||
LEFT JOIN adm_encounter ae ON ae.id = cs.encounter_id AND ae.delete_flag = '0'
|
INNER 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 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 fin_contract fc ON fc.bus_no = aa.contract_no AND fc.delete_flag = '0'
|
||||||
LEFT JOIN op_schedule os ON os.apply_id = drf.id AND os.delete_flag = '0'
|
LEFT JOIN op_schedule os ON os.apply_id = drf.id AND os.delete_flag = '0'
|
||||||
@@ -185,6 +185,8 @@
|
|||||||
</if>
|
</if>
|
||||||
AND drf.delete_flag = '0'
|
AND drf.delete_flag = '0'
|
||||||
AND os.schedule_id IS NULL
|
AND os.schedule_id IS NULL
|
||||||
|
<!-- 已取消(4)、已完成(3)的手术申请不参与门诊手术安排查找 -->
|
||||||
|
AND cs.status_enum NOT IN (3, 4)
|
||||||
</where>
|
</where>
|
||||||
ORDER BY drf.create_time DESC
|
ORDER BY drf.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -39,7 +39,12 @@ public enum GenerateSource implements HisEnumInterface {
|
|||||||
/**
|
/**
|
||||||
* 自动滚费
|
* 自动滚费
|
||||||
*/
|
*/
|
||||||
AUTO_ROLL_FEES(5, "5", "自动滚费");
|
AUTO_ROLL_FEES(5, "5", "自动滚费"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术计费
|
||||||
|
*/
|
||||||
|
SURGERY_BILLING(6, "6", "手术计费");
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -1046,8 +1046,10 @@ function handleSave() {
|
|||||||
chargeItemId: item.chargeItemId,
|
chargeItemId: item.chargeItemId,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
// 确保 organizationId 不为 undefined(手术计费场景下可能缺失 orgId)
|
||||||
|
const orgId = props.patientInfo.orgId || props.patientInfo.effectiveOrgId || 1;
|
||||||
savePrescriptionSign({
|
savePrescriptionSign({
|
||||||
organizationId: props.patientInfo.orgId,
|
organizationId: orgId,
|
||||||
adviceSaveList: list,
|
adviceSaveList: list,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -1064,6 +1066,7 @@ function handleSave() {
|
|||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error('签发失败:', error);
|
console.error('签发失败:', error);
|
||||||
|
console.warn('签发操作失败(可能无权限或后端异常):', error?.response?.data?.msg || error?.message);
|
||||||
proxy.$modal.msgError(error?.response?.data?.msg || error?.message || '签发失败,请重试');
|
proxy.$modal.msgError(error?.response?.data?.msg || error?.message || '签发失败,请重试');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1025,7 +1025,11 @@ function parseBirthDate(birthDate) {
|
|||||||
|
|
||||||
function normalizeDate(value) {
|
function normalizeDate(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
return String(value).split(/[T ]/)[0];
|
const datePart = String(value).split(/[T ]/)[0].replace(/\//g, '-');
|
||||||
|
const parts = datePart.split('-');
|
||||||
|
if (parts.length !== 3) return datePart;
|
||||||
|
const [year, month, day] = parts;
|
||||||
|
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeSex(value) {
|
function normalizeSex(value) {
|
||||||
@@ -1116,7 +1120,7 @@ function showReport(reportData = {}, readOnly = true) {
|
|||||||
addressHouse: reportData.addressHouse || '',
|
addressHouse: reportData.addressHouse || '',
|
||||||
patientBelong: reportData.patientBelong || 1,
|
patientBelong: reportData.patientBelong || 1,
|
||||||
occupation: reportData.occupation || '',
|
occupation: reportData.occupation || '',
|
||||||
caseClass: reportData.diseaseType != null ? String(reportData.diseaseType) : '',
|
caseClass: reportData.caseClass != null ? String(reportData.caseClass) : '',
|
||||||
onsetDate: normalizeDate(reportData.onsetDate),
|
onsetDate: normalizeDate(reportData.onsetDate),
|
||||||
diagDate: normalizeDate(reportData.diagDate),
|
diagDate: normalizeDate(reportData.diagDate),
|
||||||
deathDate: normalizeDate(reportData.deathDate),
|
deathDate: normalizeDate(reportData.deathDate),
|
||||||
@@ -1125,7 +1129,7 @@ function showReport(reportData = {}, readOnly = true) {
|
|||||||
selectedClassB: diseaseSelection.selectedClassB,
|
selectedClassB: diseaseSelection.selectedClassB,
|
||||||
selectedClassC: diseaseSelection.selectedClassC,
|
selectedClassC: diseaseSelection.selectedClassC,
|
||||||
otherDisease: reportData.otherDisease || (diseaseCode === 'OTHER' ? reportData.diseaseName || '' : ''),
|
otherDisease: reportData.otherDisease || (diseaseCode === 'OTHER' ? reportData.diseaseName || '' : ''),
|
||||||
diseaseType: reportData.diseaseSubtype || '',
|
diseaseType: reportData.diseaseSubtype || reportData.diseaseType || '',
|
||||||
reportOrg: reportData.reportOrg || '',
|
reportOrg: reportData.reportOrg || '',
|
||||||
reportOrgPhone: reportData.reportOrgPhone || '',
|
reportOrgPhone: reportData.reportOrgPhone || '',
|
||||||
reportDoc: reportData.reportDoc || '',
|
reportDoc: reportData.reportDoc || '',
|
||||||
@@ -1466,7 +1470,7 @@ async function buildSubmitData() {
|
|||||||
reportDate: formData.reportDate || null,
|
reportDate: formData.reportDate || null,
|
||||||
cardNameCode: 1, // 默认中华人民共和国传染病报告卡
|
cardNameCode: 1, // 默认中华人民共和国传染病报告卡
|
||||||
registrationSource: 1, // 默认门诊
|
registrationSource: 1, // 默认门诊
|
||||||
status: '',
|
status: null,
|
||||||
deptId: props.deptId || null,
|
deptId: props.deptId || null,
|
||||||
doctorId: props.doctorId || null,
|
doctorId: props.doctorId || null,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -564,22 +564,74 @@ function handleRemoveItem(index) {
|
|||||||
editingGroup.value.detailList.splice(index, 1);
|
editingGroup.value.detailList.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单击应用按钮
|
// 单击应用按钮(应用组套)
|
||||||
function handleUseOrderGroup(row) {
|
async function handleUseOrderGroup(row) {
|
||||||
if (!row.detailList || row.detailList.length === 0) {
|
if (!row.detailList || row.detailList.length === 0) {
|
||||||
ElMessage.warning('该组套没有明细项');
|
ElMessage.warning('该组套没有明细项');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 🔧 Bug 修复:组套保存时未持久化 orderDetailInfos,导致应用时缺失医嘱库信息。
|
||||||
|
// 通过 API 批量查询补全,确保 setValue 能获取到 adviceType、inventoryList、priceList 等关键字段。
|
||||||
|
const itemsMissingDetail = row.detailList.filter(
|
||||||
|
item => !item.orderDetailInfos || Object.keys(item.orderDetailInfos).length === 0
|
||||||
|
);
|
||||||
|
const detailMap = {};
|
||||||
|
if (itemsMissingDetail.length > 0) {
|
||||||
|
const ids = itemsMissingDetail
|
||||||
|
.map(item => item.orderDefinitionId)
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(',');
|
||||||
|
if (ids) {
|
||||||
|
try {
|
||||||
|
const res = await getAdviceBaseInfo({
|
||||||
|
adviceDefinitionIdParamList: ids,
|
||||||
|
organizationId: props.organizationId,
|
||||||
|
});
|
||||||
|
const records = res.data?.records || res.rows || [];
|
||||||
|
records.forEach(rec => {
|
||||||
|
if (rec.adviceDefinitionId) {
|
||||||
|
detailMap[rec.adviceDefinitionId] = rec;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
// 批量查询失败,使用原始 orderDetailInfos
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔧 辅助函数:根据字典 code 查找对应的 dictText
|
||||||
|
const findDictText = (dictList, code) => {
|
||||||
|
if (!code || !dictList?.value?.length) return '';
|
||||||
|
const found = dictList.value.find(d => d.value === code);
|
||||||
|
return found?.label || '';
|
||||||
|
};
|
||||||
|
|
||||||
// 🔧 数据预处理:确保每个明细项都有完整的医嘱信息
|
// 🔧 数据预处理:确保每个明细项都有完整的医嘱信息
|
||||||
const processedDetailList = row.detailList.map(item => {
|
const processedDetailList = row.detailList.map(item => {
|
||||||
const orderDetail = item.orderDetailInfos || {};
|
// 优先使用组套中已带的 orderDetailInfos,否则使用 API 查询结果
|
||||||
|
const orderDetail = (item.orderDetailInfos && Object.keys(item.orderDetailInfos).length > 0)
|
||||||
|
? item.orderDetailInfos
|
||||||
|
: (detailMap[item.orderDefinitionId] || {});
|
||||||
|
|
||||||
|
// 🔧 修复:组套明细只存了 methodCode/rateCode,没有 dictText。
|
||||||
|
// 用字典查找补充 dictText,确保界面显示正确的用法/频次名称。
|
||||||
|
const resolvedMethodCode = item.methodCode ?? orderDetail.methodCode;
|
||||||
|
const resolvedRateCode = item.rateCode ?? orderDetail.rateCode;
|
||||||
|
const methodCodeDictText = item.methodCode_dictText
|
||||||
|
|| findDictText(method_code, resolvedMethodCode)
|
||||||
|
|| orderDetail.methodCode_dictText
|
||||||
|
|| '';
|
||||||
|
const rateCodeDictText = item.rateCode_dictText
|
||||||
|
|| findDictText(rate_code, resolvedRateCode)
|
||||||
|
|| orderDetail.rateCode_dictText
|
||||||
|
|| '';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// 组套明细字段
|
// 组套明细字段
|
||||||
...item,
|
...item,
|
||||||
|
|
||||||
// 医嘱库字段(可能为空,需要兜底)
|
// 医嘱库字段
|
||||||
adviceName: orderDetail.adviceName || item.orderDefinitionName || '未知项目',
|
adviceName: orderDetail.adviceName || item.orderDefinitionName || '未知项目',
|
||||||
adviceType: orderDetail.adviceType,
|
adviceType: orderDetail.adviceType,
|
||||||
adviceDefinitionId: item.orderDefinitionId || orderDetail.adviceDefinitionId,
|
adviceDefinitionId: item.orderDefinitionId || orderDetail.adviceDefinitionId,
|
||||||
@@ -592,7 +644,6 @@ function handleUseOrderGroup(row) {
|
|||||||
partPercent: orderDetail.partPercent ?? 1,
|
partPercent: orderDetail.partPercent ?? 1,
|
||||||
partAttributeEnum: orderDetail.partAttributeEnum,
|
partAttributeEnum: orderDetail.partAttributeEnum,
|
||||||
unitConversionRatio: orderDetail.unitConversionRatio,
|
unitConversionRatio: orderDetail.unitConversionRatio,
|
||||||
// 🔧 Bug #218 修复:positionId 可能存储在 item 本身,优先使用 item.positionId
|
|
||||||
positionId: item.positionId ?? orderDetail.positionId,
|
positionId: item.positionId ?? orderDetail.positionId,
|
||||||
defaultLotNumber: orderDetail.defaultLotNumber,
|
defaultLotNumber: orderDetail.defaultLotNumber,
|
||||||
|
|
||||||
@@ -602,6 +653,10 @@ function handleUseOrderGroup(row) {
|
|||||||
unitCodeName: item.unitCodeName || orderDetail.unitCode_dictText,
|
unitCodeName: item.unitCodeName || orderDetail.unitCode_dictText,
|
||||||
minUnitCode: orderDetail.minUnitCode,
|
minUnitCode: orderDetail.minUnitCode,
|
||||||
doseUnitCode: orderDetail.doseUnitCode,
|
doseUnitCode: orderDetail.doseUnitCode,
|
||||||
|
|
||||||
|
// 字典文本(传递到 item 层级,避免后续代码依赖 mergedDetail 再查一次)
|
||||||
|
methodCode_dictText: methodCodeDictText,
|
||||||
|
rateCode_dictText: rateCodeDictText,
|
||||||
|
|
||||||
// 合并后的完整对象(用于 setValue)
|
// 合并后的完整对象(用于 setValue)
|
||||||
// 先展开 orderDetail 获取所有药品基础字段(categoryCode、minUnitCode、doseUnitCode、
|
// 先展开 orderDetail 获取所有药品基础字段(categoryCode、minUnitCode、doseUnitCode、
|
||||||
@@ -616,19 +671,19 @@ function handleUseOrderGroup(row) {
|
|||||||
categoryCode: item.categoryCode ?? orderDetail.categoryCode,
|
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: resolvedRateCode,
|
||||||
methodCode: item.methodCode ?? orderDetail.methodCode,
|
rateCode_dictText: rateCodeDictText,
|
||||||
|
methodCode: resolvedMethodCode,
|
||||||
|
methodCode_dictText: methodCodeDictText,
|
||||||
dispensePerDuration: item.dispensePerDuration ?? orderDetail.dispensePerDuration,
|
dispensePerDuration: item.dispensePerDuration ?? orderDetail.dispensePerDuration,
|
||||||
doseQuantity: item.doseQuantity ?? orderDetail.doseQuantity,
|
doseQuantity: item.doseQuantity ?? orderDetail.doseQuantity,
|
||||||
// 🔧 Bug #218 / #403 修复:positionId 可能存储在 item 本身,优先使用 item.positionId
|
|
||||||
positionId: item.positionId ?? orderDetail.positionId,
|
positionId: item.positionId ?? orderDetail.positionId,
|
||||||
// 执行科室:优先使用组套明细中保存的 orgId
|
|
||||||
orgId: item.orgId ?? orderDetail.orgId,
|
orgId: item.orgId ?? orderDetail.orgId,
|
||||||
orgName: item.orgName ?? orderDetail.orgName,
|
orgName: item.orgName ?? orderDetail.orgName,
|
||||||
// 组号(保留组套中的分组信息)
|
|
||||||
groupId: item.groupId,
|
groupId: item.groupId,
|
||||||
groupOrder: item.groupOrder,
|
groupOrder: item.groupOrder,
|
||||||
therapyEnum: item.therapyEnum ?? orderDetail.therapyEnum ?? '1',
|
// 🔧 类型默认为临时医嘱(2=临时,1=长期)
|
||||||
|
therapyEnum: item.therapyEnum ?? orderDetail.therapyEnum ?? '2',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -645,9 +700,9 @@ function handlePreviewGroup(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 确认应用组套(从预览对话框)
|
// 确认应用组套(从预览对话框)
|
||||||
function confirmUseGroup() {
|
async function confirmUseGroup() {
|
||||||
if (currentGroup.value) {
|
if (currentGroup.value) {
|
||||||
handleUseOrderGroup(currentGroup.value);
|
await handleUseOrderGroup(currentGroup.value);
|
||||||
previewVisible.value = false;
|
previewVisible.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1026,7 +1026,7 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
|||||||
return found.label;
|
return found.label;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失或标签为空时的兜底
|
// 🔧 Bug #458 Fix: 诊疗/手术类型字典缺失时的兜底,避免保存后"医嘱类型"列显示为空
|
||||||
if (adviceTableName === 'wor_activity_definition' || adviceTableName === 'wor_service_request') {
|
if (adviceTableName === 'wor_activity_definition' || adviceTableName === 'wor_service_request') {
|
||||||
if (type === 6) return '手术';
|
if (type === 6) return '手术';
|
||||||
if (type === 4) return '手术';
|
if (type === 4) return '手术';
|
||||||
@@ -1036,15 +1036,6 @@ const mapAdviceTypeLabel = (type, adviceTableName) => {
|
|||||||
return '诊疗';
|
return '诊疗';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug #458 Fix: 兜底映射,确保所有有效 adviceType 都有显示标签
|
|
||||||
// 不依赖字典数据和表名,直接返回标准类型名称
|
|
||||||
if (type === 3) return '诊疗';
|
|
||||||
if (type === 6) return '手术';
|
|
||||||
if (type === 4) return '耗材';
|
|
||||||
if (type === 1) return '西药';
|
|
||||||
if (type === 2) return '中成药';
|
|
||||||
if (type === 5) return '会诊';
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1667,16 +1658,12 @@ function getListInfo(addNewRow) {
|
|||||||
contentJson?.consultationRequestId;
|
contentJson?.consultationRequestId;
|
||||||
|
|
||||||
let adviceType = item.adviceType;
|
let adviceType = item.adviceType;
|
||||||
|
|
||||||
// 🔧 Bug Fix: 后端保存时将耗材(4)转换为中成药(2),显示时需要转换回来
|
// 🔧 Bug Fix: 后端保存时将耗材(4)转换为中成药(2),显示时需要转换回来
|
||||||
// 检查 adviceTableName,如果是耗材表则应该是耗材类型
|
// 检查 adviceTableName,如果是耗材表则应该是耗材类型
|
||||||
const adviceTableName = contentJson?.adviceTableName || item.adviceTableName;
|
const adviceTableName = contentJson?.adviceTableName || item.adviceTableName;
|
||||||
|
|
||||||
// 🔧 Bug #458 Fix: 后端可能返回空字符串的 adviceType_dictText,需重新计算
|
let adviceType_dictText = item.adviceType_dictText || mapAdviceTypeLabel(adviceType, adviceTableName);
|
||||||
const backendDictText = item.adviceType_dictText;
|
|
||||||
let adviceType_dictText = (backendDictText && backendDictText.trim())
|
|
||||||
? backendDictText
|
|
||||||
: mapAdviceTypeLabel(adviceType, adviceTableName);
|
|
||||||
|
|
||||||
// 如果是会诊类型,设置为会诊类型
|
// 如果是会诊类型,设置为会诊类型
|
||||||
if (isConsultation) {
|
if (isConsultation) {
|
||||||
@@ -3675,6 +3662,13 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
defaultLotNumber: item.orderDetailInfos?.defaultLotNumber,
|
defaultLotNumber: item.orderDetailInfos?.defaultLotNumber,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 🔧 Bug 修复:字典查找兜底,防止 mergedDetail 中 dictText 为空
|
||||||
|
const findDictText = (dictList, code) => {
|
||||||
|
if (!code || !dictList?.length) return '';
|
||||||
|
const found = dictList.find(d => d.value === code);
|
||||||
|
return found?.label || '';
|
||||||
|
};
|
||||||
|
|
||||||
// 在 setValue 之前预初始化空行
|
// 在 setValue 之前预初始化空行
|
||||||
prescriptionList.value[rowIndex.value] = {
|
prescriptionList.value[rowIndex.value] = {
|
||||||
uniqueKey: nextId.value++,
|
uniqueKey: nextId.value++,
|
||||||
@@ -3685,43 +3679,105 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
// 使用医嘱项目详情设置值
|
// 使用医嘱项目详情设置值
|
||||||
setValue(mergedDetail);
|
setValue(mergedDetail);
|
||||||
|
|
||||||
|
// 🔧 Bug 修复:使用 mergedDetail 优先,避免 item 中 undefined 覆盖 setValue 中已设置的字段
|
||||||
|
const resolvedQuantity = mergedDetail.quantity ?? item.quantity ?? 1;
|
||||||
|
const resolvedDose = mergedDetail.dose ?? item.dose;
|
||||||
|
const resolvedMethodCode = mergedDetail.methodCode ?? item.methodCode;
|
||||||
|
const resolvedRateCode = mergedDetail.rateCode ?? item.rateCode;
|
||||||
|
const resolvedUnitCode = mergedDetail.unitCode ?? item.unitCode;
|
||||||
|
|
||||||
|
// 🔧 Bug 修复:setValue 可能因库存不足提前 return,导致 unitPrice/minUnitPrice 等字段未设置。
|
||||||
|
// 从 mergedDetail 或 item 中获取兜底值,避免价格计算产生 NaN。
|
||||||
|
const safePrice = (val) => {
|
||||||
|
const n = Number(val);
|
||||||
|
return (n !== undefined && n !== null && !isNaN(n) && isFinite(n)) ? n : 0;
|
||||||
|
};
|
||||||
|
const resolvedUnitPrice = safePrice(
|
||||||
|
prescriptionList.value[rowIndex.value]?.unitPrice
|
||||||
|
?? mergedDetail.unitPrice
|
||||||
|
?? item.unitPrice
|
||||||
|
?? 0
|
||||||
|
);
|
||||||
|
const resolvedMinUnitPrice = safePrice(
|
||||||
|
prescriptionList.value[rowIndex.value]?.minUnitPrice
|
||||||
|
?? mergedDetail.minUnitPrice
|
||||||
|
?? item.minUnitPrice
|
||||||
|
?? 0
|
||||||
|
);
|
||||||
|
const resolvedPartPercent = safePrice(
|
||||||
|
item.orderDetailInfos?.partPercent
|
||||||
|
?? mergedDetail.partPercent
|
||||||
|
?? 1
|
||||||
|
);
|
||||||
|
|
||||||
// 创建新的处方项目
|
// 创建新的处方项目
|
||||||
const newRow = {
|
const newRow = {
|
||||||
...prescriptionList.value[rowIndex.value],
|
...prescriptionList.value[rowIndex.value],
|
||||||
patientId: props.patientInfo.patientId,
|
patientId: props.patientInfo.patientId,
|
||||||
encounterId: props.patientInfo.encounterId,
|
encounterId: props.patientInfo.encounterId,
|
||||||
accountId: accountId.value,
|
accountId: accountId.value,
|
||||||
quantity: item.quantity,
|
quantity: resolvedQuantity,
|
||||||
methodCode: item.methodCode,
|
methodCode: resolvedMethodCode,
|
||||||
rateCode: item.rateCode,
|
methodCode_dictText: mergedDetail.methodCode_dictText
|
||||||
dispensePerDuration: item.dispensePerDuration,
|
|| findDictText(method_code.value, resolvedMethodCode)
|
||||||
dose: item.dose,
|
|| '',
|
||||||
doseQuantity: item.doseQuantity,
|
rateCode: resolvedRateCode,
|
||||||
|
rateCode_dictText: mergedDetail.rateCode_dictText
|
||||||
|
|| findDictText(rate_code.value, resolvedRateCode)
|
||||||
|
|| '',
|
||||||
|
dispensePerDuration: mergedDetail.dispensePerDuration ?? item.dispensePerDuration,
|
||||||
|
dose: resolvedDose,
|
||||||
|
doseQuantity: mergedDetail.doseQuantity ?? item.doseQuantity,
|
||||||
executeNum: 1,
|
executeNum: 1,
|
||||||
unitCode: item.unitCode,
|
unitCode: resolvedUnitCode,
|
||||||
unitCode_dictText: item.unitCodeName || '',
|
unitCode_dictText: item.unitCodeName
|
||||||
|
|| mergedDetail.unitCodeName
|
||||||
|
|| findDictText(unit_code.value, resolvedUnitCode)
|
||||||
|
|| '',
|
||||||
|
doseUnitCode: mergedDetail.doseUnitCode,
|
||||||
|
doseUnitCode_dictText: mergedDetail.doseUnitCode_dictText || '',
|
||||||
|
// 🔧 确保 price/adviceType 字段有安全默认值(避免 NaN 导致模板条件判断失效)
|
||||||
|
unitPrice: resolvedUnitPrice,
|
||||||
|
minUnitPrice: resolvedMinUnitPrice,
|
||||||
|
unitTempPrice: resolvedUnitPrice,
|
||||||
|
adviceType: prescriptionList.value[rowIndex.value]?.adviceType
|
||||||
|
|| Number(mergedDetail.adviceType)
|
||||||
|
|| Number(item.adviceType)
|
||||||
|
|| 0,
|
||||||
|
adviceType_dictText: prescriptionList.value[rowIndex.value]?.adviceType_dictText
|
||||||
|
|| mergedDetail.adviceType_dictText
|
||||||
|
|| item.adviceType_dictText
|
||||||
|
|| '',
|
||||||
statusEnum: 1,
|
statusEnum: 1,
|
||||||
|
// 🔧 类型:组套应用默认为临时医嘱(2=临时,1=长期)
|
||||||
|
therapyEnum: mergedDetail.therapyEnum ?? item.therapyEnum ?? '2',
|
||||||
// 🔧 修复执行科室逻辑:优先使用 orgId(所属科室),其次 positionId
|
// 🔧 修复执行科室逻辑:优先使用 orgId(所属科室),其次 positionId
|
||||||
// 🔧 Bug #455: 诊疗类(adviceType=3)使用患者就诊科室,不使用目录配置的ID
|
// 🔧 Bug #455: 诊疗类(adviceType=3)使用患者就诊科室,不使用目录配置的ID
|
||||||
orgId: item.adviceType === 3
|
orgId: item.adviceType === 3
|
||||||
? props.patientInfo?.orgId
|
? props.patientInfo?.orgId
|
||||||
: (item.orderDetailInfos?.orgId || mergedDetail.orgId || item.positionId || item.orderDetailInfos?.positionId || mergedDetail.positionId),
|
: (item.orderDetailInfos?.orgId || mergedDetail.orgId || item.positionId || item.orderDetailInfos?.positionId || mergedDetail.positionId),
|
||||||
|
positionName: prescriptionList.value[rowIndex.value]?.positionName
|
||||||
|
|| mergedDetail.orgName
|
||||||
|
|| mergedDetail.positionName
|
||||||
|
|| findOrgNameById(mergedDetail.orgId || props.patientInfo?.orgId)
|
||||||
|
|| '',
|
||||||
dbOpType: prescriptionList.value[rowIndex.value].requestId ? '2' : '1',
|
dbOpType: prescriptionList.value[rowIndex.value].requestId ? '2' : '1',
|
||||||
conditionId: conditionId.value,
|
conditionId: conditionId.value,
|
||||||
conditionDefinitionId: conditionDefinitionId.value,
|
conditionDefinitionId: conditionDefinitionId.value,
|
||||||
encounterDiagnosisId: encounterDiagnosisId.value,
|
encounterDiagnosisId: encounterDiagnosisId.value,
|
||||||
|
diagnosisName: diagnosisName.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 计算价格和总量
|
// 计算价格和总量(使用安全值)
|
||||||
const unitInfo = unitCodeList.value.find((k) => k.value == item.unitCode);
|
const unitInfo = unitCodeList.value.find((k) => k.value == resolvedUnitCode);
|
||||||
if (unitInfo && unitInfo.type == 'minUnit') {
|
if (unitInfo && unitInfo.type == 'minUnit') {
|
||||||
newRow.price = newRow.minUnitPrice;
|
newRow.price = resolvedMinUnitPrice;
|
||||||
newRow.totalPrice = (item.quantity * newRow.minUnitPrice).toFixed(6);
|
newRow.totalPrice = (resolvedQuantity * resolvedMinUnitPrice).toFixed(6);
|
||||||
newRow.minUnitQuantity = item.quantity;
|
newRow.minUnitQuantity = resolvedQuantity;
|
||||||
} else {
|
} else {
|
||||||
newRow.price = newRow.unitPrice;
|
newRow.price = resolvedUnitPrice;
|
||||||
newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6);
|
newRow.totalPrice = (resolvedQuantity * resolvedUnitPrice).toFixed(6);
|
||||||
newRow.minUnitQuantity = item.quantity * (item.orderDetailInfos?.partPercent || mergedDetail.partPercent || 1);
|
newRow.minUnitQuantity = resolvedQuantity * resolvedPartPercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
newRow.contentJson = JSON.stringify(newRow);
|
newRow.contentJson = JSON.stringify(newRow);
|
||||||
|
|||||||
@@ -636,11 +636,12 @@ function getList() {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
surgeryList.value = res.data?.records || []
|
surgeryList.value = res.data?.records || []
|
||||||
} else {
|
} else {
|
||||||
console.warn('手术列表加载失败(可能无权限或数据异常):', res.msg)
|
proxy.$modal.msgError(res.msg || '数据加载失败,请稍后重试')
|
||||||
surgeryList.value = []
|
surgeryList.value = []
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.warn('手术列表请求异常:', error)
|
console.error('获取手术列表失败:', error)
|
||||||
|
proxy.$modal.msgError('数据加载失败,请稍后重试')
|
||||||
surgeryList.value = []
|
surgeryList.value = []
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@@ -1141,8 +1142,8 @@ function submitForm() {
|
|||||||
// 保存麻醉方式
|
// 保存麻醉方式
|
||||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||||
open.value = false
|
open.value = false
|
||||||
// 由父组件 @saved 事件负责刷新列表(带延迟确保后端事务已提交)
|
getList() // 提交成功后直接刷新列表
|
||||||
emit('saved')
|
emit('saved') // 通知父组件刷新医嘱列表
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
||||||
}
|
}
|
||||||
@@ -1158,8 +1159,8 @@ function submitForm() {
|
|||||||
// 保存麻醉方式
|
// 保存麻醉方式
|
||||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||||
open.value = false
|
open.value = false
|
||||||
// 由父组件 @saved 事件负责刷新列表
|
getList() // 修改成功后直接刷新列表
|
||||||
emit('saved')
|
emit('saved') // 通知父组件刷新医嘱列表
|
||||||
} else {
|
} else {
|
||||||
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
|
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
</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(); setTimeout(() => surgeryRef?.getList(), 500) }" />
|
@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" />
|
||||||
|
|||||||
@@ -220,6 +220,7 @@
|
|||||||
:is-edit-mode="true"
|
:is-edit-mode="true"
|
||||||
:edit-data="editingRow"
|
:edit-data="editingRow"
|
||||||
:external-patient-info="patientInfo"
|
:external-patient-info="patientInfo"
|
||||||
|
@submit-ok="handleEditSuccess"
|
||||||
/>
|
/>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
<el-button @click="editDialogVisible = false">取消</el-button>
|
||||||
@@ -678,16 +679,15 @@ const handlePrint = async (row) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
// 构建 descJson 字段行(与详情弹窗展示的字段一致)
|
||||||
const fieldKeys = ['targetDepartment', 'urgencyLevel', 'expectedExaminationTime', 'allergyHistory', 'examinationPurpose', 'medicalHistorySummary', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
const fieldKeys = ['targetDepartment', 'symptom', 'sign', 'clinicalDiagnosis', 'otherDiagnosis', 'relatedResult', 'attention'];
|
||||||
let descFieldsHtml = '';
|
let descFieldsHtml = '';
|
||||||
fieldKeys.forEach((key) => {
|
fieldKeys.forEach((key) => {
|
||||||
const label = labelMap[key] || key;
|
const label = labelMap[key] || key;
|
||||||
const value = transformField(key, descData[key]);
|
if (descData[key] != null && descData[key] !== '') {
|
||||||
if (value != null && value !== '') {
|
|
||||||
descFieldsHtml += `
|
descFieldsHtml += `
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="label">${label}:</span>
|
<span class="label">${label}:</span>
|
||||||
<span class="value">${value}</span>
|
<span class="value">${descData[key]}</span>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -968,12 +968,17 @@ const handleEdit = (row) => {
|
|||||||
|
|
||||||
// 编辑弹窗确认提交
|
// 编辑弹窗确认提交
|
||||||
const handleEditSubmit = () => {
|
const handleEditSubmit = () => {
|
||||||
// 调用MedicalExaminations组件的submit方法
|
|
||||||
if (editFormRef.value?.submit) {
|
if (editFormRef.value?.submit) {
|
||||||
editFormRef.value.submit();
|
editFormRef.value.submit();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 编辑保存成功回调:关闭弹窗并刷新列表
|
||||||
|
const handleEditSuccess = () => {
|
||||||
|
editDialogVisible.value = false;
|
||||||
|
fetchData();
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => patientInfo.value?.encounterId,
|
() => patientInfo.value?.encounterId,
|
||||||
(val) => {
|
(val) => {
|
||||||
|
|||||||
@@ -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 数据添加后也去重
|
emits('diagnosisSave', false);
|
||||||
deduplicateDiagnosisList();
|
|
||||||
}
|
}
|
||||||
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; // 这里是关键!把”诊断排序”改成新顺序
|
||||||
|
|||||||
@@ -1,6 +1,24 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
// 申请单相关接口
|
// 申请单相关接口
|
||||||
|
|
||||||
|
// 手术项目专用分页查询(仅手术 + 定价,无库存/草稿库存等无关逻辑)
|
||||||
|
export function getSurgeryPage(params) {
|
||||||
|
return request({
|
||||||
|
url: '/doctor-station/advice/surgery-page',
|
||||||
|
method: 'get',
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查项目专用分页查询(仅检查(23) + 定价,绕过 AOP 校验提升加载速度)
|
||||||
|
export function getExaminationPage(params) {
|
||||||
|
return request({
|
||||||
|
url: '/doctor-station/advice/examination-page',
|
||||||
|
method: 'get',
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//医嘱大下拉
|
//医嘱大下拉
|
||||||
export function getApplicationList(queryParams) {
|
export function getApplicationList(queryParams) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ import dayjs from 'dayjs';
|
|||||||
import {patientInfo} from '../../../store/patient.js';
|
import {patientInfo} from '../../../store/patient.js';
|
||||||
import {getDepartmentList} from '@/api/public.js';
|
import {getDepartmentList} from '@/api/public.js';
|
||||||
import {getEncounterDiagnosis} from '../../api.js';
|
import {getEncounterDiagnosis} from '../../api.js';
|
||||||
import {getApplicationList, saveCheckd} from './api';
|
import {getExaminationPage, saveCheckd} from './api';
|
||||||
import {ElMessage, ElMessageBox} from 'element-plus';
|
import {ElMessage, ElMessageBox} from 'element-plus';
|
||||||
import {WarningFilled, Warning, Refresh, Files, Document, EditPen, Aim, DocumentCopy} from '@element-plus/icons-vue';
|
import {WarningFilled, Warning, Refresh, Files, Document, EditPen, Aim, DocumentCopy} from '@element-plus/icons-vue';
|
||||||
|
|
||||||
@@ -266,27 +266,23 @@ const isSevereAllergy = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
console.log('getList called, effectivePatientInfo:', effectivePatientInfo.value);
|
|
||||||
if (!effectivePatientInfo.value?.inHospitalOrgId) {
|
if (!effectivePatientInfo.value?.inHospitalOrgId) {
|
||||||
console.log('inHospitalOrgId is missing, setting empty list');
|
|
||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getApplicationList({
|
getExaminationPage({
|
||||||
pageSize: 500,
|
|
||||||
pageNum: 1,
|
|
||||||
categoryCode: '23',
|
|
||||||
organizationId: effectivePatientInfo.value.inHospitalOrgId,
|
organizationId: effectivePatientInfo.value.inHospitalOrgId,
|
||||||
adviceTypes: [3],
|
pageNo: 1,
|
||||||
|
pageSize: 5000,
|
||||||
|
searchKey: '',
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200 && res.data?.records) {
|
||||||
applicationListAll.value = res.data.records;
|
applicationListAll.value = res.data.records;
|
||||||
applicationList.value = res.data.records.map((item) => {
|
applicationList.value = res.data.records.map((item) => {
|
||||||
const priceInfo = item.priceList?.[0] || {};
|
const price = item.price != null ? Number(item.price).toFixed(2) : '0.00';
|
||||||
const price = priceInfo.price != null ? Number(priceInfo.price).toFixed(2) : '0.00';
|
const unit = item.unitCodeDictText || item.unitCode || '';
|
||||||
const unit = item.unitCode_dictText || item.unitCode || '';
|
|
||||||
return {
|
return {
|
||||||
adviceDefinitionId: item.adviceDefinitionId,
|
adviceDefinitionId: item.adviceDefinitionId,
|
||||||
orgId: item.orgId,
|
orgId: item.orgId,
|
||||||
@@ -299,7 +295,6 @@ const getList = () => {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
// 使用 adviceName 匹配
|
// 使用 adviceName 匹配
|
||||||
const selectedNames = props.editData.requestFormDetailList.map(item => item.adviceName);
|
const selectedNames = props.editData.requestFormDetailList.map(item => item.adviceName);
|
||||||
console.log('getList completed, selectedNames:', selectedNames);
|
|
||||||
const selectedIds = [];
|
const selectedIds = [];
|
||||||
applicationList.value?.forEach(app => {
|
applicationList.value?.forEach(app => {
|
||||||
// 匹配时去掉价格部分,只比较名称
|
// 匹配时去掉价格部分,只比较名称
|
||||||
@@ -308,7 +303,6 @@ const getList = () => {
|
|||||||
selectedIds.push(app.key);
|
selectedIds.push(app.key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('getList completed, matched selectedIds:', selectedIds);
|
|
||||||
transferValue.value = selectedIds;
|
transferValue.value = selectedIds;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -404,13 +398,11 @@ const loadPatientAllergyHistory = () => {
|
|||||||
if (!effectivePatientInfo.value?.patientId) return;
|
if (!effectivePatientInfo.value?.patientId) return;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 加载编辑数据
|
// 加载编辑数据 — 只负责解析 descJson 填充表单字段
|
||||||
|
// 已选项目的匹配由 getList 数据加载完成后统一处理
|
||||||
const loadEditData = () => {
|
const loadEditData = () => {
|
||||||
if (!props.isEditMode || !props.editData?.requestFormId) return;
|
if (!props.isEditMode || !props.editData?.requestFormId) return;
|
||||||
|
|
||||||
console.log('loadEditData called, editData:', props.editData);
|
|
||||||
|
|
||||||
// 解析已有的descJson填充表单
|
|
||||||
if (props.editData.descJson) {
|
if (props.editData.descJson) {
|
||||||
try {
|
try {
|
||||||
const obj = JSON.parse(props.editData.descJson);
|
const obj = JSON.parse(props.editData.descJson);
|
||||||
@@ -431,91 +423,16 @@ const loadEditData = () => {
|
|||||||
console.error('解析descJson失败:', e);
|
console.error('解析descJson失败:', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置已选项目(从requestFormDetailList获取)
|
|
||||||
// 注意:后端返回的字段是 adviceName,不是 adviceDefinitionId
|
|
||||||
console.log('requestFormDetailList:', props.editData.requestFormDetailList);
|
|
||||||
if (props.editData.requestFormDetailList && props.editData.requestFormDetailList.length) {
|
|
||||||
// 使用 adviceName 匹配
|
|
||||||
const selectedNames = props.editData.requestFormDetailList.map(item => item.adviceName);
|
|
||||||
console.log('setting transferValue by adviceName to:', selectedNames);
|
|
||||||
// 通过名称匹配找到对应的 key
|
|
||||||
const selectedIds = [];
|
|
||||||
applicationList.value?.forEach(app => {
|
|
||||||
if (selectedNames.includes(app.label?.split(' (')[0])) {
|
|
||||||
selectedIds.push(app.key);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log('matched selectedIds:', selectedIds);
|
|
||||||
transferValue.value = selectedIds;
|
|
||||||
} else {
|
|
||||||
console.log('requestFormDetailList is empty or undefined');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const projectWithDepartment = (selectProjectIds, type) => {
|
const projectWithDepartment = (selectProjectIds) => {
|
||||||
let isRelease = true;
|
if (!selectProjectIds || selectProjectIds.length === 0) {
|
||||||
const arr = [];
|
|
||||||
// 确保 applicationList 存在
|
|
||||||
if (!applicationList.value || !Array.isArray(applicationList.value)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
selectProjectIds.forEach((element) => {
|
|
||||||
const searchData = applicationList.value.find((item) => {
|
|
||||||
return element == item.adviceDefinitionId;
|
|
||||||
});
|
|
||||||
arr.push(searchData);
|
|
||||||
});
|
|
||||||
// 只有当选择了项目(arr 非空)时才设置 targetDepartment
|
|
||||||
if (arr.length > 0) {
|
|
||||||
const obj = arr[0];
|
|
||||||
// 检查是否有未定义的项目(applicationList 中找不到)
|
|
||||||
if (!obj) {
|
|
||||||
console.warn('未找到项目定义,无法设置执行科室');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const isCompare = arr.every((item) => item && item.orgId == obj.orgId);
|
|
||||||
if (!isCompare) {
|
|
||||||
ElMessage({ type: 'error', message: '执行科室不同' });
|
|
||||||
isRelease = false;
|
|
||||||
}
|
|
||||||
const findItem = findTreeItem(orgOptions.value, obj.orgId);
|
|
||||||
if (!findItem) {
|
|
||||||
isRelease = false;
|
|
||||||
ElMessage({ type: 'error', message: '未找到项目执行的科室' });
|
|
||||||
}
|
|
||||||
if (type == 1 && isRelease) {
|
|
||||||
form.targetDepartment = findItem.id;
|
|
||||||
console.log('targetDepartment 设置为:', form.targetDepartment, '科室名称:', findItem.name);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 清空选择时,也要清空 targetDepartment
|
|
||||||
form.targetDepartment = '';
|
form.targetDepartment = '';
|
||||||
}
|
}
|
||||||
return isRelease;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(() => transferValue.value, (newValue) => {
|
watch(() => transferValue.value, (newValue) => {
|
||||||
console.log('transferValue changed:', newValue);
|
projectWithDepartment(newValue);
|
||||||
console.log('applicationList length:', applicationList.value?.length);
|
|
||||||
projectWithDepartment(newValue, 1);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 监听 applicationList 加载完成,重新设置已选项目
|
|
||||||
watch(() => applicationList.value, (newList) => {
|
|
||||||
if (newList && newList.length > 0 && props.isEditMode && props.editData?.requestFormDetailList?.length) {
|
|
||||||
console.log('applicationList loaded, re-setting transferValue');
|
|
||||||
// 使用 adviceName 匹配
|
|
||||||
const selectedNames = props.editData.requestFormDetailList.map(item => item.adviceName);
|
|
||||||
const selectedIds = [];
|
|
||||||
newList.forEach(app => {
|
|
||||||
const appName = app.label?.split(' (')[0];
|
|
||||||
if (selectedNames.includes(appName)) {
|
|
||||||
selectedIds.push(app.key);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
transferValue.value = selectedIds;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const getPriorityCode = () => {
|
const getPriorityCode = () => {
|
||||||
@@ -526,8 +443,8 @@ const submit = () => {
|
|||||||
if (transferValue.value.length == 0) {
|
if (transferValue.value.length == 0) {
|
||||||
return proxy.$message.error('请选择检查项目');
|
return proxy.$message.error('请选择检查项目');
|
||||||
}
|
}
|
||||||
if (!projectWithDepartment(transferValue.value, 2)) {
|
if (!form.targetDepartment) {
|
||||||
return;
|
return proxy.$message.error('请选择发往科室');
|
||||||
}
|
}
|
||||||
if (!form.examinationPurpose) {
|
if (!form.examinationPurpose) {
|
||||||
return ElMessageBox.alert('请输入检查目的', '提示', { confirmButtonText: '确定', type: 'warning' });
|
return ElMessageBox.alert('请输入检查目的', '提示', { confirmButtonText: '确定', type: 'warning' });
|
||||||
@@ -542,21 +459,25 @@ const submit = () => {
|
|||||||
let applicationListAllFilter = applicationListAll.value.filter((item) => {
|
let applicationListAllFilter = applicationListAll.value.filter((item) => {
|
||||||
return transferValue.value.includes(item.adviceDefinitionId);
|
return transferValue.value.includes(item.adviceDefinitionId);
|
||||||
});
|
});
|
||||||
|
// 从原始记录中提取检查项目名称,用于申请单名称字段
|
||||||
|
const selectedNames = applicationListAllFilter.map(item => item.adviceName).join('+');
|
||||||
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
||||||
|
// 新接口 getExaminationPage 返回扁平字段(price/unitCode),兼容旧接口 priceList[0]
|
||||||
|
const priceInfo = item.priceList?.[0] || {};
|
||||||
return {
|
return {
|
||||||
adviceDefinitionId: item.adviceDefinitionId,
|
adviceDefinitionId: item.adviceDefinitionId,
|
||||||
adviceName: item.adviceName,
|
adviceName: item.adviceName,
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
unitCode: item.priceList[0].unitCode,
|
unitCode: item.unitCode || priceInfo.unitCode || '',
|
||||||
unitPrice: item.priceList[0].price,
|
unitPrice: item.price ?? priceInfo.price ?? 0,
|
||||||
totalPrice: item.priceList[0].price,
|
totalPrice: item.price ?? priceInfo.price ?? 0,
|
||||||
positionId: item.positionId,
|
positionId: item.positionId,
|
||||||
ybClassEnum: item.ybClassEnum,
|
ybClassEnum: item.ybClassEnum,
|
||||||
conditionId: item.conditionId,
|
conditionId: item.conditionId,
|
||||||
encounterDiagnosisId: item.encounterDiagnosisId,
|
encounterDiagnosisId: item.encounterDiagnosisId,
|
||||||
adviceType: item.adviceType,
|
adviceType: item.adviceType,
|
||||||
definitionId: item.priceList[0].definitionId,
|
definitionId: item.chargeItemDefinitionId || priceInfo.definitionId || '',
|
||||||
definitionDetailId: item.priceList[0].definitionDetailId,
|
definitionDetailId: item.definitionDetailId || priceInfo.definitionDetailId || '',
|
||||||
accountId: effectivePatientInfo.value.accountId,
|
accountId: effectivePatientInfo.value.accountId,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -573,7 +494,7 @@ const submit = () => {
|
|||||||
encounterId: effectivePatientInfo.value.encounterId,
|
encounterId: effectivePatientInfo.value.encounterId,
|
||||||
organizationId: effectivePatientInfo.value.inHospitalOrgId,
|
organizationId: effectivePatientInfo.value.inHospitalOrgId,
|
||||||
requestFormId: requestFormId,
|
requestFormId: requestFormId,
|
||||||
name: applicationListAllFilter.map(item => item.adviceName).join('、'),
|
name: selectedNames,
|
||||||
descJson: JSON.stringify(submitForm),
|
descJson: JSON.stringify(submitForm),
|
||||||
categoryEnum: '22',
|
categoryEnum: '22',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@@ -5,13 +5,27 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="surgery-container">
|
<div class="surgery-container">
|
||||||
<div v-loading="loading" class="transfer-wrapper" style="min-height: 300px;">
|
<div class="transfer-wrapper" style="min-height: 300px;">
|
||||||
|
<!-- 搜索框:≥3字触发后端搜索 -->
|
||||||
|
<div style="padding: 6px 0;">
|
||||||
|
<el-input
|
||||||
|
v-model="searchKey"
|
||||||
|
placeholder="请输入3个字及以上搜索"
|
||||||
|
clearable
|
||||||
|
@input="onSearchInput"
|
||||||
|
style="width: 320px;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<!-- 加载提示不阻塞穿梭框操作 -->
|
||||||
|
<div v-if="loading" style="padding:8px 0; color:#909399; font-size:13px;">
|
||||||
|
<el-icon class="is-loading"><Loading /></el-icon> 手术项目加载中...
|
||||||
|
</div>
|
||||||
<el-transfer
|
<el-transfer
|
||||||
|
ref="transferRef"
|
||||||
v-model="transferValue"
|
v-model="transferValue"
|
||||||
:data="applicationList"
|
:data="applicationList"
|
||||||
filter-placeholder="项目代码/名称"
|
:titles="['待选择', '已选择']"
|
||||||
filterable
|
:format="leftPanelFormat"
|
||||||
:titles="['未选择', '已选择']"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="bloodTransfusion-form">
|
<div class="bloodTransfusion-form">
|
||||||
@@ -78,17 +92,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup name="Surgery">
|
<script setup name="Surgery">
|
||||||
import {getCurrentInstance, onBeforeMount, onMounted, reactive, ref, watch} from 'vue';
|
import {computed, getCurrentInstance, onBeforeMount, onMounted, reactive, ref, watch} from 'vue';
|
||||||
import {patientInfo} from '../../../store/patient.js';
|
import {patientInfo} from '../../../store/patient.js';
|
||||||
import {getDepartmentList} from '@/api/public.js';
|
import {getDepartmentList} from '@/api/public.js';
|
||||||
import {getEncounterDiagnosis} from '../../api.js';
|
import {getEncounterDiagnosis} from '../../api.js';
|
||||||
import {getApplicationList, saveSurgery} from './api';
|
import {getSurgeryPage, saveSurgery} from './api';
|
||||||
import {ElMessage} from 'element-plus';
|
import {ElMessage} from 'element-plus';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
// 模块级缓存:避免每次打开弹窗都重新请求手术项目列表
|
// 模块级缓存:避免每次打开弹窗都重新请求手术项目列表
|
||||||
let surgeryRecordsCache = null; // 原始 API 记录
|
let surgeryRecordsCache = null; // 原始 API 记录
|
||||||
let surgeryMappedCache = null; // 映射后的 el-transfer 数据
|
let surgeryMappedCache = null; // 映射后的 el-transfer 数据
|
||||||
|
let searchDebounceTimer = null; // 搜索防抖
|
||||||
|
const transferRef = ref(null);
|
||||||
|
const dbTotal = ref(0); // 数据库中的手术项目总数
|
||||||
|
const searchKey = ref(''); // 搜索关键字
|
||||||
|
const checkedCount = computed(() => transferValue.value.length);
|
||||||
|
const leftPanelFormat = computed(() => ({
|
||||||
|
noChecked: ` 0/${dbTotal.value}`,
|
||||||
|
hasChecked: ` \${checked}/${dbTotal.value}`,
|
||||||
|
}));
|
||||||
// 递归查找树形科室节点
|
// 递归查找树形科室节点
|
||||||
const findTreeItem = (list, id) => {
|
const findTreeItem = (list, id) => {
|
||||||
if (!list || list.length === 0) return null;
|
if (!list || list.length === 0) return null;
|
||||||
@@ -108,55 +131,82 @@ const applicationListAll = ref();
|
|||||||
const applicationList = ref();
|
const applicationList = ref();
|
||||||
const orgOptions = ref([]); // 科室选项
|
const orgOptions = ref([]); // 科室选项
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
|
const mapToTransferItem = (item) => {
|
||||||
|
const price = item.price != null ? Number(item.price).toFixed(2) : '0.00';
|
||||||
|
const unit = item.unitCodeDictText || item.unitCode || '';
|
||||||
|
return {
|
||||||
|
adviceDefinitionId: item.adviceDefinitionId,
|
||||||
|
orgId: item.orgId,
|
||||||
|
label: item.adviceName + ' (¥' + price + '/' + unit + ')',
|
||||||
|
key: item.adviceDefinitionId,
|
||||||
|
};
|
||||||
|
};
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
if (!patientInfo.value?.inHospitalOrgId) {
|
if (!patientInfo.value?.inHospitalOrgId) {
|
||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 命中缓存时直接使用,避免重复请求导致加载缓慢
|
// 命中内存缓存时直接使用
|
||||||
if (surgeryMappedCache && surgeryMappedCache.length > 0) {
|
if (surgeryMappedCache && surgeryMappedCache.length > 0) {
|
||||||
applicationList.value = surgeryMappedCache;
|
applicationList.value = surgeryMappedCache;
|
||||||
applicationListAll.value = surgeryRecordsCache;
|
applicationListAll.value = surgeryRecordsCache;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
loadPage('');
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载手术项目分页数据
|
||||||
|
* @param {string} key 搜索关键字(可选)
|
||||||
|
*/
|
||||||
|
const loadPage = (key) => {
|
||||||
|
const orgId = patientInfo.value.inHospitalOrgId;
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getApplicationList({
|
getSurgeryPage({ organizationId: orgId, pageNo: 1, pageSize: 100, searchKey: key || '' })
|
||||||
pageSize: 500,
|
|
||||||
pageNum: 1,
|
|
||||||
categoryCode: '24',
|
|
||||||
organizationId: patientInfo.value.inHospitalOrgId,
|
|
||||||
adviceTypes: [3, 6], //1 药品 2耗材 3诊疗 6手术
|
|
||||||
})
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code !== 200 || !res.data?.records) {
|
||||||
applicationListAll.value = res.data.records;
|
|
||||||
applicationList.value = res.data.records.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,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
// 写入模块缓存,后续打开弹窗直接复用
|
|
||||||
surgeryRecordsCache = res.data.records;
|
|
||||||
surgeryMappedCache = applicationList.value;
|
|
||||||
} else {
|
|
||||||
console.warn('获取手术项目列表失败:', res.message);
|
|
||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
|
dbTotal.value = 0;
|
||||||
|
loading.value = false;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
dbTotal.value = res.data.total || 0;
|
||||||
|
const records = res.data.records;
|
||||||
|
applicationListAll.value = records;
|
||||||
|
applicationList.value = records.map(mapToTransferItem);
|
||||||
|
// 仅在无搜索时缓存
|
||||||
|
if (!key) {
|
||||||
|
surgeryRecordsCache = records;
|
||||||
|
surgeryMappedCache = applicationList.value;
|
||||||
|
}
|
||||||
|
loading.value = false;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.warn('手术项目列表加载失败(可能无权限):', e?.message || e);
|
console.error('手术项目加载失败:', e);
|
||||||
applicationList.value = [];
|
applicationList.value = [];
|
||||||
})
|
dbTotal.value = 0;
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索输入框变化处理(防抖300ms,≥3字触发后端搜索)
|
||||||
|
*/
|
||||||
|
const onSearchInput = () => {
|
||||||
|
clearTimeout(searchDebounceTimer);
|
||||||
|
const val = searchKey.value.trim();
|
||||||
|
if (!val) {
|
||||||
|
// 清空搜索框,恢复初始数据
|
||||||
|
loadPage('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (val.length >= 3) {
|
||||||
|
searchDebounceTimer = setTimeout(() => {
|
||||||
|
loadPage(val);
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const transferValue = ref([]);
|
const transferValue = ref([]);
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
// categoryType: '', // 项目类别
|
// categoryType: '', // 项目类别
|
||||||
@@ -243,20 +293,15 @@ const submit = () => {
|
|||||||
});
|
});
|
||||||
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
applicationListAllFilter = applicationListAllFilter.map((item) => {
|
||||||
return {
|
return {
|
||||||
adviceDefinitionId: item.adviceDefinitionId /** 诊疗定义id */,
|
adviceDefinitionId: item.adviceDefinitionId,
|
||||||
adviceDefinitionName: item.adviceDefinitionName /** 诊疗定义名称(手术项目名称) */,
|
adviceDefinitionName: item.adviceName,
|
||||||
quantity: 1, // /** 请求数量 */
|
quantity: 1,
|
||||||
unitCode: item.priceList[0].unitCode /** 请求单位编码 */,
|
unitCode: item.unitCode,
|
||||||
unitPrice: item.priceList[0].price /** 单价 */,
|
unitPrice: item.price,
|
||||||
totalPrice: item.priceList[0].price /** 总价 */,
|
totalPrice: item.price,
|
||||||
positionId: item.positionId, //执行科室id
|
positionId: item.positionId,
|
||||||
ybClassEnum: item.ybClassEnum, //类别医保编码
|
definitionId: item.chargeItemDefinitionId,
|
||||||
conditionId: item.conditionId, //诊断ID
|
accountId: patientInfo.value.accountId,
|
||||||
encounterDiagnosisId: item.encounterDiagnosisId, //就诊诊断id
|
|
||||||
adviceType: item.adviceType, ///** 医嘱类型 */
|
|
||||||
definitionId: item.priceList[0].definitionId, //费用定价主表ID */
|
|
||||||
definitionDetailId: item.definitionDetailId, //费用定价子表ID */
|
|
||||||
accountId: patientInfo.value.accountId, // // 账户id
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
saveSurgery({
|
saveSurgery({
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ const form = ref({
|
|||||||
prescriptionList: prescriptionList.value,
|
prescriptionList: prescriptionList.value,
|
||||||
});
|
});
|
||||||
const adviceQueryParams = ref({
|
const adviceQueryParams = ref({
|
||||||
adviceType: '',
|
adviceType: 1,
|
||||||
categoryCode: '', // 初始为空,等待加载配置后动态设置
|
categoryCode: '', // 初始为空,等待加载配置后动态设置
|
||||||
searchKey: '',
|
searchKey: '',
|
||||||
});
|
});
|
||||||
@@ -533,7 +533,6 @@ const statusOption = [
|
|||||||
let loadingInstance = undefined;
|
let loadingInstance = undefined;
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.addEventListener('keydown', escKeyListener);
|
document.addEventListener('keydown', escKeyListener);
|
||||||
getList();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -574,6 +573,7 @@ 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;
|
||||||
@@ -585,11 +585,6 @@ 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();
|
||||||
@@ -691,7 +686,7 @@ function loadConfiguredCategories() {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
// 创建新对象触发响应式更新
|
// 创建新对象触发响应式更新
|
||||||
adviceQueryParams.value = {
|
adviceQueryParams.value = {
|
||||||
adviceType: '',
|
adviceType: 1,
|
||||||
categoryCode: defaultCategoryCode,
|
categoryCode: defaultCategoryCode,
|
||||||
searchKey: '',
|
searchKey: '',
|
||||||
};
|
};
|
||||||
@@ -715,17 +710,9 @@ 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) &&
|
||||||
matchAdviceType &&
|
(!orderClassCode.value || orderClassCode.value == item.adviceType) &&
|
||||||
(!orderStatus.value || (orderStatus.value == item.statusEnum && item.requestId))
|
(!orderStatus.value || (orderStatus.value == item.statusEnum && item.requestId))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -753,28 +740,12 @@ 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) {
|
||||||
const compositeValue = '1-' + row.categoryCode;
|
return '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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增医嘱
|
// 新增医嘱
|
||||||
@@ -831,8 +802,8 @@ function clickRowDb(row, column, event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row.showPopover = false;
|
row.showPopover = false;
|
||||||
// 仅”待签发(statusEnum==1)”允许编辑;”已签发(statusEnum==2)”及之后状态不允许编辑
|
// “待签发(已保存 requestId存在)”不允许再编辑;仅“待保存(无requestId)”允许编辑
|
||||||
if (row.statusEnum == 1) {
|
if (row.statusEnum == 1 && !row.requestId) {
|
||||||
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
||||||
row.therapyEnum = String(row.therapyEnum ?? '1');
|
row.therapyEnum = String(row.therapyEnum ?? '1');
|
||||||
row.isEdit = true;
|
row.isEdit = true;
|
||||||
@@ -910,9 +881,9 @@ function handleFocus(row, index) {
|
|||||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||||
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
const selectValue = (adviceType == 1 && row.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||||
// 修复Bug #486:当行没有显式选择医嘱类型时(row.adviceType为undefined),
|
// If the row has an explicit adviceType (saved/existing row), use its own categoryCode.
|
||||||
// 不传categoryCode,让搜索在全药库中进行;只有行已选择类型时才用对应categoryCode过滤
|
// If no type is selected (new row), use empty string for global search across all categories.
|
||||||
const categoryCode = row.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : '';
|
const categoryCode = selectedItem ? selectedItem.categoryCode : (row.adviceType != null ? (row.categoryCode || '') : '');
|
||||||
const searchKey = row.adviceName || '';
|
const searchKey = row.adviceName || '';
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -949,12 +920,9 @@ function handleChange(value) {
|
|||||||
// 用 adviceType + categoryCode 组合查找匹配的选项
|
// 用 adviceType + categoryCode 组合查找匹配的选项
|
||||||
const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
const selectValue = (adviceType == 1 && row?.categoryCode) ? '1-' + row.categoryCode : adviceType;
|
||||||
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
const selectedItem = adviceTypeList.value.find(item => item.value === selectValue) || adviceTypeList.value.find(item => item.adviceType === adviceType);
|
||||||
// 修复Bug #486:当行没有显式选择医嘱类型时(row?.adviceType为undefined),
|
// 修复Bug #486:当行没有显式选择医嘱类型时,不传categoryCode,让搜索在全药库中进行
|
||||||
// 不传categoryCode,让搜索在全药库中进行;只有行已选择类型时才用对应categoryCode过滤
|
const categoryCode = selectedItem ? selectedItem.categoryCode : (row?.adviceType !== undefined ? (adviceQueryParams.value.categoryCode || '') : '');
|
||||||
const categoryCode = row?.adviceType !== undefined ? (selectedItem ? selectedItem.categoryCode : '') : '';
|
tableRef.refresh(adviceType, categoryCode, value);
|
||||||
// 修复Bug #453:当adviceType为空字符串或NaN时,不传具体类型,让refresh函数根据searchKey决定搜索范围
|
|
||||||
const effectiveAdviceType = (adviceType && !isNaN(Number(adviceType))) ? adviceType : '';
|
|
||||||
tableRef.refresh(effectiveAdviceType, categoryCode, value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1213,27 +1181,19 @@ function handleSave() {
|
|||||||
});
|
});
|
||||||
// 此处签发处方和单行保存处方传参相同,后台已经将传参存为JSON字符串,此处直接转换为JSON即可
|
// 此处签发处方和单行保存处方传参相同,后台已经将传参存为JSON字符串,此处直接转换为JSON即可
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
let list = [];
|
let list = saveList.map((item) => {
|
||||||
try {
|
const parsedContent = JSON.parse(item.contentJson);
|
||||||
list = saveList.map((item) => {
|
return {
|
||||||
const parsedContent = item.contentJson ? JSON.parse(item.contentJson) || {} : {};
|
...parsedContent,
|
||||||
return {
|
adviceType: item.adviceType,
|
||||||
...parsedContent,
|
requestId: item.requestId,
|
||||||
adviceType: item.adviceType,
|
dbOpType: '1',
|
||||||
requestId: item.requestId,
|
groupId: item.groupId,
|
||||||
dbOpType: '1',
|
uniqueKey: undefined,
|
||||||
groupId: item.groupId,
|
// 确保 therapyEnum 被正确传递
|
||||||
uniqueKey: undefined,
|
therapyEnum: parsedContent.therapyEnum || item.therapyEnum || '1',
|
||||||
// 确保 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('签发处方参数:', {
|
||||||
@@ -1248,16 +1208,9 @@ 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;
|
||||||
@@ -1358,12 +1311,11 @@ 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 || String(itemNo).trim() === '') {
|
if (!itemNo) {
|
||||||
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: String(itemNo) }).then((res) => {
|
getBindDevice({ typeCode: row.adviceType, itemNo: itemNo }).then((res) => {
|
||||||
if (res.data.length == 0) {
|
if (res.data.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1424,21 +1376,13 @@ 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) {
|
||||||
row.dbOpType = '1';
|
handleAddPrescription();
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -1479,40 +1423,32 @@ function handleSaveBatch() {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
proxy.$modal.msgSuccess('保存成功');
|
proxy.$modal.msgSuccess('保存成功');
|
||||||
// 修复 Bug #405:保存成功后锁定所有待保存行,避免医嘱条目仍处于可编辑状态
|
// 修复【#405】:保存成功后重置所有待保存行的 isEdit 为 false,锁定医嘱不再编辑
|
||||||
// saveList 中的 item 与 prescriptionList 是同一对象引用,直接修改即可
|
|
||||||
saveList.forEach(item => {
|
saveList.forEach(item => {
|
||||||
item.isEdit = false;
|
const row = prescriptionList.value.find(r => r.uniqueKey === item.uniqueKey);
|
||||||
|
if (row) row.isEdit = false;
|
||||||
});
|
});
|
||||||
// 兜底:锁定所有 statusEnum == 1 的行,确保没有遗漏
|
|
||||||
prescriptionList.value.forEach(row => {
|
|
||||||
if (row.statusEnum == 1) {
|
|
||||||
row.isEdit = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
expandOrder.value = [];
|
|
||||||
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 || '保存失败,请重试');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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 +1513,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 +1531,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,
|
||||||
@@ -1630,21 +1562,17 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
// 🔥 新版组件已经预处理了数据,优先使用 mergedDetail
|
// 🔥 新版组件已经预处理了数据,优先使用 mergedDetail
|
||||||
const mergedDetail = item.mergedDetail || {
|
const mergedDetail = item.mergedDetail || {
|
||||||
...(item.orderDetailInfos || {}),
|
...(item.orderDetailInfos || {}),
|
||||||
adviceName: item.orderDefinitionName || item.orderDetailInfos?.adviceName || '未知项目',
|
adviceName: item.orderDetailInfos?.adviceName || item.orderDefinitionName || '未知项目',
|
||||||
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,
|
||||||
// 🔧 Bug #403 修复:dose/doseQuantity/dispensePerDuration 需用 null 检查,
|
dose: item.dose || item.orderDetailInfos?.dose,
|
||||||
// 避免组套中值为 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 !== undefined && item.dispensePerDuration !== null
|
dispensePerDuration: item.dispensePerDuration || item.orderDetailInfos?.dispensePerDuration,
|
||||||
? item.dispensePerDuration : item.orderDetailInfos?.dispensePerDuration,
|
doseQuantity: item.doseQuantity,
|
||||||
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,
|
||||||
@@ -1663,15 +1591,20 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
setValue(mergedDetail);
|
setValue(mergedDetail);
|
||||||
|
|
||||||
// 创建新的处方项目
|
// 创建新的处方项目
|
||||||
// 🔧 Bug #403 修复:关键字段使用 null-safe 回退到 mergedDetail(已由 setValue 填充完整数据)
|
|
||||||
// 先取 setValue 填充的行数据作为基础
|
|
||||||
const baseRow = prescriptionList.value[rowIndex.value];
|
|
||||||
const newRow = {
|
const newRow = {
|
||||||
...baseRow,
|
...prescriptionList.value[rowIndex.value],
|
||||||
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,确保树匹配不到时仍有中文名称可显示
|
||||||
@@ -1680,33 +1613,19 @@ function handleSaveGroup(orderGroupList) {
|
|||||||
conditionId: conditionId.value,
|
conditionId: conditionId.value,
|
||||||
conditionDefinitionId: conditionDefinitionId.value,
|
conditionDefinitionId: conditionDefinitionId.value,
|
||||||
encounterDiagnosisId: encounterDiagnosisId.value,
|
encounterDiagnosisId: encounterDiagnosisId.value,
|
||||||
therapyEnum: baseRow?.therapyEnum || '1',
|
therapyEnum: prescriptionList.value[rowIndex.value]?.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 || '';
|
|
||||||
|
|
||||||
// 计算价格和总量
|
// 计算价格和总量
|
||||||
// 🔧 Bug #403 修复:使用 newRow.unitCode(已由 setValue 填充)而非 item.unitCode
|
const unitInfo = unitCodeList.value.find((k) => k.value == 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 = ((finalQuantity || 0) * newRow.minUnitPrice).toFixed(6);
|
newRow.totalPrice = (item.quantity * newRow.minUnitPrice).toFixed(6);
|
||||||
newRow.minUnitQuantity = finalQuantity || 0;
|
newRow.minUnitQuantity = item.quantity;
|
||||||
} else {
|
} else {
|
||||||
newRow.price = newRow.unitPrice;
|
newRow.price = newRow.unitPrice;
|
||||||
newRow.totalPrice = ((finalQuantity || 0) * newRow.unitPrice).toFixed(6);
|
newRow.totalPrice = (item.quantity * newRow.unitPrice).toFixed(6);
|
||||||
newRow.minUnitQuantity = (finalQuantity || 0) * partPercent;
|
newRow.minUnitQuantity = item.quantity * (item.orderDetailInfos?.partPercent || mergedDetail.partPercent || 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
newRow.contentJson = JSON.stringify(newRow);
|
newRow.contentJson = JSON.stringify(newRow);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<span class="descriptions-item-label">全选:</span>
|
<span class="descriptions-item-label">全选:</span>
|
||||||
<el-switch v-model="chooseAll" @change="handelSwitchChange" />
|
<el-switch v-model="chooseAll" @change="handelSwitchChange" />
|
||||||
<el-button class="ml20" type="primary" @click="handleCheck"> 核对通过 </el-button>
|
<el-button class="ml20" type="primary" @click="handleCheck"> 核对通过 </el-button>
|
||||||
<el-button class="ml20 mr20" type="danger" @click="handleCancel"> 退回 </el-button>
|
<el-button class="ml20 mr20" type="danger" :disabled="hasDispensedSelected" @click="handleCancel"> 退回 </el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -152,6 +152,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import {ref, computed} from 'vue';
|
||||||
import {adviceVerify, cancel, getPrescriptionList} from './api';
|
import {adviceVerify, cancel, getPrescriptionList} from './api';
|
||||||
import {patientInfoList} from '../../components/store/patient.js';
|
import {patientInfoList} from '../../components/store/patient.js';
|
||||||
import {formatDateStr} from '@/utils/index';
|
import {formatDateStr} from '@/utils/index';
|
||||||
@@ -163,6 +164,11 @@ const type = ref(null);
|
|||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const chooseAll = ref(false);
|
const chooseAll = ref(false);
|
||||||
|
const selectionTrigger = ref(0);
|
||||||
|
const hasDispensedSelected = computed(() => {
|
||||||
|
selectionTrigger.value;
|
||||||
|
return getSelectRows().some(item => item.dispenseStatus === 4);
|
||||||
|
});
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
requestStatus: {
|
requestStatus: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -262,7 +268,9 @@ function getGroupMarkers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 选择框改变时的处理
|
// 选择框改变时的处理
|
||||||
function handleSelectionChange(selection, row) {}
|
function handleSelectionChange(selection, row) {
|
||||||
|
selectionTrigger.value++;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 核对通过
|
* 核对通过
|
||||||
@@ -291,7 +299,7 @@ function handleCancel() {
|
|||||||
// 校验已发药的医嘱不允许退回
|
// 校验已发药的医嘱不允许退回
|
||||||
let dispensedItems = list.filter(item => item.dispenseStatus === 4);
|
let dispensedItems = list.filter(item => item.dispenseStatus === 4);
|
||||||
if (dispensedItems.length > 0) {
|
if (dispensedItems.length > 0) {
|
||||||
proxy.$message.error('该医嘱已发药,无法退回');
|
proxy.$message.error('该药品已由药房发放,请先执行退药处理,不可直接退回');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cancel(list).then((res) => {
|
cancel(list).then((res) => {
|
||||||
@@ -310,12 +318,16 @@ function getSelectRows() {
|
|||||||
// 获取选中的医嘱信息
|
// 获取选中的医嘱信息
|
||||||
let list = [];
|
let list = [];
|
||||||
prescriptionList.value.forEach((item, index) => {
|
prescriptionList.value.forEach((item, index) => {
|
||||||
list = [...list, ...proxy.$refs['tableRef' + index][0].getSelectionRows()];
|
const ref = proxy.$refs['tableRef' + index];
|
||||||
|
if (ref && ref[0]) {
|
||||||
|
list = [...list, ...ref[0].getSelectionRows()];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return list.map((item) => {
|
return list.map((item) => {
|
||||||
return {
|
return {
|
||||||
requestId: item.requestId,
|
requestId: item.requestId,
|
||||||
requestTable: item.adviceTable,
|
requestTable: item.adviceTable,
|
||||||
|
dispenseStatus: item.dispenseStatus,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,无法调用!');
|
||||||
|
|||||||
@@ -546,7 +546,7 @@
|
|||||||
v-model="form.admissionTime"
|
v-model="form.admissionTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择入室时间"
|
placeholder="选择入室时间"
|
||||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -558,7 +558,7 @@
|
|||||||
v-model="form.entryTime"
|
v-model="form.entryTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择进室时间"
|
placeholder="选择进室时间"
|
||||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -570,7 +570,7 @@
|
|||||||
v-model="form.anesStart"
|
v-model="form.anesStart"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择麻醉开始时间"
|
placeholder="选择麻醉开始时间"
|
||||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -584,7 +584,7 @@
|
|||||||
v-model="form.startTime"
|
v-model="form.startTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择切开时间"
|
placeholder="选择切开时间"
|
||||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -596,7 +596,7 @@
|
|||||||
v-model="form.endTime"
|
v-model="form.endTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择手术结束时间"
|
placeholder="选择手术结束时间"
|
||||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -608,7 +608,7 @@
|
|||||||
v-model="form.anesEnd"
|
v-model="form.anesEnd"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择麻醉结束时间"
|
placeholder="选择麻醉结束时间"
|
||||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -689,7 +689,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 手术申请查询弹窗 -->
|
<!-- 手术申请查询弹窗 -->
|
||||||
<el-dialog :title="'手术申请查询'" v-model="showApplyDialog" width="1200px" @close="cancelApplyDialog">
|
<el-dialog :title="'手术申请查询'" v-model="showApplyDialog" width="1200px" @close="cancelApplyDialog" class="surgery-apply-dialog">
|
||||||
<!-- 查询条件区 -->
|
<!-- 查询条件区 -->
|
||||||
<el-form :model="applyQueryParams" ref="applyQueryRef" :inline="true" class="query-form">
|
<el-form :model="applyQueryParams" ref="applyQueryRef" :inline="true" class="query-form">
|
||||||
<el-form-item label="手术单号" prop="surgeryNo">
|
<el-form-item label="手术单号" prop="surgeryNo">
|
||||||
@@ -741,16 +741,16 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- 结果表格区 -->
|
<!-- 结果表格区 -->
|
||||||
<el-table
|
<el-table
|
||||||
ref="applyTableRef"
|
ref="applyTableRef"
|
||||||
v-loading="applyLoading"
|
v-loading="applyLoading"
|
||||||
:data="applyList"
|
:data="applyList"
|
||||||
row-key="surgeryNo"
|
row-key="surgeryNo"
|
||||||
@row-click="handleApplyRowClick"
|
@row-click="handleApplyRowClick"
|
||||||
:row-class-name="tableRowClassName"
|
:row-class-name="tableRowClassName"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
max-height="400"
|
max-height="340"
|
||||||
:scroll="{ y: 400 }"
|
:scroll="{ y: 340 }"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" :selectable="handleSelectable" />
|
<el-table-column type="selection" width="55" :selectable="handleSelectable" />
|
||||||
<el-table-column label="ID" align="center" width="80" fixed>
|
<el-table-column label="ID" align="center" width="80" fixed>
|
||||||
@@ -781,7 +781,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 底部分页区 -->
|
<!-- 底部分页区 -->
|
||||||
<div class="pagination-container" style="margin-top: 10px; padding-bottom: 10px">
|
<div class="pagination-container apply-pagination" style="margin-top: 10px; padding-bottom: 20px">
|
||||||
<pagination
|
<pagination
|
||||||
v-show="applyTotal > 0"
|
v-show="applyTotal > 0"
|
||||||
:total="applyTotal"
|
:total="applyTotal"
|
||||||
@@ -792,10 +792,12 @@
|
|||||||
@pagination="getSurgicalScheduleList"
|
@pagination="getSurgicalScheduleList"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 分页与底部操作区之间的间隔 -->
|
||||||
|
<div style="height: 48px"></div>
|
||||||
|
|
||||||
<!-- 底部操作区 -->
|
<!-- 底部操作区 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer" style="margin-top: 24px; padding-top: 12px; border-top: 1px solid #ebeef5">
|
||||||
<el-button @click="cancelApplyDialog">取消</el-button>
|
<el-button @click="cancelApplyDialog">取消</el-button>
|
||||||
<el-button type="primary" @click="confirmApply">确认</el-button>
|
<el-button type="primary" @click="confirmApply">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -1535,8 +1537,8 @@ function handleMedicalAdvice(row) {
|
|||||||
temporarySigned.value = hasSubmittedAdvices; // 修复:根据已有数据状态设置,而非盲目重置
|
temporarySigned.value = hasSubmittedAdvices; // 修复:根据已有数据状态设置,而非盲目重置
|
||||||
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
|
||||||
|
|
||||||
// 调用计费接口获取数据(使用手术计费来源参数,匹配 surgery billing 创建的记录)
|
// 调用计费接口获取数据
|
||||||
getPrescriptionList(row.visitId, 6, row.operCode).then((res) => {
|
getPrescriptionList(row.visitId).then((res) => {
|
||||||
console.log('=== 拉取计费数据返回结果 ===', res)
|
console.log('=== 拉取计费数据返回结果 ===', res)
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
// 🔧 修复:显示所有药品请求数据,不管有没有计费项目
|
// 🔧 修复:显示所有药品请求数据,不管有没有计费项目
|
||||||
@@ -1741,39 +1743,27 @@ function handleTemporaryMedicalSubmit(data) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 🔧 修复 Bug #445: 使用稳定可靠的字段组合匹配已提交项目,从已生成列表中剔除待生成项
|
// 🔧 修复 Bug #445: 使用稳定的字段组合匹配已提交项目,而不是依赖可能为空的 requestId/chargeItemId
|
||||||
// 匹配键:优先使用 chargeItemId(后端费用项目ID,最可靠),其次使用 名称+规格+数量 组合
|
// 构建已提交项目的匹配键集合(药品名称 + 规格 + 数量)
|
||||||
const submittedKeys = new Set()
|
const submittedKeys = new Set(
|
||||||
const submittedChargeIds = new Set()
|
(data.temporaryAdvices || [])
|
||||||
|
.map(a => {
|
||||||
|
const om = a.originalMedicine || {}
|
||||||
|
const name = om.medicineName || om.adviceName || om.advice_name || a.adviceName || ''
|
||||||
|
const spec = om.specification || om.volume || ''
|
||||||
|
const qty = om.quantity || 0
|
||||||
|
return `${name}|||${spec}|||${qty}`
|
||||||
|
})
|
||||||
|
.filter(k => k !== '|||0') // 过滤掉空项
|
||||||
|
)
|
||||||
|
|
||||||
;(data.temporaryAdvices || []).forEach(a => {
|
if (submittedKeys.size > 0) {
|
||||||
const om = a.originalMedicine || {}
|
|
||||||
// 收集 chargeItemId(最可靠的匹配标识)
|
|
||||||
if (om.chargeItemId) {
|
|
||||||
submittedChargeIds.add(om.chargeItemId)
|
|
||||||
}
|
|
||||||
// 构建名称+规格+数量的匹配键(用于无 chargeItemId 的兜底匹配)
|
|
||||||
// 注意:originalMedicine 中的名称字段是 adviceName(来自 billingMedicines.map 时的字段)
|
|
||||||
const name = om.medicineName || om.adviceName || om.advice_name || a.adviceName || ''
|
|
||||||
const spec = om.specification || om.volume || ''
|
|
||||||
const qty = om.quantity || 0
|
|
||||||
if (name) {
|
|
||||||
submittedKeys.add(`${name}|||${spec}|||${qty}`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (submittedChargeIds.size > 0 || submittedKeys.size > 0) {
|
|
||||||
temporaryBillingMedicines.value = (temporaryBillingMedicines.value || []).filter(m => {
|
temporaryBillingMedicines.value = (temporaryBillingMedicines.value || []).filter(m => {
|
||||||
// 优先用 chargeItemId 匹配
|
const key = `${m.medicineName || ''}|||${m.specification || ''}|||${m.quantity || 0}`
|
||||||
if (m.chargeItemId && submittedChargeIds.has(m.chargeItemId)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
// 兜底用 名称+规格+数量 匹配
|
|
||||||
const key = `${m.medicineName || m.adviceName || ''}|||${m.specification || m.volume || ''}|||${m.quantity || 0}`
|
|
||||||
return !submittedKeys.has(key)
|
return !submittedKeys.has(key)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 如果没有任何匹配标识,清空待生成列表(保守策略:认为所有项目都已提交)
|
// 如果没有任何匹配键,清空待生成列表(所有项目都已提交)
|
||||||
temporaryBillingMedicines.value = []
|
temporaryBillingMedicines.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2362,6 +2352,22 @@ function getRowClassName({ row, rowIndex }) {
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 手术申请查询弹窗 — 分页与footer间距 */
|
||||||
|
.surgery-apply-dialog :deep(.el-dialog__body) {
|
||||||
|
padding-bottom: 32px;
|
||||||
|
}
|
||||||
|
.surgery-apply-dialog :deep(.el-dialog__footer) {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
.surgery-apply-dialog :deep(.apply-pagination) {
|
||||||
|
padding-bottom: 24px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
.surgery-apply-dialog :deep(.apply-pagination .el-pagination) {
|
||||||
|
margin-right: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 选中行样式 */
|
/* 选中行样式 */
|
||||||
:deep(.el-table .selected-row) {
|
:deep(.el-table .selected-row) {
|
||||||
background-color: #ecf5ff !important;
|
background-color: #ecf5ff !important;
|
||||||
@@ -2372,3 +2378,21 @@ function getRowClassName({ row, rowIndex }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* 手术申请查询弹窗 — 非 scoped 确保穿透 teleport */
|
||||||
|
.surgery-apply-dialog .apply-pagination {
|
||||||
|
padding-bottom: 24px !important;
|
||||||
|
margin-bottom: 16px !important;
|
||||||
|
border-bottom: 1px solid #ebeef5 !important;
|
||||||
|
}
|
||||||
|
.surgery-apply-dialog .apply-pagination .el-pagination {
|
||||||
|
margin-right: 80px !important;
|
||||||
|
}
|
||||||
|
.surgery-apply-dialog .el-dialog__body {
|
||||||
|
padding-bottom: 32px !important;
|
||||||
|
}
|
||||||
|
.surgery-apply-dialog .el-dialog__footer {
|
||||||
|
padding-top: 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user