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

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
+15 -12
View File
@@ -213,12 +213,12 @@ export async function getRulesList(params: RulesQueryParams): Promise<{data: Rul
if (reviewType) {
try {
// 先获取所有评查点组数据,用于找到对应的pid
const groupsAllResponse = await postgrestGet<{code: number; msg: string; data: Array<{id: number; pid: number}>}>('evaluation_point_groups', {
select: 'id,pid',
const groupsAllResponse = await postgrestGet<{code: number; msg: string; data: Array<{id: number; pid: number; m_type: number}>}>('evaluation_point_groups', {
select: 'id,pid,m_type',
token
});
let groups: Array<{id: number; pid: number}> = [];
let groups: Array<{id: number; pid: number; m_type: number}> = [];
if (!groupsAllResponse.error) {
if (groupsAllResponse.data && 'code' in groupsAllResponse.data && groupsAllResponse.data.data) {
@@ -232,12 +232,14 @@ export async function getRulesList(params: RulesQueryParams): Promise<{data: Rul
let pidList: number[] = [];
if (reviewType === 'contract') {
// 合同类型,找到所有pid=3的评查点组
const contractGroups = groups.filter(g => g.pid === 3).map(g => g.id);
// 合同类型,找到所有pid=3的评查点组 2025/10/29: 修改为通过m_type = 0 去查找评查点组
// const contractGroups = groups.filter(g => g.pid === 3).map(g => g.id);
const contractGroups = groups.filter(g => g.m_type === 0).map(g => g.id);
pidList = contractGroups;
} else if (reviewType === 'record') {
// 卷宗类型,找到所有pid=1或pid=2的评查点组
const recordGroups = groups.filter(g => g.pid === 1 || g.pid === 2).map(g => g.id);
// 卷宗类型,找到所有pid=1或pid=2的评查点组 2025/10/29: 修改为通过m_type = 1 去查找评查点组
// const recordGroups = groups.filter(g => g.pid === 1 || g.pid === 2).map(g => g.id);
const recordGroups = groups.filter(g => g.m_type === 1).map(g => g.id);
pidList = recordGroups;
}
@@ -860,7 +862,8 @@ export async function getRuleTypes(reviewType?: string, token?: string): Promise
code,
name,
description,
is_enabled
is_enabled,
m_type
`,
// 查询父ID为0的类型(顶级类型)
filter: {
@@ -871,11 +874,11 @@ export async function getRuleTypes(reviewType?: string, token?: string): Promise
// 根据 reviewType 添加过滤条件
if (reviewType === 'contract') {
// 如果是合同类型,只加载id=3的评查点类型
postgrestParams.filter!['id'] = 'eq.3';
// 如果是合同类型,只加载id=3的评查点类型 2025/10/29: 修改为通过m_type = 0 去查找评查点组
postgrestParams.filter!['m_type'] = 'eq.0';
} else if (reviewType === 'record') {
// 如果是卷宗类型,只加载id=1和id=2的评查点类型
postgrestParams.filter!['id'] = 'in.(1,2)';
// 如果是卷宗类型,只加载id=1和id=2的评查点类型 2025/10/29: 修改为通过m_type = 1 去查找评查点组
postgrestParams.filter!['m_type'] = 'eq.1';
}
// 发送请求获取评查点类型列表