소스 검색

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

zhangweicheng 5 년 전
부모
커밋
92a0835d6d
3개의 변경된 파일13개의 추가작업 그리고 10개의 파일을 삭제
  1. 5 2
      modules/complementary_glj_lib/models/gljModel.js
  2. 4 4
      modules/glj/models/glj_list_model.js
  3. 4 4
      modules/main/facade/ration_facade.js

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

@@ -354,8 +354,11 @@ class GljDao {
                 componentIdListCpt.push(component.ID);
             }
             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 = [];
         for (let tmp of compositionGljList) {
             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];
             }
             // 配合比数据插入
@@ -602,8 +602,8 @@ class GLJListModel extends BaseModel {
                 gljInsertData.push(gljData);
             }
             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 = scMathUtil.roundTo(basePrice,-6);

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

@@ -441,10 +441,10 @@ async function addRationGLJ(std,newRation,compilation) {
             }else {
                 std_glj = stdGLJMap[sub.gljId];
                 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){
                 newGLJ.name = std_glj.name;