Tony Kang 1 неделя назад
Родитель
Сommit
895d8b3dc6
2 измененных файлов с 32 добавлено и 21 удалено
  1. 11 0
      app/controller/report_controller.js
  2. 21 21
      app/view/report/index.ejs

+ 11 - 0
app/controller/report_controller.js

@@ -1586,9 +1586,20 @@ module.exports = app => {
         }
 
         async indexForCostAnalysis(ctx) {
+            // 成本分析
             await this.indexForCostManager(ctx, sourceTypeConst.sourceType.cost_ledger, -800);
         }
 
+        async indexFortCostBook(ctx) {
+            // 财务账面
+            await this.indexForCostManager(ctx, sourceTypeConst.sourceType.cost_book, -801);
+        }
+
+        async indexForCostLedger(ctx) {
+            // 成本报审
+            await this.indexForCostManager(ctx, sourceTypeConst.sourceType.cost_ledger, -802);
+        }
+
         /**
          * 报表打印页面
          *

+ 21 - 21
app/view/report/index.ejs

@@ -468,33 +468,33 @@
         CURRENT_SELECTED_BIZ_TYPE = type;
         switch (type) {
             case 'cost_ledger':
-                current_stage_id = -800;
-                current_stage_times = BGL_OBJ.ledge[0].audit_times;
-                SOURCE_TYPE = 400;
-                BGL_OBJ.source_type = 400;
-                if (BGL_OBJ.ledge.length > 0) {
-                    BGL_OBJ.BUSINESS_ID = BGL_OBJ.ledge[0].id;
-                    BGL_OBJ.status = BGL_OBJ.ledge[0].audit_status;
+                if (BGL_OBJ.allStages.ledge.length > 0) {
+                    current_stage_id = -800;
+                    current_stage_times = BGL_OBJ.allStages.ledge[0].audit_times;
+                    SOURCE_TYPE = 400;
+                    BGL_OBJ.source_type = 400;
+                    BGL_OBJ.BUSINESS_ID = BGL_OBJ.allStages.ledge[0].id;
+                    BGL_OBJ.status = BGL_OBJ.allStages.ledge[0].audit_status;
                 }
                 break;
             case 'cost_book':
-                current_stage_id = -801;
-                current_stage_times = BGL_OBJ.book[0].audit_times;
-                SOURCE_TYPE = 401;
-                BGL_OBJ.source_type = 401;
-                if (BGL_OBJ.book.length > 0) { 
-                    BGL_OBJ.BUSINESS_ID = BGL_OBJ.book[0].id;
-                    BGL_OBJ.status = BGL_OBJ.book[0].audit_status;
+                if (BGL_OBJ.allStages.book.length > 0) { 
+                    current_stage_id = -801;
+                    current_stage_times = BGL_OBJ.allStages.book[0].audit_times;
+                    SOURCE_TYPE = 401;
+                    BGL_OBJ.source_type = 401;
+                    BGL_OBJ.BUSINESS_ID = BGL_OBJ.allStages.book[0].id;
+                    BGL_OBJ.status = BGL_OBJ.allStages.book[0].audit_status;
                 }
                 break;
             case 'cost_analysis':
-                current_stage_id = -802;
-                current_stage_times = BGL_OBJ.analysis[0].audit_times;
-                SOURCE_TYPE = 402;
-                BGL_OBJ.source_type = 402;
-                if (BGL_OBJ.analysis.length > 0) {
-                    BGL_OBJ.BUSINESS_ID = BGL_OBJ.analysis[0].id;
-                    BGL_OBJ.status = BGL_OBJ.analysis[0].audit_status;
+                if (BGL_OBJ.allStages.analysis.length > 0) {
+                    current_stage_id = -802;
+                    current_stage_times = BGL_OBJ.allStages.analysis[0].audit_times;
+                    SOURCE_TYPE = 402;
+                    BGL_OBJ.source_type = 402;
+                    BGL_OBJ.BUSINESS_ID = BGL_OBJ.allStages.analysis[0].id;
+                    BGL_OBJ.status = BGL_OBJ.allStages.analysis[0].audit_status;
                 }
                 break;
         }