From efd57382a2887281049402088986efa3a64248e9 Mon Sep 17 00:00:00 2001 From: Byran Date: Thu, 9 Jan 2025 02:39:33 +0000 Subject: [PATCH] =?UTF-8?q?2.6-[Bug]:=20=E4=BC=9A=E7=AD=BE=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4=E4=BC=A0=E9=98=85=E5=90=8E=E6=89=A7=E8=A1=8C=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E9=A9=B3=E5=9B=9E=E5=AF=BC=E8=87=B4=E8=A2=AB=E4=BC=A0?= =?UTF-8?q?=E9=98=85=E4=BA=BA=E6=B2=A1=E6=9C=89=E5=BE=85=E5=8A=9E=20#6985?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/engine/manager/uuflow_manager.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/workflow/engine/manager/uuflow_manager.js b/packages/workflow/engine/manager/uuflow_manager.js index b63d70dbfe..475ea41c5d 100644 --- a/packages/workflow/engine/manager/uuflow_manager.js +++ b/packages/workflow/engine/manager/uuflow_manager.js @@ -1884,17 +1884,19 @@ uuflowManager.engine_step_type_is_counterSign = function (instance_id, trace_id, if (instance_traces[i]._id === trace_id) { h = 0; while (h < instance_traces[i].approves.length) { - if (instance_traces[i].approves[h]._id === approve_id || ((step.oneClickApproval && ['approved', 'readed'].includes(judge)) || (step.oneClickRejection && 'rejected' === judge))) { - // 更新当前trace.approve记录 - approveFinishDate = new Date; - setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true; - setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate; - setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date; - setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted; - finishedApproveIds.push(instance_traces[i].approves[h]._id) - } - else if (instance_traces[i].approves[h].is_finished === false && instance_traces[i].approves[h].type !== 'cc' && instance_traces[i].approves[h].type !== 'distribute') { - isAllApproveFinished = false; + if (instance_traces[i].approves[h].type !== 'cc' && instance_traces[i].approves[h].type !== 'distribute') { + if (instance_traces[i].approves[h]._id === approve_id || ((step.oneClickApproval && ['approved', 'readed'].includes(judge)) || (step.oneClickRejection && 'rejected' === judge))) { + // 更新当前trace.approve记录 + approveFinishDate = new Date; + setTraceObj[`traces.${i}.approves.${h}.is_finished`] = true; + setTraceObj[`traces.${i}.approves.${h}.finish_date`] = approveFinishDate; + setTraceObj[`traces.${i}.approves.${h}.cost_time`] = approveFinishDate - instance_traces[i].approves[h].start_date; + setTraceObj[`traces.${i}.approves.${h}.auto_submitted`] = auto_submitted; + finishedApproveIds.push(instance_traces[i].approves[h]._id) + } + else if (instance_traces[i].approves[h].is_finished === false) { + isAllApproveFinished = false; + } } h++; }