this.filterHandle2(/[^\d.]/g, 'amount')
this.filterHandle2(/\.{2,}/g, 'amount')
this.filterHandle2(/^\./g, 'amount')
this.filterHandle2(/[0]{2,}/g, 'amount')
this.filterHandle2(/\.\d{3,}/g, 'amount')
filterHandle2 (reg, prop) {
this.$set(this.query, prop, this.query[prop].replace(reg, ''))
},
//input输入框只能输入数字和 小数点后两位
function inputnum(obj,val){
obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
obj.value = obj.value.replace(/\.{2,}/g,""); //只保留第一个, 清除多余的
obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
}