diff --git a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue index 1819c81f..e9d1e8dc 100644 --- a/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue +++ b/openhis-ui-vue3/src/views/maintainSystem/Inspection/index.vue @@ -1061,10 +1061,6 @@ const handlePackageVisibleChange = (visible) => { // 可选:如果希望页面一打开就预加载一次,保留 onMounted // 如果希望完全由用户点击触发,可以注释掉 onMounted -onMounted(() => { - // getFeePackages(); -}); - // ============================== // 【修复】级联下拉框逻辑 (包含直接请求代码) @@ -1190,9 +1186,7 @@ const handleEditRow = (row) => { }; onMounted(() => { - // ... 其他初始化代码 - loadParentTypes(); // <--- 确保这一行存在 - // ... + loadParentTypes(); }); @@ -1334,8 +1328,8 @@ const packageFilter = ref(''); // 过滤后的检验项目数据(仅保留费用套餐的前端过滤,其他过滤已由后端处理) const filteredInspectionItems = computed(() => { return inspectionItems.value.filter(item => { - // 按费用套餐过滤(费用套餐是前端自定义字段,需要前端过滤) - if (packageFilter.value && item.package !== packageFilter.value) { + // 按费用套餐过滤(用 feePackageId 与选中的套餐 id 比对) + if (packageFilter.value && String(item.feePackageId) !== String(packageFilter.value)) { return false; } return true; @@ -1888,7 +1882,7 @@ const addNewItem = () => { amount: 0.00, sortOrder: inspectionItems.value.length + 1, serviceRange: '全部', - sub医技Type: '', + subItemName: '', remark: '', status: true }; @@ -2058,8 +2052,8 @@ const deleteItem = async (id) => { }; const cancelEdit = (item) => { - // 如果是新添加的行,则直接删除 - if (item.id.toString().length > 10) { // 临时ID,使用Date.now()生成 + // 如果是新添加的行,则直接删除(临时ID为数字类型) + if (typeof item.id === 'number') { const index = inspectionItems.value.findIndex(i => i.id === item.id); if (index !== -1) { inspectionItems.value.splice(index, 1);