Browse Source

bug fixed

zhangweicheng 7 years atrás
parent
commit
fe10cabf3a

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

@@ -246,11 +246,11 @@ async function addRationGLJ(std,newRation) {
         let cptGLJID=[];//补充工料机ID数组
             //let stdGLJID = _.map(std.rationGljList,'gljId');
         for(let tem_g  of std.rationGljList){
-            if(tem_g.type == 'std'){
-                stdGLJID.push(tem_g.gljId);
-            }else if(tem_g.type == 'complementary'){
+             if(tem_g.type == 'complementary'){
                 cptGLJID.push(tem_g.gljId);
-            }
+             }else {
+                stdGLJID.push(tem_g.gljId);
+             }
         }
        let stdGLJList = stdGLJID.length > 0 ? await std_glj_lib_gljList_model.find({'ID':{'$in':stdGLJID}}):[];//速度优化-------先一次性取出所有的工料机列表
        let stdGLJMap = _.indexBy(stdGLJList, 'ID');
@@ -269,13 +269,13 @@ async function addRationGLJ(std,newRation) {
             newGLJ.quantity = sub.consumeAmt;
             newGLJ.glj_repository_id = std.rationRepId;
             let std_glj = null;
-            if(sub.type == 'std'){//有可能来自标准工料机库或补充工料机库
-                std_glj = stdGLJMap[sub.gljId];
-                newGLJ.from = 'std';
-            }else if(sub.type == 'complementary'){
+           if(sub.type == 'complementary'){//有可能来自标准工料机库或补充工料机库
                 std_glj = cptGLJMap[sub.gljId];
                 newGLJ.from = 'cpt';
-            }
+            }else {
+               std_glj = stdGLJMap[sub.gljId];
+               newGLJ.from = 'std';
+           }
             let std_gljTime = +new Date();
             if(std_glj){
                 newGLJ.name = std_glj.name;

+ 2 - 1
web/building_saas/js/global.js

@@ -15,7 +15,8 @@ function autoFlashHeight(){
     $('#glj_tree_div .modal-content').width($(window).width() < 1020 + 20 ? $(window).width() - 20 : 1020);
     //$("#main .main-data-top").height($(window).height()-headerHeight-toolsbarHeight-bottomContentHeight-1);
     typeof(loadMainSize)== 'function' ?loadMainSize():'';//zhang 2018-06-04  统一加载高度方法
-    typeof(loadProjectGljSize)== 'function'?loadProjectGljSize():'';    $(".main-data-full").height($(window).height()-headerHeight-toolsbarHeight-1);
+    typeof(loadProjectGljSize)== 'function'?loadProjectGljSize():'';
+    $(".main-data-full").height($(window).height()-headerHeight-toolsbarHeight-1);
     $(".main-data-full-fl").height($(window).height()-headerHeight-toolsbarHeight-37);
     $(".main-data-full-feeRate").height($(window).height()-headerHeight-78);
     $(".main-data-full-tender").height($(window).height()-headerHeight-btntoolsbarHeight-10);

+ 1 - 0
web/building_saas/main/js/models/project_glj.js

@@ -201,6 +201,7 @@ ProjectGLJ.prototype.updateGLJProperty = function (node, updateField, newval) {
     let rationTypeGLJ = node.data;
     let postData = {};
     if (rationTypeGLJ[updateField] == newval) {
+        projectObj.mainController.refreshTreeNode([node]);
         return;
     }
     let data = {