Skip to content

Commit 2dae231

Browse files
committed
【功能新增】审批节点的审批人与发起人相同时,对应的处理类型的配置
1 parent fd13eb7 commit 2dae231

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

src/components/SimpleProcessDesignerV2/src/consts.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export interface SimpleFlowNode {
7777
timeoutHandler?: TimeoutHandler
7878
// 审批任务拒绝处理
7979
rejectHandler?: RejectHandler
80+
// 审批节点的审批人与发起人相同时,对应的处理类型
81+
assignStartUserHandlerType?: number
8082
}
8183
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
8284
export enum CandidateStrategy {
@@ -174,6 +176,21 @@ export enum RejectHandlerType {
174176
*/
175177
RETURN_USER_TASK = 2
176178
}
179+
// 用户任务的审批人与发起人相同时,处理类型枚举
180+
export enum AssignStartUserHandlerType {
181+
/**
182+
* 由发起人对自己审批
183+
*/
184+
START_USER_AUDIT = 1,
185+
/**
186+
* 自动跳过【参考飞书】:1)如果当前节点还有其他审批人,则交由其他审批人进行审批;2)如果当前节点没有其他审批人,则该节点自动通过
187+
*/
188+
SKIP = 2,
189+
/**
190+
* 转交给部门负责人审批
191+
*/
192+
ASSIGN_DEPT_LEADER
193+
}
177194

178195
// 时间单位枚举
179196
export enum TimeUnitType {
@@ -309,6 +326,11 @@ export const REJECT_HANDLER_TYPES: DictDataVO[] = [
309326
{ label: '驳回到指定节点', value: RejectHandlerType.RETURN_USER_TASK }
310327
// { label: '结束任务', value: RejectHandlerType.FINISH_TASK }
311328
]
329+
export const ASSIGN_START_USER_HANDLER_TYPES: DictDataVO[] = [
330+
{ label: '由发起人对自己审批', value: 1 },
331+
{ label: '自动跳过', value: 2 },
332+
{ label: '转交给部门负责人审批', value: 3 }
333+
]
312334

313335
// 比较运算符
314336
export const COMPARISON_OPERATORS: DictDataVO = [

src/components/SimpleProcessDesignerV2/src/node.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import {
1010
NodeType,
1111
ApproveMethodType,
1212
RejectHandlerType,
13-
NODE_DEFAULT_NAME
13+
NODE_DEFAULT_NAME,
14+
AssignStartUserHandlerType,
15+
ASSIGN_START_USER_HANDLER_TYPES
1416
} from './consts'
1517
export function useWatchNode(props: { flowNode: SimpleFlowNode }): Ref<SimpleFlowNode> {
1618
const node = ref<SimpleFlowNode>(props.flowNode)
@@ -97,6 +99,7 @@ export type UserTaskFormType = {
9799
returnNodeId?: string
98100
timeoutHandlerEnable?: boolean
99101
timeoutHandlerAction?: number
102+
assignStartUserHandlerType?: AssignStartUserHandlerType
100103
timeDuration?: number
101104
maxRemindCount?: number
102105
buttonsSetting: any[]
@@ -125,6 +128,7 @@ export function useNodeForm(nodeType: NodeType) {
125128
approveMethod: ApproveMethodType.RRANDOM_SELECT_ONE_APPROVE,
126129
approveRatio: 100,
127130
rejectHandlerType: RejectHandlerType.FINISH_PROCESS,
131+
assignStartUserHandlerType: AssignStartUserHandlerType.START_USER_AUDIT,
128132
returnNodeId: '',
129133
timeoutHandlerEnable: false,
130134
timeoutHandlerAction: 1,

src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,17 @@
275275
>
276276
<el-input-number v-model="configForm.maxRemindCount" :min="1" :max="10" />
277277
</el-form-item>
278+
279+
<el-divider content-position="left">审批人与提交人为同一人时</el-divider>
280+
<el-form-item prop="assignStartUserHandlerType">
281+
<el-radio-group v-model="configForm.assignStartUserHandlerType">
282+
<div class="flex-col">
283+
<div v-for="(item, index) in ASSIGN_START_USER_HANDLER_TYPES" :key="index">
284+
<el-radio :key="item.value" :value="item.value" :label="item.label" />
285+
</div>
286+
</div>
287+
</el-radio-group>
288+
</el-form-item>
278289
</el-form>
279290
</div>
280291
</el-tab-pane>
@@ -364,7 +375,8 @@ import {
364375
REJECT_HANDLER_TYPES,
365376
DEFAULT_BUTTON_SETTING,
366377
OPERATION_BUTTON_NAME,
367-
ButtonSetting
378+
ButtonSetting,
379+
ASSIGN_START_USER_HANDLER_TYPES
368380
} from '../consts'
369381
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
370382
import {
@@ -506,6 +518,8 @@ const saveConfig = async () => {
506518
timeDuration: isoTimeDuration.value,
507519
maxRemindCount: cTimeoutMaxRemindCount.value
508520
}
521+
// 设置用户任务的审批人与发起人相同时
522+
currentNode.value.assignStartUserHandlerType = configForm.value.assignStartUserHandlerType
509523
// 设置表单权限
510524
currentNode.value.fieldsPermission = fieldsPermissionConfig.value
511525
// 设置按钮权限
@@ -560,6 +574,8 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
560574
}
561575
configForm.value.timeoutHandlerAction = node.timeoutHandler?.action
562576
configForm.value.maxRemindCount = node.timeoutHandler?.maxRemindCount
577+
// 1.5 设置用户任务的审批人与发起人相同时
578+
configForm.value.assignStartUserHandlerType = node.assignStartUserHandlerType
563579
// 2. 操作按钮设置
564580
buttonsSetting.value = cloneDeep(node.buttonsSetting) || DEFAULT_BUTTON_SETTING
565581
// 3. 表单字段权限配置

0 commit comments

Comments
 (0)