Browse Source

终审后签名人的日期调整

Tony Kang 11 months ago
parent
commit
0ccddb0928
1 changed files with 12 additions and 1 deletions
  1. 12 1
      app/service/role_rpt_rel.js

+ 12 - 1
app/service/role_rpt_rel.js

@@ -293,7 +293,18 @@ module.exports = app => {
                             role.sign_date = stage.auditors[0].begin_time || time;
                         } else {
                             const audit = this.ctx.helper._.findLast(stage.auditors, x => { return x.aid === role.acc_id; });
-                            role.sign_date = audit ? audit.end_time || time : new Date(period[period.length - 1]);
+                            // 备注:因为业务上会出现那种非流程、非原报的签名人,所以这个audit会为null,如为null,则取流程最后一个通过的日期,总之,就不取period的后一个日期了
+                            if (audit) {
+                                role.sign_date = audit.end_time || time;
+                            } else {
+                                role.sign_date = time;
+                                stage.auditors.forEach(ad => {
+                                    if (ad.status === 3) {
+                                        role.sign_date = ad.end_time || time;
+                                    }
+                                });
+                            }
+                            // role.sign_date = audit ? audit.end_time || time : new Date(period[period.length - 1]);
                         }
                         role.sign_flow = 1;
                         bChange = true;