buscador de clientes

This commit is contained in:
nelo 2016-11-29 14:56:05 +01:00
parent bb72b4c251
commit 8705324085
9 changed files with 161 additions and 83 deletions

View File

@ -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) {

View File

@ -1,10 +1,10 @@
<form action="#">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable">
<label class="mdl-button mdl-js-button mdl-button--icon" for="sample6">
<label class="mdl-button mdl-js-button mdl-button--icon" for="text-search">
<i class="material-icons">search</i>
</label>
<div class="mdl-textfield__expandable-holder">
<input class="mdl-textfield__input" type="text" id="sample6">
<input class="mdl-textfield__input" type="text" style="color:black;" id="text-search" bg-panel>
<label class="mdl-textfield__label" for="sample-expandable">*[text]*</label>
</div>
</div>

View File

@ -1,41 +1,41 @@
<form ng-submit="$ctrl.submit()">
<vn-vertical full-height pad-large style="box-sizing: border-box;">
<vn-horizontal>
<vn-one>
<h3 style="margin-top: 0;">Datos básicos</h3>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Alias" name"alias" model="$ctrl.model.alias"></vn-textfield>
<vn-textfield label="NIF/CIF" name="fi" model="$ctrl.model.fi"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Razón social" name"socialName" model="$ctrl.model.name"></vn-textfield>
<vn-date-picker label="Fecha alta" name"dischargeDate" model="$ctrl.model.dischargeDate"></vn-date-picker>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Contacto" name="contact" model="$ctrl.model.contact"></vn-textfield>
<vn-textfield label="Teléfono" name="telefono" model="$ctrl.model.phone"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Calidad" name="quality" model="$ctrl.model.quality"></vn-textfield>
<vn-combo label="Comercial" name="salesPerson" model="$ctrl.model.salesPerson">
<option value="1">Comercial 1</option>
<option value="2">Comercial 2</option>
</vn-combo>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-submit class="colored" text="Guardar"></vn-submit>
</vn-one>
</vn-horizontal>
</vn-vertical>
<vn-vertical full-height pad-large style="box-sizing: border-box;">
<vn-horizontal>
<vn-one>
<h3 style="margin-top: 0;">Datos básicos</h3>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Alias" name"alias" model="$ctrl.model.alias"></vn-textfield>
<vn-textfield label="NIF/CIF" name="fi" model="$ctrl.model.fi"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Razón social" name"socialName" model="$ctrl.model.name"></vn-textfield>
<vn-date-picker label="Fecha alta" name"dischargeDate" model="$ctrl.model.dischargeDate"></vn-date-picker>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Contacto" name="contact" model="$ctrl.model.contact"></vn-textfield>
<vn-textfield label="Teléfono" name="telefono" model="$ctrl.model.phone"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Calidad" name="quality" model="$ctrl.model.quality"></vn-textfield>
<vn-combo label="Comercial" name="salesPerson" model="$ctrl.model.salesPerson">
<option value="1">Comercial 1</option>
<option value="2">Comercial 2</option>
</vn-combo>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-submit class="colored" text="Guardar"></vn-submit>
</vn-one>
</vn-horizontal>
</vn-vertical>
</form>

View File

@ -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';

View File

@ -0,0 +1,11 @@
<vn-vertical class="full-height">
<vn-topbar></vn-topbar>
<vn-horizontal class="full-height">
<vn-empty class="bg-content" style="width: 18em">
<vn-left-menu items="$ctrl.items" descriptor="$ctrl.descriptor"></vn-left-menu>
</vn-empty>
<vn-auto>
<vn-vertical ui-view></vn-vertical>
</vn-auto>
</vn-horizontal>
</vn-vertical>

View File

@ -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);

View File

@ -1,11 +1,42 @@
<form ng-submit="$ctrl.submit()">
<vn-vertical class="full-height">
<vn-topbar></vn-topbar>
<vn-horizontal class="full-height">
<vn-empty class="bg-content" style="width: 18em">
<vn-left-menu items="$ctrl.items" descriptor="$ctrl.descriptor"></vn-left-menu>
</vn-empty>
<vn-auto>
<vn-vertical ui-view></vn-vertical>
</vn-auto>
<vn-horizontal>
<vn-four></vn-four>
<vn-eight>
<vn-vertical>
<vn-horizontal>
<vn-one>
<vn-textfield label="Id Cliente" alias="id" model="$ctrl.model.id"></vn-textfield>
<vn-textfield label="NIF/CIF" alis="nif" model="$ctrl.model.fi"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Alias" alias="alias" model="$ctrl.model.alias"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Razon Social" alias="razon" model="$ctrl.model.name"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Población" alias="poblacion" model="$ctrl.model.city"></vn-textfield>
<vn-textfield label="Código Postal" alias="cp" model="$ctrl.model.cp"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<vn-textfield label="Email" alias="mail" model="$ctrl.model.email"></vn-textfield>
<vn-textfield label="Teléfono" alias="phone" model="$ctrl.model.phone"></vn-textfield>
</vn-one>
</vn-horizontal>
<vn-submit text="Buscar"></vn-submit>
</vn-vertical>
</vn-eight>
</vn-horizontal>
</vn-vertical>
</form>

View File

@ -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);

View File

@ -1,20 +1,30 @@
[{
url: '/client',
state: 'client',
template: '<vn-client-index full-height></vn-client-index>',
module: 'crud',
description: '',
image: '',
},{
url: '/basic-data',
state: 'client.basicdata',
template: '<vn-client-basic-data full-height></vn-client-basic-data>',
module: 'crud'
},{
url: '/addresses',
state: 'client.addresses',
template: '<vn-client-addresses full-height></vn-client-addresses>',
module: 'crud'
}]
[
{
url: '/clients',
state: 'clients',
template: '<vn-client-index full-height></vn-client-index>',
module: 'crud',
description: '',
image: '',
}
,{
url: '/client',
state: 'client',
template: '<vn-client-client full-height></vn-client-client>',
module: 'crud',
description: '',
image: '',
},{
url: '/basic-data',
state: 'client.basicdata',
template: '<vn-client-basic-data full-height></vn-client-basic-data>',
module: 'crud'
},{
url: '/addresses',
state: 'client.addresses',
template: '<vn-client-addresses full-height></vn-client-addresses>',
module: 'crud'
}
]