diff --git a/atst/models/clin.py b/atst/models/clin.py index 081ab764..dd4bdd76 100644 --- a/atst/models/clin.py +++ b/atst/models/clin.py @@ -27,3 +27,10 @@ class CLIN(Base, mixins.TimestampsMixin): end_date = Column(Date, nullable=False) obligated_amount = Column(Numeric(scale=2), nullable=False) jedi_clin_type = Column(SQLAEnum(JEDICLINType, native_enum=False), nullable=False) + + def to_dictionary(self): + return { + c.name: getattr(self, c.name) + for c in self.__table__.columns + if c.name not in ["id"] + } diff --git a/atst/models/task_order.py b/atst/models/task_order.py index 93131078..9f37854a 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -129,6 +129,9 @@ class TaskOrder(Base, mixins.TimestampsMixin): def to_dictionary(self): return { "portfolio_name": self.portfolio_name, + "clins": [ + clin.to_dictionary() for clin in self.clins + ], **{ c.name: getattr(self, c.name) for c in self.__table__.columns diff --git a/js/components/clin_fields.js b/js/components/clin_fields.js index df3d3b83..808c764b 100644 --- a/js/components/clin_fields.js +++ b/js/components/clin_fields.js @@ -6,87 +6,14 @@ export default { name: 'clin-fields', components: { - DateSelector, - optionsinput, textinput, }, props: { - clinIndex: String, + initialClinIndex: Number, + }, + + data: function() { + return {clinIndex: this.initialClinIndex} }, - // get clin index from props and pass into template - template: ` -