Fix Bug #428: 门诊医生站-检查申请:未实现分类联动检查方法及套餐明细展示与勾选逻辑
- 分类对象初始化时增加 methods: [],确保 Vue 响应式追踪分类下检查方法的加载 - handleMethodSelect 创建新项目时复制 cat.methods 全部方法数组(原只放单个方法),允许用户在右侧面板切换其他方法 - handleMethodSelect 新增/更新项目时同步 packageName 字段,确保 toggleItemExpand 能通过名称查找并加载套餐明细 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -924,7 +924,8 @@ async function loadCategoryList() {
|
||||
categoryName: t.name,
|
||||
// “检查类型管理”里配置的执行科室(图三)
|
||||
performDeptName: t.department || '',
|
||||
items: []
|
||||
items: [],
|
||||
methods: [] // #428修复: 初始化 methods 数组,确保 Vue 响应式追踪
|
||||
});
|
||||
}
|
||||
const unclassified = [];
|
||||
@@ -1267,6 +1268,7 @@ async function handleMethodSelect(checked, method, cat) {
|
||||
if (method.packageId) {
|
||||
existingItem.isPackage = true;
|
||||
existingItem.packageId = method.packageId;
|
||||
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
|
||||
// 预加载套餐明细
|
||||
loadPackageDetailsForItem(existingItem);
|
||||
}
|
||||
@@ -1294,12 +1296,13 @@ async function handleMethodSelect(checked, method, cat) {
|
||||
checkType: cat.typeName,
|
||||
nationalCode: targetItem.nationalCode || '',
|
||||
checked: true,
|
||||
methods: [method],
|
||||
methods: cat.methods || [method], // #428修复: 复制分类下全部方法,允许用户切换
|
||||
selectedMethod: method,
|
||||
expanded: false,
|
||||
// 从方法中获取套餐信息(优先级高于项目本身的 packageName)
|
||||
// 从方法或项目中获取套餐信息
|
||||
isPackage: !!method.packageId || !!targetItem.packageName,
|
||||
packageId: method.packageId || targetItem.packageId || null
|
||||
packageId: method.packageId || targetItem.packageId || null,
|
||||
packageName: method.packageName || targetItem.packageName || null // #428修复: 复制 packageName,确保套餐明细可加载
|
||||
};
|
||||
selectedItems.value.push(newItem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user