Commit 0d3b8c07 authored by 季圣华's avatar 季圣华
Browse files

解决单据中改优惠率的时候金额计算bug

parent 860a5ca8
......@@ -556,10 +556,8 @@ export const BillModalMixin = {
//改变优惠率
onKeyUpDiscount(e) {
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 allTaxLastMoney = (discountMoney + discountLastMoney).toFixed(2)-0
let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney-0
let discountMoneyNew = (allTaxLastMoney*value*0.01).toFixed(2)-0
let discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2)-0
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
......@@ -571,19 +569,15 @@ export const BillModalMixin = {
//改变付款优惠
onKeyUpDiscountMoney(e) {
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
if(discount !== 100) {
let allTaxLastMoney = (discountLastMoney/(1-discount/100)).toFixed(2)-0
let discountNew = (value/allTaxLastMoney*100).toFixed(2)-0
let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2)-0
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'discount':discountNew,'discountLastMoney':discountLastMoneyNew,
'changeAmount':changeAmountNew,'debt':0})
});
}
let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney-0
let discountNew = (value/allTaxLastMoney*100).toFixed(2)-0
let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2)-0
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'discount':discountNew,'discountLastMoney':discountLastMoneyNew,
'changeAmount':changeAmountNew,'debt':0})
});
},
//其它费用
onKeyUpOtherMoney(e) {
......
Supports Markdown
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