Guardar cliente
This commit is contained in:
parent
a930b15963
commit
c6d4d47dec
|
@ -9,6 +9,7 @@ directive.$inject =[resolveFactory.NAME];
|
|||
export function directive (resolve){
|
||||
return{
|
||||
require:'E',
|
||||
transclude: true,
|
||||
template: function(_,attr){
|
||||
return resolve.getTemplate(_NAME, attr);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<select class="mdl-textfield__input" class="*[className]*" name="*[name]*" ng-model="*[model]*" *[enabled]*>
|
||||
<select class="mdl-textfield__input" class="*[className]*" name="*[name]*" ng-model="*[model]*" *[enabled]* ng-transclude>
|
||||
</select>
|
||||
<label class="mdl-textfield__label">*[label]*</label>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input class="*[className]*" type="password" name="*[name]*" ng-model="*[model]*" *[enabled]*>
|
||||
<input class="*[className]*" type="text" name="*[name]*" ng-model="*[model]*" *[enabled]*>
|
||||
<label class="mdl-textfield__label">*[label]*</label>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<li>
|
||||
<a href="{{$ctrl.item.href}}" style="display: block; text-decoration: none; color: inherit; padding: .5em 1em;">
|
||||
<a href="{{$ctrl.item.href}}" style="display: block; text-decoration: none; color: inherit; padding: .5em 2em;">
|
||||
<i class="material-icons" style="float: right; margin-left: .4em;">keyboard_arrow_right</i>
|
||||
<i class="material-icons" style="vertical-align: middle; margin-right: .4em;">{{$ctrl.item.image}}</i>
|
||||
<span>{{$ctrl.item.text}}</span>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<form ng-submit="$ctrl.submit()">
|
||||
<vn-vertical full-height pad-large style="box-sizing: border-box;">
|
||||
<vn-horizontal>
|
||||
<vn-one>
|
||||
|
@ -6,31 +7,35 @@
|
|||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-one>
|
||||
<vn-textfield label="Alias" name"alias" model="customer.alias"></vn-textfield>
|
||||
<vn-textfield label="NIF/CIF" name="fi" model="customer.fi"></vn-textfield>
|
||||
<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="customer.socialName"></vn-textfield>
|
||||
<vn-date-picker label="Fecha alta" name"dischargeDate" model="customer.dischargeDate"></vn-date-picker>
|
||||
<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="customer.contact"></vn-textfield>
|
||||
<vn-textfield label="Teléfono" name="telefono" model="customer.phone"></vn-textfield>
|
||||
<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="customer.quality"></vn-textfield>
|
||||
<vn-combo label="Comercial" name="salesPerson" model="customer.salesPerson"></vn-combo>
|
||||
<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-button class="colored" text="Guardar"></vn-button>
|
||||
<vn-submit class="colored" text="Guardar"></vn-submit>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-vertical>
|
||||
</form>
|
|
@ -6,6 +6,16 @@ export const _NAME = 'customerBasicData';
|
|||
export const NAME = 'vnCustomerBasicData';
|
||||
|
||||
export const COMPONENT = {
|
||||
template: template
|
||||
template: template,
|
||||
controller: function ($http)
|
||||
{
|
||||
this.submit = function ()
|
||||
{
|
||||
$http.post('/client/api/Clients', this.model).then (
|
||||
() => console.log ('OK'),
|
||||
() => console.log ('ER')
|
||||
);
|
||||
};
|
||||
},
|
||||
};
|
||||
module.component(NAME, COMPONENT);
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
node_modules
|
|
@ -1 +0,0 @@
|
|||
export * from './src/app'
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"name": "@salix/app",
|
||||
"version": "0.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://git.verdnatura.es:/salix"
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
import {bootstrap} from './bootstrap';
|
||||
import * as spliting from './spliting';
|
||||
import * as routes from './configroutes';
|
||||
|
||||
import padding from './styles/layout.css'
|
||||
import margin from './styles/margin.scss'
|
||||
import layout from './styles/padding.scss'
|
||||
import background from './styles/background.scss'
|
||||
|
||||
bootstrap();
|
|
@ -1,17 +0,0 @@
|
|||
import {ng} from 'vendor';
|
||||
import {NAME} from 'core';
|
||||
|
||||
export const bootstrap = () => {
|
||||
const selector = 'selector'
|
||||
|
||||
let _script = document.currentScript || (() => {
|
||||
let scripts = document.getElementsByTagName('script');
|
||||
return scripts[scripts.length - 1];
|
||||
})();
|
||||
|
||||
let _element = _script && document.querySelector(_script.getAttribute(selector));
|
||||
if (!_element) {
|
||||
throw new Error("element is not defined");
|
||||
}
|
||||
ng.bootstrap(_element, [NAME]);
|
||||
};
|
|
@ -1,34 +0,0 @@
|
|||
import * as core from 'core';
|
||||
import * as spliting from './spliting';
|
||||
import * as deps from './spliting/deps.json';
|
||||
|
||||
function loader(route) {
|
||||
return function ($ocLazyLoad, $q) {
|
||||
return $q((resolve) => {
|
||||
core.splitingRegister.execute(route.module).then(function (dependencies) {
|
||||
var array = dependencies.map((item) => { return { name: item } });
|
||||
resolve($ocLazyLoad.load(array));
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function config($stateProvider, $urlRouterProvider) {
|
||||
|
||||
core.splitingRegister.registerGraph(deps);
|
||||
|
||||
$urlRouterProvider.otherwise('/client/index');
|
||||
|
||||
for (var file in routes)
|
||||
routes[file].forEach(function (route) {
|
||||
$stateProvider.state(route.state, {
|
||||
url: route.url,
|
||||
template: route.template,
|
||||
resolve: {
|
||||
loader: loader(route)
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
core.module.config(config);
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"name": "@salix/core",
|
||||
"version": "0.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://git.verdnatura.es:/salix"
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"app": ["crud"],
|
||||
"crud": []
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
import * as core from 'core';
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
export const $module = () => {
|
||||
return new Promise(resolve => {
|
||||
require.ensure([], () => {
|
||||
require('$module');
|
||||
resolve('$module');
|
||||
}, '$module');
|
||||
});
|
||||
};
|
||||
|
||||
core.splitingRegister.register('$module', $module);
|
|
@ -1,27 +0,0 @@
|
|||
@import "colors";
|
||||
|
||||
$bg-main: $color-green;
|
||||
$bg-minor: $color-orange;
|
||||
$bg-content: $color-light-grey;
|
||||
$bg-panel: $color-white;
|
||||
$bg-dark-bar: $color-black;
|
||||
$bg-dark-menu: $color-dark-grey;
|
||||
|
||||
html [bg-main], .bg-main {
|
||||
background-color: $bg-main;
|
||||
}
|
||||
html [bg-minor], .bg-minor {
|
||||
background-color: $bg-minor;
|
||||
}
|
||||
html [bg-content], .bg-content {
|
||||
background-color: $bg-content;
|
||||
}
|
||||
html [bg-panel], .bg-panel {
|
||||
background-color: $bg-panel;
|
||||
}
|
||||
html [bg-dark-bar], .bg-dark-bar {
|
||||
background-color: $bg-dark-bar;
|
||||
}
|
||||
html [bg-dark-menu], .bg-dark-menu {
|
||||
background-color: darken($bg-dark-menu, 35%);
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
$color-green: rgb(139,195,74);
|
||||
$color-orange: rgb(255,171,64);
|
||||
$color-dark-grey: #424242;
|
||||
$color-light-grey: gray;
|
||||
$color-white: white;
|
||||
$color-black: black;
|
|
@ -1,24 +0,0 @@
|
|||
@font-face {
|
||||
font-family: roboto-italic;
|
||||
src: url(./fonts/Roboto-Italic.ttf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: roboto-thin;
|
||||
src: url(./fonts/Roboto-Thin.ttf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: roboto-regular;
|
||||
src: url(./fonts/Roboto-Regular.ttf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: roboto-condensed-italic;
|
||||
src: url(./fonts/Roboto-CondensedItalic.ttf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: roboto-bold;
|
||||
src: url(./fonts/Roboto-Bold.ttf);
|
||||
}
|
||||
@font-face {
|
||||
font-family: roboto-bold-condensed;
|
||||
src: url(./fonts/Roboto-BoldCondensed.ttf);
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
html [full-height], .full-height {
|
||||
height: 100%;
|
||||
}
|
||||
html [self-scroll], .self-scroll {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* Horizontal & vertical */
|
||||
|
||||
html [vn-horizontal], vn-horizontal, .vn-horizontal,
|
||||
html [vn-vertical], vn-vertical, .vn-vertical {
|
||||
display: flex;
|
||||
}
|
||||
html [vn-horizontal], vn-horizontal, .vn-horizontal {
|
||||
flex-direction: row;
|
||||
}
|
||||
vn-horizontal [reverse] {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
html [vn-vertical], vn-vertical, .vn-vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
vn-vertical [reverse] {
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
html [wrap] {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
html [wrap-reverse] {
|
||||
flex-wrap: wrap-reverse;
|
||||
}
|
||||
html [scrollable] {
|
||||
min-height: 1px;
|
||||
flex: 1;
|
||||
flex-basis: 0.000000001px;
|
||||
}
|
||||
|
||||
/* Horizontal & vertical childs */
|
||||
|
||||
html [vn-auto],
|
||||
html [vn-none],
|
||||
html [vn-one],
|
||||
html [vn-two],
|
||||
html [vn-three],
|
||||
html [vn-four],
|
||||
html [vn-five],
|
||||
html [vn-six],
|
||||
html [vn-seven],
|
||||
html [vn-eight],
|
||||
html [vn-nine],
|
||||
html [vn-ten],
|
||||
html [vn-eleven],
|
||||
html [vn-twelve]{
|
||||
flex-basis: 0.000000001px;
|
||||
}
|
||||
html [vn-auto], vn-auto, .vn-auto {
|
||||
flex: 1;
|
||||
flex-basis: auto;
|
||||
}
|
||||
html [vn-empty], vn-empty, .vn-empty {
|
||||
display: block;
|
||||
}
|
||||
html [vn-none], vn-none, .vn-none {
|
||||
flex: 1;
|
||||
flex: none;
|
||||
}
|
||||
html [vn-one], vn-one, .vn-one {
|
||||
flex: 1;
|
||||
}
|
||||
html [vn-two], vn-two, .vn-two {
|
||||
flex: 2;
|
||||
}
|
||||
html [vn-three], vn-three, .vn-three {
|
||||
flex: 3;
|
||||
}
|
||||
html [vn-four], vn-four, .vn-four {
|
||||
flex: 4;
|
||||
}
|
||||
html [vn-five], vn-five, .vn-five {
|
||||
flex: 5;
|
||||
}
|
||||
html [vn-six], vn-six, .vn-six {
|
||||
flex: 6;
|
||||
}
|
||||
html [vn-seven], vn-seven, .vn-seven {
|
||||
flex: 7;
|
||||
}
|
||||
html [vn-eight], vn-eight, .vn-eight {
|
||||
flex: 8;
|
||||
}
|
||||
html [vn-nine], vn-nine, .vn-nine {
|
||||
flex: 9;
|
||||
}
|
||||
html [vn-ten], vn-ten, .vn-ten {
|
||||
flex: 10;
|
||||
}
|
||||
html [vn-eleven], vn-eleven, .vn-eleven {
|
||||
flex: 11;
|
||||
}
|
||||
html [vn-twelve], vn-twelve, .vn-twelve {
|
||||
flex: 12;
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
$margin-none: 0;
|
||||
|
||||
/* Small */
|
||||
|
||||
$margin-small: 8px;
|
||||
$margin-small-top: 8px;
|
||||
$margin-small-left: 8px;
|
||||
$margin-small-right: 8px;
|
||||
$margin-small-bottom: 8px;
|
||||
|
||||
/* Medium */
|
||||
|
||||
$margin-medium: 16px;
|
||||
$margin-medium-top: 16px;
|
||||
$margin-medium-left: 16px;
|
||||
$margin-medium-right: 16px;
|
||||
$margin-medium-bottom: 16px;
|
||||
|
||||
/* Large */
|
||||
|
||||
$margin-large: 32px;
|
||||
$margin-large-top: 32px;
|
||||
$margin-large-left: 32px;
|
||||
$margin-large-right: 32px;
|
||||
$margin-large-bottom: 32px;
|
||||
|
||||
/* None */
|
||||
|
||||
html [margin-none], .margin-none {
|
||||
margin: $margin-none;
|
||||
}
|
||||
|
||||
/* Small */
|
||||
|
||||
html [margin-small], .margin-small {
|
||||
margin: $margin-small;
|
||||
}
|
||||
html [margin-small-top], .margin-small-top {
|
||||
margin-top: $margin-small-top;
|
||||
}
|
||||
html [margin-small-left], .margin-small-left {
|
||||
margin-left: $margin-small-left;
|
||||
}
|
||||
html [margin-small-right], .margin-small-right {
|
||||
margin-right: $margin-small-right;
|
||||
}
|
||||
html [margin-small-bottom], .margin-small-bottom {
|
||||
margin-bottom: $margin-small-bottom;
|
||||
}
|
||||
|
||||
/* Medium */
|
||||
|
||||
html [margin-medium], .margin-medium {
|
||||
margin: $margin-medium;
|
||||
}
|
||||
html [margin-medium-top], .margin-medium-top {
|
||||
margin-top: $margin-medium-top;
|
||||
}
|
||||
html [margin-medium-left], .margin-medium-left {
|
||||
margin-left: $margin-medium-left;
|
||||
}
|
||||
html [margin-medium-right], .margin-medium-right {
|
||||
margin-right: $margin-medium-right;
|
||||
}
|
||||
html [margin-medium-bottom], .margin-medium-bottom {
|
||||
margin-bottom: $margin-medium-bottom;
|
||||
}
|
||||
|
||||
/* Large */
|
||||
|
||||
html [margin-large], .margin-large {
|
||||
margin: $margin-large;
|
||||
}
|
||||
html [margin-large-top], .margin-large-top {
|
||||
margin-top: $margin-large-top;
|
||||
}
|
||||
html [margin-large-left], .margin-large-left {
|
||||
margin-left: $margin-large-left;
|
||||
}
|
||||
html [margin-large-right], .margin-large-right {
|
||||
margin-right: $margin-large-right;
|
||||
}
|
||||
html [margin-large-bottom], .margin-large-bottom {
|
||||
margin-bottom: $margin-large-bottom;
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
$pad-none: 0;
|
||||
|
||||
/* Small */
|
||||
|
||||
$pad-small: 8px;
|
||||
$pad-small-top: 8px;
|
||||
$pad-small-left: 8px;
|
||||
$pad-small-right: 8px;
|
||||
$pad-small-bottom: 8px;
|
||||
|
||||
/* Medium */
|
||||
|
||||
$pad-medium: 16px;
|
||||
$pad-medium-top: 16px;
|
||||
$pad-medium-left: 16px;
|
||||
$pad-medium-right: 16px;
|
||||
$pad-medium-bottom: 16px;
|
||||
|
||||
/* Large */
|
||||
|
||||
$pad-large: 32px;
|
||||
$pad-large-top: 32px;
|
||||
$pad-large-left: 32px;
|
||||
$pad-large-right: 32px;
|
||||
$pad-large-bottom: 32px;
|
||||
|
||||
/* None */
|
||||
|
||||
html [pad-none], .pad-none {
|
||||
padding: $pad-none;
|
||||
}
|
||||
|
||||
/* Small */
|
||||
|
||||
html [pad-small], .pad-small {
|
||||
padding: $pad-small;
|
||||
}
|
||||
html [pad-small-top], .pad-small-top {
|
||||
padding-top: $pad-small-top;
|
||||
}
|
||||
html [pad-small-left], .pad-small-left {
|
||||
padding-left: $pad-small-left;
|
||||
}
|
||||
html [pad-small-right], .pad-small-right {
|
||||
padding-right: $pad-small-right;
|
||||
}
|
||||
html [pad-small-bottom], .pad-small-bottom {
|
||||
padding-bottom: $pad-small-bottom;
|
||||
}
|
||||
|
||||
/* Medium */
|
||||
|
||||
html [pad-medium], .pad-medium {
|
||||
padding: $pad-medium;
|
||||
}
|
||||
html [pad-medium-top], .pad-medium-top {
|
||||
padding-top: $pad-medium-top;
|
||||
}
|
||||
html [pad-medium-left], .pad-medium-left {
|
||||
padding-left: $pad-medium-left;
|
||||
}
|
||||
html [pad-medium-right], .pad-medium-right {
|
||||
padding-right: $pad-medium-right;
|
||||
}
|
||||
html [pad-medium-bottom], .pad-medium-bottom {
|
||||
padding-bottom: $pad-medium-bottom;
|
||||
}
|
||||
|
||||
/* Large */
|
||||
|
||||
html [pad-large], .pad-large {
|
||||
padding: $pad-large;
|
||||
}
|
||||
html [pad-large-top], .pad-medium-large {
|
||||
padding-top: $pad-large-top;
|
||||
}
|
||||
html [pad-large-left], .pad-large-left {
|
||||
padding-left: $pad-large-left;
|
||||
}
|
||||
html [pad-large-right], .pad-large-right {
|
||||
padding-right: $pad-large-right;
|
||||
}
|
||||
html [pad-large-bottom], .pad-large-bottom {
|
||||
padding-bottom: $pad-large-bottom;
|
||||
}
|
Loading…
Reference in New Issue