瀏覽代碼

bug fixed

zhangweicheng 7 年之前
父節點
當前提交
e296d4d643

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

@@ -186,7 +186,7 @@ ProjectGLJ.prototype.refreshRationGLJPrice=function (glj) {
         if(ration_glj.projectGLJID ==glj.id){
             ration_glj.basePrice=glj.unit_price.base_price;
             ration_glj.marketPrice=glj.unit_price.market_price;
-            ration_glj.adjustPrice=glj.adjust_price;
+            ration_glj.adjustPrice=this.getAdjustPrice(glj);
         }
     }
 

+ 3 - 1
web/building_saas/main/js/models/quantity_detail.js

@@ -487,7 +487,9 @@ var quantity_detail = {
         };
         quantity_detail.prototype.autoTransformQuantity = function(value,node){
             let data = node.data;
-            if(node.sourceType === project.Ration.getSourceType()&&data.unit) {
+            let option = optionsOprObj.getOption(optionsOprObj.optionsTypes.GENERALOPTS,'rationQuanACToRationUnit');
+            console.log(option);
+            if(option==true&&node.sourceType === project.Ration.getSourceType()&&data.unit) {//还需加入判读是否转换
                 let times = parseInt(data.unit);
                 if (isNaN(times)) {
                     times = 1

+ 12 - 6
web/building_saas/main/js/models/ration_glj.js

@@ -284,14 +284,16 @@ var ration_glj = {
             var callback=function (data) {
                 let initShow = false;//是否需要表格初始化显示
                 if(updateField=='customQuantity'){
+                    console.log(data);
                     me.refreshAfterQuantityUpdate(data);
                 }else {
                     var doc = data.doc;
                     for(var key in doc){
                         recode[key] = doc[key];
                     }
+                    console.log(data);
                     if(data.hasOwnProperty('adjustState')){//更新定额调整状态
-                        me.updateRationAdjustState(data.adjustState);
+                        me.updateRationAdjustState(data.adjustState,recode.rationID);
                     }
                     if(recode.subList&&recode.subList.length>0){
                         initShow = true;
@@ -327,12 +329,16 @@ var ration_glj = {
             data.glj_result.forEach(function (item) {
                 me.refreshEachItme(item.doc,item.query);
             })
-            me.updateRationAdjustState(data.adjustState);
+            me.updateRationAdjustState(data.adjustState,data.rationID);
         };
-        ration_glj.prototype.updateRationAdjustState=function(adjustState){
-            var selected = projectObj.project.mainTree.selected;
-            selected.data.adjustState=adjustState;
-            projectObj.mainController.refreshTreeNode([selected]);
+        ration_glj.prototype.updateRationAdjustState=function(adjustState,rationID){
+            var node = _.find(projectObj.project.mainTree.items,function (n) {
+                return n.sourceType==ModuleNames.ration&&n.data.ID==rationID;
+            })
+            if(node){
+                node.data.adjustState=adjustState;
+            }
+            projectObj.mainController.refreshTreeNode([node]);
         };
         ration_glj.prototype.getGLJData = function(cb){
             CommonAjax.get('/rationGlj/getGLJData', function (data) {

+ 3 - 14
web/building_saas/main/js/views/glj_view.js

@@ -37,7 +37,7 @@ var gljOprObj = {
         view: {
             comboBox: [{row: -1, col: 12, rowCount: -1, colCount: 1}],
             lockedCells: [{row: -1, col: 3, rowCount: -1, colCount: 1}],
-            lockColumns:[0,4,5,7,8,9,11]
+            lockColumns:[0,4,5,7,8,9,10,12]
         },
         notEditedType: ['砼','桨','配比','机']
     },
@@ -538,8 +538,6 @@ var gljOprObj = {
      //   $('#dropdown').hide();
     },
     showRationGLJData:function (node) {
-        console.log("showRationGLJData");
-        console.log(+new Date());
         var gljList = [];
         var ration_glj = projectObj.project.ration_glj;
         node=node?node:projectObj.project.mainTree.selected;
@@ -551,23 +549,14 @@ var gljOprObj = {
     },
     showRationGLJSheetData:function (init) {
         this.sheet.setRowCount(0);
-        console.log("showRationGLJSheetData---init")
-        console.log(+new Date())
+        //console.log(+new Date())
         //this.sheet.getRange(0,-1,this.sheet.getRowCount(),-1).visible(true); //这个方法导致加载缓慢
         this.sheetData=_.sortBy(this.sheetData,'type');
-        console.log("addMixRatioToShow");
-        console.log(+new Date())
         this.sumQuantity();//计算总消耗量
         this.addMixRatioToShow();//显示组成物信息
-        console.log("start initRationTree");
-        console.log(+new Date());
         this.initRationTree(init);
-        console.log("end initRationTree");
-        console.log(+new Date());
-
         sheetCommonObj.showData(this.sheet,this.setting,this.sheetData);
-        console.log("end show");
-        console.log(+new Date())
+
     },
     initRationTree:function (init) {
         this.sheet.getRange(-1, 0, -1, 1).cellType(this.getTreeNodeCellType(this.sheetData));