36
36
:rule =" approveForm.rule"
37
37
/>
38
38
</el-card >
39
+ <el-form-item :label =" `${nodeTypeName}意见`" prop =" reason" >
40
+ <el-input
41
+ v-model =" approveReasonForm.reason"
42
+ :placeholder =" `请输入${nodeTypeName}意见`"
43
+ type =" textarea"
44
+ :rows =" 4"
45
+ />
46
+ </el-form-item >
39
47
<el-form-item
40
- label =" 选择审批人 "
48
+ label =" 选择下一个节点的审批人 "
41
49
prop =" selectApproveUser"
42
50
v-if =" dialogVisibleSelectApproveUser"
43
51
>
48
56
@select-user-confirm =" selectUserConfirm"
49
57
/>
50
58
</el-form-item >
51
- <el-form-item :label =" `${nodeTypeName}意见`" prop =" reason" >
52
- <el-input
53
- v-model =" approveReasonForm.reason"
54
- :placeholder =" `请输入${nodeTypeName}意见`"
55
- type =" textarea"
56
- :rows =" 4"
57
- />
58
- </el-form-item >
59
59
<el-form-item
60
60
v-if =" runningTask.signEnable"
61
61
label =" 签名"
@@ -695,30 +695,7 @@ const openPopover = async (type: string) => {
695
695
message .warning (' 表单校验不通过,请先完善表单!!' )
696
696
return
697
697
}
698
- // 获取修改的流程变量, 暂时只支持流程表单
699
- const variables = getUpdatedProcessInstanceVariables ()
700
- const param = {
701
- processInstanceId: props .processInstance .id ,
702
- processVariablesStr: JSON .stringify (variables )
703
- }
704
- // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
705
- const res = await ProcessInstanceApi .getApprovalDetail (param )
706
- // 当前待审批节点id
707
- const activityId = res .todoTask ?.taskDefinitionKey
708
- if (res .activityNodes && res .activityNodes .length > 0 ) {
709
- // 找到当前节点的索引
710
- const currentNodeIndex = res .activityNodes .findIndex ((node ) => node .id === activityId )
711
- const nextNode = res .activityNodes [currentNodeIndex + 1 ]
712
- if (
713
- nextNode .candidateStrategy === CandidateStrategy .START_USER_SELECT &&
714
- ! nextNode .tasks &&
715
- nextNode .candidateUsers ?.length === 0
716
- ) {
717
- // 自选审批人,则弹出选择审批人弹窗
718
- activityNodes .value = [nextNode ]
719
- dialogVisibleSelectApproveUser .value = true
720
- }
721
- }
698
+ initNextTaskSelectAssigneeFormField ()
722
699
}
723
700
if (type === ' return' ) {
724
701
// 获取退回节点
@@ -744,6 +721,33 @@ const closePropover = (type: string, formRef: FormInstance | undefined) => {
744
721
dialogVisibleSelectApproveUser .value = false
745
722
}
746
723
724
+ /** // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 */
725
+ const initNextTaskSelectAssigneeFormField = async () => {
726
+ // 获取修改的流程变量, 暂时只支持流程表单
727
+ const variables = getUpdatedProcessInstanceVariables ()
728
+ const param = {
729
+ processInstanceId: props .processInstance .id ,
730
+ processVariablesStr: JSON .stringify (variables )
731
+ }
732
+ const res = await ProcessInstanceApi .getApprovalDetail (param )
733
+ // 当前待审批节点id
734
+ const activityId = res .todoTask ?.taskDefinitionKey
735
+ if (res .activityNodes && res .activityNodes .length > 0 ) {
736
+ // 找到当前节点的索引
737
+ const currentNodeIndex = res .activityNodes .findIndex ((node ) => node .id === activityId )
738
+ const nextNode = res .activityNodes [currentNodeIndex + 1 ]
739
+ if (
740
+ nextNode .candidateStrategy === CandidateStrategy .START_USER_SELECT &&
741
+ ! nextNode .tasks &&
742
+ nextNode .candidateUsers ?.length === 0
743
+ ) {
744
+ // 自选审批人,则弹出选择审批人弹窗
745
+ activityNodes .value = [nextNode ]
746
+ dialogVisibleSelectApproveUser .value = true
747
+ }
748
+ }
749
+ }
750
+
747
751
/** 处理审批通过和不通过的操作 */
748
752
const handleAudit = async (pass : boolean , formRef : FormInstance | undefined ) => {
749
753
formLoading .value = true
@@ -764,33 +768,10 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
764
768
dialogVisibleSelectApproveUser .value &&
765
769
Object .keys (approveReasonForm .selectApproveUser ).length === 0
766
770
) {
767
- message .warning (' 审批人不能为空 !' )
771
+ message .warning (' 下一个节点的审批人不能为空 !' )
768
772
return
769
773
}
770
- // 获取修改的流程变量, 暂时只支持流程表单
771
774
const variables = getUpdatedProcessInstanceVariables ()
772
- const param = {
773
- processInstanceId: props .processInstance .id ,
774
- processVariablesStr: JSON .stringify (variables )
775
- }
776
- // 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人
777
- const res = await ProcessInstanceApi .getApprovalDetail (param )
778
- // 当前待审批节点id
779
- const activityId = res .todoTask ?.taskDefinitionKey
780
- if (res .activityNodes && res .activityNodes .length > 0 ) {
781
- // 找到当前节点的索引
782
- const currentNodeIndex = res .activityNodes .findIndex ((node ) => node .id === activityId )
783
- const nextNode = res .activityNodes [currentNodeIndex + 1 ]
784
- if (
785
- nextNode .candidateStrategy === CandidateStrategy .START_USER_SELECT &&
786
- ! nextNode .tasks &&
787
- nextNode .candidateUsers ?.length === 0
788
- ) {
789
- // 自选审批人,则弹出选择审批人弹窗
790
- activityNodes .value = [nextNode ]
791
- dialogVisibleSelectApproveUser .value = true
792
- }
793
- }
794
775
// 审批通过数据
795
776
const data = {
796
777
id: runningTask .value .id ,
0 commit comments