瀏覽代碼

流程外签名日期问题

Tony Kang 11 月之前
父節點
當前提交
e91e364b1a
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      app/controller/report_controller.js

+ 4 - 6
app/controller/report_controller.js

@@ -2177,12 +2177,10 @@ function _getSignDateByAllScenarios(userAccId, current_stage_id, STAGE_AUDIT, ST
     }
     if (!isOrgRpt && !hasAudit) {
         // 非审批流程人员以及非原报,则显示期截至时间
-        for (const stg of STAGE_LIST) {
-            if (stg.id === current_stage_id && stg.period) {
-                const period = stg.period.split(' ~ ');
-                if (period.length === 2) {
-                    rst = period[1];
-                }
+        // 之前给我的解释有问题的,不应该找stage的period属性,而是找当期最后一个status===3的end_time时间(STAGE_AUDIT已经取了最后times,并已排序了)
+        for (const stg_audit of STAGE_AUDIT) {
+            if (stg_audit.status === 3) {
+                rst = stg_audit.end_time;
             }
         }
     }