Commit fe46d506 by lixiaomin

修改商品折扣价和原价比较

parent af29af1b
......@@ -167,8 +167,8 @@ export default {
}else if(!regular.test(value)){
callback(new Error('请输入大于0的正数,最多保留1位小数'));
}else if(this.form.price){
let discountValue=value-0;
let priceValue=this.form.price-0;
let discountValue=parseFloat(value);
let priceValue=parseFloat(this.form.price);
if(discountValue > priceValue){
callback(new Error('折扣价不能大于原价'));
}else {
......@@ -185,9 +185,9 @@ export default {
callback(new Error('不能为空'));
}else if(!regular.test(value)){
callback(new Error('请输入大于0的正数,最多保留1位小数'));
}else if(this.form.discount){
let discountValue=this.form.discount-0;
let priceValue=value-0;
}else if(this.form.discount){
let discountValue=parseFloat(this.form.discount);
let priceValue=parseFloat(value);
if(priceValue<discountValue){
callback(new Error('原价不能小于折扣价'));
}else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment