parent
440e9705d2
commit
6eca92afcc
|
@ -1,6 +1,6 @@
|
|||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="search"></vn-textfield>
|
||||
<i class="material-icons" id="down_menu">keyboard_arrow_down</i>
|
||||
<vn-icon-button icon="search"></vn-icon-button>
|
||||
<i class="material-icons">keyboard_arrow_down</i>
|
||||
<vn-icon-button icon="search" margin-small-top></vn-icon-button>
|
||||
</vn-horizontal>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<button type="*[typeName]*" class="mdl-button mdl-js-button mdl-button--icon *[className]*">
|
||||
<i class="material-icons">*[icon]*</i>
|
||||
<button type="*[typeName]*" class="mdl-button mdl-js-button mdl-button--raised *[className]*">
|
||||
<i class="material-icons">*[icon]*</i>*[label]*
|
||||
</button>
|
|
@ -9,6 +9,7 @@ export function factory() {
|
|||
enabled: 'true',
|
||||
typeName: 'button',
|
||||
icon: '',
|
||||
label: '',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,16 @@
|
|||
font-weight: bolder;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.mdl-button--icon {
|
||||
background-color: #ff9400;
|
||||
font-weight: bolder;
|
||||
color: white;
|
||||
}
|
||||
.mdl-button--icon:hover {
|
||||
background-color: #ffa410;
|
||||
}
|
||||
|
||||
.mdl-button--raised:hover {
|
||||
background-color: #ffa410;
|
||||
}
|
|
@ -1,23 +1,21 @@
|
|||
<form ng-submit="basicData.submit()" pad-large>
|
||||
<vn-title>Datos básicos</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Nombre" name="name" entity="client"></vn-textfield>
|
||||
<vn-textfield vn-one label="NIF/CIF" name="fi" entity="client"></vn-textfield>
|
||||
<vn-textfield vn-one label="Nombre" model="basicData.client.name" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="NIF/CIF" model="basicData.client.fi" entity="basicData"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield autofocus vn-one label="Razón social" field="socialName" entity="client"></vn-textfield>
|
||||
<vn-date-picker vn-one label="Fecha alta" field="dischargeDate" entity="client"></vn-date-picker>
|
||||
<vn-textfield autofocus vn-one label="Razón social" model="basicData.client.socialName" entity="basicData"></vn-textfield>
|
||||
<vn-date-picker vn-one label="Fecha alta" model="basicData.client.dischargeDate" entity="basicData"></vn-date-picker>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<!--<vn-textfield vn-one label="Contacto" name="contact" model="basicData.client"></vn-textfield>-->
|
||||
<vn-textfield vn-one label="Teléfono" name="telefono" entity="client"></vn-textfield>
|
||||
<vn-textfield vn-one label="Fax" name="fax" entity="client"></vn-textfield>
|
||||
<vn-textfield vn-one label="Email" name="email" entity="client"></vn-textfield>
|
||||
<vn-textfield vn-one label="Teléfono" model="basicData.client.telefono" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="Fax" model="basicData.client.fax" entity="basicData"></vn-textfield>
|
||||
<vn-textfield vn-one label="Email" fiemodelld="basicData.client.email" entity="basicData"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-combo vn-one label="Comercial" name="salesPerson" entity="client">
|
||||
<option value="1">Comercial 1</option>
|
||||
<option value="2">Comercial 2</option>
|
||||
<vn-combo vn-one label="Comercial" model="basicData.client.salesPerson" entity="basicData">
|
||||
<option ng-repeat="p in basicData.sales" value="{{p.id}}">{{p.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
|
|
|
@ -9,14 +9,20 @@ export const COMPONENT = {
|
|||
client: '<'
|
||||
},
|
||||
controller: function($http) {
|
||||
$http.get('/client/api/SalesPeople').then(
|
||||
json => {
|
||||
this.sales = json.data;
|
||||
console.log(this.sales);
|
||||
},
|
||||
json => console.error(json.data.error.message)
|
||||
);
|
||||
this.submit = function() {
|
||||
$http.post('/client/api/Clients', this.model).then(
|
||||
$http.put('/client/api/Clients', this.client).then(
|
||||
json => console.log(json.statusText),
|
||||
json => console.error(json.data.error.message)
|
||||
);
|
||||
};
|
||||
},
|
||||
controllerAs: 'client'
|
||||
}
|
||||
};
|
||||
COMPONENT.controller.$inject = ['$http'];
|
||||
module.component(NAME, COMPONENT);
|
||||
|
|
|
@ -17,4 +17,6 @@ export {NAME as CLIENT_NOTES,
|
|||
export {NAME as CLIENT_SEARCH_PANEL,
|
||||
COMPONENT as CLIENT_SEARCH_PANEL_COMPONENT} from './search-panel/search-panel';
|
||||
export {NAME as CLIENT_ITEM,
|
||||
COMPONENT as CLIENT_ITEM_COMPONENT} from './index/item-client';
|
||||
COMPONENT as CLIENT_ITEM_COMPONENT} from './index/item-client';
|
||||
export {NAME as CLIENT_CREATE,
|
||||
COMPONENT as CLIENT_CREATE_COMPONENT} from './create/index';
|
|
@ -0,0 +1,16 @@
|
|||
<form ng-submit="create.submit()" pad-large>
|
||||
<vn-title>Crear Cliente</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Nombre" field="name" entity="create"></vn-textfield>
|
||||
<vn-textfield vn-one label="NIF/CIF" field="fi" entity="create"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield autofocus vn-one label="Razón social" field="socialName" entity="create"></vn-textfield>
|
||||
<vn-one></vn-one>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-one>
|
||||
<vn-submit label="Crear" id="create"></vn-submit>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</form>
|
|
@ -0,0 +1,18 @@
|
|||
import template from './index.html';
|
||||
import {module} from '../../module';
|
||||
|
||||
export const NAME = "vnClientCreate";
|
||||
export const COMPONENT = {
|
||||
template: template,
|
||||
controllerAs: "create",
|
||||
controller: function($http, $state){
|
||||
this.submit = function(){
|
||||
$http.post('/client/api/Clients', this.model).then(
|
||||
json => $state.go('clientCard.basicData',{id: json.data.id}),
|
||||
json => console.error(json.data.error.message)
|
||||
);
|
||||
};
|
||||
}
|
||||
};
|
||||
COMPONENT.controller.$inject = ["$http", "$state"];
|
||||
module.component(NAME, COMPONENT);
|
|
@ -1,16 +1,23 @@
|
|||
<vn-vertical class="full-height">
|
||||
<vn-topbar></vn-topbar>
|
||||
<vn-horizontal>
|
||||
<vn-four></vn-four>
|
||||
<vn-searchbar vn-four id="searchbar"></vn-searchbar>
|
||||
<vn-search-panel ></vn-search-panel>
|
||||
<vn-four></vn-four>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-three></vn-three>
|
||||
<vn-vertical>
|
||||
<vn-item-client ng-repeat="client in search.clients" client="client" vn-six></vn-item-client>
|
||||
</vn-vertical>
|
||||
<vn-three></vn-three>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
<vn-topbar></vn-topbar>
|
||||
<form ng-submit="search.submit()" pad-large>
|
||||
<vn-horizontal>
|
||||
<vn-four></vn-four>
|
||||
<vn-searchbar vn-four></vn-searchbar>
|
||||
<vn-four></vn-four>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-four></vn-four>
|
||||
<a vn-two ui-sref="create"><vn-button label="Create client"></vn-button></a>
|
||||
<vn-submit vn-two label="Buscar"></vn-submit>
|
||||
<vn-four></vn-four>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-three></vn-three>
|
||||
<vn-vertical>
|
||||
<vn-item-client ng-repeat="client in search.clients" client="client" vn-six></vn-item-client>
|
||||
</vn-vertical>
|
||||
<vn-three></vn-three>
|
||||
</vn-horizontal>
|
||||
</form>
|
||||
</vn-vertical>
|
||||
|
|
|
@ -15,12 +15,13 @@ export const COMPONENT = {
|
|||
json => console.error(json.data.error.message)
|
||||
);
|
||||
|
||||
|
||||
this.submit = function() {
|
||||
var query = {where: this.model, fields: {id: true}};
|
||||
var query = {where: model};
|
||||
var self = this;
|
||||
$http.get(`/client/api/Clients/findOne?filter=${JSON.stringify(query)}`).then(
|
||||
function(response) {
|
||||
console.log(response);
|
||||
self.clients = [];
|
||||
self.clients.push(response.data);
|
||||
},
|
||||
function(response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div>{{itemClient.client.phone}}, {{itemClient.client.contact}}</div>
|
||||
</vn-auto>
|
||||
<vn-empty>
|
||||
<a ui-sref="clientCard.basicData({ id: {{itemClient.client.id}} })"><vn-icon-button icon="edit"></vn-icon-button></a>
|
||||
<a ui-sref="clientCard.basicData({ id: {{itemClient.client.id}} })"><i class="material-icons">edit</i></a>
|
||||
</vn-empty>
|
||||
</vn-horizontal>
|
||||
</vn-auto>
|
|
@ -1,45 +1,58 @@
|
|||
{
|
||||
module: "crud",
|
||||
routes: [{
|
||||
url: "/clients",
|
||||
state: "clients",
|
||||
component: "vn-client-index"
|
||||
},{
|
||||
url: "/clients/:id",
|
||||
state: "clientCard",
|
||||
component: "vn-client-card"
|
||||
},{
|
||||
url: "/basic-data",
|
||||
state: "clientCard.basicData",
|
||||
component: "vn-client-basic-data",
|
||||
params: {
|
||||
client: "card.client"
|
||||
routes: [
|
||||
{
|
||||
url: "/clients",
|
||||
state: "clients",
|
||||
component: "vn-client-index"
|
||||
},
|
||||
description: "Datos básicos",
|
||||
icon: "person"
|
||||
},{
|
||||
url: "/fiscal-data",
|
||||
state: "clientCard.fiscalData",
|
||||
component: "vn-client-fiscal-data",
|
||||
description: "Datos facturación",
|
||||
icon: "assignment"
|
||||
},{
|
||||
url: "/addresses",
|
||||
state: "clientCard.addresses",
|
||||
component: "vn-client-addresses",
|
||||
description: "Consignatarios",
|
||||
icon: "local_shipping"
|
||||
},{
|
||||
url: "/web-access",
|
||||
state: "clientCard.webAccess",
|
||||
component: "vn-client-web-access",
|
||||
description: "Acceso web",
|
||||
icon: "language"
|
||||
},{
|
||||
url: "/notes",
|
||||
state: "clientCard.notes",
|
||||
component: "vn-client-notes",
|
||||
description: "Notas",
|
||||
icon: "insert_drive_file"
|
||||
}]
|
||||
{
|
||||
url: "/clients/:id",
|
||||
state: "clientCard",
|
||||
component: "vn-client-card"
|
||||
},
|
||||
{
|
||||
url: "/basic-data",
|
||||
state: "clientCard.basicData",
|
||||
component: "vn-client-basic-data",
|
||||
params: {
|
||||
client: "card.client"
|
||||
},
|
||||
description: "Datos básicos",
|
||||
icon: "person"
|
||||
}
|
||||
,{
|
||||
url: "/fiscal-data",
|
||||
state: "clientCard.fiscalData",
|
||||
component: "vn-client-fiscal-data",
|
||||
description: "Datos facturación",
|
||||
icon: "assignment"
|
||||
},
|
||||
{
|
||||
url: "/addresses",
|
||||
state: "clientCard.addresses",
|
||||
component: "vn-client-addresses",
|
||||
description: "Consignatarios",
|
||||
icon: "local_shipping"
|
||||
},
|
||||
{
|
||||
url: "/web-access",
|
||||
state: "clientCard.webAccess",
|
||||
component: "vn-client-web-access",
|
||||
description: "Acceso web",
|
||||
icon: "language"
|
||||
},
|
||||
{
|
||||
url: "/notes",
|
||||
state: "clientCard.notes",
|
||||
component: "vn-client-notes",
|
||||
description: "Notas",
|
||||
icon: "insert_drive_file"
|
||||
},
|
||||
{
|
||||
url: "/create",
|
||||
state: "create",
|
||||
component: "vn-client-create",
|
||||
}
|
||||
]
|
||||
}
|
18
db.json
18
db.json
|
@ -2,7 +2,9 @@
|
|||
"ids": {
|
||||
"User": 2,
|
||||
"AccessToken": 2,
|
||||
"Client": 3
|
||||
"Client": 15,
|
||||
"PaymentMethod": 4,
|
||||
"SalesPerson": 4
|
||||
},
|
||||
"models": {
|
||||
"User": {
|
||||
|
@ -12,8 +14,18 @@
|
|||
"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue": "{\"id\":\"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue\",\"ttl\":1209600,\"created\":\"2016-11-21T11:06:11.113Z\",\"userId\":1}"
|
||||
},
|
||||
"Client": {
|
||||
"1": "{\"name\":\"Cliente1 SL\",\"salesPerson\":1,\"fi\":\"123456789\",\"registerDate\":\"29/11/2016\",\"contact\":\"a@a.com\",\"phone\":\"123456789\",\"quality\":\"1\",\"id\":1}",
|
||||
"2": "{\"name\":\"Cliente2 SL\",\"salesPerson\":1,\"fi\":\"123456788\",\"contact\":\"b@b.com\",\"phone\":\"222222222\",\"quality\":\"1\",\"id\":2}"
|
||||
"12": "{\"name\":\"Cliente 2\",\"id\":12,\"fi\":\"1111111111\",\"salesPerson\":\"2\"}",
|
||||
"14": "{\"name\":\"cliente 1\",\"id\":14}"
|
||||
},
|
||||
"PaymentMethod": {
|
||||
"1": "{\"name\":\"Tarjeta\",\"id\":1}",
|
||||
"2": "{\"name\":\"Giro Bancario\",\"id\":2}",
|
||||
"3": "{\"name\":\"Transferencia\",\"id\":3}"
|
||||
},
|
||||
"SalesPerson": {
|
||||
"1": "{\"id\":1,\"name\":\"Jesus Brocal\"}",
|
||||
"2": "{\"name\":\"Juan Carlos Lorenzo\",\"id\":2}",
|
||||
"3": "{\"name\":\"Carlos Zambrano\",\"id\":3}"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,9 +35,7 @@
|
|||
},
|
||||
"active": {
|
||||
"type": "boolean"
|
||||
}
|
||||
|
||||
/*
|
||||
},
|
||||
"credit": {
|
||||
"type": "Number"
|
||||
},
|
||||
|
@ -61,14 +59,18 @@
|
|||
"invoiceByEmail": {
|
||||
"type": "boolean",
|
||||
"description": "Send invoices by email"
|
||||
},
|
||||
"relations": {
|
||||
"salesPerson": {
|
||||
"type": "belongsTo",
|
||||
"model": "SalesPerson",
|
||||
"foreignKey": "salePersonId"
|
||||
},
|
||||
"paymentMethod":{
|
||||
"type": "belongsTo",
|
||||
"model": "PaymentMethod",
|
||||
"foreingKey": "payId"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
"salesPerson": {
|
||||
"type": "Number",
|
||||
"required": "true"
|
||||
},*/
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "PaymentMethod",
|
||||
"base": "PersistedModel",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"required": "true"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "SalesPerson",
|
||||
"base": "PersistedModel",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"required": "true"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,6 +36,14 @@
|
|||
"dataSource": "db",
|
||||
"public": true
|
||||
},
|
||||
"PaymentMethod": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
},
|
||||
"SalesPerson": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
},
|
||||
"Address": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
|
|
Loading…
Reference in New Issue