解决单据中改优惠率的时候金额计算bug
This commit is contained in:
@@ -556,10 +556,8 @@ export const BillModalMixin = {
|
|||||||
//改变优惠率
|
//改变优惠率
|
||||||
onKeyUpDiscount(e) {
|
onKeyUpDiscount(e) {
|
||||||
const value = e.target.value-0
|
const value = e.target.value-0
|
||||||
let discountMoney = this.form.getFieldValue('discountMoney')-0
|
|
||||||
let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0
|
|
||||||
let otherMoney = this.form.getFieldValue('otherMoney')-0
|
let otherMoney = this.form.getFieldValue('otherMoney')-0
|
||||||
let allTaxLastMoney = (discountMoney + discountLastMoney).toFixed(2)-0
|
let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney-0
|
||||||
let discountMoneyNew = (allTaxLastMoney*value*0.01).toFixed(2)-0
|
let discountMoneyNew = (allTaxLastMoney*value*0.01).toFixed(2)-0
|
||||||
let discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2)-0
|
let discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2)-0
|
||||||
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
|
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
|
||||||
@@ -571,19 +569,15 @@ export const BillModalMixin = {
|
|||||||
//改变付款优惠
|
//改变付款优惠
|
||||||
onKeyUpDiscountMoney(e) {
|
onKeyUpDiscountMoney(e) {
|
||||||
const value = e.target.value-0
|
const value = e.target.value-0
|
||||||
let discount = this.form.getFieldValue('discount')-0
|
|
||||||
let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0
|
|
||||||
let otherMoney = this.form.getFieldValue('otherMoney')-0
|
let otherMoney = this.form.getFieldValue('otherMoney')-0
|
||||||
if(discount !== 100) {
|
let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney-0
|
||||||
let allTaxLastMoney = (discountLastMoney/(1-discount/100)).toFixed(2)-0
|
let discountNew = (value/allTaxLastMoney*100).toFixed(2)-0
|
||||||
let discountNew = (value/allTaxLastMoney*100).toFixed(2)-0
|
let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2)-0
|
||||||
let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2)-0
|
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
|
||||||
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
|
this.$nextTick(() => {
|
||||||
this.$nextTick(() => {
|
this.form.setFieldsValue({'discount':discountNew,'discountLastMoney':discountLastMoneyNew,
|
||||||
this.form.setFieldsValue({'discount':discountNew,'discountLastMoney':discountLastMoneyNew,
|
'changeAmount':changeAmountNew,'debt':0})
|
||||||
'changeAmount':changeAmountNew,'debt':0})
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
//其它费用
|
//其它费用
|
||||||
onKeyUpOtherMoney(e) {
|
onKeyUpOtherMoney(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user