Fix form so TO saves properly
This commit is contained in:
parent
454643c3c9
commit
732830a500
@ -19,9 +19,9 @@ class TaskOrders(BaseDomainClass):
|
||||
UNCLASSIFIED_FUNDING = []
|
||||
|
||||
@classmethod
|
||||
def create(cls, creator, portfolio_id, number, clins):
|
||||
def create(cls, creator, portfolio_id, number, clins, pdf):
|
||||
task_order = TaskOrder(
|
||||
portfolio_id=portfolio_id, creator=creator, number=number
|
||||
portfolio_id=portfolio_id, creator=creator, number=number, pdf=pdf
|
||||
)
|
||||
db.session.add(task_order)
|
||||
db.session.commit()
|
||||
@ -31,8 +31,9 @@ class TaskOrders(BaseDomainClass):
|
||||
return task_order
|
||||
|
||||
@classmethod
|
||||
def update(cls, task_order_id, number, clins):
|
||||
def update(cls, task_order_id, number, clins, pdf):
|
||||
task_order = TaskOrders.get(task_order_id)
|
||||
task_order.pdf = pdf
|
||||
|
||||
for clin in task_order.clins:
|
||||
db.session.delete(clin)
|
||||
|
@ -64,13 +64,39 @@
|
||||
</select>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="usa-input usa-input--validation--anything usa-input--success">
|
||||
<label :for="'clins-' + clinIndex + '-number'">
|
||||
<div class="usa-input__title"> Number </div>
|
||||
</label>
|
||||
<input type="text" :id="'clins-' + clinIndex + '-number'" placeholder="">
|
||||
<input type="hidden" :name="'clins-' + clinIndex + '-number'">
|
||||
</div>
|
||||
|
||||
<textinput :name="'clins-' + clinIndex + '-number'" inline-template>
|
||||
<div>
|
||||
<label :for="name">
|
||||
<span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span>
|
||||
<span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span>
|
||||
<div class="usa-input__title"> Number </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>
|
||||
|
||||
<date-selector :name-tag="'clins-' + clinIndex + '-start_date'" inline-template>
|
||||
<fieldset class="usa-input date-picker" v-bind:class="{ 'usa-input--success': isDateValid }">
|
||||
@ -182,14 +208,40 @@
|
||||
</fieldset>
|
||||
</date-selector>
|
||||
|
||||
<div class=" usa-input usa-input--validation--anything">
|
||||
<label :for="'clins-' + clinIndex + '-obligated_amount'">
|
||||
<div class="usa-input__title"> Obligated Amount
|
||||
</div>
|
||||
</label>
|
||||
<input type="text" :id="'clins-' + clinIndex + '-obligated_amount'" placeholder="">
|
||||
<input type="hidden" :name="'clins-' + clinIndex + '-obligated_amount'">
|
||||
</div>
|
||||
<textinput :name="'clins-' + clinIndex + '-obligated_amount'" validation="dollars" inline-template>
|
||||
<div>
|
||||
<label :for="name">
|
||||
<span v-show='showError'>{{ Icon('alert',classes="icon-validation") }}</span>
|
||||
<span v-show='showValid'>{{ Icon('ok',classes="icon-validation") }}</span>
|
||||
<div class="usa-input__title">Obligated Amount</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'
|
||||
v-bind:show-mask='true'
|
||||
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>
|
||||
</clin-fields>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user