|
@@ -532,27 +532,13 @@ const containChangeTotalBlur = (row) => {
|
|
|
}
|
|
|
const unPayRatioBlur = (row)=>{
|
|
|
nextTick(()=>{
|
|
|
- console.log(row, 'row')
|
|
|
+ console.log(row, 'rowzhifubili')
|
|
|
|
|
|
- //计算本期计量金额
|
|
|
- //如果为空
|
|
|
- let currentMeterTotal = row.currentMeterTotal
|
|
|
- const isMeter = isNumberReg(currentMeterTotal)
|
|
|
- if (isNullES(currentMeterTotal) || !isMeter) {
|
|
|
- currentMeterTotal = 0
|
|
|
- }
|
|
|
- //本期计量金额
|
|
|
- row.currentMeterTotal = currentMeterTotal
|
|
|
- row.currentMeterMoney = (BigNumber(currentMeterTotal).multipliedBy(row.currentPrice)).toString()
|
|
|
- row.allMeterTotal = (BigNumber(currentMeterTotal).plus(row.otherMeterTotal)).toString()
|
|
|
- //计算总计量金额
|
|
|
- let meterMoney = 0, table = addTableData.value
|
|
|
- for (let i = 0; i < table.length; i++) {
|
|
|
- meterMoney = (BigNumber(meterMoney).plus(table[i].currentMeterMoney)).toString()
|
|
|
- }
|
|
|
- baseForm.value.meterMoney = meterMoney
|
|
|
+
|
|
|
// 计算方式:
|
|
|
//本期支 付比例=本期计量数量/变更后数量
|
|
|
+ //本期支付比例=本期计量数量/变更后数量
|
|
|
+ //本期计量数量=本期支付比例*变更后数量
|
|
|
// 会返回最大支付比例 upPayRatio
|
|
|
// 和其他期支付比例 otherPayRatio
|
|
|
|
|
@@ -567,16 +553,14 @@ const unPayRatioBlur = (row)=>{
|
|
|
let result = BigNumber(payRatio).plus(otherPayRatio)//本期支付比例+其他期支付比例
|
|
|
// 本期计量数量=本期支付比例*变更后数量
|
|
|
row.currentMeterTotal = (payRatio.dividedBy(100).multipliedBy(changeTotal)).toString()
|
|
|
+ row.currentMeterMoney = (BigNumber(row.currentMeterTotal).multipliedBy(row.currentPrice)).toString()//本期计量金额额
|
|
|
+ row.allMeterTotal = (BigNumber(row.currentMeterTotal).plus(row.otherMeterTotal)).toString()
|
|
|
const isComparedRa = result.comparedTo(upPayRatio)
|
|
|
isComparedRaVal.value = isComparedRa
|
|
|
- console.log(upPayRatio, 'upPayRatio')
|
|
|
- console.log(payRatio, 'payRatio')
|
|
|
- console.log(isComparedRa, 'isComparedRa')
|
|
|
- // //a 大于 b = 1,a 等于 b = 0,a 小于 b = -1, a 或 b 的值异常时 = null
|
|
|
- if (isComparedRa === 1 ) {
|
|
|
- isCanSave.value = true
|
|
|
|
|
|
- window.$message.warning('累计计量金额超出支付比列,如需计量100%,请完成关联对应的质保资料')
|
|
|
+ if (isComparedRa === 1 ) {
|
|
|
+ isCanSave.value = true
|
|
|
+ window.$message.warning('累计计量金额超出支付比列,如需计量100%,请完成关联对应的质保资料')
|
|
|
// return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
|
|
|
|
|
|
|
|
@@ -584,6 +568,15 @@ const unPayRatioBlur = (row)=>{
|
|
|
isCanSave.value = false
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //计算总计量金额
|
|
|
+ let meterMoney = 0, table = addTableData.value
|
|
|
+ for (let i = 0; i < table.length; i++) {
|
|
|
+ meterMoney = (BigNumber(meterMoney).plus(table[i].currentMeterMoney)).toString()
|
|
|
+ }
|
|
|
+ baseForm.value.meterMoney = meterMoney
|
|
|
|
|
|
|
|
|
})
|
|
@@ -593,21 +586,9 @@ const unPayRatioBlur = (row)=>{
|
|
|
const isCanSave = ref(false)
|
|
|
|
|
|
const addTableRowStyle = ({ row }) => {
|
|
|
- console.log(row, 'rowcxxuanr')
|
|
|
|
|
|
//本期支付比例+其他期支付比例
|
|
|
// 是否大于最大支付比例
|
|
|
- // if ( isComparedRaVal.value === 1 || isComparedRaVal.value === null) {
|
|
|
- // isCanSave.value = true
|
|
|
-
|
|
|
- // return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
|
|
|
-
|
|
|
-
|
|
|
- // } else {
|
|
|
- // isCanSave.value = false
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
let payRatio = new BigNumber(row.payRatio )//本期支付比例
|
|
|
let upPayRatio = new BigNumber(row.upPayRatio )//最大支付比例
|
|
|
let otherPayRatio = new BigNumber(row.otherPayRatio )//其他期支付比例
|
|
@@ -615,9 +596,6 @@ const addTableRowStyle = ({ row }) => {
|
|
|
|
|
|
const isComparedRa = result.comparedTo(upPayRatio)
|
|
|
isComparedRaVal.value = isComparedRa
|
|
|
- console.log(upPayRatio, 'upPayRatio')
|
|
|
- console.log(payRatio, 'payRatio')
|
|
|
- console.log(isComparedRa, 'isComparedRa333334444')
|
|
|
// //a 大于 b = 1,a 等于 b = 0,a 小于 b = -1, a 或 b 的值异常时 = null
|
|
|
if (isComparedRa === 1 ) {
|
|
|
isCanSave.value = true
|