Browse Source

bug fixed

zhangweicheng 7 years ago
parent
commit
eac5d12b88

+ 1 - 1
modules/ration_glj/facade/glj_calculate_facade.js

@@ -101,7 +101,7 @@ async function calculateQuantityPerGLJ(glj,index,coeList,assList,adjustState,noN
     };
     try {
         if(noNeedCal==null){
-            if(!glj._doc.hasOwnProperty('customQuantity')||glj.customQuantity==null){
+            if(!glj._doc.hasOwnProperty('customQuantity')||glj.customQuantity==null||glj.customQuantity==""){
                 quantity =scMathUtil.roundTo(parseFloat(glj.rationItemQuantity),-decimal);
                 quantity =calculateAss(quantity,assList,glj);
                 quantity = calculateQuantityByCoes(quantity,coeList,glj);

+ 1 - 1
public/web/scMathUtil.js

@@ -183,7 +183,7 @@ let scMathUtil = {
 
 Number.prototype.toDecimal = function (ADigit) {
     //return parseFloat(this.toFixed(ADigit));
-    digit = (ADigit && typeof(ADigit) === 'number' && Number.isInteger(ADigit) && ADigit >= 0) ? -ADigit : -2;
+    digit = ((ADigit!=null||ADigit!=undefined) && typeof(ADigit) === 'number' && Number.isInteger(ADigit) && ADigit >= 0) ? -ADigit : -2;
     // var s = scMathUtil.roundTo(this, digit);
     // console.log('Number: ' + this + '   Digit: ' + digit + '    Result: ' + s);
     // return parseFloat(s);

+ 1 - 1
web/building_saas/main/js/views/glj_view.js

@@ -755,7 +755,7 @@ var gljOprObj = {
         var newval;
         if(updateField=='marketPrice'||updateField=='customQuantity'||updateField=='basePrice'){
             if(args.editingText==null){
-                updateField=='marketPrice'||updateField=='customQuantity'?newval=0:newval="";
+                updateField=='marketPrice'?newval=0:newval="";
             }else {
                 var decimal = updateField=='customQuantity'?getDecimal("glj.quantity"):getDecimal("glj.unitPrice");
                 newval = number_util.checkNumberValue(args.editingText,decimal);

+ 6 - 2
web/building_saas/main/js/views/project_view.js

@@ -270,7 +270,7 @@ var projectObj = {
             project.ration_glj.updateFromMainSpread(value,node,fieldName);
         }if(node.sourceType==ModuleNames.ration&&node.data.type==rationType.gljRation){
             gljOprObj.updateRationTypeGLJ(value,node,fieldName);
-        } else if (value !== calcFees.getFee(node.data, fieldName)) {
+        } else if (value !== calcFees.getFee(node.data, fieldName)||fieldName == 'quantity') {//工程量需要进行转换,所以做特殊处理
             if (fieldName === 'code') {
                 projectObj.updateCode(node, value);
             }
@@ -282,7 +282,11 @@ var projectObj = {
                 if (fieldName === 'quantity') {
                    if (value) {
                        value = project.quantity_detail.autoTransformQuantity(value,node);
-                       value = value.toDecimal(decimalObj.decimal(fieldName,node))
+                       value = scMathUtil.roundForObj(value,decimalObj.decimal(fieldName,node));
+                       if(value==node.data[fieldName]){
+                           projectObj.mainController.refreshTreeNode([node]);
+                           return;
+                       }
                    };
                    if(project.quantity_detail.quantityEditChecking(value,node,fieldName)){
                        node.data.isFromDetail=0;