Browse Source

中间计量修改

duy 1 year ago
parent
commit
bd1dc42efc
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/views/debit-pay/admin/components/middlepay/addModal.vue

+ 7 - 3
src/views/debit-pay/admin/components/middlepay/addModal.vue

@@ -103,7 +103,7 @@
                                 <hc-table-input v-model="row.containChangeTotal" :disabled="isView" @blur="containChangeTotalBlur(row)" />
                             </template>
                             <template #payRatio="{ row }">
-                                <hc-table-input v-model="row.payRatio" :disabled="isView" @blur="unPayRatioBlur(row)" />
+                                <hc-table-input v-model="row.payRatio" :disabled="isView || !row.unPayRatio" @blur="unPayRatioBlur(row)" />
                             </template>
                             <template #currentMeterMoney="{ row }">
                                 <hc-table-input v-model="row.currentMeterMoney" disabled />
@@ -474,6 +474,7 @@ const addTableData = ref([])
 const isComparedRaVal = ref(-1)
 //计算本期计量金额
 const currentMeterTotalBlur = (row) => {
+console.log(row, 'row')
     //如果为空
     let currentMeterTotal = row.currentMeterTotal
     const isMeter = isNumberReg(currentMeterTotal)
@@ -493,8 +494,11 @@ const currentMeterTotalBlur = (row) => {
         baseForm.value.meterMoney = meterMoney
         //计算本期支付比例
         //本期支 付比例=本期计量数量/变更后数量
-        row.payRatio = isNaN(BigNumber(currentMeterTotal).dividedBy(row.changeTotal).toString() * 100) ? '0.00' : BigNumber(currentMeterTotal).dividedBy(row.changeTotal).toString() * 100
-        row.payRatio = row.payRatio .toFixed(2) === 'Infinity' ? 0 : row.payRatio .toFixed(2)
+        //如果不存在unPayRatio,支付比例不能计算
+        if (row.unPayRatio) {
+            row.payRatio = isNaN(BigNumber(currentMeterTotal).dividedBy(row.changeTotal).toString() * 100) ? '0.00' : BigNumber(currentMeterTotal).dividedBy(row.changeTotal).toString() * 100
+            row.payRatio = row.payRatio .toFixed(2) === 'Infinity' ? 0 : row.payRatio .toFixed(2)
+        }
         compareRowUnpayRatio(row, 1)
 
     })