修改称重商品提交时只保留两位小数
This commit is contained in:
parent
dbf34179e9
commit
8c16d95ead
|
|
@ -62,23 +62,6 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
// 处理小数点
|
||||
// if (newval == '.' || newval == '0.') {
|
||||
// this.number = newval;
|
||||
// } else {
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.number = this.payMoney;
|
||||
this.number = newval;
|
||||
}
|
||||
if (newval * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
} else {
|
||||
const shengyu = this.payMoney - this.number;
|
||||
|
||||
this.tips =
|
||||
shengyu > 0 ? "还需额外支付" + shengyu.toFixed(2) + "元" : "";
|
||||
}
|
||||
// }
|
||||
},
|
||||
},
|
||||
computed:{
|
||||
|
|
@ -100,15 +83,10 @@ export default {
|
|||
this.focus = false;
|
||||
},
|
||||
inputNumber(e) {
|
||||
console.log("inputNumber");
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
console.log(e);
|
||||
|
||||
},
|
||||
inputChange(e) {
|
||||
if (e * 1 > this.payMoney * 1) {
|
||||
this.tips = "已超出未结账金额";
|
||||
}
|
||||
console.log(e);
|
||||
},
|
||||
clear(e) {
|
||||
|
|
@ -120,7 +98,7 @@ export default {
|
|||
if(this.number*1<=0){
|
||||
return this.$message("请输入重量");
|
||||
}
|
||||
this.$emit("confirm", this.item, this.number);
|
||||
this.$emit("confirm", this.item, (this.number*1).toFixed(2));
|
||||
this.close();
|
||||
},
|
||||
open(item) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue