Browse Source

修改工料机汇总定额工料机消耗量的汇总处理

olym 7 năm trước cách đây
mục cha
commit
32b8b40eda
1 tập tin đã thay đổi với 8 bổ sung9 xóa
  1. 8 9
      modules/glj/models/glj_list_model.js

+ 8 - 9
modules/glj/models/glj_list_model.js

@@ -13,7 +13,6 @@ import UnitPriceFileModel from "./unit_price_file_model";
 import GLJTypeConst from "../../common/const/glj_type_const";
 import RationGLJFacade from "../../ration_glj/facade/ration_glj_facade";
 import STDGLJLibGLJListModel from "../../common/std/std_glj_lib_glj_list_model";
-import STDGLJType from "../../../public/cache/std_glj_type_util";
 import MixRatioModel from "./mix_ratio_model";
 const ProjectModel = require('../../pm/models/project_model').project;
 
@@ -110,7 +109,14 @@ class GLJListModel extends BaseModel {
             let quantityList = {};
             // 整理数据
             for (let tmp of quantityData) {
-                quantityList[tmp.projectGLJID] = tmp.quantity;
+                let tmpNum = parseInt(tmp.rationQuantity);
+                tmpNum = isNaN(tmpNum) ? 1 : tmpNum;
+                if (quantityList[tmp.projectGLJID] === undefined) {
+                    quantityList[tmp.projectGLJID] = tmp.quantity * tmpNum;
+                } else {
+                    quantityList[tmp.projectGLJID] += tmp.quantity * tmpNum;
+                }
+
             }
 
             // 查找组成物的消耗量
@@ -436,13 +442,6 @@ class GLJListModel extends BaseModel {
             return;
         }
 
-        // 获取工料机类型以及整理数据
-        let gljTypeList = STDGLJType.getStdGljTypeCacheObj().toArray();
-        let gljType = {};
-        for (let tmp of gljTypeList) {
-            gljType[tmp.fullName] = tmp.ID;
-        }
-
         // 整理插入的数据
         let gljInsertData = [];
         let unitPriceInsertData = [];