|
@@ -47,7 +47,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<number-input
|
|
|
:value="paybackTableData[scope.$index].money"
|
|
|
- @input="onPaybackSplitMoneyChange(scope, $event)"
|
|
|
+ @input="onPaybackSplitMoneyChange({ $index: scope.$index, money: scope.row.money }, $event)"
|
|
|
type="number"
|
|
|
placeholder="请输入"
|
|
|
:min="0"
|
|
@@ -168,7 +168,10 @@ export default {
|
|
|
},
|
|
|
buySubject() {
|
|
|
this.reset()
|
|
|
- }
|
|
|
+ },
|
|
|
+ exceptedPayBackMoney() {
|
|
|
+ this.clearTableKey('money')
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
reset() {
|
|
@@ -235,8 +238,8 @@ export default {
|
|
|
|
|
|
return lastMoney
|
|
|
},
|
|
|
- onPaybackSplitMoneyChange(scope, e) {
|
|
|
- const index = scope.$index
|
|
|
+ onPaybackSplitMoneyChange({ $index, money }, e) {
|
|
|
+ const index = $index
|
|
|
this.onChangeTableLineData('money', index, e)
|
|
|
if (!this.pageTotalMoney.hasContract) {
|
|
|
this.onChangeTableLineData('money', index, '')
|
|
@@ -245,7 +248,7 @@ export default {
|
|
|
type: 'warning'
|
|
|
})
|
|
|
}
|
|
|
- if (scope.row.money === 0 || scope.row.money === '0') {
|
|
|
+ if (money === 0 || money === '0') {
|
|
|
this.onChangeTableLineData('money', index, '')
|
|
|
return this.$message({
|
|
|
message: '不可为0',
|
|
@@ -309,6 +312,11 @@ export default {
|
|
|
clearPaybackTableData() {
|
|
|
this.setPageFormData('paybackTableData', [])
|
|
|
},
|
|
|
+ clearTableKey(key) {
|
|
|
+ this.paybackTableData.forEach((p, index) => {
|
|
|
+ this.onChangeTableLineData(key, index, '')
|
|
|
+ })
|
|
|
+ },
|
|
|
initPaybackTableData() {
|
|
|
const arr = new Array(this.pageForm.paybackTimes - 0).fill(undefined).map(() => new PayBackTableRow())
|
|
|
// this.paybackTableData = arr
|