zhongzewei 7 anni fa
parent
commit
f9c175eac3
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      web/maintain/std_glj_lib/js/gljComponent.js

+ 4 - 4
web/maintain/std_glj_lib/js/gljComponent.js

@@ -318,7 +318,7 @@ let gljComponentOprObj = {
             let consumeAmt = parseFloat(args.editingText);
             console.log(consumeAmt);
             if(!isNaN(consumeAmt) && consumeAmt !== me.currentEditingComponent.consumeAmt){
-                let roundCons = scMathUtil.roundTo(consumeAmt, -3);
+                let roundCons = scMathUtil.roundTo(parseFloat(consumeAmt), -3);
                 console.log(roundCons);
                 let component = that.currentGlj.component;
                 for(let i = 0; i < component.length; i++){
@@ -439,7 +439,7 @@ let gljComponentOprObj = {
                 if(row + i < that.currentComponent.length){
                     let currentObj = that.currentComponent[row + i];
                     if(items[i].consumeAmt.trim().length > 0 && items[i].consumeAmt !== currentObj.consumeAmt){
-                        let roundCons = scMathUtil.roundTo(items[i].consumeAmt, -3);
+                        let roundCons = scMathUtil.roundTo(parseFloat(items[i].consumeAmt), -3);
                         isChange = true;
                         currentObj.consumeAmt = roundCons;
                         for(let j = 0; j < component.length; j++){
@@ -498,8 +498,8 @@ let gljComponentOprObj = {
     reCalGljBasePrc: function (component) {
         let me = gljComponentOprObj, gljBasePrc = 0;
         for(let i = 0; i < component.length; i++){
-            let roundBasePrc = scMathUtil.roundTo(component[i].basePrice, -2);
-            gljBasePrc += scMathUtil.roundTo(roundBasePrc * component[i].consumeAmt, -2);
+            let roundBasePrc = scMathUtil.roundTo(parseFloat(component[i].basePrice), -2);
+            gljBasePrc += scMathUtil.roundTo(roundBasePrc * parseFloat(component[i].consumeAmt), -2);
         }
         return gljBasePrc;
     }