added batch edit
This commit is contained in:
@ -8,6 +8,7 @@ export class MeasurementModel extends BaseModel {
|
||||
sample_id: IdModel = null;
|
||||
measurement_template: IdModel;
|
||||
values: {[prop: string]: any} = {};
|
||||
status = '';
|
||||
|
||||
constructor(measurementTemplate: IdModel = null) {
|
||||
super();
|
||||
|
@ -17,7 +17,7 @@ export class SampleModel extends BaseModel {
|
||||
measurements: MeasurementModel[] = [];
|
||||
note_id: IdModel = null;
|
||||
user_id: IdModel = null;
|
||||
validate = false;
|
||||
selected = false;
|
||||
notes: {
|
||||
comment: string,
|
||||
sample_references: {sample_id: IdModel, relation: string}[],
|
||||
@ -42,7 +42,16 @@ export class SampleModel extends BaseModel {
|
||||
}
|
||||
|
||||
sendFormat() {
|
||||
return pick(this.conditionTemplateCheck(), ['color', 'type', 'batch', 'condition', 'material_id', 'notes']);
|
||||
const tmp = pick(this.conditionTemplateCheck(), ['color', 'type', 'batch', 'condition', 'material_id', 'notes']);
|
||||
Object.keys(tmp).forEach(key => {
|
||||
if (tmp[key] === undefined) {
|
||||
delete tmp[key];
|
||||
}
|
||||
});
|
||||
if (this.material && this.material.name === undefined) {
|
||||
delete tmp.material_id;
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
private conditionTemplateCheck() {
|
||||
|
Reference in New Issue
Block a user