TonyKang 4 vuotta sitten
vanhempi
commit
de327723f6
1 muutettua tiedostoa jossa 9 lisäystä ja 9 poistoa
  1. 9 9
      modules/reports/controllers/rpt_controller.js

+ 9 - 9
modules/reports/controllers/rpt_controller.js

@@ -212,14 +212,14 @@ async function getAllPagesCommon(construct_id, user_id, prj_id, prj_ids, rpt_id,
             let promiseArr = [null, null, null];
             if (summaryRst.length > 0) {
                 if (summaryRst.indexOf(`Budget`) >= 0 || summaryRst.indexOf(`BudgetDetail`) >= 0) {
-                    promiseArr[0] = bill_facade.getBudgetSummary(construct_id); //与其他汇总类的请求互斥,不能同时出现!
-                    // if (flag.budgetSumType && flag.budgetSumType === 'budget_construct') {
-                    //     //建设项目level
-                    //     promiseArr[0] = bill_facade.getBudgetSummary(construct_id); //与其他汇总类的请求互斥,不能同时出现!
-                    // } else {
-                    //     //单项工程level
-                    //     promiseArr[0] = bill_facade.getSinglesBudgetSummary(construct_id); //与其他汇总类的请求互斥,不能同时出现!
-                    // }
+                    // promiseArr[0] = bill_facade.getBudgetSummary(construct_id, false); //与其他汇总类的请求互斥,不能同时出现!
+                    if (flag.budgetSumType && flag.budgetSumType === 'budget_single') {
+                        //单项工程level
+                        promiseArr[0] = bill_facade.getSinglesBudgetSummary(construct_id); //与其他汇总类的请求互斥,不能同时出现!
+                    } else {
+                        //建设项目level
+                        promiseArr[0] = bill_facade.getBudgetSummary(construct_id); //与其他汇总类的请求互斥,不能同时出现!
+                    }
                 }
                 if (summaryRst.indexOf(`Construct`) >= 0 || summaryRst.indexOf(`ConstructDetail`) >= 0) {
                     promiseArr[0] = pm_facade.getSummaryInfoByTender(prj_id, pm_facade.projectType.project);
@@ -281,7 +281,7 @@ async function getAllPagesCommon(construct_id, user_id, prj_id, prj_ids, rpt_id,
                     cb('Exception occurs while on going...', null);
                 }
             };
-        if (flag !== undefined && flag !== null && (flag.constructSumType === 'constructSum' || flag.auditType === 'audit_compare' || flag.budgetSumType === 'budget_single')) {
+        if (flag !== undefined && flag !== null && (flag.constructSumType === 'constructSum' || flag.auditType === 'audit_compare' || (flag.budgetSumType === 'budget_single' && summaryRst.indexOf(`ConstructDetail`) < 0))) {
                 //备注:原先这个功能是为了合并建设项目下所有的单位工程的数据,
                 //     现在发现就是通用型,审核对比也可以用这个逻辑把数据合并在一起再处理(审核对比的处理逻辑放在模板计算式里)
                 try {