From 47fec183a77805941257c09d8af794cbd60a9312 Mon Sep 17 00:00:00 2001 From: nelo Date: Thu, 19 Jan 2017 13:21:01 +0100 Subject: [PATCH] notas --- @salix/crud/src/client/new-note/index.js | 13 +++++++------ @salix/crud/src/client/notes/index.html | 11 +++++++---- @salix/crud/src/client/routes.js | 4 +--- services/client/common/models/Address.js | 15 ++------------- .../client/common/models/ClientObservation.js | 10 +--------- 5 files changed, 18 insertions(+), 35 deletions(-) diff --git a/@salix/crud/src/client/new-note/index.js b/@salix/crud/src/client/new-note/index.js index 16ef1dbaff..f1bd48dfac 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 d73dffb716..5d40d3bfe0 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}}
+
+