优化财务单据的数值计算

This commit is contained in:
季圣华
2021-06-02 23:33:42 +08:00
parent c25b6dd41e
commit faf5710133
5 changed files with 6 additions and 4 deletions

View File

@@ -166,7 +166,6 @@ export const BillModalMixin = {
//单元值改变一个字符就触发一次 //单元值改变一个字符就触发一次
onValueChange(event) { onValueChange(event) {
let that = this let that = this
debugger
const { type, row, column, value, target } = event const { type, row, column, value, target } = event
let param,operNumber,unitPrice,taxUnitPrice,allPrice,taxRate,taxMoney,taxLastMoney let param,operNumber,unitPrice,taxUnitPrice,allPrice,taxRate,taxMoney,taxLastMoney
switch(column.key) { switch(column.key) {

View File

@@ -165,7 +165,8 @@
for(let item of detailArr){ for(let item of detailArr){
totalPrice += item.eachAmount-0 totalPrice += item.eachAmount-0
} }
billMain.totalPrice = totalPrice billMain.totalPrice = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(this.model.id){ if(this.model.id){
billMain.id = this.model.id billMain.id = this.model.id
} }

View File

@@ -177,7 +177,8 @@
for(let item of detailArr){ for(let item of detailArr){
totalPrice += item.eachAmount-0 totalPrice += item.eachAmount-0
} }
billMain.totalPrice = totalPrice billMain.totalPrice = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(this.model.id){ if(this.model.id){
billMain.id = this.model.id billMain.id = this.model.id
} }

View File

@@ -168,7 +168,7 @@
for(let item of detailArr){ for(let item of detailArr){
totalPrice += item.eachAmount-0 totalPrice += item.eachAmount-0
} }
billMain.totalPrice = totalPrice billMain.totalPrice = 0-totalPrice
if(this.model.id){ if(this.model.id){
billMain.id = this.model.id billMain.id = this.model.id
} }

View File

@@ -165,6 +165,7 @@
let moneyBeginNeedGet = beginNeedGet - 0; //期初应收 let moneyBeginNeedGet = beginNeedGet - 0; //期初应收
let moneyBeginNeedPay = beginNeedPay - 0; //期初应付 let moneyBeginNeedPay = beginNeedPay - 0; //期初应付
money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2); money = (money + moneyBeginNeedGet - moneyBeginNeedPay).toFixed(2);
money = 0-money;
if(type === 'first') { if(type === 'first') {
this.firstTotal = prefix + money + "" this.firstTotal = prefix + money + ""
} else if(type === 'last') { } else if(type === 'last') {