zhengkaixin há 2 anos atrás
pai
commit
c8e6136dca
1 ficheiros alterados com 24 adições e 2 exclusões
  1. 24 2
      pagesFinance/user/withdrawal/businessInfo.vue

+ 24 - 2
pagesFinance/user/withdrawal/businessInfo.vue

@@ -193,7 +193,8 @@
 					<text class="unit" style="float: right;font-size: 16px;">度</text>
 					<span class="withdraw-input" style="width: 63%;">
 						<u-input height="20px" placeholder="请填写实际电量"
-						 maxlength="10"
+						 maxlength="10"
+						  @input="ckInput_Q"
 						 v-model="info.electricQuantity" input-align="left"
 							type="digit">
 
@@ -813,7 +814,28 @@
 			}
 			
 		},
-		methods: {
+		methods: {
+			ckInput_Q(text) {
+				if (text.indexOf('.') > 0) {
+					
+					var k =text.split(".")[1]
+					if(k.length>=3){
+						this.$nextTick(()=>{
+							text=parseFloat(text).toFixed(2);
+							this.info.electricQuantity= text
+						})
+					}
+				}
+				var t = Number(text);
+				if (t < 0) {
+					this.$nextTick(() => {
+						this.info.electricQuantity = '';
+					})
+					
+				}
+				
+			},
+			
 			ckInput_f(text) {
 				if (text.indexOf('.') > 0) {