From 0080d89f7e29e10b29e1b1ec877d5433edd8107e Mon Sep 17 00:00:00 2001 From: guanyu Date: Tue, 14 Apr 2026 17:11:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?test:=20=E3=80=90=E5=85=B3=E7=BE=BD?= =?UTF-8?q?=E3=80=91=E7=A6=81=E7=94=A8=E4=BB=A3=E7=90=86=E5=90=8E=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20gitea=20=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git_test3.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 git_test3.md diff --git a/git_test3.md b/git_test3.md new file mode 100644 index 00000000..2bdb4ab9 --- /dev/null +++ b/git_test3.md @@ -0,0 +1 @@ +# Git 代理禁用后测试 - 关羽 2026-04-14 17:11:41 From 51d4b1e3f2eb9451e4e9bbd0f3d67bf5c318df0f Mon Sep 17 00:00:00 2001 From: zhangfei Date: Tue, 14 Apr 2026 17:12:02 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E3=80=90=E5=BC=A0=E9=A3=9E=E3=80=91Gitea?= =?UTF-8?q?=20=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TEST.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 TEST.md diff --git a/TEST.md b/TEST.md new file mode 100644 index 00000000..ee473aa2 --- /dev/null +++ b/TEST.md @@ -0,0 +1 @@ +# 张飞测试记录 From fe7778e6e03ba45d1a8099ddd0210c70d11a1696 Mon Sep 17 00:00:00 2001 From: guanyu Date: Tue, 14 Apr 2026 17:12:39 +0800 Subject: [PATCH 3/6] test: ACP test --- test-acp.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test-acp.txt diff --git a/test-acp.txt b/test-acp.txt new file mode 100644 index 00000000..759a8508 --- /dev/null +++ b/test-acp.txt @@ -0,0 +1 @@ +test Tue Apr 14 05:12:39 PM CST 2026 From 26e0665eeb39823e86c0e0507c214cc7e3036d65 Mon Sep 17 00:00:00 2001 From: duzhongxu <15039018447@163.com> Date: Tue, 14 Apr 2026 17:23:44 +0800 Subject: [PATCH 4/6] =?UTF-8?q?103=20=E5=A2=9E=E5=8A=A0=E5=8C=BB=E7=94=9F?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=8A=A5=E5=8D=A1=E7=AE=A1=E7=90=86=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=88=E9=9C=80=E6=B1=82=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CardManageAppServiceImpl.java | 244 ++++--- .../web/cardmanagement/dto/CardQueryDto.java | 4 +- .../cardmanagement/dto/DoctorCardListDto.java | 52 +- .../dto/DoctorCardQueryDto.java | 4 +- .../dto/DoctorCardUpdateDto.java | 36 +- .../cardmanagement/dto/InfectiousCardDto.java | 8 +- .../mapper/InfectiousAuditMapper.java | 6 +- .../mapper/InfectiousCardMapper.java | 14 +- .../dto/InfectiousCardDto.java | 7 +- .../infectious/domain/InfectiousAudit.java | 5 +- .../infectious/domain/InfectiousCard.java | 32 +- .../ReportManagement/index.vue | 12 +- .../infectiousDiseaseReportDialog.vue | 18 +- .../components/infectiousReport/index.vue | 230 ++++-- .../doctorstation/mycardmanagement/index.vue | 668 ++++++++++-------- 15 files changed, 833 insertions(+), 507 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java index d7624e92..b026ccb7 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/appservice/impl/CardManageAppServiceImpl.java @@ -12,6 +12,8 @@ import com.core.common.utils.SecurityUtils; import com.core.common.core.domain.model.LoginUser; import com.openhis.infectious.domain.InfectiousAudit; import com.openhis.infectious.domain.InfectiousCard; +import com.openhis.administration.domain.Practitioner; +import com.openhis.administration.service.IPractitionerService; import com.openhis.web.cardmanagement.appservice.ICardManageAppService; import com.openhis.web.cardmanagement.dto.*; import com.openhis.web.cardmanagement.mapper.InfectiousAuditMapper; @@ -52,6 +54,7 @@ public class CardManageAppServiceImpl implements ICardManageAppService { private final InfectiousCardMapper infectiousCardMapper; private final InfectiousAuditMapper infectiousAuditMapper; + private final IPractitionerService iPractitionerService; @Override public CardStatisticsDto getStatistics() { @@ -74,7 +77,7 @@ public class CardManageAppServiceImpl implements ICardManageAppService { } // 状态 - if (StringUtils.hasText(queryParams.getStatus())) { + if (queryParams.getStatus() != null) { wrapper.eq(InfectiousCard::getStatus, queryParams.getStatus()); } @@ -127,7 +130,7 @@ public class CardManageAppServiceImpl implements ICardManageAppService { if (card == null) { return new ArrayList<>(); } - List records = infectiousAuditMapper.selectByCardId(card.getId()); + List records = infectiousAuditMapper.selectByCardId(card.getCardNo()); return records.stream().map(this::convertAuditToDto).collect(Collectors.toList()); } @@ -145,16 +148,16 @@ public class CardManageAppServiceImpl implements ICardManageAppService { for (String cardNo : batchAuditDto.getCardNos()) { InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); if (card == null) continue; - if ("2".equals(card.getStatus()) || "3".equals(card.getStatus())) continue; + if (Integer.valueOf(2).equals(card.getStatus()) || Integer.valueOf(3).equals(card.getStatus())) continue; // 更新状态为已审核 - String oldStatus = card.getStatus(); - card.setStatus("2"); + Integer oldStatus = card.getStatus(); + card.setStatus(2); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); // 创建审核记录 - createAuditRecord(card.getId(), oldStatus, "2", "1", batchAuditDto.getAuditOpinion(), + createAuditRecord(card.getCardNo(), oldStatus, 2, 1, batchAuditDto.getAuditOpinion(), null, auditorId, auditorName, true, batchAuditDto.getCardNos().size()); successCount++; } @@ -176,17 +179,17 @@ public class CardManageAppServiceImpl implements ICardManageAppService { for (String cardNo : batchReturnDto.getCardNos()) { InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo); if (card == null) continue; - if ("2".equals(card.getStatus()) || "3".equals(card.getStatus())) continue; + if (Integer.valueOf(2).equals(card.getStatus()) || Integer.valueOf(3).equals(card.getStatus())) continue; // 更新状态为退回 (审核失败) - String oldStatus = card.getStatus(); - card.setStatus("5"); + Integer oldStatus = card.getStatus(); + card.setStatus(5); card.setReturnReason(batchReturnDto.getReturnReason()); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); // 创建审核记录 - createAuditRecord(card.getId(), oldStatus, "5", "3", null, + createAuditRecord(card.getCardNo(), oldStatus, 5, 3, null, batchReturnDto.getReturnReason(), auditorId, auditorName, true, batchReturnDto.getCardNos().size()); successCount++; } @@ -206,13 +209,13 @@ public class CardManageAppServiceImpl implements ICardManageAppService { String auditorName = SecurityUtils.getUsername(); // 更新状态 - String oldStatus = card.getStatus(); - card.setStatus("2"); + Integer oldStatus = card.getStatus(); + card.setStatus(2); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); // 创建审核记录 - createAuditRecord(card.getId(), oldStatus, "2", "2", auditDto.getAuditOpinion(), + createAuditRecord(card.getCardNo(), oldStatus, 2, 2, auditDto.getAuditOpinion(), null, auditorId, auditorName, false, 1); return R.ok("审核通过"); @@ -230,14 +233,14 @@ public class CardManageAppServiceImpl implements ICardManageAppService { String auditorName = SecurityUtils.getUsername(); // 更新状态 - String oldStatus = card.getStatus(); - card.setStatus("5"); + Integer oldStatus = card.getStatus(); + card.setStatus(5); card.setReturnReason(returnDto.getReturnReason()); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); // 创建审核记录 - createAuditRecord(card.getId(), oldStatus, "5", "4", null, + createAuditRecord(card.getCardNo(), oldStatus, 5, 4, null, returnDto.getReturnReason(), auditorId, auditorName, false, 1); return R.ok("已退回"); @@ -251,7 +254,7 @@ public class CardManageAppServiceImpl implements ICardManageAppService { if (queryParams.getRegistrationSource() != null) { wrapper.eq(InfectiousCard::getRegistrationSource, queryParams.getRegistrationSource()); } - if (StringUtils.hasText(queryParams.getStatus())) { + if (queryParams.getStatus() != null) { wrapper.eq(InfectiousCard::getStatus, queryParams.getStatus()); } if (StringUtils.hasText(queryParams.getPatientName())) { @@ -292,7 +295,7 @@ public class CardManageAppServiceImpl implements ICardManageAppService { row.createCell(1).setCellValue(card.getPatName()); row.createCell(2).setCellValue("1".equals(card.getSex()) ? "男" : "2".equals(card.getSex()) ? "女" : "未知"); row.createCell(3).setCellValue(card.getAge() != null ? card.getAge() + "岁" : ""); - row.createCell(4).setCellValue(card.getDiseaseName()); + row.createCell(4).setCellValue(card.getDiseaseCode()); row.createCell(5).setCellValue(card.getDeptName()); row.createCell(6).setCellValue(card.getCreateTime() != null ? dateFormat.format(card.getCreateTime()) : ""); row.createCell(7).setCellValue(getStatusText(card.getStatus())); @@ -316,7 +319,19 @@ public class CardManageAppServiceImpl implements ICardManageAppService { @Override public DoctorCardStatisticsDto getDoctorCardStatistics() { - Long doctorId = SecurityUtils.getUserId(); + Long userId = SecurityUtils.getUserId(); + + // 通过 sys_user 表的 user_id 查询医生表 (adm_practitioner) 获取医生 ID + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null) { + DoctorCardStatisticsDto dto = new DoctorCardStatisticsDto(); + dto.setTotalCount(0); + dto.setPendingFailedCount(0); + dto.setReportedCount(0); + return dto; + } + + Long doctorId = practitioner.getId(); DoctorCardStatisticsDto dto = new DoctorCardStatisticsDto(); Integer totalCount = infectiousCardMapper.countByDoctorId(doctorId); @@ -331,7 +346,18 @@ public class CardManageAppServiceImpl implements ICardManageAppService { @Override public R getDoctorCardPage(DoctorCardQueryDto queryParams) { - Long doctorId = SecurityUtils.getUserId(); + Long userId = SecurityUtils.getUserId(); + + // 通过 sys_user 表的 user_id 查询医生表 (adm_practitioner) 获取医生 ID + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null) { + Map emptyResult = new HashMap<>(); + emptyResult.put("list", new ArrayList<>()); + emptyResult.put("total", 0L); + return R.ok(emptyResult); + } + + Long doctorId = practitioner.getId(); Page page = new Page<>(queryParams.getPageNo(), queryParams.getPageSize()); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); @@ -340,7 +366,7 @@ public class CardManageAppServiceImpl implements ICardManageAppService { wrapper.eq(InfectiousCard::getDoctorId, doctorId); // 状态筛选 - if (StringUtils.hasText(queryParams.getStatus())) { + if (queryParams.getStatus() != null) { wrapper.eq(InfectiousCard::getStatus, queryParams.getStatus()); } @@ -354,13 +380,24 @@ public class CardManageAppServiceImpl implements ICardManageAppService { wrapper.le(InfectiousCard::getCreateTime, endDateTime); } - // 关键词搜索(患者姓名或报卡名称) + // 关键词搜索(患者姓名、疾病编码、报卡名称) if (StringUtils.hasText(queryParams.getKeyword())) { - wrapper.and(w -> w - .like(InfectiousCard::getPatName, queryParams.getKeyword()) - .or() - .like(InfectiousCard::getDiseaseName, queryParams.getKeyword()) - ); + String kw = queryParams.getKeyword(); + // 将关键词匹配报卡名称,找出对应的 cardNameCode 列表 + List matchedCodes = getMatchedCardNameCodes(kw); + // cardNameCode为null的记录默认也属于"中华人民共和国传染病报告卡",匹配到code=1时需包含Null记录 + boolean includeNull = matchedCodes.contains(1); + wrapper.and(w -> { + w.like(InfectiousCard::getPatName, kw) + .or() + .like(InfectiousCard::getDiseaseCode, kw); + if (!matchedCodes.isEmpty()) { + w.or().in(InfectiousCard::getCardNameCode, matchedCodes); + } + if (includeNull) { + w.or().isNull(InfectiousCard::getCardNameCode); + } + }); } // 按创建时间倒序 @@ -388,17 +425,19 @@ public class CardManageAppServiceImpl implements ICardManageAppService { } // 验证权限:只能提交自己的报卡 - if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + Long userId = SecurityUtils.getUserId(); + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null || !practitioner.getId().equals(card.getDoctorId())) { return R.fail("无权操作此报卡"); } - // 验证状态:只有暂存状态可以提交 - if (!"0".equals(card.getStatus())) { + // 狋证状态:只有暂存状态可以提交 + if (!Integer.valueOf(0).equals(card.getStatus())) { return R.fail("只能提交暂存状态的报卡"); } - + // 更新状态为已提交 - card.setStatus("1"); + card.setStatus(1); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); @@ -414,17 +453,19 @@ public class CardManageAppServiceImpl implements ICardManageAppService { } // 验证权限:只能撤回自己的报卡 - if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + Long userId = SecurityUtils.getUserId(); + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null || !practitioner.getId().equals(card.getDoctorId())) { return R.fail("无权操作此报卡"); } - // 验证状态:只有已提交状态可以撤回 - if (!"1".equals(card.getStatus())) { + // 狋证状态:只有已提交状态可以撤回 + if (!Integer.valueOf(1).equals(card.getStatus())) { return R.fail("只能撤回已提交状态的报卡"); } - + // 更新状态为暂存 - card.setStatus("0"); + card.setStatus(0); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); @@ -440,17 +481,19 @@ public class CardManageAppServiceImpl implements ICardManageAppService { } // 验证权限:只能删除自己的报卡 - if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + Long userId = SecurityUtils.getUserId(); + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null || !practitioner.getId().equals(card.getDoctorId())) { return R.fail("无权操作此报卡"); } - // 验证状态:只有暂存状态可以删除 - if (!"0".equals(card.getStatus())) { + // 狋证状态:只有暂存状态可以删除 + if (!Integer.valueOf(0).equals(card.getStatus())) { return R.fail("只能删除暂存状态的报卡"); } - + // 更新状态为作废 - card.setStatus("6"); + card.setStatus(6); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); @@ -464,7 +507,12 @@ public class CardManageAppServiceImpl implements ICardManageAppService { return R.fail("请选择要提交的报卡"); } - Long doctorId = SecurityUtils.getUserId(); + Long userId = SecurityUtils.getUserId(); + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null) { + return R.fail("当前用户未关联医生信息"); + } + Long doctorId = practitioner.getId(); int successCount = 0; for (String cardNo : cardNos) { @@ -472,13 +520,13 @@ public class CardManageAppServiceImpl implements ICardManageAppService { if (card == null) continue; // 验证权限:只能提交自己的报卡 - if (!card.getDoctorId().equals(doctorId)) continue; - - // 验证状态:只有暂存状态可以提交 - if (!"0".equals(card.getStatus())) continue; + if (!doctorId.equals(card.getDoctorId())) continue; + // 狋证状态:只有暂存状态可以提交 + if (!Integer.valueOf(0).equals(card.getStatus())) continue; + // 更新状态为已提交 - card.setStatus("1"); + card.setStatus(1); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); successCount++; @@ -498,7 +546,12 @@ public class CardManageAppServiceImpl implements ICardManageAppService { return R.fail("请选择要删除的报卡"); } - Long doctorId = SecurityUtils.getUserId(); + Long userId = SecurityUtils.getUserId(); + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null) { + return R.fail("当前用户未关联医生信息"); + } + Long doctorId = practitioner.getId(); int successCount = 0; for (String cardNo : cardNos) { @@ -506,13 +559,13 @@ public class CardManageAppServiceImpl implements ICardManageAppService { if (card == null) continue; // 验证权限:只能删除自己的报卡 - if (!card.getDoctorId().equals(doctorId)) continue; - - // 验证状态:只有暂存状态可以删除 - if (!"0".equals(card.getStatus())) continue; + if (!doctorId.equals(card.getDoctorId())) continue; + // 狋证状态:只有暂存状态可以删除 + if (!Integer.valueOf(0).equals(card.getStatus())) continue; + // 更新状态为作废 - card.setStatus("6"); + card.setStatus(6); card.setUpdateTime(new Date()); infectiousCardMapper.updateById(card); successCount++; @@ -530,6 +583,13 @@ public class CardManageAppServiceImpl implements ICardManageAppService { // 获取当前登录用户信息 LoginUser loginUser = SecurityUtils.getLoginUser(); Long currentUserId = loginUser.getUserId(); + + // 通过 sys_user 表的 user_id 查询医生表 (adm_practitioner) 获取医生 ID + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(currentUserId); + if (practitioner == null) { + return R.fail("当前用户未关联医生信息"); + } + Long doctorId = practitioner.getId(); // 查询报卡 InfectiousCard card = infectiousCardMapper.selectByCardNo(updateDto.getCardNo()); @@ -538,12 +598,12 @@ public class CardManageAppServiceImpl implements ICardManageAppService { } // 验证是否当前医生的报卡 - 根据 doctorId 字段验证 - if (!currentUserId.equals(card.getDoctorId())) { + if (!doctorId.equals(card.getDoctorId())) { return R.fail("只能修改自己的报卡"); } - // 验证状态是否允许修改(只能修改暂存状态的报卡) - if (!"0".equals(card.getStatus())) { + // 狋证状态是否允许修改(只能修改暂存状态的报卡) + if (!Integer.valueOf(0).equals(card.getStatus())) { return R.fail("只能修改暂存状态的报卡"); } @@ -559,15 +619,6 @@ public class CardManageAppServiceImpl implements ICardManageAppService { card.setUpdateTime(new Date()); card.setUpdateBy(loginUser.getUsername()); // 使用username作为更新者 - card.setUpdateTime(new Date()); - card.setUpdateBy(loginUser.getUsername()); // 使用 username 作为更新者 - - card.setUpdateTime(new Date()); - card.setUpdateBy(loginUser.getUsername()); // 使用 username 作为更新者 - - card.setUpdateTime(new Date()); - card.setUpdateBy(loginUser.getUsername()); // 使用 username 作为更新者 - int rows = infectiousCardMapper.updateById(card); if (rows > 0) { return R.ok("更新成功"); @@ -583,12 +634,14 @@ public class CardManageAppServiceImpl implements ICardManageAppService { } // 验证权限:只能导出自己的报卡 - if (!card.getDoctorId().equals(SecurityUtils.getUserId())) { + Long userId = SecurityUtils.getUserId(); + Practitioner practitioner = iPractitionerService.getPractitionerByUserId(userId); + if (practitioner == null || !practitioner.getId().equals(card.getDoctorId())) { return; } - // 验证状态:只有已上报状态可以导出 - if (!"3".equals(card.getStatus())) { + // 狋证状态:只有已上报状态可以导出 + if (!Integer.valueOf(3).equals(card.getStatus())) { return; } @@ -612,6 +665,8 @@ public class CardManageAppServiceImpl implements ICardManageAppService { private DoctorCardListDto convertToDoctorCardListDto(InfectiousCard card) { DoctorCardListDto dto = new DoctorCardListDto(); BeanUtils.copyProperties(card, dto); + // 由于数据库中没有 disease_name 字段,使用 disease_code 作为疾病名称展示 + dto.setDiseaseName(card.getDiseaseCode()); dto.setCardName(getCardName(card.getCardNameCode())); dto.setSubmitTime(card.getCreateTime() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(card.getCreateTime()) : null); @@ -632,13 +687,35 @@ public class CardManageAppServiceImpl implements ICardManageAppService { } } + /** + * 根据关键词匹配报卡名称,返回匹配的 cardNameCode 列表 + */ + private List getMatchedCardNameCodes(String keyword) { + // 报卡名称映射表 code -> name + java.util.Map cardNameMap = new java.util.LinkedHashMap<>(); + cardNameMap.put(1, "中华人民共和国传染病报告卡"); + cardNameMap.put(2, "甲类传染病报告卡"); + cardNameMap.put(3, "乙类传染病报告卡"); + cardNameMap.put(4, "丙类传染病报告卡"); + + List matchedCodes = new ArrayList<>(); + for (java.util.Map.Entry entry : cardNameMap.entrySet()) { + if (entry.getValue().contains(keyword)) { + matchedCodes.add(entry.getKey()); + } + } + // cardNameCode 为 null 的数据默认也是「中华人民共和国传染病报告卡」 + // 如果关键词匹配 code=1,则同时要包含 null 的记录 + return matchedCodes; + } + /** * 转换审核记录为 DTO */ private AuditRecordDto convertAuditToDto(InfectiousAudit audit) { AuditRecordDto dto = new AuditRecordDto(); BeanUtils.copyProperties(audit, dto); - dto.setCardId(audit.getCardId() != null ? audit.getCardId().toString() : null); + dto.setCardId(audit.getCardId()); return dto; } @@ -648,6 +725,8 @@ public class CardManageAppServiceImpl implements ICardManageAppService { private InfectiousCardDto convertToDto(InfectiousCard card) { InfectiousCardDto dto = new InfectiousCardDto(); BeanUtils.copyProperties(card, dto); + // 由于数据库中没有 disease_name 字段,使用 disease_code 作为疾病名称展示 + dto.setDiseaseName(card.getDiseaseCode()); dto.setStatusText(getStatusText(card.getStatus())); return dto; } @@ -655,15 +734,15 @@ public class CardManageAppServiceImpl implements ICardManageAppService { /** * 创建审核记录 */ - private void createAuditRecord(Long cardId, String statusFrom, String statusTo, String auditType, + private void createAuditRecord(String cardId, Integer statusFrom, Integer statusTo, Integer auditType, String auditOpinion, String returnReason, String auditorId, String auditorName, Boolean isBatch, Integer batchSize) { InfectiousAudit audit = new InfectiousAudit(); audit.setCardId(cardId); audit.setAuditSeq(infectiousAuditMapper.getNextAuditSeq(cardId)); - audit.setAuditType(auditType); - audit.setAuditStatusFrom(statusFrom); - audit.setAuditStatusTo(statusTo); + audit.setAuditType(String.valueOf(auditType)); + audit.setAuditStatusFrom(statusFrom != null ? String.valueOf(statusFrom) : null); + audit.setAuditStatusTo(statusTo != null ? String.valueOf(statusTo) : null); audit.setAuditTime(LocalDateTime.now()); audit.setAuditorId(auditorId); audit.setAuditorName(auditorName); @@ -677,15 +756,16 @@ public class CardManageAppServiceImpl implements ICardManageAppService { /** * 获取状态文本 */ - private String getStatusText(String status) { + private String getStatusText(Integer status) { + if (status == null) return "未知"; switch (status) { - case "0": return "暂存"; - case "1": return "已提交"; - case "2": return "审核通过"; - case "3": return "已上报"; - case "4": return "失败"; - case "5": return "审核失败"; - case "6": return "作废"; + case 0: return "暂存"; + case 1: return "已提交"; + case 2: return "审核通过"; + case 3: return "已上报"; + case 4: return "失败"; + case 5: return "审核失败"; + case 6: return "作废"; default: return "未知"; } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/CardQueryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/CardQueryDto.java index 9a9c9ec7..afb9167e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/CardQueryDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/CardQueryDto.java @@ -29,8 +29,8 @@ public class CardQueryDto { /** 患者姓名 */ private String patientName; - /** 审核状态 */ - private String status; + /** 审核状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回/6作废) */ + private Integer status; /** 科室ID */ private Long deptId; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardListDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardListDto.java index 0677f4d8..ec6140ba 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardListDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardListDto.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; +import java.time.LocalDate; +import java.time.LocalDateTime; + /** * 医生个人报卡列表DTO * @@ -41,6 +44,51 @@ public class DoctorCardListDto { /** 提交时间 */ private String submitTime; - /** 状态 */ - private String status; + /** 状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回/6作废) */ + private Integer status; + + /** 疾病名称 */ + private String diseaseName; + + /** 发病日期 */ + private LocalDate onsetDate; + + /** 诊断日期 */ + private LocalDateTime diagDate; + + /** 报告单位 */ + private String reportOrg; + + /** 报告医生 */ + private String reportDoc; + + /** 传染病类别 */ + private String diseaseType; + + /** 性别 (1男/2女/0未知) */ + private String sex; + + /** 年龄 */ + private Integer age; + + /** 年龄单位 (1岁/2月/3天) */ + private String ageUnit; + + /** 现住址省 */ + private String addressProv; + + /** 现住址市 */ + private String addressCity; + + /** 现住址县 */ + private String addressCounty; + + /** 现住址街道 */ + private String addressTown; + + /** 现住址村/居委 */ + private String addressVillage; + + /** 现住址门牌号 */ + private String addressHouse; } \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardQueryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardQueryDto.java index c2915ebd..88afa60c 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardQueryDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardQueryDto.java @@ -26,8 +26,8 @@ public class DoctorCardQueryDto { /** 结束日期 */ private String endDate; - /** 状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回) */ - private String status; + /** 状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回/6作废) */ + private Integer status; /** 患者姓名或报卡名称 */ private String keyword; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardUpdateDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardUpdateDto.java index 9cc027d0..9332947b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardUpdateDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/DoctorCardUpdateDto.java @@ -1,18 +1,44 @@ package com.openhis.web.cardmanagement.dto; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.time.LocalDate; import java.time.LocalDateTime; @Data public class DoctorCardUpdateDto { + @NotBlank(message = "卡片编号不能为空") private String cardNo; + private String phone; + private String contactPhone; // 紧急联系人电话 + private LocalDate onsetDate; private LocalDateTime diagDate; - private String diseaseType; // 修改为diseaseType,对应InfectiousCard中的diseaseType字段 - private String addressProv; - private String addressCity; - private String addressCounty; - private String addressHouse; + + private String diseaseType; // 病例分类(对应InfectiousCard中的diseaseType字段) + private String diseaseCode; // 疾病编码 + + @NotNull(message = "病例类别不能为空") + private Integer caseClass; // 病例类别(1疑似病例/2临床诊断病例/3实验室确诊病例/4病原携带者/5阳性检测结果) + + private String occupation; // 职业 + + @NotNull(message = "病人属于不能为空") + private Integer patientBelong; // 病人属于(1本县区/2本市其他县区/3本省其他地市/4外省/5港澳台/6外籍) + + private String addressProv; // 现住址省 + private String addressCity; // 现住址市 + private String addressCounty; // 现住址县 + private String addressTown; // 现住址街道 + private String addressVillage; // 现住址村/居委 + private String addressHouse; // 现住址门牌号 + + private String parentName; // 家长姓名 + private String workplace; // 工作单位 + private String correctName; // 订正病名 + private LocalDate deathDate; // 死亡日期 + private String withdrawReason; // 退卡原因 + private String otherDisease; // 其他传染病名称 } \ No newline at end of file diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java index 5e7ce7ac..e69466ef 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/dto/InfectiousCardDto.java @@ -65,8 +65,8 @@ public class InfectiousCardDto { /** 现住址门牌号 */ private String addressHouse; - /** 病人属于 */ - private String patientbelong; + /** 病人属于(1本县区/2本市其他县区/3本省其他地市/4外省/5港澳台/6外籍) */ + private Integer patientBelong; /** 职业 */ private String occupation; @@ -110,8 +110,8 @@ public class InfectiousCardDto { /** 填卡日期 */ private LocalDate reportDate; - /** 状态 */ - private String status; + /** 状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回/6作废) */ + private Integer status; /** 状态文本 */ private String statusText; diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousAuditMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousAuditMapper.java index 06015a26..b3c873c9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousAuditMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousAuditMapper.java @@ -18,14 +18,14 @@ import java.util.List; public interface InfectiousAuditMapper extends BaseMapper { /** - * 根据报卡ID查询审核记录 + * 根据报卡编号查询审核记录 */ @Select("SELECT * FROM infectious_audit WHERE card_id = #{cardId} ORDER BY audit_time DESC") - List selectByCardId(@Param("cardId") Long cardId); + List selectByCardId(@Param("cardId") String cardId); /** * 获取下一个审核序号 */ @Select("SELECT COALESCE(MAX(audit_seq), 0) + 1 FROM infectious_audit WHERE card_id = #{cardId}") - Integer getNextAuditSeq(@Param("cardId") Long cardId); + Integer getNextAuditSeq(@Param("cardId") String cardId); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java index 4d67cc8b..d51a1c51 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/cardmanagement/mapper/InfectiousCardMapper.java @@ -21,25 +21,25 @@ public interface InfectiousCardMapper extends BaseMapper { /** * 统计今日待审核数量 */ - @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE(create_time) = CURRENT_DATE AND status = '1'") + @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE(create_time) = CURRENT_DATE AND status = 1") Integer countTodayPending(); /** * 统计本月审核失败数量 */ - @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = '5'") + @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = 5") Integer countMonthFailed(); /** * 统计本月审核成功数量 */ - @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = '2'") + @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = 2") Integer countMonthSuccess(); /** * 统计本月已上报数量 */ - @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = '3'") + @Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = 3") Integer countMonthReported(); /** @@ -55,14 +55,14 @@ public interface InfectiousCardMapper extends BaseMapper { Integer countByDoctorId(@Param("doctorId") Long doctorId); /** - * 统计医生待处理失败数(状态为0暂存或4失败) + * 统计医生待提交数(状态为0暂存待提交) */ - @Select("SELECT COUNT(*) FROM infectious_card WHERE doctor_id = #{doctorId} AND status IN ('0', '4')") + @Select("SELECT COUNT(*) FROM infectious_card WHERE doctor_id = #{doctorId} AND status = 0") Integer countPendingFailedByDoctorId(@Param("doctorId") Long doctorId); /** * 统计医生已成功上报数(状态为3已上报) */ - @Select("SELECT COUNT(*) FROM infectious_card WHERE doctor_id = #{doctorId} AND status = '3'") + @Select("SELECT COUNT(*) FROM infectious_card WHERE doctor_id = #{doctorId} AND status = 3") Integer countReportedByDoctorId(@Param("doctorId") Long doctorId); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardDto.java index c8ae75f0..e7884643 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/reportManagement/dto/InfectiousCardDto.java @@ -127,14 +127,11 @@ public class InfectiousCardDto { /** 审核意见 */ private String auditOpinion; - /** 退回原因 */ + /** 退卡原因 */ private String returnReason; /** 订正病名 */ - private String correctName; - - /** 退卡原因 */ - private String withdrawReason; + private String revisedDiseaseName; /** 其他传染病 */ private String otherDisease; diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousAudit.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousAudit.java index 0c58af3b..b9a58bf2 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousAudit.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousAudit.java @@ -29,9 +29,8 @@ public class InfectiousAudit extends HisBaseEntity { @JsonSerialize(using = ToStringSerializer.class) private Long auditId; - /** 报卡ID */ - @JsonSerialize(using = ToStringSerializer.class) - private Long cardId; + /** 报卡编号(关联 infectious_card.card_no) */ + private String cardId; /** 审核序号 */ private Integer auditSeq; diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousCard.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousCard.java index ece2b24a..6fcf2c5f 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousCard.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/infectious/domain/InfectiousCard.java @@ -1,6 +1,7 @@ package com.openhis.infectious.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.core.common.core.domain.HisBaseEntity; @@ -26,12 +27,8 @@ import java.time.LocalDateTime; @EqualsAndHashCode(callSuper = false) public class InfectiousCard extends HisBaseEntity { - /** 卡片编号 */ - @TableId(type = IdType.ASSIGN_ID) - @JsonSerialize(using = ToStringSerializer.class) - private Long id; - - /** 卡片编号(业务编号) */ + /** 卡片编号(业务编号,主键) */ + @TableId(type = IdType.INPUT) private String cardNo; /** 本次就诊ID */ @@ -97,8 +94,9 @@ public class InfectiousCard extends HisBaseEntity { /** 现住址门牌号 */ private String addressHouse; - /** 病人属于 */ - private String patientbelong; + /** 病人属于(1本县区/2本市其他县区/3本省其他地市/4外省/5港澳台/6外籍) */ + @TableField("patient_belong") + private Integer patientBelong; /** 职业 */ private String occupation; @@ -106,18 +104,15 @@ public class InfectiousCard extends HisBaseEntity { /** 疾病编码 */ private String diseaseCode; - /** 疾病名称 */ - private String diseaseName; - - /** 分型 */ - private String diseaseSubtype; - - /** 其他传染病 */ - private String otherDisease; - /** 病例分类 */ private String diseaseType; + /** 其他传染病名称 */ + private String otherDisease; + + /** 病例类别(1疑似病例/2临床诊断病例/3实验室确诊病例/4病原携带者/5阳性检测结果) */ + private Integer caseClass; + /** 发病日期 */ private LocalDate onsetDate; @@ -146,7 +141,7 @@ public class InfectiousCard extends HisBaseEntity { private LocalDate reportDate; /** 状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回) */ - private String status; + private Integer status; /** 失败原因 */ private String failMsg; @@ -165,6 +160,7 @@ public class InfectiousCard extends HisBaseEntity { private Long deptId; /** 科室名称 */ + @TableField(exist = false) private String deptName; /** 医生ID */ diff --git a/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/index.vue b/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/index.vue index a96b6471..1e40fca7 100644 --- a/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/index.vue +++ b/openhis-ui-vue3/src/views/diseaseReportManagement/ReportManagement/index.vue @@ -334,12 +334,12 @@ - - - - - - + + + + + + diff --git a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue index 3f271cfd..6965b5a2 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue @@ -130,12 +130,12 @@ 病人属于 - 本县区 - 本市其他县区 - 本省其他地市 - 外省 - 港澳台 - 外籍 + 本县区 + 本市其他县区 + 本省其他地市 + 外省 + 港澳台 + 外籍 @@ -732,7 +732,7 @@ const form = ref({ addressTown: '', addressVillage: '', addressHouse: '', - patientBelong: '1', + patientBelong: 1, occupation: '', caseClass: '', onsetDate: '', @@ -1186,7 +1186,7 @@ function show(diagnosisData) { addressHouse: diagnosisData?.addressHouse || '', // 门牌号 // 患者类型和职业 - patientBelong: '1', // 患者属于(本县区/本市其他县区/本省其他地市/外省/港澳台/外籍) + patientBelong: 1, // 患者属于(本县区/本市其他县区/本省其他地市/外省/港澳台/外籍) occupation: '', // 职业 caseClass: '', // 病例分类(疑似病例/临床诊断病例/确诊病例/病原携带者/阳性检测) @@ -1297,7 +1297,7 @@ async function buildSubmitData() { addressTown: formData.addressTown || '', addressVillage: formData.addressVillage || '', addressHouse: formData.addressHouse || '', - patientBelong: patientBelongMap[formData.patientBelong] || 1, + patientBelong: formData.patientBelong || 1, occupation: formData.occupation || null, diseaseCode: diseaseCode || null, diseaseType: diseaseType || null, diff --git a/openhis-ui-vue3/src/views/doctorstation/components/infectiousReport/index.vue b/openhis-ui-vue3/src/views/doctorstation/components/infectiousReport/index.vue index 1881bfcb..e777f337 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/infectiousReport/index.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/infectiousReport/index.vue @@ -31,12 +31,12 @@ - + - + @@ -45,7 +45,7 @@ - + 未知 @@ -55,11 +55,11 @@
- + - + - +
@@ -67,8 +67,8 @@
- - + + @@ -82,7 +82,7 @@ - + @@ -91,12 +91,12 @@ - + - + @@ -112,6 +112,7 @@ placeholder="请选择省/市/区县/街道" clearable style="width: 100%" + :disabled="isReadOnly" @change="handleAddressChange" /> @@ -119,10 +120,10 @@ - + - + @@ -130,13 +131,13 @@ - - 本县区 - 本市其他县区 - 本省其他地市 - 外省 - 港澳台 - 外籍 + + 本县区 + 本市其他县区 + 本省其他地市 + 外省 + 港澳台 + 外籍 @@ -146,14 +147,14 @@ - + - + 疑似病例 临床诊断病例 确诊病例 @@ -175,6 +176,7 @@ style="width: 100%" value-format="YYYY-MM-DD" format="YYYY-MM-DD" + :disabled="isReadOnly" /> @@ -187,6 +189,7 @@ style="width: 100%" value-format="YYYY-MM-DD" format="YYYY-MM-DD" + :disabled="isReadOnly" /> @@ -199,6 +202,7 @@ style="width: 100%" value-format="YYYY-MM-DD" format="YYYY-MM-DD" + :disabled="isReadOnly" /> @@ -215,11 +219,13 @@
鼠疫 霍乱
@@ -232,7 +238,8 @@ v-for="disease in classBDiseases" :key="disease.code" :model-value="form.selectedClassB === disease.code" - @update:model-value="(checked) => handleClassBCheckbox(disease.code, checked)" + :disabled="isReadOnly" + @update:model-value="(checked) => isReadOnly ? null : handleClassBCheckbox(disease.code, checked)" >{{ disease.name }} @@ -245,7 +252,8 @@ v-for="disease in classCDiseases" :key="disease.code" :model-value="form.selectedClassC === disease.code" - @update:model-value="(checked) => handleClassCCheckbox(disease.code, checked)" + :disabled="isReadOnly" + @update:model-value="(checked) => isReadOnly ? null : handleClassCCheckbox(disease.code, checked)" >{{ disease.name }} @@ -254,12 +262,12 @@ - + - + - + @@ -304,17 +312,18 @@ style="width: 100%" value-format="YYYY-MM-DD" format="YYYY-MM-DD" + :disabled="isReadOnly" /> - + - + @@ -322,15 +331,15 @@ - + - -
+ +
保 存 重 置
@@ -347,6 +356,9 @@ import { useDict } from '@/utils/dict'; const { proxy } = getCurrentInstance(); const userStore = useUserStore(); +// 是否只读模式 +const isReadOnly = computed(() => props.mode === 'view'); + // 获取职业字典数据 const { prfs: occupationList } = useDict('prfs'); @@ -418,9 +430,19 @@ const props = defineProps({ type: String, default: '', }, + // 'create' | 'view' | 'edit' + mode: { + type: String, + default: 'create', + }, + // 已有报卡数据(view/edit 模式下使用) + cardData: { + type: Object, + default: null, + }, }); -const emit = defineEmits(['saved']); +const emit = defineEmits(['saved', 'submit-edit']); // 地址级联选择器配置 const addressOptions = ref(pcas); @@ -453,7 +475,7 @@ const form = ref({ addressTown: '', addressVillage: '', addressHouse: '', - patientBelong: '1', + patientBelong: 1, occupation: '', caseClass: '', onsetDate: '', @@ -567,19 +589,27 @@ const isChildPatient = computed(() => { // 监听疾病选择变化,自动清空分型选择 watch(() => [form.value.selectedClassA, form.value.selectedClassB, form.value.selectedClassC], (newVal, oldVal) => { - if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) { + // 在view/edit模式下初始化时不清空分型,避免数据加载时被错误清空 + if (JSON.stringify(newVal) !== JSON.stringify(oldVal) && props.mode !== 'view' && props.mode !== 'edit') { form.value.diseaseType = ''; } updateSelectedDiseases(); }, { deep: true }); -// 监听患者信息变化,自动填充表单 +// 监听患者信息变化,自动填充表单(仅 create 模式) watch(() => props.patientInfo, (newVal) => { - if (newVal && Object.keys(newVal).length > 0) { + if (props.mode === 'create' && newVal && Object.keys(newVal).length > 0) { initForm(); } }, { deep: true, immediate: true }); +// 监听 cardData 变化,在 view/edit 模式下初始化 +watch(() => props.cardData, (newVal) => { + if ((props.mode === 'view' || props.mode === 'edit') && newVal) { + initFormFromCard(newVal); + } +}, { immediate: true }); + // 监听Tab切换,重新初始化 watch(() => props.activeTab, (newVal) => { if (newVal === 'infectiousReport' && props.patientInfo && Object.keys(props.patientInfo).length > 0) { @@ -808,7 +838,7 @@ async function initForm() { addressTown: patientInfo.addressStreet || '', addressVillage: '', addressHouse: '', - patientBelong: '1', + patientBelong: 1, occupation: '', caseClass: '', onsetDate: getCurrentDate(), @@ -893,7 +923,7 @@ function buildSubmitData() { addressTown: formData.addressTown || '', addressVillage: formData.addressVillage || '', addressHouse: formData.addressHouse || '', - patientBelong: parseInt(formData.patientBelong) || 1, + patientBelong: formData.patientBelong || 1, occupation: formData.occupation || null, diseaseCode: diseaseCode || null, diseaseType: diseaseType || null, @@ -1015,15 +1045,20 @@ async function handleSubmit() { const submitData = buildSubmitData(); - const res = await saveInfectiousDiseaseReport(submitData); - - if (res.code === 200) { - proxy.$modal.msgSuccess('传染病报告卡保存成功'); - emit('saved'); - // 重新初始化表单,获取新的卡片编号 - initForm(); + if (props.mode === 'edit') { + // 编辑模式:通过事件通知父组件处理保存 + emit('submit-edit', submitData); } else { - proxy.$modal.msgError(res.msg || '保存失败'); + // 新建模式 + const res = await saveInfectiousDiseaseReport(submitData); + if (res.code === 200) { + proxy.$modal.msgSuccess('传染病报告卡保存成功'); + emit('saved'); + // 重新初始化表单,获取新的卡片编号 + initForm(); + } else { + proxy.$modal.msgError(res.msg || '保存失败'); + } } } catch (err) { console.error('传染病报告卡保存失败:', err); @@ -1065,7 +1100,7 @@ function handleReset() { form.value.contactPhone = ''; form.value.occupation = ''; form.value.caseClass = ''; - form.value.patientBelong = '1'; + form.value.patientBelong = 1; form.value.otherDisease = ''; form.value.correctName = ''; form.value.withdrawReason = ''; @@ -1075,22 +1110,108 @@ function handleReset() { updateSelectedDiseases(); } +// 从已有报卡数据初始化表单(view/edit 模式) +function initFormFromCard(card) { + if (!card) return; + + const ageUnitReverseMap = { '1': '岁', '2': '月', '3': '天' }; + const sexMap = { '1': '男', '2': '女', '0': '未知' }; + + // 拆解出生日期 + let birthYear = '', birthMonth = '', birthDay = ''; + if (card.birthday) { + const parts = card.birthday.split('-'); + birthYear = parts[0] || ''; + birthMonth = parts[1] || ''; + birthDay = parts[2] || ''; + } + + // 还原疾病分类选中状态 + let selectedClassA = '', selectedClassB = '', selectedClassC = ''; + if (card.diseaseCode) { + if (card.diseaseCode.startsWith('01')) selectedClassA = card.diseaseCode; + else if (card.diseaseCode.startsWith('02')) selectedClassB = card.diseaseCode; + else if (card.diseaseCode.startsWith('03')) selectedClassC = card.diseaseCode; + } + + form.value = { + cardNo: card.cardNo || '', + patName: card.patName || '', + parentName: card.parentName || '', + idNo: card.idNo || '', + sex: sexMap[card.sex] || card.sex || '男', + birthYear, + birthMonth, + birthDay, + age: card.age != null ? String(card.age) : '', + ageUnit: ageUnitReverseMap[card.ageUnit] || '岁', + workplace: card.workplace || '', + phone: card.phone || '', + contactPhone: card.contactPhone || '', + addressProv: card.addressProv || '', + addressCity: card.addressCity || '', + addressCounty: card.addressCounty || '', + addressTown: card.addressTown || '', + addressVillage: card.addressVillage || '', + addressHouse: card.addressHouse || '', + patientBelong: card.patientBelong || 1, + occupation: card.occupation || '', + caseClass: card.caseClass != null ? String(card.caseClass) : '', + onsetDate: card.onsetDate || '', + diagDate: card.diagDate ? card.diagDate.substring(0, 10) : '', + deathDate: card.deathDate || '', + selectedDiseases: card.diseaseCode && card.diseaseCode !== 'OTHER' ? [card.diseaseCode] : [], + selectedClassA, + selectedClassB, + selectedClassC, + otherDisease: card.diseaseCode === 'OTHER' ? (card.otherDisease || '') : (card.otherDisease || ''), + diseaseType: card.diseaseType || '', + reportOrg: card.reportOrg || '', + reportOrgPhone: card.reportOrgPhone || '', + reportDoc: card.reportDoc || '', + reportDate: card.reportDate || '', + correctName: card.correctName || '', + withdrawReason: card.withdrawReason || '', + remark: card.remark || '', + encounterId: card.visitId || '', + patientId: card.patId || '', + diagnosisId: card.diagId || '', + }; + + // 设置地址级联选择器 + const provName = card.addressProv || ''; + const cityName = card.addressCity || ''; + const countyName = card.addressCounty || ''; + const townName = card.addressTown || ''; + let names = []; + if (municipalities.includes(provName)) { + names = [provName, countyName, townName].filter(n => n); + } else { + names = [provName, cityName, countyName, townName].filter(n => n); + } + addressCodes.value = findCodesByNames(names); +} + // 组件挂载时初始化 onMounted(() => { - if (props.patientInfo && Object.keys(props.patientInfo).length > 0) { + if ((props.mode === 'view' || props.mode === 'edit') && props.cardData) { + initFormFromCard(props.cardData); + } else if (props.mode === 'create' && props.patientInfo && Object.keys(props.patientInfo).length > 0) { initForm(); } }); // 暴露方法供父组件调用 defineExpose({ - initForm + initForm, + initFormFromCard }); \ No newline at end of file From 53080648a19b63aa5acc00ca742302e389a278f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=90=B3?= Date: Tue, 14 Apr 2026 21:35:13 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E3=80=90=E9=99=88=E7=90=B3=E3=80=91Git?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=8C=E6=AC=A1=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GIT_TEST_CHENLIN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/GIT_TEST_CHENLIN.md b/GIT_TEST_CHENLIN.md index 3ee442a4..4a42fa43 100644 --- a/GIT_TEST_CHENLIN.md +++ b/GIT_TEST_CHENLIN.md @@ -1 +1,2 @@ 陈琳Git提交测试 - 2026-04-14 16:57:08 +陈琳二次测试 - 2026-04-14 21:35:12 From 283cf784a39971bf7adf076083ae2cfc6637ec93 Mon Sep 17 00:00:00 2001 From: guanyu Date: Tue, 14 Apr 2026 21:35:44 +0800 Subject: [PATCH 6/6] =?UTF-8?q?test:=20=E3=80=90=E5=85=B3=E7=BE=BD?= =?UTF-8?q?=E3=80=91=E6=99=9A=E9=97=B4=20git=20=E6=8F=90=E4=BA=A4=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git_test4.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 git_test4.md diff --git a/git_test4.md b/git_test4.md new file mode 100644 index 00000000..9b826515 --- /dev/null +++ b/git_test4.md @@ -0,0 +1 @@ +# Git 晚间测试 - 关羽 2026-04-14 21:35:44