Remove code related to Totals box from CLIN fields vue component
This commit is contained in:
parent
5d34899127
commit
20871e787f
@ -4,8 +4,6 @@ import Modal from '../mixins/modal'
|
|||||||
import optionsinput from './options_input'
|
import optionsinput from './options_input'
|
||||||
import textinput from './text_input'
|
import textinput from './text_input'
|
||||||
|
|
||||||
const JEDI_CLIN_TYPE = 'jedi_clin_type'
|
|
||||||
const OBLIGATED_AMOUNT = 'obligated_amount'
|
|
||||||
const START_DATE = 'start_date'
|
const START_DATE = 'start_date'
|
||||||
const END_DATE = 'end_date'
|
const END_DATE = 'end_date'
|
||||||
const POP = 'period_of_performance'
|
const POP = 'period_of_performance'
|
||||||
@ -24,11 +22,6 @@ export default {
|
|||||||
|
|
||||||
props: {
|
props: {
|
||||||
initialClinIndex: Number,
|
initialClinIndex: Number,
|
||||||
initialClinType: String,
|
|
||||||
initialAmount: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
initialStartDate: {
|
initialStartDate: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
@ -58,8 +51,6 @@ export default {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
clinIndex: this.initialClinIndex,
|
clinIndex: this.initialClinIndex,
|
||||||
clinType: this.initialClinType,
|
|
||||||
amount: this.initialAmount || 0,
|
|
||||||
startDate: start,
|
startDate: start,
|
||||||
endDate: end,
|
endDate: end,
|
||||||
popValid: popValidation,
|
popValid: popValidation,
|
||||||
@ -74,11 +65,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
created: function() {
|
created: function() {
|
||||||
emitEvent('clin-change', this, {
|
|
||||||
id: this._uid,
|
|
||||||
clinType: this.clinType,
|
|
||||||
amount: this.initialAmount,
|
|
||||||
})
|
|
||||||
emitEvent('field-mount', this, {
|
emitEvent('field-mount', this, {
|
||||||
optional: false,
|
optional: false,
|
||||||
name: 'clins-' + this.clinIndex + '-' + POP,
|
name: 'clins-' + this.clinIndex + '-' + POP,
|
||||||
@ -87,14 +73,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
clinChangeEvent: function() {
|
|
||||||
emitEvent('clin-change', this, {
|
|
||||||
id: this._uid,
|
|
||||||
clinType: this.clinType,
|
|
||||||
amount: this.amount,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
checkPopValid: function() {
|
checkPopValid: function() {
|
||||||
return this.startDate < this.endDate
|
return this.startDate < this.endDate
|
||||||
},
|
},
|
||||||
@ -114,13 +92,7 @@ export default {
|
|||||||
|
|
||||||
handleFieldChange: function(event) {
|
handleFieldChange: function(event) {
|
||||||
if (this._uid === event.parent_uid) {
|
if (this._uid === event.parent_uid) {
|
||||||
if (event.name.includes(JEDI_CLIN_TYPE)) {
|
if (event.name.includes(START_DATE)) {
|
||||||
this.clinType = event.value
|
|
||||||
this.clinChangeEvent()
|
|
||||||
} else if (event.name.includes(OBLIGATED_AMOUNT)) {
|
|
||||||
this.amount = parseFloat(event.value)
|
|
||||||
this.clinChangeEvent()
|
|
||||||
} else if (event.name.includes(START_DATE)) {
|
|
||||||
if (!!event.value) this.startDate = new Date(event.value)
|
if (!!event.value) this.startDate = new Date(event.value)
|
||||||
this.validatePop()
|
this.validatePop()
|
||||||
} else if (event.name.includes(END_DATE)) {
|
} else if (event.name.includes(END_DATE)) {
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
<clin-fields
|
<clin-fields
|
||||||
{% if fields %}
|
{% if fields %}
|
||||||
v-bind:initial-clin-index='{{ index }}'
|
v-bind:initial-clin-index='{{ index }}'
|
||||||
v-bind:initial-clin-type="'{{ fields.jedi_clin_type.data }}'"
|
|
||||||
v-bind:initial-amount='{{ fields.obligated_amount.data or 0 }}'
|
|
||||||
v-bind:initial-start-date="'{{ fields.start_date.data | string }}'"
|
v-bind:initial-start-date="'{{ fields.start_date.data | string }}'"
|
||||||
v-bind:initial-end-date="'{{ fields.end_date.data | string }}'"
|
v-bind:initial-end-date="'{{ fields.end_date.data | string }}'"
|
||||||
v-bind:initial-clin-number="'{{ fields.number.data | string }}'"
|
v-bind:initial-clin-number="'{{ fields.number.data | string }}'"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user