From 870532408576a8eb4af1741d51b60edf3d9eeec4 Mon Sep 17 00:00:00 2001 From: nelo Date: Tue, 29 Nov 2016 14:56:05 +0100 Subject: [PATCH] buscador de clientes --- @salix/app/src/configroutes.js | 2 +- @salix/core/src/searchbar/searchbar.mt.html | 4 +- @salix/crud/src/client/basic-data/index.html | 78 ++++++++++---------- @salix/crud/src/client/client.js | 6 +- @salix/crud/src/client/client/client.html | 11 +++ @salix/crud/src/client/client/client.js | 24 ++++++ @salix/crud/src/client/index/index.html | 45 +++++++++-- @salix/crud/src/client/index/index.js | 28 +++---- @salix/crud/src/client/routes.js | 46 +++++++----- 9 files changed, 161 insertions(+), 83 deletions(-) create mode 100644 @salix/crud/src/client/client/client.html create mode 100644 @salix/crud/src/client/client/client.js diff --git a/@salix/app/src/configroutes.js b/@salix/app/src/configroutes.js index 9acf3276c..5ef97c6dc 100644 --- a/@salix/app/src/configroutes.js +++ b/@salix/app/src/configroutes.js @@ -17,7 +17,7 @@ function config($stateProvider, $urlRouterProvider) { core.splitingRegister.registerGraph(deps); - $urlRouterProvider.otherwise('/client'); + $urlRouterProvider.otherwise('/clients'); for (var file in routes) routes[file].forEach(function (route) { diff --git a/@salix/core/src/searchbar/searchbar.mt.html b/@salix/core/src/searchbar/searchbar.mt.html index 7034d79d6..bf432de77 100644 --- a/@salix/core/src/searchbar/searchbar.mt.html +++ b/@salix/core/src/searchbar/searchbar.mt.html @@ -1,10 +1,10 @@
-
diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html index 5eafbea40..d487ecb42 100644 --- a/@salix/crud/src/client/basic-data/index.html +++ b/@salix/crud/src/client/basic-data/index.html @@ -1,41 +1,41 @@ - - - -

Datos básicos

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + +

Datos básicos

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/@salix/crud/src/client/client.js b/@salix/crud/src/client/client.js index b4e35cc0e..5c86bc714 100644 --- a/@salix/crud/src/client/client.js +++ b/@salix/crud/src/client/client.js @@ -1,6 +1,8 @@ -export {NAME as CLIENT_INDEX, - COMPONENT as CLIENT_INDEX_COMPONENT} from './index/index'; +export {NAME as CLIENT_CLIENT, + COMPONENT as CLIENT_CLIENT_COMPONENT} from './client/client'; export {NAME as CLIENT_BASIC_DATA_INDEX, COMPONENT as CLIENT_BASIC_DATA_INDEX_COMPONENT} from './basic-data/index'; export {NAME as CLIENT_ADDRESSES, COMPONENT as CLIENT_ADDRESSES_COMPONENT} from './addresses/index'; +export {NAME as CLIENTS, + COMPONENT as CLIENTS_COMPONENT} from './index/index'; \ No newline at end of file diff --git a/@salix/crud/src/client/client/client.html b/@salix/crud/src/client/client/client.html new file mode 100644 index 000000000..9dae5e69d --- /dev/null +++ b/@salix/crud/src/client/client/client.html @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/@salix/crud/src/client/client/client.js b/@salix/crud/src/client/client/client.js new file mode 100644 index 000000000..d15a9a1b9 --- /dev/null +++ b/@salix/crud/src/client/client/client.js @@ -0,0 +1,24 @@ +import template from './client.html'; +import {module} from '../../module'; + +const _NAME = 'clientClient'; +// export const NAME = module.getName(_NAME); +export const NAME = "vnClientClient"; +export const COMPONENT = { + template: template, + controller: function() { + this.items = [ + {text: "Datos básicos", image: "person", href: "#/client/basic-data"}, + {text: "Datos facturación", image: "assignment", href: "#/client/invoicing-data"}, + {text: "Acceso web", image: "language", href: "#/client/web-access"}, + {text: "Consignatarios", image: "local_shipping", href: "#/client/addresses"}, + {text: "Notas", image: "insert_drive_file", href: "#/client/notes"} + ]; + this.descriptor = [ + {text: "Cliente 1231"}, + {text: "Floristeria Lola"}, + {text: "987 654 321"} + ]; + } +}; +module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/index/index.html b/@salix/crud/src/client/index/index.html index 9dae5e69d..32eab6c59 100644 --- a/@salix/crud/src/client/index/index.html +++ b/@salix/crud/src/client/index/index.html @@ -1,11 +1,42 @@ +
- - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/@salix/crud/src/client/index/index.js b/@salix/crud/src/client/index/index.js index ea82f2e91..973188f7c 100644 --- a/@salix/crud/src/client/index/index.js +++ b/@salix/crud/src/client/index/index.js @@ -2,23 +2,23 @@ import template from './index.html'; import {module} from '../../module'; const _NAME = 'clientIndex'; -// export const NAME = module.getName(_NAME); +//export const NAME = module.core.util.getName(_NAME); export const NAME = "vnClientIndex"; export const COMPONENT = { template: template, - controller: function() { - this.items = [ - {text: "Datos básicos", image: "person", href: "#/client/basic-data"}, - {text: "Datos facturación", image: "assignment", href: "#/client/invoicing-data"}, - {text: "Acceso web", image: "language", href: "#/client/web-access"}, - {text: "Consignatarios", image: "local_shipping", href: "#/client/addresses"}, - {text: "Notas", image: "insert_drive_file", href: "#/client/notes"} - ]; - this.descriptor = [ - {text: "Cliente 1231"}, - {text: "Floristeria Lola"}, - {text: "987 654 321"} - ]; + controller: function($http){ + this.submit = function () { + var query = {"where": this.model, "fields": {"id": true}}; + console.log(query); + $http.get(`/client/api/Clients/findOne?filter=${JSON.stringify(query)}`).then ( + function(response){ + console.log(response); + }, + function(response){ + console.log(response); + } + ); + }; } }; module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/routes.js b/@salix/crud/src/client/routes.js index c339a9d60..cf5889c35 100644 --- a/@salix/crud/src/client/routes.js +++ b/@salix/crud/src/client/routes.js @@ -1,20 +1,30 @@ -[{ - url: '/client', - state: 'client', - template: '', - module: 'crud', - description: '', - image: '', -},{ - url: '/basic-data', - state: 'client.basicdata', - template: '', - module: 'crud' -},{ - url: '/addresses', - state: 'client.addresses', - template: '', - module: 'crud' -}] +[ + { + url: '/clients', + state: 'clients', + template: '', + module: 'crud', + description: '', + image: '', + } + ,{ + url: '/client', + state: 'client', + template: '', + module: 'crud', + description: '', + image: '', + },{ + url: '/basic-data', + state: 'client.basicdata', + template: '', + module: 'crud' + },{ + url: '/addresses', + state: 'client.addresses', + template: '', + module: 'crud' + } +]