232
232
</el-form-item >
233
233
<el-form-item
234
234
label =" 执行动作"
235
- prop =" timeoutHandlerAction "
235
+ prop =" timeoutHandlerType "
236
236
v-if =" configForm.timeoutHandlerEnable"
237
237
>
238
238
<el-radio-group
239
- v-model =" configForm.timeoutHandlerAction "
240
- @change =" timeoutActionChanged "
239
+ v-model =" configForm.timeoutHandlerType "
240
+ @change =" timeoutHandlerTypeChanged "
241
241
>
242
242
<el-radio-button
243
- v-for =" item in TIMEOUT_HANDLER_ACTION_TYPES "
243
+ v-for =" item in TIMEOUT_HANDLER_TYPES "
244
244
:key =" item.value"
245
245
:value =" item.value"
246
246
:label =" item.label"
276
276
<el-form-item
277
277
label =" 最大提醒次数"
278
278
prop =" maxRemindCount"
279
- v-if =" configForm.timeoutHandlerEnable && configForm.timeoutHandlerAction === 1"
279
+ v-if =" configForm.timeoutHandlerEnable && configForm.timeoutHandlerType === 1"
280
280
>
281
281
<el-input-number v-model =" configForm.maxRemindCount" :min =" 1" :max =" 10" />
282
282
</el-form-item >
283
+
284
+ <el-divider content-position =" left" >审批人与提交人为同一人时</el-divider >
285
+ <el-form-item prop =" assignStartUserHandlerType" >
286
+ <el-radio-group v-model =" configForm.assignStartUserHandlerType" >
287
+ <div class =" flex-col" >
288
+ <div v-for =" (item, index) in ASSIGN_START_USER_HANDLER_TYPES" :key =" index" >
289
+ <el-radio :key =" item.value" :value =" item.value" :label =" item.label" />
290
+ </div >
291
+ </div >
292
+ </el-radio-group >
293
+ </el-form-item >
283
294
</el-form >
284
295
</div >
285
296
</el-tab-pane >
@@ -364,14 +375,16 @@ import {
364
375
ApproveMethodType ,
365
376
TimeUnitType ,
366
377
RejectHandlerType ,
367
- TIMEOUT_HANDLER_ACTION_TYPES ,
378
+ TIMEOUT_HANDLER_TYPES ,
368
379
TIME_UNIT_TYPES ,
369
380
REJECT_HANDLER_TYPES ,
370
381
DEFAULT_BUTTON_SETTING ,
371
382
OPERATION_BUTTON_NAME ,
372
383
ButtonSetting ,
373
384
MULTI_LEVEL_DEPT ,
374
- CANDIDATE_STRATEGY
385
+ CANDIDATE_STRATEGY ,
386
+ ASSIGN_START_USER_HANDLER_TYPES ,
387
+ TimeoutHandlerType
375
388
} from ' ../consts'
376
389
377
390
import {
@@ -435,7 +448,7 @@ const formRules = reactive({
435
448
approveRatio: [{ required: true , message: ' 通过比例不能为空' , trigger: ' blur' }],
436
449
returnNodeId: [{ required: true , message: ' 驳回节点不能为空' , trigger: ' change' }],
437
450
timeoutHandlerEnable: [{ required: true }],
438
- timeoutHandlerAction : [{ required: true }],
451
+ timeoutHandlerType : [{ required: true }],
439
452
timeDuration: [{ required: true , message: ' 超时时间不能为空' , trigger: ' blur' }],
440
453
maxRemindCount: [{ required: true , message: ' 提醒次数不能为空' , trigger: ' blur' }]
441
454
})
@@ -499,8 +512,8 @@ const returnTaskList = ref<SimpleFlowNode[]>([])
499
512
// 审批人超时未处理设置
500
513
const {
501
514
timeoutHandlerChange,
502
- cTimeoutAction ,
503
- timeoutActionChanged ,
515
+ cTimeoutType ,
516
+ timeoutHandlerTypeChanged ,
504
517
timeUnit,
505
518
timeUnitChange,
506
519
isoTimeDuration,
@@ -532,10 +545,12 @@ const saveConfig = async () => {
532
545
// 设置超时处理
533
546
currentNode .value .timeoutHandler = {
534
547
enable: configForm .value .timeoutHandlerEnable ! ,
535
- action: cTimeoutAction .value ,
548
+ type: cTimeoutType .value ,
536
549
timeDuration: isoTimeDuration .value ,
537
550
maxRemindCount: cTimeoutMaxRemindCount .value
538
551
}
552
+ // 设置用户任务的审批人与发起人相同时
553
+ currentNode .value .assignStartUserHandlerType = configForm .value .assignStartUserHandlerType
539
554
// 设置表单权限
540
555
currentNode .value .fieldsPermission = fieldsPermissionConfig .value
541
556
// 设置按钮权限
@@ -553,7 +568,7 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
553
568
configForm .value .candidateStrategy = node .candidateStrategy !
554
569
// 解析候选人参数
555
570
parseCandidateParam (node .candidateStrategy ! , node ?.candidateParam )
556
- if (configForm .value .deptIds && configForm .value .deptIds .length > 1 ) {
571
+ if (configForm .value .userIds && configForm .value .userIds .length > 1 ) {
557
572
notAllowedMultiApprovers .value = true
558
573
} else {
559
574
notAllowedMultiApprovers .value = false
@@ -578,8 +593,10 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
578
593
configForm .value .timeDuration = parseInt (parseTime )
579
594
timeUnit .value = convertTimeUnit (parseTimeUnit )
580
595
}
581
- configForm .value .timeoutHandlerAction = node .timeoutHandler ?.action
596
+ configForm .value .timeoutHandlerType = node .timeoutHandler ?.type
582
597
configForm .value .maxRemindCount = node .timeoutHandler ?.maxRemindCount
598
+ // 1.5 设置用户任务的审批人与发起人相同时
599
+ configForm .value .assignStartUserHandlerType = node .assignStartUserHandlerType
583
600
// 2. 操作按钮设置
584
601
buttonsSetting .value = cloneDeep (node .buttonsSetting ) || DEFAULT_BUTTON_SETTING
585
602
// 3. 表单字段权限配置
@@ -623,21 +640,21 @@ function useTimeoutHandler() {
623
640
if (configForm .value .timeoutHandlerEnable ) {
624
641
timeUnit .value = 2
625
642
configForm .value .timeDuration = 6
626
- configForm .value .timeoutHandlerAction = 1
643
+ configForm .value .timeoutHandlerType = 1
627
644
configForm .value .maxRemindCount = 1
628
645
}
629
646
}
630
647
// 超时执行的动作
631
- const cTimeoutAction = computed (() => {
648
+ const cTimeoutType = computed (() => {
632
649
if (! configForm .value .timeoutHandlerEnable ) {
633
650
return undefined
634
651
}
635
- return configForm .value .timeoutHandlerAction
652
+ return configForm .value .timeoutHandlerType
636
653
})
637
654
638
655
// 超时处理动作改变
639
- const timeoutActionChanged = () => {
640
- if (configForm .value .timeoutHandlerAction === 1 ) {
656
+ const timeoutHandlerTypeChanged = () => {
657
+ if (configForm .value .timeoutHandlerType === TimeoutHandlerType . REMINDER ) {
641
658
configForm .value .maxRemindCount = 1 // 超时提醒次数,默认为1
642
659
}
643
660
}
@@ -680,16 +697,16 @@ function useTimeoutHandler() {
680
697
if (! configForm .value .timeoutHandlerEnable ) {
681
698
return undefined
682
699
}
683
- if (configForm .value .timeoutHandlerAction !== 1 ) {
700
+ if (configForm .value .timeoutHandlerType !== TimeoutHandlerType . REMINDER ) {
684
701
return undefined
685
702
}
686
703
return configForm .value .maxRemindCount
687
704
})
688
705
689
706
return {
690
707
timeoutHandlerChange ,
691
- cTimeoutAction ,
692
- timeoutActionChanged ,
708
+ cTimeoutType ,
709
+ timeoutHandlerTypeChanged ,
693
710
timeUnit ,
694
711
timeUnitChange ,
695
712
isoTimeDuration ,
0 commit comments