Merge
This commit is contained in:
commit
02f8363c69
|
@ -1,7 +1,7 @@
|
|||
<li>
|
||||
<a ui-sref="{{menu.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;">{{menu.item.icon}}</i>
|
||||
<span>{{menu.item.description}}</span>
|
||||
</a>
|
||||
<a ui-sref="{{menu.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;">{{menu.item.icon}}</i>
|
||||
<span>{{menu.item.description}}</span>
|
||||
</a>
|
||||
</li>
|
|
@ -9,7 +9,7 @@ export const NAME = util.getName(_NAME);
|
|||
directive.$inject = [resolveFactory.NAME];
|
||||
export function directive(resolve) {
|
||||
return {
|
||||
require: 'E',
|
||||
restrict: 'E',
|
||||
transclude: true,
|
||||
template: function(_, attr) {
|
||||
return resolve.getTemplate(_NAME, attr);
|
||||
|
|
|
@ -48,6 +48,8 @@ export {NAME as CARD, directive as CardDirective} from './card/card';
|
|||
export {NAME as CARD_MDL, factory as cardMdl} from './card/card.mdl';
|
||||
export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch';
|
||||
export {NAME as SWITCH_MDL, factory as switchdMdl} from './switch/switch.mdl';
|
||||
export {NAME as FLOATBUTTON, directive as FloatButtonDirective} from './floatbutton/floatbutton';
|
||||
export {NAME as FLOATBUTTON_MDL, factory as floatButtondMdl} from './floatbutton/floatbutton.mdl';
|
||||
export {directive as Icon} from './icon/icon';
|
||||
export {factory as IconMdl} from './icon/icon.mdl';
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import {module as _module} from '../module';
|
||||
import * as resolveFactory from '../resolveDefaultComponents';
|
||||
import * as util from '../util';
|
||||
|
||||
const _NAME = 'floatButton';
|
||||
export const NAME = util.getName(_NAME);
|
||||
|
||||
directive.$inject = [resolveFactory.NAME];
|
||||
export function directive(resolve) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: function(_, attr) {
|
||||
return resolve.getTemplate(_NAME, attr);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_module.directive(NAME, directive);
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<button class="*[className]*">
|
||||
<vn-icon icon="*[icon]*"></vn-icon>
|
||||
</button>
|
|
@ -0,0 +1,20 @@
|
|||
import {module as _module} from '../module';
|
||||
import * as util from '../util';
|
||||
import * as constant from '../constants';
|
||||
import template from './floatbutton.mdl.html';
|
||||
|
||||
const _NAME = 'floatButton';
|
||||
const DEFAULT_CLASS = 'mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored';
|
||||
|
||||
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
|
||||
|
||||
export function factory() {
|
||||
return {
|
||||
template: template,
|
||||
default: {
|
||||
className: DEFAULT_CLASS
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_module.factory(NAME, factory);
|
|
@ -1 +1 @@
|
|||
<i class="material-icons">*[icon]*</i>
|
||||
<i display-block class="material-icons">*[icon]*</i>
|
||||
|
|
|
@ -18,6 +18,11 @@
|
|||
.mdl-button--colored:active {
|
||||
background-color: #ffa410 !important;
|
||||
}
|
||||
.mdl-button--colored:hover {
|
||||
.mdl-button--colored:hover,
|
||||
.mdl-button--raised:hover {
|
||||
background-color: #ffa410 !important;
|
||||
}
|
||||
.mdl-button--fab{
|
||||
color: white !important;
|
||||
background-color: #ff9400 !important;
|
||||
}
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
<form name="form" ng-submit="form.$valid && addressData.submit()" pad-medium>
|
||||
<vn-card >
|
||||
<vn-vertical pad-large>
|
||||
<vn-title>Consignatario</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee" focus></vn-textfield>
|
||||
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
|
||||
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
|
||||
<vn-combo vn-one label="Provincia" field="addressData.address.province">
|
||||
<option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-combo vn-one label="Agencia" field="addressData.address.agency">
|
||||
<option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
<vn-empty>
|
||||
<vn-card >
|
||||
<vn-vertical pad-large>
|
||||
<vn-title>Consignatario</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee" focus></vn-textfield>
|
||||
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
|
||||
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
|
||||
<vn-combo vn-one label="Provincia" field="addressData.address.province">
|
||||
<option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-combo vn-one label="Agencia" field="addressData.address.agency">
|
||||
<option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-empty margin-small-top >
|
||||
<vn-submit label="Guardar" id="save"></vn-submit>
|
||||
</vn-empty>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
</form>
|
|
@ -5,7 +5,7 @@ export const NAME = 'vnClientAddressesDataCreate';
|
|||
export const COMPONENT = {
|
||||
template: template,
|
||||
controllerAs: 'addressData',
|
||||
controller: function($http)
|
||||
controller: function($http, $state)
|
||||
{
|
||||
this.address = {};
|
||||
$http.get('/client/api/Agencies').then(
|
||||
|
@ -16,10 +16,12 @@ export const COMPONENT = {
|
|||
);
|
||||
|
||||
this.submit = function(){
|
||||
$http.post('/client/api/Addresses', this.address);
|
||||
}
|
||||
}
|
||||
$http.post('/client/api/Addresses', this.address).then(
|
||||
json => $state.go('clientCard.addresses')
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
COMPONENT.controller.$inject = ['$http'];
|
||||
COMPONENT.controller.$inject = ['$http', '$state'];
|
||||
module.component(NAME, COMPONENT);
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
<form name="form" ng-submit="form.$valid && addressData.submit()" pad-medium>
|
||||
<vn-card>
|
||||
<vn-vertical pad-large>
|
||||
<vn-title>Consignatario</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Activo" field="addressData.address.enabled"></vn-check>
|
||||
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee"></vn-textfield>
|
||||
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
|
||||
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
|
||||
<vn-combo vn-one label="Provincia" field="addressData.address.province">
|
||||
<option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-combo vn-one label="Agencia" field="addressData.address.agency">
|
||||
<option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
<vn-empty margin-large-top>
|
||||
<vn-card>
|
||||
<vn-vertical pad-large>
|
||||
<vn-title>Consignatario</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Activo" field="addressData.address.enabled"></vn-check>
|
||||
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee"></vn-textfield>
|
||||
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
|
||||
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
|
||||
<vn-combo vn-one label="Provincia" field="addressData.address.province">
|
||||
<option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-combo vn-one label="Agencia" field="addressData.address.agency">
|
||||
<option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-empty margin-small-top>
|
||||
<vn-submit label="Guardar" id="save"></vn-submit>
|
||||
</vn-empty>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
</form>
|
|
@ -1,27 +1,25 @@
|
|||
<vn-vertical pad-medium>
|
||||
<vn-card>
|
||||
<vn-vertical pad-large>
|
||||
<vn-horizontal>
|
||||
<vn-title vn-one>Consignatario</vn-title>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal ng-repeat="i in address.addresses" class="pad-medium-top" style="align-items: center;">
|
||||
<vn-auto style="border-radius: .5em;" class="pad-small border-solid" ng-class="{'bg-dark-item': i.default,'bg-opacity-item': !i.enabled && !i.default}">
|
||||
<vn-horizontal style="align-items: center;">
|
||||
<vn-auto>
|
||||
<div><b>{{i.consignee}}</b></div>
|
||||
<div>{{i.street}}</div>
|
||||
<div>{{i.city}}, {{i.province}}</div>
|
||||
<div>{{i.phone}}, {{i.mobile}}</div>
|
||||
</vn-auto>
|
||||
<a vn-empty ui-sref="clientCard.addressDataEdit({ addressId: {{i.id}} })"><vn-icon-button icon="edit"></vn-icon-button></a>
|
||||
<vn-card>
|
||||
<vn-vertical pad-large>
|
||||
<vn-horizontal>
|
||||
<vn-title vn-one>Consignatario</vn-title>
|
||||
</vn-horizontal>
|
||||
</vn-auto>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal margin-large-top>
|
||||
<vn-one>
|
||||
<a ui-sref="clientCard.addressDataCreate"><vn-button label="Nuevo"></vn-button></a>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-horizontal ng-repeat="i in address.addresses" class="pad-medium-top" style="align-items: center;">
|
||||
<vn-auto style="border-radius: .5em;" class="pad-small border-solid" ng-class="{'bg-dark-item': i.default,'bg-opacity-item': !i.enabled && !i.default}">
|
||||
<vn-horizontal style="align-items: center;">
|
||||
<vn-auto>
|
||||
<div><b>{{i.consignee}}</b></div>
|
||||
<div>{{i.street}}</div>
|
||||
<div>{{i.city}}, {{i.province}}</div>
|
||||
<div>{{i.phone}}, {{i.mobile}}</div>
|
||||
</vn-auto>
|
||||
<a vn-empty ui-sref="clientCard.addressDataEdit({ addressId: {{i.id}} })"><vn-icon-button icon="edit"></vn-icon-button></a>
|
||||
</vn-horizontal>
|
||||
</vn-auto>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-one margin-large-top style="position: fixed; bottom: 2em; right: 2em;">
|
||||
<a ui-sref="clientCard.addressDataCreate"><vn-float-button icon="add"></vn-float-button></a>
|
||||
</vn-one>
|
||||
</vn-vertical>
|
||||
|
|
|
@ -9,15 +9,16 @@
|
|||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Teléfono" field="basicData.client.phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Móvil" field="basicData.client.mobile"></vn-textfield>
|
||||
<vn-textfield vn-one label="Fax" field="basicData.client.fax"></vn-textfield>
|
||||
<vn-textfield vn-one label="Email" field="basicData.client.email"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Email" field="basicData.client.email"></vn-textfield>
|
||||
<vn-combo vn-one label="Comercial" field="basicData.client.salesPerson">
|
||||
<option value=""></option>
|
||||
<option ng-repeat="p in basicData.sales" value="{{p.id}}">{{p.name}}</ng-repeat>
|
||||
</vn-combo>
|
||||
<vn-two></vn-two>
|
||||
<vn-one></vn-one>
|
||||
</vn-horizontal>
|
||||
|
||||
</vn-vertical>
|
||||
|
@ -26,4 +27,4 @@
|
|||
<vn-submit margin-small-top label="Guardar" id="save"></vn-submit>
|
||||
</vn-vertical>
|
||||
</form>
|
||||
<vn-confirm-client client="basicData.client" client-old="basicData.clientOld" state="basicData.state"></vn-confirm-client>
|
||||
<vn-dialog-confirm object="basicData.client" object-old="basicData.clientOld" state="basicData.state"></vn-dialog-confirm>
|
||||
|
|
|
@ -9,8 +9,7 @@ export const COMPONENT = {
|
|||
client: '<'
|
||||
},
|
||||
controller: function($http, copyObject, equalsObject, $transitions, $element) {
|
||||
|
||||
var self = this;
|
||||
var self = this;
|
||||
var deregister = $transitions.onStart({ }, callback);
|
||||
|
||||
this.$onChanges = function(changes) {
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
<vn-vertical full-height style="max-width: 85em; margin: 0 auto;">
|
||||
<vn-horizontal full-height>
|
||||
<vn-empty pad-medium-left style="min-width: 18em;">
|
||||
<vn-descriptor client="card.client" class="display-block" ></vn-descriptor>
|
||||
<vn-left-menu items="card.items"></vn-left-menu>
|
||||
</vn-empty>
|
||||
<vn-auto>
|
||||
<vn-vertical ui-view></vn-vertical>
|
||||
</vn-auto>
|
||||
<vn-vertical full-height >
|
||||
<vn-horizontal>
|
||||
<vn-horizontal full-height vn-eleven>
|
||||
<vn-empty pad-medium-left style="min-width: 18em;">
|
||||
<vn-descriptor client="card.client" class="display-block" ></vn-descriptor>
|
||||
<vn-left-menu items="card.items"></vn-left-menu>
|
||||
</vn-empty>
|
||||
<vn-auto>
|
||||
<vn-vertical ui-view></vn-vertical>
|
||||
</vn-auto>
|
||||
</vn-horizontal>
|
||||
<vn-one></vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</p>
|
||||
</div>
|
||||
<div class="mdl-dialog__actions mdl-dialog__actions--full-width">
|
||||
<button type="button" class="mdl-button" ng-click="clientConfirm.accept()">Aceptar</button>
|
||||
<button type="button" class="mdl-button close" ng-click="clientConfirm.cancel()">Cancelar</button>
|
||||
<button type="button" class="mdl-button" ng-click="dialogConfirm.accept()">Aceptar</button>
|
||||
<button type="button" class="mdl-button close" ng-click="dialogConfirm.cancel()">Cancelar</button>
|
||||
</div>
|
||||
</dialog>
|
|
@ -1,28 +1,27 @@
|
|||
import template from './index.html';
|
||||
import {module} from '../../module';
|
||||
|
||||
export const NAME = 'vnConfirmClient';
|
||||
export const NAME = 'vnDialogConfirm';
|
||||
export const COMPONENT = {
|
||||
template: template,
|
||||
controllerAs: 'clientConfirm',
|
||||
controllerAs: 'dialogConfirm',
|
||||
bindings: {
|
||||
state: '<',
|
||||
client: '=',
|
||||
clientOld: "="
|
||||
object: '=',
|
||||
objectOld: "="
|
||||
},
|
||||
controller: function($state, $element, copyObject){
|
||||
|
||||
var dialog = $element.find('dialog')[0]
|
||||
controller: function($state, $element, copyObject) {
|
||||
var dialog = $element.find('dialog')[0];
|
||||
|
||||
this.accept = function(){
|
||||
copyObject(this.clientOld, this.client);
|
||||
this.accept = function() {
|
||||
copyObject(this.objectOld, this.object);
|
||||
$state.go(this.state);
|
||||
dialog.close();
|
||||
}
|
||||
};
|
||||
|
||||
this.cancel = function(){
|
||||
this.cancel = function() {
|
||||
dialog.close();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
COMPONENT.controller.$inject = ['$state', '$element', 'copyObject'];
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<i class="material-icons descriptor-icon">person</i>
|
||||
</vn-one>
|
||||
<vn-vertical vn-two>
|
||||
<div class="margin-none">{{descriptor.client.clientId}}</div>
|
||||
<div class="margin-none">{{descriptor.client.id}}</div>
|
||||
<div class="margin-none">{{descriptor.client.name}}</div>
|
||||
<div class="margin-none">{{descriptor.client.phone}}</div>
|
||||
</vn-vertical>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
<vn-vertical pad-large>
|
||||
<vn-title>Datos fiscales y de facturación</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Cliente activo" field="fiscal.client.active"></vn-check>
|
||||
<vn-check vn-one label="Facturar" field="fiscal.client.hasToInvoice"></vn-check>
|
||||
<vn-check vn-one label="Factura impresa" field="invoiceByEmail"></vn-check>
|
||||
</vn-horizontal>
|
||||
|
@ -21,12 +20,7 @@
|
|||
<option ng-repeat="c in fiscal.countries | orderBy:'name'" value="{{c.id}}">{{c.name}}</option>
|
||||
</vn-combo>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Teléfono Fijo" field="fiscal.client.phone"></vn-textfield>
|
||||
<vn-textfield vn-one label="Teléfono Movil" field="fiscal.client.mobile"></vn-textfield>
|
||||
<vn-textfield vn-one label="Correo electrónico" field="fiscal.client.email"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-card margin-small-bottom>
|
||||
<vn-vertical pad-large>
|
||||
|
@ -56,8 +50,8 @@
|
|||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-vertical>
|
||||
<vn-submit label="Guardar"></vn-submit>
|
||||
</vn-vertical>
|
||||
<vn-dialog-confirm object="fiscal.client" object-old="fiscal.clientOld" state="fiscal.state"></vn-dialog-confirm>
|
||||
</form>
|
||||
<vn-vertical>
|
||||
<vn-submit label="Guardar"></vn-submit>
|
||||
</vn-vertical>
|
||||
<vn-confirm-client client="fiscal.client" client-old="fiscal.clientOld" state="fiscal.state"></vn-confirm-client>
|
||||
|
|
|
@ -9,14 +9,13 @@ export const COMPONENT = {
|
|||
client: '<'
|
||||
},
|
||||
controller: function($http, copyObject, equalsObject, $transitions, $element) {
|
||||
|
||||
var self = this;
|
||||
var deregister = $transitions.onStart({ }, callback);
|
||||
|
||||
|
||||
$http.get('/client/api/Countries').then(
|
||||
json => this.countries = json.data
|
||||
);
|
||||
|
||||
|
||||
$http.get('/client/api/Provinces').then(
|
||||
json => this.provinces = json.data
|
||||
);
|
||||
|
@ -24,7 +23,7 @@ export const COMPONENT = {
|
|||
$http.get('/client/api/PaymentMethods').then(
|
||||
json => this.payments = json.data
|
||||
);
|
||||
|
||||
|
||||
this.submit = function() {
|
||||
if (!equalsObject(this.client, this.clientOld)) {
|
||||
this.client.modify = "FiscalData";
|
||||
|
|
|
@ -12,13 +12,12 @@ export const COMPONENT = {
|
|||
var where = null;
|
||||
var filter = this.filter;
|
||||
var queryStr = '/client/api/Clients';
|
||||
|
||||
var search = filter.search;
|
||||
if(search)
|
||||
if (search)
|
||||
where = {name: {ilike: search}};
|
||||
|
||||
var params = filter.params;
|
||||
if(params) {
|
||||
if (params) {
|
||||
where = {};
|
||||
let partials = {
|
||||
alias: true,
|
||||
|
@ -26,18 +25,18 @@ export const COMPONENT = {
|
|||
socialName: true,
|
||||
city: true,
|
||||
email: true
|
||||
}
|
||||
for(let param in params)
|
||||
if (params[param]) {
|
||||
if(partials[param])
|
||||
where[param] = {ilike: params[param]};
|
||||
else
|
||||
};
|
||||
for (let param in params)
|
||||
if (params[param]) {
|
||||
if (partials[param])
|
||||
where[param] = {ilike: params[param]};
|
||||
else
|
||||
where[param] = params[param];
|
||||
}
|
||||
}
|
||||
filter.params = undefined;
|
||||
}
|
||||
|
||||
if(where) {
|
||||
if (where) {
|
||||
let json = JSON.stringify({where: where});
|
||||
queryStr = `${queryStr}?filter=${json}`;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ vn-item-client a {
|
|||
color: inherit;
|
||||
}
|
||||
vn-item-client a:hover {
|
||||
background-color: rgba(0, 0, 0, .1);
|
||||
color: white;
|
||||
background-color: #424242;
|
||||
}
|
||||
|
||||
.vn-item-client-name{
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<vn-card>
|
||||
<vn-vertical pad-large>
|
||||
<vn-title>Web access</vn-title>
|
||||
<vn-check label="Web access enabled" field="web.client.active"></vn-check>
|
||||
<vn-textfield label="User" class="margin-medium-top" field="web.client.user" focus></vn-textfield>
|
||||
<vn-check label="Web access enabled" field="web.account.active"></vn-check>
|
||||
<vn-textfield label="User" class="margin-medium-top" field="web.account.user" focus></vn-textfield>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-horizontal margin-small-top>
|
||||
|
@ -11,4 +11,4 @@
|
|||
<vn-button label="Change password" vn-dialog="vn-client-change-password"></vn-button>
|
||||
</vn-horizontal>
|
||||
</form>
|
||||
<vn-confirm-client client="web.client" client-old="web.clientOld" state="web.state"></vn-confirm-client>
|
||||
<vn-dialog-confirm object="web.account" object-old="web.accountOld" state="web.state"></vn-dialog-confirm>
|
||||
|
|
|
@ -9,17 +9,16 @@ export const COMPONENT = {
|
|||
client: '<'
|
||||
},
|
||||
controller: function($http, copyObject, equalsObject, $transitions, $element) {
|
||||
|
||||
var self = this;
|
||||
var deregister = $transitions.onStart({ }, callback);
|
||||
|
||||
|
||||
this.submit = function() {
|
||||
if (!equalsObject(this.client, this.clientOld)) {
|
||||
if (!equalsObject(this.account, this.accountOld)) {
|
||||
this.client.modify = "WebAccess";
|
||||
$http.put('/client/api/Clients', this.client).then(
|
||||
$http.put(`/client/api/Accounts/${this.account.id}`, this.account).then(
|
||||
json => {
|
||||
this.client = json.data;
|
||||
this.copyClient();
|
||||
this.account = json.data;
|
||||
self.copyAccount();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -27,7 +26,7 @@ export const COMPONENT = {
|
|||
|
||||
this.$onChanges = function(changes) {
|
||||
if (this.client) {
|
||||
this.copyClient();
|
||||
this.getAccount(this.client.id);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -36,7 +35,7 @@ export const COMPONENT = {
|
|||
};
|
||||
|
||||
function callback(transition) {
|
||||
if (!equalsObject(self.client, self.clientOld)) {
|
||||
if (!equalsObject(self.account, self.accountOld)) {
|
||||
self.state = transition.to().name;
|
||||
var dialog = $element[0].querySelector('dialog');
|
||||
dialog.showModal();
|
||||
|
@ -44,9 +43,21 @@ export const COMPONENT = {
|
|||
}
|
||||
}
|
||||
|
||||
this.copyClient = function() {
|
||||
this.clientOld = {};
|
||||
copyObject(this.client, this.clientOld);
|
||||
this.copyAccount = function() {
|
||||
this.accountOld = {};
|
||||
copyObject(this.account, this.accountOld);
|
||||
};
|
||||
|
||||
this.getAccount = function(clientId) {
|
||||
$http.get(`/client/api/Accounts/${clientId}`).then(
|
||||
json => {
|
||||
this.account = json.data;
|
||||
this.copyAccount();
|
||||
},
|
||||
json => {
|
||||
this.account = {id: clientId};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
7
db.json
7
db.json
|
@ -8,7 +8,8 @@
|
|||
"Address": 58,
|
||||
"Country": 3,
|
||||
"Province": 3,
|
||||
"Agency": 4
|
||||
"Agency": 4,
|
||||
"Account": 14
|
||||
},
|
||||
"models": {
|
||||
"User": {
|
||||
|
@ -49,6 +50,10 @@
|
|||
"1": "{\"name\":\"Zeleris\",\"id\":1}",
|
||||
"2": "{\"name\":\"MRW\",\"id\":2}",
|
||||
"3": "{\"name\":\"DHL\",\"id\":3}"
|
||||
},
|
||||
"Account": {
|
||||
"12": "{\"id\":12,\"name\":\"prueba12\",\"active\":false,\"user\":\"juanete\"}",
|
||||
"13": "{\"id\":13,\"name\":\"manu\",\"active\":false,\"user\":\"joselito\"}"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -43,6 +43,9 @@
|
|||
"phone": {
|
||||
"type": "string"
|
||||
},
|
||||
"mobile": {
|
||||
"type": "string"
|
||||
},
|
||||
"fax": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "account",
|
||||
"name": "Account",
|
||||
"base": "PersistedModel",
|
||||
"properties": {
|
||||
"id": {
|
||||
|
|
|
@ -63,5 +63,9 @@
|
|||
"ClientObservation": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
},
|
||||
"Account": {
|
||||
"dataSource": "db",
|
||||
"public": true
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue