8
8
placement =" top-end"
9
9
:width =" 420"
10
10
trigger =" click"
11
- v-if =" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)"
11
+ v-if =" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)"
12
12
>
13
13
<template #reference >
14
14
<el-button plain type =" success" @click =" openPopover('approve')" >
60
60
placement =" top-end"
61
61
:width =" 420"
62
62
trigger =" click"
63
- v-if =" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.REJECT)"
63
+ v-if =" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.REJECT)"
64
64
>
65
65
<template #reference >
66
66
<el-button class =" mr-20px" plain type =" danger" @click =" openPopover('reject')" >
171
171
placement =" top-start"
172
172
:width =" 420"
173
173
trigger =" click"
174
- v-if =" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.TRANSFER)"
174
+ v-if =" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.TRANSFER)"
175
175
>
176
176
<template #reference >
177
177
<div @click =" openPopover('transfer')" class =" hover-bg-gray-100 rounded-xl p-6px" >
397
397
placement =" top-start"
398
398
:width =" 420"
399
399
trigger =" click"
400
- v-if =" userId === processInstance?.startUser?.id && !isEndProcessStatus(processInstance?.status)"
400
+ v-if ="
401
+ userId === processInstance?.startUser?.id && !isEndProcessStatus(processInstance?.status)
402
+ "
401
403
>
402
404
<template #reference >
403
405
<div @click =" openPopover('cancel')" class =" hover-bg-gray-100 rounded-xl p-6px" >
414
416
label-width =" 100px"
415
417
>
416
418
<el-form-item label =" 撤消理由" prop =" cancelReason" >
417
- <span class =" text-#878c93 text-12px" >  ; 撤消后,该审批流程将自动结束</span >
419
+ <span class =" text-#878c93 text-12px" >  ; 撤消后,该审批流程将自动结束</span >
418
420
<el-input
419
421
v-model =" genericForm.cancelReason"
420
422
clearable
424
426
/>
425
427
</el-form-item >
426
428
<el-form-item >
427
- <el-button :disabled =" formLoading" type =" primary" @click =" handleCancel()" >撤消</el-button >
429
+ <el-button :disabled =" formLoading" type =" primary" @click =" handleCancel()"
430
+ >撤消</el-button
431
+ >
428
432
<el-button @click =" popOverVisible.cancel = false" > 取消 </el-button >
429
433
</el-form-item >
430
434
</el-form >
434
438
<div
435
439
@click =" handleReCreate()"
436
440
class =" hover-bg-gray-100 rounded-xl p-6px"
437
- v-if =" userId === processInstance?.startUser?.id && isEndProcessStatus(processInstance?.status)
438
- && processDefinition?.formType === 10"
441
+ v-if ="
442
+ userId === processInstance?.startUser?.id &&
443
+ isEndProcessStatus(processInstance?.status) &&
444
+ processDefinition?.formType === 10
445
+ "
439
446
>
440
447
<Icon :size =" 14" icon =" ep:refresh" />  ; 再次提交
441
448
</div >
442
449
<!-- 弹窗:子任务 -->
443
450
<TaskSignList ref =" taskSignListRef" @success =" reload" />
444
-
445
-
446
451
</div >
447
452
</template >
448
453
<script lang="ts" setup>
@@ -457,20 +462,22 @@ import {
457
462
OPERATION_BUTTON_NAME
458
463
} from ' @/components/SimpleProcessDesignerV2/src/consts'
459
464
import { BpmProcessInstanceStatus } from ' @/utils/constants'
460
- defineOptions ({ name: ' ProcessInstanceBtnConatiner' })
465
+
466
+ defineOptions ({ name: ' ProcessInstanceBtnContainer' })
461
467
462
468
const router = useRouter () // 路由
463
469
const message = useMessage () // 消息弹窗
464
470
const { proxy } = getCurrentInstance () as any
471
+
465
472
const userId = useUserStoreWithOut ().getUser .id // 当前登录的编号
466
473
const emit = defineEmits ([' success' ]) // 定义 success 事件,用于操作成功后的回调
467
474
const props = defineProps ({
468
475
processInstance: propTypes .object , // 流程实例信息
469
- processDefinition : propTypes .object , // 流程定义信息
476
+ processDefinition: propTypes .object , // 流程定义信息
470
477
userOptions: propTypes .any
471
478
})
479
+
472
480
const formLoading = ref (false ) // 表单加载中
473
- /** 气泡卡是否展示 */
474
481
const popOverVisible = ref ({
475
482
approve: false ,
476
483
reject: false ,
@@ -480,16 +487,15 @@ const popOverVisible = ref({
480
487
return: false ,
481
488
copy: false ,
482
489
cancel: false
483
- })
484
- /** 退回节点 */
485
- const returnList = ref ([] as any )
490
+ }) // 气泡卡是否展示
491
+ const returnList = ref ([] as any ) // 退回节点
492
+
486
493
// ========== 审批信息 ==========
487
494
const runningTask = ref <any >() // 运行中的任务
488
495
const genericForm = ref <any >({}) // 通用表单
489
496
const approveForm = ref <any >({}) // 审批通过时,额外的补充信息
490
497
const approveFormFApi = ref <any >({}) // approveForms 的 fAPi
491
498
const formRef = ref ()
492
- /** 表单校验规则 */
493
499
const genericRule = reactive ({
494
500
reason: [{ required: true , message: ' 审批意见不能为空' , trigger: ' blur' }],
495
501
returnReason: [{ required: true , message: ' 退回理由不能为空' , trigger: ' blur' }],
@@ -498,8 +504,8 @@ const genericRule = reactive({
498
504
assigneeUserId: [{ required: true , message: ' 新审批人不能为空' , trigger: ' change' }],
499
505
delegateUserId: [{ required: true , message: ' 接收人不能为空' , trigger: ' change' }],
500
506
addSignUserIds: [{ required: true , message: ' 加签处理人不能为空' , trigger: ' change' }],
501
- targetTaskDefinitionKey: [{ required: true , message: ' 退回节点不能为空' , trigger: ' change' }]
502
- })
507
+ targetTaskDefinitionKey: [{ required: true , message: ' 退回节点不能为空' , trigger: ' change' }]
508
+ }) // 表单校验规则
503
509
504
510
/** 监听 approveFormFApis,实现它对应的 form-create 初始化后,隐藏掉对应的表单提交按钮 */
505
511
watch (
@@ -520,20 +526,16 @@ const openReturnPopover = async () => {
520
526
message .warning (' 当前没有可退回的节点' )
521
527
return
522
528
}
523
- openPopover (' return' )
529
+ await openPopover (' return' )
524
530
}
531
+
525
532
/** 弹出气泡卡 */
526
- const openPopover = (type : string ) => {
533
+ const openPopover = async (type : string ) => {
527
534
Object .keys (popOverVisible .value ).forEach ((item ) => {
528
- if (item === type ) {
529
- popOverVisible .value [item ] = true
530
- } else {
531
- popOverVisible .value [item ] = false
532
- }
533
- })
534
- nextTick ().then (() => {
535
- formRef .value .resetFields ()
535
+ popOverVisible .value [item ] = item === type
536
536
})
537
+ await nextTick ()
538
+ formRef .value .resetFields ()
537
539
}
538
540
539
541
/** 处理审批通过和不通过的操作 */
@@ -575,7 +577,7 @@ const handleAudit = async (pass: boolean) => {
575
577
}
576
578
}
577
579
578
- /* 处理抄送 */
580
+ /** 处理抄送 */
579
581
const handleCopy = async () => {
580
582
formLoading .value = true
581
583
try {
@@ -718,7 +720,10 @@ const handleCancel = async () => {
718
720
const valid = await elForm .validate ()
719
721
if (! valid ) return
720
722
// 1.2 提交取消
721
- await ProcessInstanceApi .cancelProcessInstanceByStartUser (props .processInstance .id , genericForm .value .cancelReason )
723
+ await ProcessInstanceApi .cancelProcessInstanceByStartUser (
724
+ props .processInstance .id ,
725
+ genericForm .value .cancelReason
726
+ )
722
727
popOverVisible .value .return = false
723
728
message .success (' 操作成功' )
724
729
// 2 重新加载数据
@@ -764,8 +769,9 @@ const isHandleTaskStatus = () => {
764
769
const isEndProcessStatus = (status : number ) => {
765
770
let isEndStatus = false
766
771
if (
767
- BpmProcessInstanceStatus .APPROVE === status || BpmProcessInstanceStatus .REJECT === status ||
768
- BpmProcessInstanceStatus .CANCEL === status
772
+ BpmProcessInstanceStatus .APPROVE === status ||
773
+ BpmProcessInstanceStatus .REJECT === status ||
774
+ BpmProcessInstanceStatus .CANCEL === status
769
775
) {
770
776
isEndStatus = true
771
777
}
@@ -806,7 +812,6 @@ const loadTodoTask = (task: any) => {
806
812
}
807
813
808
814
defineExpose ({ loadTodoTask })
809
-
810
815
</script >
811
816
812
817
<style lang="scss" scoped>
0 commit comments