Merge pull request #882 from dod-ccpo/add-loas-to-clin
Add LOAs to CLINs
This commit is contained in:
commit
c6e8c8eb8a
@ -1,4 +1,5 @@
|
|||||||
import DateSelector from './date_selector'
|
import DateSelector from './date_selector'
|
||||||
|
import optionsinput from './options_input'
|
||||||
import textinput from './text_input'
|
import textinput from './text_input'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -6,14 +7,36 @@ export default {
|
|||||||
|
|
||||||
components: {
|
components: {
|
||||||
DateSelector,
|
DateSelector,
|
||||||
|
optionsinput,
|
||||||
textinput,
|
textinput,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
initialClinIndex: Number,
|
initialClinIndex: Number,
|
||||||
|
initialLoaCount: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
return { clinIndex: this.initialClinIndex }
|
const loas = this.initialLoaCount == 0 ? 1 : 0
|
||||||
|
const indexOffset = this.initialLoaCount
|
||||||
|
|
||||||
|
return {
|
||||||
|
clinIndex: this.initialClinIndex,
|
||||||
|
indexOffset: this.initialLoaCount,
|
||||||
|
loas: loas,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
addLoa: function(event) {
|
||||||
|
++this.loas
|
||||||
|
},
|
||||||
|
|
||||||
|
loaIndex: function(index) {
|
||||||
|
return index + this.indexOffset - 1
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
addClin: function(event) {
|
addClin: function(event) {
|
||||||
this.clins = this.clins + 1
|
++this.clins
|
||||||
this.clinIndex = this.clinIndex + 1
|
++this.clinIndex
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -7,15 +7,67 @@
|
|||||||
{% from 'components/text_input.html' import TextInput %}
|
{% from 'components/text_input.html' import TextInput %}
|
||||||
{% from 'components/upload_input.html' import UploadInput %}
|
{% from 'components/upload_input.html' import UploadInput %}
|
||||||
|
|
||||||
{% macro CLINFields(fields) %}
|
{% macro LOAInput() %}
|
||||||
<div>
|
<div v-for="loa in loas">
|
||||||
<hr>
|
<textinput :name="'clins-' + clinIndex + '-loas-' + loaIndex(loa)" inline-template>
|
||||||
{{ OptionsInput(fields.jedi_clin_type) }}
|
<div>
|
||||||
{{ TextInput(fields.number) }}
|
<label :for="name">
|
||||||
{{ DatePicker(fields.start_date) }}
|
<span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span>
|
||||||
{{ DatePicker(fields.end_date) }}
|
<span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span>
|
||||||
{{ TextInput(fields.obligated_amount, validation='dollars') }}
|
<div class="usa-input__title">Line of Accounting</div>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<masked-input
|
||||||
|
v-on:input='onInput'
|
||||||
|
v-on:blur='onBlur'
|
||||||
|
v-on:change='onChange'
|
||||||
|
v-bind:value='value'
|
||||||
|
v-bind:mask='mask'
|
||||||
|
v-bind:pipe='pipe'
|
||||||
|
v-bind:keep-char-positions='keepCharPositions'
|
||||||
|
v-bind:aria-invalid='showError'
|
||||||
|
type='text'
|
||||||
|
:id='name'
|
||||||
|
ref='input'>
|
||||||
|
</masked-input>
|
||||||
|
|
||||||
|
<input type='hidden' v-bind:value='rawValue' :name='name' />
|
||||||
|
|
||||||
|
<template v-if='showError'>
|
||||||
|
<span class='usa-input__message' v-html='validationError'></span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span class='usa-input__message'></span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</textinput>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button v-on:click="addLoa" type="button">
|
||||||
|
Add another line of accounting
|
||||||
|
</button>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro CLINFields(fields, index) %}
|
||||||
|
<clin-fields
|
||||||
|
v-bind:initial-clin-index='{{ index }}'
|
||||||
|
v-bind:initial-loa-count="{{ fields.loas.data | length }}"
|
||||||
|
inline-template>
|
||||||
|
<div>
|
||||||
|
<hr>
|
||||||
|
{{ OptionsInput(fields.jedi_clin_type) }}
|
||||||
|
{{ TextInput(fields.number) }}
|
||||||
|
|
||||||
|
{% for loa in fields.loas %}
|
||||||
|
{{ TextInput(loa) }}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{{ LOAInput() }}
|
||||||
|
{{ DatePicker(fields.start_date) }}
|
||||||
|
{{ DatePicker(fields.end_date) }}
|
||||||
|
{{ TextInput(fields.obligated_amount, validation='dollars') }}
|
||||||
|
</div>
|
||||||
|
</clin-fields>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% block portfolio_content %}
|
{% block portfolio_content %}
|
||||||
@ -44,7 +96,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
{{ TextInput(form.number, validation='taskOrderNumber') }}
|
{{ TextInput(form.number, validation='taskOrderNumber') }}
|
||||||
{% for clin in form.clins %}
|
{% for clin in form.clins %}
|
||||||
{{ CLINFields(clin) }}
|
{{ CLINFields(clin, index=loop.index - 1) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div v-for="clin in clins">
|
<div v-for="clin in clins">
|
||||||
<hr>
|
<hr>
|
||||||
@ -98,6 +150,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</textinput>
|
</textinput>
|
||||||
|
|
||||||
|
{{ LOAInput() }}
|
||||||
|
|
||||||
<date-selector :name-tag="'clins-' + clinIndex + '-start_date'" inline-template>
|
<date-selector :name-tag="'clins-' + clinIndex + '-start_date'" inline-template>
|
||||||
<fieldset class="usa-input date-picker" v-bind:class="{ 'usa-input--success': isDateValid }">
|
<fieldset class="usa-input date-picker" v-bind:class="{ 'usa-input--success': isDateValid }">
|
||||||
<legend>
|
<legend>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user