data(){
let validateLength = (rule, value, callback) => {
if (!value) {
callback();
} else {
var reg = /^-?\d{1,4}(?:\.\d{1,4})?$/; //小数点左边最高4位,小数点右边最多4位
if (reg.test(value)) {
callback();
} else {
callback(new Error("输入正确的数字,小数点后可1到4位"));
}
}
};
return{
//验证方法
validatorRules: {
payStandardLow: {
rules: [
{ required: true, message: "请输入最低投标价(万元)!" },
{ validator: validateLength, trigger: "change" }
]
},
payStandardHight: {
rules: [
{ required: true, message: "请输入最高投标价(万元)!" },
{ validator: validateLength, trigger: "change" }
]
},
payStandardPackage: {
rules: [
{ required: true, message: "请输入每包的投标保证金(元)!" },
{ validator: validateLength, trigger: "change" }
]
}
}
};
}