wansfa 1 năm trước cách đây
mục cha
commit
9376f5914e
1 tập tin đã thay đổi với 39 bổ sung22 xóa
  1. 39 22
      src/views/company/tcmScheduleReport/add.vue

+ 39 - 22
src/views/company/tcmScheduleReport/add.vue

@@ -474,24 +474,25 @@ export default {
         }
     },  
      'form.round1Money':function(newVal,oldVal){   
-       
-        if(!!newVal){
-            if(this.form.round1Order>0  && this.form.round1Order>0){
+        console.log("qxj newVal:"+newVal+",is:"+!!newVal);
+        if(newVal!=undefined){
+            if(this.form.round1Order>0){
                 this.form.round1Unit=(newVal/this.form.round1Order*1.0).toFixed(2); 
             }
             this.calcTotalMoney();
         }
     },
      'form.round1Order':function(newVal,oldVal){
-        if(!!newVal){
-           console.log('newVal:'+newVal+" registerNum:"+this.form.registerNum);
+        if(newVal!=undefined){
            this.form.round1Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round1Unit=0.0;
+           if(newVal>0)
            this.form.round1Unit=(this.form.round1Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
      'form.round2Money':function(newVal,oldVal){   
-        if(!!newVal){
+        if(newVal!=undefined){
             if(this.form.round2Order>0){
                 this.form.round2Unit=(newVal/this.form.round2Order*1.0).toFixed(2); 
             }
@@ -499,14 +500,16 @@ export default {
         }
     },
      'form.round2Order':function(newVal,oldVal){
-        if(!!newVal){
+         if(newVal!=undefined){
            this.form.round2Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round2Unit=0.0;
+           if(newVal>0)
            this.form.round2Unit=(this.form.round2Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
     'form.round3Money':function(newVal,oldVal){   
-        if(!!newVal){
+        if(newVal!=undefined){
             if(this.form.round3Order>0){
                 this.form.round3Unit=(newVal/this.form.round3Order*1.0).toFixed(2); 
             }
@@ -514,14 +517,16 @@ export default {
         }
     },
      'form.round3Order':function(newVal,oldVal){
-        if(!!newVal){
+        if(newVal!=undefined){
            this.form.round3Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round3Unit=0.0;
+           if(newVal>0)
            this.form.round3Unit=(this.form.round3Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
     'form.round4Money':function(newVal,oldVal){   
-        if(!!newVal){
+         if(newVal!=undefined){
             if(this.form.round4Order>0){
                 this.form.round4Unit=(newVal/this.form.round4Order*1.0).toFixed(2); 
             }
@@ -529,14 +534,16 @@ export default {
         }
     },
      'form.round4Order':function(newVal,oldVal){
-        if(!!newVal){
+        if(newVal!=undefined){
            this.form.round4Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round4Unit=0.0;
+           if(newVal>0)
            this.form.round4Unit=(this.form.round4Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
     'form.round5Money':function(newVal,oldVal){   
-        if(!!newVal){
+        if(newVal!=undefined){
             if(this.form.round5Order>0){
                 this.form.round5Unit=(newVal/this.form.round5Order*1.0).toFixed(2); 
             }
@@ -544,14 +551,16 @@ export default {
         }
     },
      'form.round5Order':function(newVal,oldVal){
-        if(!!newVal){
+         if(newVal!=undefined){
            this.form.round5Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round5Unit=0.0;
+           if(newVal>0)
            this.form.round5Unit=(this.form.round5Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
     'form.round6Money':function(newVal,oldVal){   
-        if(!!newVal){
+        if(newVal!=undefined){
             if(this.form.round6Order>0){
                 this.form.round6Unit=(newVal/this.form.round6Order*1.0).toFixed(2); 
             }
@@ -559,14 +568,16 @@ export default {
         }
     },
      'form.round6Order':function(newVal,oldVal){
-        if(!!newVal){
+         if(newVal!=undefined){
            this.form.round6Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round6Unit=0.0;
+           if(newVal>0)
            this.form.round6Unit=(this.form.round6Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
     'form.round7Money':function(newVal,oldVal){   
-        if(!!newVal){
+        if(newVal!=undefined){
             if(this.form.round7Order>0){
                 this.form.round7Unit=(newVal/this.form.round7Order*1.0).toFixed(2); 
             }
@@ -574,14 +585,16 @@ export default {
         }
     },
      'form.round7Order':function(newVal,oldVal){
-        if(!!newVal){
+         if(newVal!=undefined){
            this.form.round7Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round7Unit=0.0;
+           if(newVal>0)
            this.form.round7Unit=(this.form.round7Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
     'form.round8Money':function(newVal,oldVal){   
-        if(!!newVal){
+        if(newVal!=undefined){
             if(this.form.round8Order>0){
                 this.form.round8Unit=(newVal/this.form.round8Order*1.0).toFixed(2); 
             }
@@ -589,14 +602,16 @@ export default {
         }
     },
      'form.round8Order':function(newVal,oldVal){
-        if(!!newVal){
+        if(newVal!=undefined){
            this.form.round8Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+           this.form.round8Unit=0.0;
+           if(newVal>0)
            this.form.round8Unit=(this.form.round8Money/newVal*1.0).toFixed(2); 
            this.calcTotalOrder();
         }
     },
     'form.round9Money':function(newVal,oldVal){   
-        if(!!newVal){
+         if(newVal!=undefined){
             if(this.form.round9Order>0){
                 this.form.round9Unit=(newVal/this.form.round9Order*1.0).toFixed(2); 
             }
@@ -604,14 +619,16 @@ export default {
         }
     },
      'form.round9Order':function(newVal,oldVal){
-            if(!!newVal){
+            if(newVal!=undefined){
                 this.form.round9Rate=(newVal/this.form.totalNum*1.0).toFixed(2); 
+                this.form.round9Unit=0.0;
+                if(newVal>0)
                 this.form.round9Unit=(this.form.round9Money/newVal*1.0).toFixed(2); 
                 this.calcTotalOrder();
             }
       },
      'form.targetMoney':function(newVal,oldVal){
-         if(!!newVal){
+         if(newVal!=undefined){
               this.form.targetRate=(this.form.totalMoney/newVal*1.0).toFixed(5); 
          }
       },