From 3d31b3482a7bd8b9c7d68dc03f2cb5b28242e2e5 Mon Sep 17 00:00:00 2001 From: nanyangbreeze <1955231298@qq.com> Date: Tue, 3 Feb 2026 14:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E8=AE=BE=E7=BD=AE=E5=A5=97?= =?UTF-8?q?=E9=A4=90=E7=AE=A1=E7=90=86=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InspectionTypeController.java | 10 +- .../openhis/lab/domain/InspectionType.java | 4 + .../views/basicmanage/organization/index.vue | 8 +- .../views/maintainSystem/Inspection/index.vue | 194 +++++++++++------- 4 files changed, 136 insertions(+), 80 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/lab/controller/InspectionTypeController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/lab/controller/InspectionTypeController.java index a2afa1e1..07ba4edd 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/lab/controller/InspectionTypeController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/lab/controller/InspectionTypeController.java @@ -69,7 +69,9 @@ public class InspectionTypeController extends BaseController { // 验证code字段是否唯一 QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("code", inspectionType.getCode()); + queryWrapper.eq("code", inspectionType.getCode()) + // 只在“有效(valid_flag=1)”范围内判重;逻辑删除(valid_flag=0)的不阻止复用编码 + .eq("valid_flag", 1); // 查询是否存在相同编码的记录 List existingRecords = inspectionTypeService.list(queryWrapper); @@ -86,7 +88,8 @@ public class InspectionTypeController extends BaseController { return transactionTemplate.execute(status -> { // 再次检查,防止并发问题 QueryWrapper checkWrapper = new QueryWrapper<>(); - checkWrapper.eq("code", inspectionType.getCode()); + checkWrapper.eq("code", inspectionType.getCode()) + .eq("valid_flag", 1); List finalCheck = inspectionTypeService.list(checkWrapper); if (!finalCheck.isEmpty()) { return AjaxResult.error("检验类型编码已存在"); @@ -123,7 +126,8 @@ public class InspectionTypeController extends BaseController { // 验证code字段是否唯一(排除自身) QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("code", inspectionType.getCode()) - .ne("id", inspectionType.getId()); + .ne("id", inspectionType.getId()) + .eq("valid_flag", 1); if (inspectionTypeService.count(queryWrapper) > 0) { return AjaxResult.error("检验类型编码已存在"); } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/lab/domain/InspectionType.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/lab/domain/InspectionType.java index 11f82b36..a38b1e84 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/lab/domain/InspectionType.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/lab/domain/InspectionType.java @@ -31,6 +31,10 @@ public class InspectionType { /** 所属科室 */ private String department; + /** 父类ID(为空表示是大类,有值表示是子类) */ + @TableField("parent_id") + private Long parentId; + /** 排序 */ @TableField("\"order\"") private Integer sortOrder; diff --git a/openhis-ui-vue3/src/views/basicmanage/organization/index.vue b/openhis-ui-vue3/src/views/basicmanage/organization/index.vue index c100882d..dc16c81b 100644 --- a/openhis-ui-vue3/src/views/basicmanage/organization/index.vue +++ b/openhis-ui-vue3/src/views/basicmanage/organization/index.vue @@ -398,8 +398,13 @@ function resetQuery() { getPageList(); } -function getPageList() { +function getPageList(pagination) { loading.value = true; + // 如果传入了分页参数,更新queryParams + if (pagination) { + queryParams.value.pageNo = pagination.page; + queryParams.value.pageSize = pagination.limit; + } // 创建API调用的查询参数副本,处理classEnum的转换 const apiParams = { ...queryParams.value }; if (Array.isArray(apiParams.classEnum)) { @@ -435,6 +440,7 @@ function getPageList() { organization.value = processedData; total.value = res.data.total; + }).catch(error => { console.error('获取科室列表失败:', error); proxy.$modal.msgError('获取科室列表失败,请稍后重试'); diff --git a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue index 8bfde343..3f6434a5 100644 --- a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue +++ b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue @@ -86,7 +86,7 @@