fix: 跨部门分配成员下拉只显示需求部门成员,不包括一级需求部门成员

This commit is contained in:
Your Name 2026-01-21 16:15:01 +08:00
parent 634806e7cf
commit 0afea4aa08
3 changed files with 6 additions and 4 deletions

View File

@ -472,13 +472,14 @@ public class DepartmentService {
}
/**
* 获取所有需求部门的ID列表(包括 demand 和 primary_demand 类型)
* 获取所有需求部门的ID列表(只包括 demand 类型,不包括 primary_demand)
* 用于跨部门成员分配功能
* 注意:一级需求部门(primary_demand)的成员不应该出现在下拉列表中
*/
public List<Long> getAllDemandDeptIds() {
List<Department> demandDepts = departmentMapper.selectList(
new LambdaQueryWrapper<Department>()
.in(Department::getDeptType, "demand", "primary_demand")
.eq(Department::getDeptType, "demand") // 只查询 demand 类型,不包括 primary_demand
.eq(Department::getStatus, 1)
.eq(Department::getDeleted, 0)
);

Binary file not shown.

View File

@ -5448,8 +5448,9 @@ const handleApprovePrimaryTask = async (task: Task) => {
let crossDeptAssignEnabled = false
try {
const configResponse = await getSystemConfig('primary_dept_cross_dept_assign')
crossDeptAssignEnabled = configResponse.data?.configValue === 'true'
console.log('跨部门分配功能状态:', crossDeptAssignEnabled)
// API 返回的 data 直接是字符串 "true" 或 "false"
crossDeptAssignEnabled = configResponse.data === 'true' || configResponse.data === true
console.log('跨部门分配功能状态:', crossDeptAssignEnabled, '原始值:', configResponse.data)
} catch (e) {
console.log('获取跨部门分配配置失败,使用默认值(关闭)')
}