Add change handler to clin field components

- emit clin type and obligated amount
This commit is contained in:
montana-mil
2019-06-13 15:48:14 -04:00
committed by montana
parent 4074f11e25
commit c775c7322c
4 changed files with 65 additions and 31 deletions

View File

@@ -26,6 +26,8 @@ export default {
props: {
initialClinCount: Number,
initialObligated: Number,
initialTotal: Number,
},
data: function() {
@@ -35,8 +37,8 @@ export default {
return {
clins,
clinIndex,
totalClinAmount: 0,
additionalObligatedAmount: 0,
obligated: this.initialObligated || 0,
total: this.initialTotal || 0,
}
},
@@ -51,9 +53,9 @@ export default {
},
calculateClinAmounts: function (event) {
this.totalClinAmount += parseFloat(event.amount - this.totalClinAmount)
this.total += parseFloat(event.amount - this.total)
if (event.clinType.includes('1') || event.clinType.includes('3')) {
this.additionalObligatedAmount += parseFloat(event.amount - this.additionalObligatedAmount)
this.obligated += parseFloat(event.amount - this.obligated)
}
},
},