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

@@ -59,6 +59,7 @@
<clin-fields
v-bind:initial-clin-index='{{ index }}'
v-bind:initial-loa-count="{{ fields.loas.data | length }}"
v-bind:initial-clin-type="'{{ fields.jedi_clin_type.data }}'"
inline-template>
<div>
<div class="form-row">
@@ -102,7 +103,15 @@
{% endif %}
<form id="new-task-order" action='{{ action }}' method="POST" autocomplete="off" enctype="multipart/form-data">
{{ form.csrf_token }}
<to-form inline-template v-bind:initial-clin-count="{{ form.clins.data | length }}">
{% set obligated = task_order.total_obligated_funds if task_order else 0 %}
{% set total = task_order.total_contract_amount if task_order else 0 %}
<to-form
inline-template
v-bind:initial-obligated='{{ obligated }}'
v-bind:initial-total='{{ total }}'
v-bind:initial-clin-count="{{ form.clins.data | length }}">
<div>
{% call StickyCTA(text="Add Funding") %}
<span class="action-group">
@@ -382,26 +391,26 @@
</div>
{{ UploadInput(form.pdf, watch=True) }}
</div>
{{ TotalsBox(task_order=task_order) }}
</div>
<totals-box
<totals-box
inline-template
v-bind:additional-obligated='additionalObligatedAmount'
v-bind:additional-contract-amount='totalClinAmount'
v-bind:obligated='obligated'
v-bind:contract-amount='total'
>
<div class="col totals-box">
<div class="h4">Total obligated funds</div>
<div class="h3">!{ obligated }</div>
<div>This is the funding allocated to cloud services. It may be 100% or a portion of the total task order budget.</div>
<div class="col totals-box">
<div class="h4">Total obligated funds</div>
<div class="h3" v-html="formattedObligated"></div>
<div>This is the funding allocated to cloud services. It may be 100% or a portion of the total task order budget.</div>
<hr>
<hr>
<div class="h4">Total contract amount</div>
<div class="h3">!{ contractAmount }</div>
<div>This is the value of all funds obligated for this contract, including -- but not limited to -- funds obligated for the cloud.</div>
</div>
</totals-box>
<div class="h4">Total contract amount</div>
<div class="h3" v-html="formattedContractAmount"></div>
<div>This is the value of all funds obligated for this contract, including -- but not limited to -- funds obligated for the cloud.</div>
</div>
</totals-box>
</div>
</div>
</div>