From c14afe185abc2cb5fe77c4ba22c0a1f3bc16ddaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=A6=8D?= <1455167345@qq.com> Date: Tue, 11 Jun 2024 15:03:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=BB=BB=E5=8A=A1=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=E5=8F=AF=E9=A9=B3=E5=9B=9E=E5=88=B0=E4=BB=BB=E6=84=8F?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/workflow/task/process/audit.vue | 68 +++++++++++++++++-- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/src/views/demo/workflow/task/process/audit.vue b/src/views/demo/workflow/task/process/audit.vue index d28a9528..4ff2fa2b 100644 --- a/src/views/demo/workflow/task/process/audit.vue +++ b/src/views/demo/workflow/task/process/audit.vue @@ -106,7 +106,7 @@ :color="btn.type" :type="btn.type ? btn.type : 'primary'" @click="handleBtnClick(btn)" - >{{ btn.name }}{{ btn.name }} {{ btn.code }} @@ -141,6 +141,31 @@ + +
+ + + + + +
+
@@ -170,7 +195,8 @@ const formBoxRef = ref(); const emit = defineEmits(['closeModel']); const keyValue = ref(''); - + const rejectLabelCol = { span: 5 }; + const rejectWrapperCol = { span: 17 }; const flowWfDataStore = flowStore(); const prefixCls = 'preview-box'; const flowContent = ref(''); @@ -184,6 +210,8 @@ const processVisble = ref(false); const AsyncComponent = ref(); const pcForm = ref(); + const NextId = ref(''); + const rejectRelations = ref([]); const props = defineProps({ processId: String, taskId: String, @@ -250,6 +278,7 @@ const auditName = ref('audit'); const auditTitleVal = ref('审批栏'); const auditNameVal = ref('审批意见'); + const rejectOpen = ref(false); function changeActive(activeKey) { if (activeKey == 'flow') { processVisble.value = true; @@ -265,6 +294,7 @@ } async function getTaskInfo() { + rejectRelations.value = []; let query: any = { id: props.taskId, }; @@ -276,6 +306,14 @@ let content = JSON.parse(data.scheme.content); let wfData = content.wfData; console.log(wfData); + const finishedTaskSet = Array.from(new Set(data.flowViewer.finishedTaskSet)); + finishedTaskSet.forEach((item) => { + wfData.forEach((element) => { + if (item == element.id && element.id != data.task.unitId) { + rejectRelations.value.push(element); + } + }); + }); const auditNode = wfData.find((t) => t.id == data.task.unitId); console.log(auditNode); if (auditNode.auditTitle) { @@ -482,6 +520,7 @@ const currentNode: currentNodeObject = wfData.find((t) => t.id == designerData.task.unitId) || {}; designerData.currentNode = currentNode; + console.log('currentNode', currentNode); // 设置审核按钮 const btns: taskBtnsType[] = []; if (currentNode.type == 'bpmn:StartEvent') { @@ -561,7 +600,7 @@ const funName = btn.code; const res = await pcForm.value[funName](); console.log(res); - handleCreateFlow(processId); + handleSubmit(btn); } else { handleSubmit(btn); } @@ -594,8 +633,11 @@ des: formData.value.des, }); } else { + console.log(designerData.currentNode.rejectType); + console.log(btn.code); if (designerData.currentNode.rejectType == '2' && btn.code == 'disagree') { designerData.selectRejectNodeVisible = true; + rejectOpen.value = true; return; } @@ -608,7 +650,7 @@ // return; // } } - res = await auditFun(); + // res = await auditFun(); } break; } @@ -683,6 +725,21 @@ return createMessage.error('失败'); } } + // 驳回到指定节点 + async function rejectHandleOk() { + const data = await audit(props.taskId, { + code: designerData.currentBtn.code, + name: designerData.currentBtn.name, + des: formData.value.des, + NextId: NextId.value, + }); + if (data) { + closePage(); + return createMessage.success('成功'); + } else { + return createMessage.error('失败'); + } + } onBeforeMount(() => { getTaskInfo(); }); @@ -766,4 +823,7 @@ margin-right: 8px; } } + .l-from-body { + padding: 10px 30px; + }