Make sure form correctly validates after CLIN is removed
This commit is contained in:
parent
27d3f46cc9
commit
f5ce35187b
@ -78,7 +78,7 @@ export default {
|
||||
})
|
||||
emitEvent('field-mount', this, {
|
||||
optional: false,
|
||||
name: POP + "-" + this.clinIndex,
|
||||
name: 'clins-' + this.clinIndex + '-' + POP,
|
||||
valid: this.checkPopValid(),
|
||||
})
|
||||
},
|
||||
@ -104,7 +104,7 @@ export default {
|
||||
}
|
||||
|
||||
emitEvent('field-change', this, {
|
||||
name: POP + "-" + this.clinIndex,
|
||||
name: 'clins-' + this.clinIndex + '-' + POP,
|
||||
valid: this.checkPopValid(),
|
||||
})
|
||||
},
|
||||
|
@ -42,8 +42,8 @@ export default {
|
||||
},
|
||||
|
||||
data: function() {
|
||||
const clins = this.initialClinCount == 0 ? 1 : 0
|
||||
const clinIndex = this.initialClinCount == 0 ? 0 : this.initialClinCount - 1
|
||||
const clins = !this.initialClinCount ? 1 : 0
|
||||
const clinIndex = !this.initialClinCount ? 0 : this.initialClinCount - 1
|
||||
|
||||
return {
|
||||
clins,
|
||||
@ -67,7 +67,13 @@ export default {
|
||||
|
||||
handleRemoveClin: function(event) {
|
||||
--this.clinIndex
|
||||
console.log('removed clin')
|
||||
for (var field in this.fields) {
|
||||
if (field.includes('-' + event.clinIndex + '-')) {
|
||||
delete this.fields[field]
|
||||
}
|
||||
}
|
||||
|
||||
this.validateForm()
|
||||
},
|
||||
|
||||
calculateClinAmounts: function(event) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user