Browse Source

归档页面隐藏未审核的期

TonyKang 4 years ago
parent
commit
940fc1ed0d
2 changed files with 21 additions and 6 deletions
  1. 11 3
      app/view/report/index_archive.ejs
  2. 10 3
      app/view/report/index_sign.ejs

+ 11 - 3
app/view/report/index_archive.ejs

@@ -169,8 +169,15 @@
         current_stage_id = STAGE_ID;
 //        current_stage_status = STAGE_STATUS;
     } else if (STAGE_LIST.length > 0) {
-        current_stage_order = STAGE_LIST[STAGE_LIST.length - 1].order;
-        current_stage_id = STAGE_LIST[STAGE_LIST.length - 1].id;
+        for (let i = STAGE_LIST.length; i > 0; i--) {
+            if (parseInt(STAGE_LIST[i - 1].status) === 3) {
+                current_stage_order = STAGE_LIST[i - 1].order;
+                current_stage_id = STAGE_LIST[i - 1].id;
+                break;
+            }
+        }
+//        current_stage_order = STAGE_LIST[STAGE_LIST.length - 1].order;
+//        current_stage_id = STAGE_LIST[STAGE_LIST.length - 1].id;
 //        current_stage_status = STAGE_LIST[STAGE_LIST.length - 1].status;
     }
 
@@ -248,10 +255,11 @@
         } else {
             $("#optionSelectableStages")[0].style.display = '';
             $("#btnCurrentStage")[0].innerText = '第' + current_stage_order + '期';
+
             $("#optionSelectableStages").empty();
             if (STAGE_LIST.length > 0 && STAGE_ID < 0) {
                 for (let i = STAGE_LIST.length; i > 0; i--) {
-                    if (parseInt(STAGE_LIST[i - 1].order) !== current_stage_order) {
+                    if (parseInt(STAGE_LIST[i - 1].status) === 3 && parseInt(STAGE_LIST[i - 1].order) !== current_stage_order) {
                         const str = '<a class="dropdown-item" style="cursor:pointer" onclick="changeCurrentStage(this)" stg_id = "' + STAGE_LIST[i - 1].id + '" stg_order="' + STAGE_LIST[i - 1].order + '">第' + STAGE_LIST[i - 1].order + '期</a>';
                         $("#optionSelectableStages").append(str);
                     }

+ 10 - 3
app/view/report/index_sign.ejs

@@ -188,8 +188,15 @@
         current_stage_id = STAGE_ID;
 //        current_stage_status = STAGE_STATUS;
     } else if (STAGE_LIST.length > 0) {
-        current_stage_order = STAGE_LIST[STAGE_LIST.length - 1].order;
-        current_stage_id = STAGE_LIST[STAGE_LIST.length - 1].id;
+        for (let i = STAGE_LIST.length; i > 0; i--) {
+            if (parseInt(STAGE_LIST[i - 1].status) === 3) {
+                current_stage_order = STAGE_LIST[i - 1].order;
+                current_stage_id = STAGE_LIST[i - 1].id;
+                break;
+            }
+        }
+//        current_stage_order = STAGE_LIST[STAGE_LIST.length - 1].order;
+//        current_stage_id = STAGE_LIST[STAGE_LIST.length - 1].id;
 //        current_stage_status = STAGE_LIST[STAGE_LIST.length - 1].status;
     }
 
@@ -270,7 +277,7 @@
             $("#optionSelectableStages").empty();
             if (STAGE_LIST.length > 0 && STAGE_ID < 0) {
                 for (let i = STAGE_LIST.length; i > 0; i--) {
-                    if (parseInt(STAGE_LIST[i - 1].order) !== current_stage_order) {
+                    if (parseInt(STAGE_LIST[i - 1].status) === 3 && parseInt(STAGE_LIST[i - 1].order) !== current_stage_order) {
                         const str = '<a class="dropdown-item" style="cursor:pointer" onclick="changeCurrentStage(this)" stg_id = "' + STAGE_LIST[i - 1].id + '" stg_order="' + STAGE_LIST[i - 1].order + '">第' + STAGE_LIST[i - 1].order + '期</a>';
                         $("#optionSelectableStages").append(str);
                     }