From 91d673de77877fd613d7c6ce8e56620432b3b961 Mon Sep 17 00:00:00 2001 From: startcode <169514906@qq.com> Date: Mon, 22 Dec 2025 16:28:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E9=A1=B9=E7=9B=AE=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE-=E6=A3=80=E9=AA=8C=E7=B1=BB=E5=9E=8B=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openhis-server-new/core-system/pom.xml | 5 + openhis-server-new/openhis-domain/pom.xml | 5 + .../views/maintainSystem/Inspection/index.vue | 93 ++++++++++++------- 3 files changed, 72 insertions(+), 31 deletions(-) diff --git a/openhis-server-new/core-system/pom.xml b/openhis-server-new/core-system/pom.xml index 427f75db..51fa2459 100644 --- a/openhis-server-new/core-system/pom.xml +++ b/openhis-server-new/core-system/pom.xml @@ -35,6 +35,11 @@ org.postgresql postgresql + + org.projectlombok + lombok + compile + diff --git a/openhis-server-new/openhis-domain/pom.xml b/openhis-server-new/openhis-domain/pom.xml index b7962191..c91532e1 100644 --- a/openhis-server-new/openhis-domain/pom.xml +++ b/openhis-server-new/openhis-domain/pom.xml @@ -43,6 +43,11 @@ spring-boot-starter-web provided + + org.projectlombok + lombok + compile + diff --git a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue index d3544386..05de37d8 100644 --- a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue +++ b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue @@ -26,21 +26,17 @@ 新增 -
- -
- 调试科室数据 -
- +
+
- - - - - - - + + + + + + + @@ -864,18 +860,6 @@ function handlePackageDepartmentChange(selectedNode) { } } -// 调试科室数据 -function debugDepartments() { - console.log('当前科室数据:', departments.value); - console.log('第一个检验项目科室:', inspectionItems.value[0]?.department); - // 尝试模拟选择一个科室 - if (departments.value && departments.value.length > 0) { - const firstDept = departments.value[0]; - console.log('尝试选择科室:', firstDept.name); - inspectionItems.value[0].department = firstDept.name; - } -} - // 费用套餐数据 const feePackages = ref([ { value: '肝功能12项', label: '肝功能12项', amount: 120.00 }, @@ -1294,6 +1278,30 @@ const handleSelectPackage = (item) => { }; // 检验类型相关方法 +// 处理表格点击事件,用于自动删除空的编辑行 +const handleTableClick = (event) => { + // 如果点击的是表格内部的元素,不处理 + if (event.target.closest('input, select, button, .action-btn')) { + return; + } + + // 如果当前有正在编辑的行,检查是否为空 + if (editingRowId.value) { + const editingRow = tableData.value.find(row => row.id === editingRowId.value); + if (editingRow && (!editingRow.code || editingRow.code.trim() === '') && + (!editingRow.name || editingRow.name.trim() === '') && + (!editingRow.department || editingRow.department.trim() === '')) { + // 删除空的编辑行 + const index = tableData.value.findIndex(row => row.id === editingRowId.value); + if (index !== -1) { + tableData.value.splice(index, 1); + editingRowId.value = null; + ElMessage.info('已自动删除空行'); + } + } + } +}; + const addNewRow = () => { if (editingRowId.value) { ElMessage.warning('请先保存或取消当前正在编辑的行'); @@ -1323,19 +1331,37 @@ const handleConfirm = (row) => { console.log('原始row数据:', row); console.log('提交前的submitData:', submitData); - // 验证必填字段 + // 验证必填字段,如果为空则删除该行 if (!submitData.code || submitData.code.trim() === '') { - alert('检验类型编码不能为空'); + // 删除空的编辑行 + const index = tableData.value.findIndex(r => r.id === row.id); + if (index !== -1) { + tableData.value.splice(index, 1); + editingRowId.value = null; + ElMessage.info('已删除空行'); + } return; } - + if (!submitData.name || submitData.name.trim() === '') { - alert('检验类型名称不能为空'); + // 删除空的编辑行 + const index = tableData.value.findIndex(r => r.id === row.id); + if (index !== -1) { + tableData.value.splice(index, 1); + editingRowId.value = null; + ElMessage.info('已删除空行'); + } return; } - + if (!submitData.department || submitData.department.trim() === '') { - alert('执行科室不能为空'); + // 删除空的编辑行 + const index = tableData.value.findIndex(r => r.id === row.id); + if (index !== -1) { + tableData.value.splice(index, 1); + editingRowId.value = null; + ElMessage.info('已删除空行'); + } return; } @@ -1886,6 +1912,11 @@ watch(packageItems, (newVal) => { z-index: 10; } +.data-table-type .action-cell { + justify-content: flex-start; + padding-left: 24px; +} + .action-btn { width: 28px; height: 28px;
*大类编码*大类项目名称*执行科室序号备注操作*大类编码*大类项目名称*执行科室序号备注操作