diff --git a/@salix/crud/src/client/new-note/index.js b/@salix/crud/src/client/new-note/index.js index 16ef1dbaf..f1bd48dfa 100644 --- a/@salix/crud/src/client/new-note/index.js +++ b/@salix/crud/src/client/new-note/index.js @@ -12,21 +12,22 @@ export const COMPONENT = { var self = this; var deregister = $transitions.onStart({ }, callback); - + copyNote(); + this.submit = function() { if (this.note) { let observation = this.createNote(); $http.post('/client/api/ClientObservations', observation).then( json => { this.note = json.data; - this.copyNote(); + copyNote(); $state.go('clientCard.notes'); } ); } }; - this.$onDestroy = function() { + this.$onDestroy = () => { deregister(); }; @@ -44,9 +45,9 @@ export const COMPONENT = { } } - this.copyNote = () => { - this.noteOld = {} - copyObject(this.note, this.noteOld); + function copyNote() { + self.noteOld = {}; + copyObject(self.note, self.noteOld); } } }; diff --git a/@salix/crud/src/client/notes/index.html b/@salix/crud/src/client/notes/index.html index d73dffb71..5d40d3bfe 100644 --- a/@salix/crud/src/client/notes/index.html +++ b/@salix/crud/src/client/notes/index.html @@ -1,10 +1,13 @@ Notas -
-
{{n.creationDate | date:'medium'}} {{n.salesPerson}}
- {{n.text}} -
+ + +
{{n.creationDate | date:'dd/MM/yyyy HH:mm'}}
+
{{n.salesPerson}}
+
{{n.text}}
+
+