|
@@ -163,10 +163,10 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="investMoney" label="投资完成额(亿元)" width="100" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
<hc-body>
|
|
|
<!-- <hc-table-input v-model="row.investMoney" /> -->
|
|
|
- <el-input v-model="row.investMoney" clearable :formatter="formatInput" />
|
|
|
+ <el-input v-model="row.investMoney" clearable :formatter="formatInput" @change="changeInvestMoney($event, row, $index)" />
|
|
|
</hc-body>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -510,9 +510,19 @@ const formatInput = (value)=>{
|
|
|
// 如果是数字且不小于0,则返回原始值
|
|
|
return value
|
|
|
} else {
|
|
|
- // 如果输入不符合要求,则返回空字符串
|
|
|
- return ''
|
|
|
+ // 如果输入不符合要求,则返回空字符串
|
|
|
+ return ''
|
|
|
+ }
|
|
|
}
|
|
|
+const changeInvestMoney = (val, row, index)=>{
|
|
|
+ let table = yearData.value.list[yearIndex.value].list
|
|
|
+ table.forEach((ele, index)=>{
|
|
|
+ if (index === 0) {
|
|
|
+ table[index].investMoneyAll = Number(table[index].investMoney )
|
|
|
+ } else if (0 < index < 12) {
|
|
|
+ table[index].investMoneyAll = Number(table[index].investMoney ) + Number(table[index - 1].investMoneyAll)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
defineExpose({
|
|
|
batchRemove,
|