|
@@ -92,7 +92,7 @@
|
|
|
<hc-table-input v-model="row.changeTotal" disabled />
|
|
|
</template>
|
|
|
<template #currentMeterTotal="{ row }">
|
|
|
- <hc-table-input v-model="row.currentMeterTotal" />
|
|
|
+ <hc-table-input v-model="row.currentMeterTotal" @blur="currentMeterTotalBlur(row)" />
|
|
|
</template>
|
|
|
<template #containChangeTotal="{ row }">
|
|
|
<hc-table-input v-model="row.containChangeTotal" />
|
|
@@ -141,6 +141,7 @@ import { nextTick, ref, watch } from 'vue'
|
|
|
import { getStoreValue } from '~src/utils/storage'
|
|
|
import HcBillBaseModal from './addBillBaseModal.vue'
|
|
|
import { arrToId, getArrValue, getObjValue, getRandom } from 'js-fast-way'
|
|
|
+import BigNumber from 'bignumber.js'
|
|
|
import { getHeader } from 'hc-vue3-ui'
|
|
|
|
|
|
import unitApi from '~api/project/debit/contract/unit'
|
|
@@ -317,6 +318,20 @@ const addTableColumn = ref([
|
|
|
])
|
|
|
const addTableData = ref([])
|
|
|
|
|
|
+//计算本期计量金额
|
|
|
+const currentMeterTotalBlur = (row) => {
|
|
|
+ const { currentMeterTotal, currentPrice, allMeterTotal } = row
|
|
|
+ row.currentMeterMoney = (BigNumber(currentMeterTotal).multipliedBy(currentPrice)).toNumber()
|
|
|
+ row.allMeterTotal = (BigNumber(currentMeterTotal).plus(allMeterTotal)).toNumber()
|
|
|
+ //计算总计量金额
|
|
|
+ let meterMoney = 0
|
|
|
+ for (let i = 0; i < addTableData.value.length; i++) {
|
|
|
+ meterMoney = (BigNumber(meterMoney).plus(addTableData.value[i].currentMeterMoney)).toNumber()
|
|
|
+ }
|
|
|
+ baseForm.value.meterMoney = meterMoney
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//添加分解单
|
|
|
const addBillBaseModalShow = ref(false)
|
|
|
const billBaseIds = ref('')
|