添加根据合同/卷宗的入口进行分类评查点列表,同时区分卷宗添加的分组属于卷宗,合同添加的分组属于合同

This commit is contained in:
2025-10-29 21:01:01 +08:00
parent e56d199c3c
commit 064f05ffa5
3 changed files with 50 additions and 19 deletions
+8 -1
View File
@@ -24,6 +24,7 @@ export interface ApiRuleGroup {
code?: string;
description?: string;
is_enabled: boolean;
m_type?: number; // 文档类型:0=合同,1=其他
created_at?: string;
updated_at?: string;
}
@@ -35,6 +36,7 @@ export interface RuleGroupCreateUpdateDto {
pid: string | null; // 父分组ID,如果是一级分组则为null或'0'
description?: string;
is_enabled: boolean;
reviewType?: string; // 审核类型:'contract'=合同,其他为卷宗
}
// 用于替换代码中的 any 类型
@@ -446,13 +448,18 @@ export async function createRuleGroup(groupData: RuleGroupCreateUpdateDto, token
return { error: '父分组ID格式错误', status: 400 };
}
// 根据 reviewType 确定 m_type 的值
// contract -> 0, 其他 -> 1
const mType = groupData.reviewType === 'contract' ? 0 : 1;
// 构建API请求数据 - 确保字段类型符合数据库要求
const apiGroup: ApiRuleGroup = {
pid: pidValue,
name: groupData.name.trim(),
code: groupData.code.trim(),
description: groupData.description || '',
is_enabled: groupData.is_enabled
is_enabled: groupData.is_enabled,
m_type: mType
};
// console.log('创建评查点分组请求数据:', JSON.stringify(apiGroup, null, 2));