From c3d7f9de940c2689822cb2ddddd60ca41a9ff4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B5=A9=E6=9E=97?= Date: Tue, 10 Sep 2024 13:46:47 +0800 Subject: [PATCH] =?UTF-8?q?[Bug]:=20=E4=BC=9A=E7=AD=BE=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E4=BC=A0=E9=98=85=E5=90=8E=E6=89=A7=E8=A1=8C=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E9=A9=B3=E5=9B=9E=E5=AF=BC=E8=87=B4=E8=A2=AB=E4=BC=A0=E9=98=85?= =?UTF-8?q?=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++; }