修改计算公式
This commit is contained in:
parent
850509ba04
commit
276b42ea8b
|
|
@ -169,7 +169,7 @@ export default {
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
console.log(this.form.discount / 100)
|
console.log(this.form.discount / 100)
|
||||||
this.$emit("confirm", (this.form.discount / 100));
|
this.$emit("confirm", {discount:this.form.discount / 100,currentPrice:((this.form.discount*this.form.money)/100).toFixed(2)} );
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
open(data) {
|
open(data) {
|
||||||
|
|
|
||||||
|
|
@ -1861,10 +1861,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
gaijia() {
|
gaijia() {
|
||||||
|
if(!this.createOrder.data.amount ){
|
||||||
|
return 0
|
||||||
|
}
|
||||||
const disCountOriginPrice =
|
const disCountOriginPrice =
|
||||||
this.createOrder.data.amount - this.coupdiscount;
|
this.createOrder.data.amount - this.productCouponDiscountAmount;
|
||||||
const disocunt = (1 - this.createOrder.discount) * disCountOriginPrice;
|
const discountPrice= ((1-this.createOrder.discount)*disCountOriginPrice).toFixed(2)
|
||||||
return disocunt.toFixed(2);
|
return discountPrice;
|
||||||
},
|
},
|
||||||
pointsCanDicountMoney() {
|
pointsCanDicountMoney() {
|
||||||
return (this.yinFuJinE - this.points.toMoney).toFixed(2);
|
return (this.yinFuJinE - this.points.toMoney).toFixed(2);
|
||||||
|
|
@ -1881,11 +1884,24 @@ export default {
|
||||||
}, 0);
|
}, 0);
|
||||||
return n;
|
return n;
|
||||||
},
|
},
|
||||||
|
productCouponDiscountAmount(){
|
||||||
|
const n = this.quansSelArr.filter(v=>v.type==2).reduce((prve, cur) => {
|
||||||
|
return prve + cur.discountAmount * 1;
|
||||||
|
}, 0);
|
||||||
|
return n;
|
||||||
|
},
|
||||||
|
fullCouponDiscountAmount(){
|
||||||
|
const n = this.quansSelArr.filter(v=>v.type==1).reduce((prve, cur) => {
|
||||||
|
return prve + cur.discountAmount * 1;
|
||||||
|
}, 0);
|
||||||
|
return n;
|
||||||
|
},
|
||||||
currentPayMoney() {
|
currentPayMoney() {
|
||||||
const amount = this.createOrder.data.amount || 0;
|
const amount = this.createOrder.data.amount || 0;
|
||||||
const discount = this.createOrder.discount || 1;
|
const discount = this.createOrder.discount || 1;
|
||||||
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
|
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
|
||||||
const total = amount - this.gaijia - this.coupdiscount;
|
// const total = amount - this.gaijia - this.coupdiscount;
|
||||||
|
const total = amount - this.productCouponDiscountAmount-this.gaijia -this.fullCouponDiscountAmount;
|
||||||
return total <= 0 ? 0 : total;
|
return total <= 0 ? 0 : total;
|
||||||
},
|
},
|
||||||
yinFuJinE() {
|
yinFuJinE() {
|
||||||
|
|
@ -2917,7 +2933,8 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ChangeDiscount(discount) {
|
ChangeDiscount(e) {
|
||||||
|
const {discount,currentPrice}=e;
|
||||||
const fullCoupIndex = this.quansSelArr.findIndex((v) => v.type == 1);
|
const fullCoupIndex = this.quansSelArr.findIndex((v) => v.type == 1);
|
||||||
const fullCoup = this.quansSelArr[fullCoupIndex];
|
const fullCoup = this.quansSelArr[fullCoupIndex];
|
||||||
this.createOrder.discount = discount;
|
this.createOrder.discount = discount;
|
||||||
|
|
@ -2949,7 +2966,7 @@ export default {
|
||||||
if (!canDiscount) {
|
if (!canDiscount) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const amount = (this.createOrder.data.amount - this.coupdiscount).toFixed(
|
const amount = (this.createOrder.data.amount -this.productCouponDiscountAmount).toFixed(
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
console.log(amount);
|
console.log(amount);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue