Commit fe46d506 by lixiaomin

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

parent af29af1b
...@@ -167,8 +167,8 @@ export default { ...@@ -167,8 +167,8 @@ export default {
}else if(!regular.test(value)){ }else if(!regular.test(value)){
callback(new Error('请输入大于0的正数,最多保留1位小数')); callback(new Error('请输入大于0的正数,最多保留1位小数'));
}else if(this.form.price){ }else if(this.form.price){
let discountValue=value-0; let discountValue=parseFloat(value);
let priceValue=this.form.price-0; let priceValue=parseFloat(this.form.price);
if(discountValue > priceValue){ if(discountValue > priceValue){
callback(new Error('折扣价不能大于原价')); callback(new Error('折扣价不能大于原价'));
}else { }else {
...@@ -186,8 +186,8 @@ export default { ...@@ -186,8 +186,8 @@ export default {
}else if(!regular.test(value)){ }else if(!regular.test(value)){
callback(new Error('请输入大于0的正数,最多保留1位小数')); callback(new Error('请输入大于0的正数,最多保留1位小数'));
}else if(this.form.discount){ }else if(this.form.discount){
let discountValue=this.form.discount-0; let discountValue=parseFloat(this.form.discount);
let priceValue=value-0; let priceValue=parseFloat(value);
if(priceValue<discountValue){ if(priceValue<discountValue){
callback(new Error('原价不能小于折扣价')); callback(new Error('原价不能小于折扣价'));
}else { }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