From 019104f46007b1aa6463db3efa9d933788cffba6 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Tue, 8 Oct 2024 12:42:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E4=BF=AE=E6=94=B9=E3=80=91-=20=E6=96=B0=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E7=95=8C=E9=9D=A2=E9=83=A8=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/processInstance/index.ts | 2 +- .../detail/ProcessInstanceTimeline.vue | 17 ++-- .../bpm/processInstance/detail/index_new.vue | 89 ++++++++++++------- 3 files changed, 70 insertions(+), 38 deletions(-) diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts index 3d6330a8..86928816 100644 --- a/src/api/bpm/processInstance/index.ts +++ b/src/api/bpm/processInstance/index.ts @@ -47,7 +47,7 @@ export type ApprovalNodeInfo = { status: number startTime?: Date endTime?: Date - candidateUserList?: User[] + candidateUsers?: User[] tasks: ApprovalTaskInfo[] } diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue index afb778c4..d201db12 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue @@ -14,7 +14,7 @@
-
+
{{ task.assigneeUser.nickname }}
@@ -57,14 +57,20 @@ > {{ task.ownerUser.nickname }}
- - +
+
+ {{ task.reason }} +
+
@@ -91,7 +97,6 @@
{{ user.nickname }}
-
diff --git a/src/views/bpm/processInstance/detail/index_new.vue b/src/views/bpm/processInstance/detail/index_new.vue index b2035a19..54880487 100644 --- a/src/views/bpm/processInstance/detail/index_new.vue +++ b/src/views/bpm/processInstance/detail/index_new.vue @@ -12,25 +12,37 @@
{{ processInstance.name }}
- +
- + + + + {{ processInstance?.startUser?.nickname.substring(0, 1) }} + {{ processInstance?.startUser?.nickname }}
{{ formatDate(processInstance.startTime) }} 提交
- +
- +
- +
+ - +
+ + + +
+ - +
+ + + +
+ - 流转评论 + +
+ 流转评论 +
+
-
+
({}) // 流程实例 +let processDefinitionId = undefined // 流程定义 Id const operationButtonRef = ref() const timelineRef = ref() const bpmnXml = ref('') // BPMN XML @@ -151,10 +171,10 @@ const detailForm = ref({ }) // 流程实例的表单详情 /** 获得详情 */ -const getDetail = () => { +const getDetail = async () => { // 1. 获得流程实例相关 getProcessInstance() - // 2. 获得流程任务列表(审批记录) + // 2. 获得流程任务列表 getTaskList() } @@ -202,9 +222,9 @@ const getProcessInstance = async () => { // 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath) } - + processDefinitionId = processDefinition.id // 加载流程图 - bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinition.id))?.bpmnXml + // bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinition.id))?.bpmnXml } finally { processInstanceLoading.value = false } @@ -273,6 +293,13 @@ const refresh = () => { /** 当前的Tab */ const activeTab = ref('form') +/** Tab 切换 加载流程图,直接加载显示不出来,不知道啥原因,所以切换以后在加载 */ +const onTabChange = async (tabName: string) => { + if (tabName === 'diagram' && processDefinitionId && !bpmnXml.value) { + //加载流程图 + bpmnXml.value = (await DefinitionApi.getProcessDefinition(processDefinitionId))?.bpmnXml + } +} /** 初始化 */ const userOptions = ref([]) // 用户列表 onMounted(async () => { From a4a4dcdfc2aa275394df47a5082a48d1bb24fa9a Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Tue, 8 Oct 2024 21:49:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=91=E5=A4=9A=E4=BA=BA=E5=AE=A1=E6=89=B9=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E9=BB=98=E8=AE=A4=E4=B8=BA=E6=8C=89=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=E4=BE=9D=E6=AC=A1=E5=AE=A1=E6=89=B9=EF=BC=8C=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E6=8C=91=E9=80=89=E4=B8=80=E4=BA=BA=E5=8A=9F=E8=83=BD=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E8=A2=AB=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/nodes-config/UserTaskNodeConfig.vue | 36 ++----------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue index 969cf48b..57b96654 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue @@ -139,7 +139,6 @@ clearable multiple style="width: 100%" - @change="changedCandidateUsers" > {{ item.label }} @@ -537,8 +532,7 @@ const { getShowText } = useNodeForm(NodeType.USER_TASK_NODE) const configForm = tempConfigForm as Ref -// 不允许多人审批 -const notAllowedMultiApprovers = ref(false) + // 改变审批人设置策略 const changeCandidateStrategy = () => { configForm.value.userIds = [] @@ -548,29 +542,8 @@ const changeCandidateStrategy = () => { configForm.value.userGroups = [] configForm.value.deptLevel = 1 configForm.value.approveMethod = ApproveMethodType.SEQUENTIAL_APPROVE - if ( - configForm.value.candidateStrategy === CandidateStrategy.START_USER || - configForm.value.candidateStrategy === CandidateStrategy.USER - ) { - notAllowedMultiApprovers.value = true - } else { - notAllowedMultiApprovers.value = false - } -} -// 改变审批候选人 -const changedCandidateUsers = () => { - if ( - configForm.value.userIds && - configForm.value.userIds?.length <= 1 && - configForm.value.candidateStrategy === CandidateStrategy.USER - ) { - configForm.value.approveMethod = ApproveMethodType.RANDOM_SELECT_ONE_APPROVE - configForm.value.rejectHandlerType = RejectHandlerType.FINISH_PROCESS - notAllowedMultiApprovers.value = true - } else { - notAllowedMultiApprovers.value = false - } } + // 审批方式改变 const approveMethodChanged = () => { configForm.value.rejectHandlerType = RejectHandlerType.FINISH_PROCESS @@ -666,11 +639,6 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => { configForm.value.candidateStrategy = node.candidateStrategy! // 解析候选人参数 parseCandidateParam(node.candidateStrategy!, node?.candidateParam) - if (configForm.value.userIds && configForm.value.userIds.length > 1) { - notAllowedMultiApprovers.value = true - } else { - notAllowedMultiApprovers.value = false - } // 2.2 设置审批方式 configForm.value.approveMethod = node.approveMethod! if (node.approveMethod == ApproveMethodType.APPROVE_BY_RATIO) { From 4342c3ee056803195facf1542866dd9b52b02760 Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Thu, 10 Oct 2024 23:09:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=91=20=E6=96=B0=E5=AE=A1=E6=89=B9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=B0=94=E6=B3=A1=E5=8D=A1=E6=8C=89=E9=92=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/task/index.ts | 5 + .../SimpleProcessDesignerV2/src/consts.ts | 7 +- .../detail/ProcessInstanceOperationButton.vue | 547 ++++++++++++++---- .../bpm/processInstance/detail/index_new.vue | 18 +- src/views/bpm/task/copy/index.vue | 1 + 5 files changed, 451 insertions(+), 127 deletions(-) diff --git a/src/api/bpm/task/index.ts b/src/api/bpm/task/index.ts index d32b2e14..cf75bfa5 100644 --- a/src/api/bpm/task/index.ts +++ b/src/api/bpm/task/index.ts @@ -106,6 +106,11 @@ export const signDeleteTask = async (data: any) => { return await request.delete({ url: '/bpm/task/delete-sign', data }) } +// 抄送 +export const copyTask = async (data: any) => { + return await request.put({ url: '/bpm/task/copy', data }) +} + // 获取减签任务列表 export const getChildrenTaskList = async (id: string) => { return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id }) diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts index 0364c5e6..44fbf361 100644 --- a/src/components/SimpleProcessDesignerV2/src/consts.ts +++ b/src/components/SimpleProcessDesignerV2/src/consts.ts @@ -362,7 +362,11 @@ export enum OperationButtonType { /** * 回退 */ - RETURN = 6 + RETURN = 6, + /** + * 抄送 + */ + COPY = 7 } /** @@ -504,6 +508,7 @@ OPERATION_BUTTON_NAME.set(OperationButtonType.TRANSFER, '转办') OPERATION_BUTTON_NAME.set(OperationButtonType.DELEGATE, '委派') OPERATION_BUTTON_NAME.set(OperationButtonType.ADD_SIGN, '加签') OPERATION_BUTTON_NAME.set(OperationButtonType.RETURN, '回退') +OPERATION_BUTTON_NAME.set(OperationButtonType.COPY, '抄送') // 默认的按钮权限设置 export const DEFAULT_BUTTON_SETTING: ButtonSetting[] = [ diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue index 34ba2bbe..96d9739e 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue @@ -5,14 +5,14 @@ > @@ -22,16 +22,10 @@ label-position="top" class="mb-auto" ref="formRef" - :model="auditForm" - :rules="auditRule" + :model="genericForm" + :rules="genericRule" label-width="100px" > - - {{ processInstance?.startUser.nickname }} - - {{ processInstance?.startUser.deptName }} - -