|
@@ -508,8 +508,24 @@ const currentMeterTotalBlur = (row) => {
|
|
|
//计算本期计量金额
|
|
|
nextTick(() => {
|
|
|
row.currentMeterTotal = currentMeterTotal
|
|
|
- row.currentMeterMoney = (BigNumber(currentMeterTotal).multipliedBy(row.currentPrice)).toFixed(2).toString()
|
|
|
row.allMeterTotal = (BigNumber(currentMeterTotal).plus(row.otherMeterTotal)).toString()
|
|
|
+ row.currentMeterMoney = (BigNumber(currentMeterTotal).multipliedBy(row.currentPrice)).toFixed(2).toString()
|
|
|
+
|
|
|
+ //计算是否相等
|
|
|
+ const allMeterTotal = new BigNumber(row.allMeterTotal)
|
|
|
+ const changeTotal = new BigNumber(row.changeTotal)
|
|
|
+ // 比较这两个值
|
|
|
+ const areEqual = allMeterTotal.isEqualTo(changeTotal)
|
|
|
+ if (areEqual) {
|
|
|
+ //本期计量金额 = 单价 * 变更后数量 - 基数
|
|
|
+ const currentPrice = new BigNumber(row.currentPrice)
|
|
|
+ const changeTotal = new BigNumber(row.changeTotal)
|
|
|
+ const otherMeterTotal = new BigNumber(row.otherMeterTotal)
|
|
|
+ // 计算本期计量金额
|
|
|
+ const currentMeterMoney = currentPrice.times(changeTotal).minus(otherMeterTotal)
|
|
|
+ row.currentMeterMoney = currentMeterMoney.toString()
|
|
|
+ }
|
|
|
+
|
|
|
//计算总计量金额
|
|
|
let meterMoney = 0, table = addTableData.value
|
|
|
for (let i = 0; i < table.length; i++) {
|
|
@@ -580,9 +596,24 @@ const unPayRatioBlur = (row)=>{
|
|
|
let changeTotal = new BigNumber(row.changeTotal )//变更后数量
|
|
|
// 本期计量数量=本期支付比例*变更后数量
|
|
|
row.currentMeterTotal = (payRatio.dividedBy(100).multipliedBy(changeTotal)).toFixed(2).toString()
|
|
|
- row.currentMeterMoney = (BigNumber(row.currentMeterTotal).multipliedBy(row.currentPrice)).toFixed(2).toString()//本期计量金额额
|
|
|
row.allMeterTotal = (BigNumber(row.currentMeterTotal).plus(row.otherMeterTotal)).toFixed(2).toString()
|
|
|
- // 就去对比:本期支付比例+其他期支付比例
|
|
|
+ row.currentMeterMoney = (BigNumber(row.currentMeterTotal).multipliedBy(row.currentPrice)).toFixed(2).toString()//本期计量金额额
|
|
|
+
|
|
|
+ //计算是否相等
|
|
|
+ const allMeterTotal = new BigNumber(row.allMeterTotal)
|
|
|
+ // 比较这两个值
|
|
|
+ const areEqual = allMeterTotal.isEqualTo(changeTotal)
|
|
|
+ if (areEqual) {
|
|
|
+ //本期计量金额 = 单价 * 变更后数量 - 基数
|
|
|
+ const currentPrice = new BigNumber(row.currentPrice)
|
|
|
+ const changeTotal = new BigNumber(row.changeTotal)
|
|
|
+ const otherMeterTotal = new BigNumber(row.otherMeterTotal)
|
|
|
+ // 计算本期计量金额
|
|
|
+ const currentMeterMoney = currentPrice.times(changeTotal).minus(otherMeterTotal)
|
|
|
+ row.currentMeterMoney = currentMeterMoney.toString()
|
|
|
+ }
|
|
|
+
|
|
|
+ // 就去对比:本期支付比例+其他期支付比例
|
|
|
// 是否大于最大支付比例
|
|
|
compareRowUnpayRatio(row, 1)
|
|
|
//计算总计量金额
|