浏览代码

支持补充工料机多单价的情况

zhangweicheng 5 年之前
父节点
当前提交
92a0835d6d

+ 5 - 2
modules/complementary_glj_lib/models/gljModel.js

@@ -354,8 +354,11 @@ class GljDao {
                 componentIdListCpt.push(component.ID);
                 componentIdListCpt.push(component.ID);
             }
             }
             let isStdFlag = component.isStd ? 'std' : 'cpt';
             let isStdFlag = component.isStd ? 'std' : 'cpt';
-            //对于补充人材机的组成物,不会有多单价的情况
-            componentConsume[component.ID + '_' + isStdFlag] = component.consumeAmt;
+            if(component.consumeAmt != undefined && component.consumeAmt != null) {
+                componentConsume[component.ID + '_' + isStdFlag] = component.consumeAmt;
+            }else if(component.consumeAmtProperty){
+                componentConsume[component.ID + '_' + isStdFlag] = component.consumeAmtProperty;
+            }
         }
         }
 
 
         // 查找标准库数据
         // 查找标准库数据

+ 4 - 4
modules/glj/models/glj_list_model.js

@@ -569,8 +569,8 @@ class GLJListModel extends BaseModel {
         let mixRatioInsertData = [];
         let mixRatioInsertData = [];
         for (let tmp of compositionGljList) {
         for (let tmp of compositionGljList) {
             let consumpiton = tmp.consumption;
             let consumpiton = tmp.consumption;
-            //只有标准的工料机的组成物才会有多单价、多组成物消耗量的情况 fromTable
-            if(fromTable == 'std' && ext && ext.quantityField &&( tmp.consumption[ext.quantityField]!= undefined && tmp.consumption[ext.quantityField]!=null)){
+            //多单价、多组成物消耗量的情况 fromTable
+            if(ext && ext.quantityField &&( tmp.consumption[ext.quantityField]!= undefined && tmp.consumption[ext.quantityField]!=null)){
                 consumpiton = tmp.consumption[ext.quantityField];
                 consumpiton = tmp.consumption[ext.quantityField];
             }
             }
             // 配合比数据插入
             // 配合比数据插入
@@ -602,8 +602,8 @@ class GLJListModel extends BaseModel {
                 gljInsertData.push(gljData);
                 gljInsertData.push(gljData);
             }
             }
             let basePrice = tmp.basePrice;
             let basePrice = tmp.basePrice;
-            //只有标准的工料机的组成物才会有多单价、多组成物消耗量的情况 fromTable
-            if(fromTable == 'std' && ext && ext.priceField &&( tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
+            //多单价、多组成物消耗量的情况 fromTable
+            if(ext && ext.priceField &&( tmp.priceProperty[ext.priceField]!= undefined && tmp.priceProperty[ext.priceField]!=null)){
                 basePrice = tmp.priceProperty[ext.priceField];
                 basePrice = tmp.priceProperty[ext.priceField];
             }
             }
             basePrice = scMathUtil.roundTo(basePrice,-6);
             basePrice = scMathUtil.roundTo(basePrice,-6);

+ 4 - 4
modules/main/facade/ration_facade.js

@@ -441,10 +441,10 @@ async function addRationGLJ(std,newRation,compilation) {
             }else {
             }else {
                 std_glj = stdGLJMap[sub.gljId];
                 std_glj = stdGLJMap[sub.gljId];
                 newGLJ.from = 'std';
                 newGLJ.from = 'std';
-                //多单价情况处理
-                if(ext && ext.priceField && std_glj && std_glj.priceProperty){
-                    std_glj.basePrice =  std_glj.priceProperty[ext.priceField];
-                }
+            }
+            //多单价情况处理
+            if(ext && ext.priceField && std_glj && std_glj.priceProperty){
+                std_glj.basePrice =  std_glj.priceProperty[ext.priceField];
             }
             }
             if(std_glj){
             if(std_glj){
                 newGLJ.name = std_glj.name;
                 newGLJ.name = std_glj.name;