zhangweicheng 7 年之前
父节点
当前提交
ef84bd814b
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      web/building_saas/main/js/models/calc_program.js

+ 8 - 2
web/building_saas/main/js/models/calc_program.js

@@ -728,8 +728,14 @@ let calcTools = {
     getRationsByProjectGLJ(PGLJID){
         let rationIDs = [];
         let RGs = projectObj.project.ration_glj.datas;
+        let PGLJIDs = [];
+        if(Array.isArray(PGLJID)){//为了提高效率,改成支持传入数组
+            PGLJIDs = PGLJID
+        }else {
+            PGLJIDs = [PGLJID];
+        }
         for (let rg of RGs){
-            if (rg.projectGLJID == PGLJID){
+            if (PGLJIDs.indexOf(rg.projectGLJID) !== -1){
                 rationIDs.push(rg.rationID);
             }
         };
@@ -743,7 +749,7 @@ let calcTools = {
         // 工料机形式的定额
         let items = projectObj.project.mainTree.items;
         for (let item of items){
-            if (item.data.projectGLJID == PGLJID)
+            if (PGLJIDs.indexOf(item.data.projectGLJID)  !== -1)
                 rationNodes.push(item);
         };