Merge branch 'dev' of https://git.verdnatura.es/salix into dev

* 'dev' of https://git.verdnatura.es/salix:
  tabla localizador de rutas maquetada
  structure module locator
  new icon-menu
  new module locator
  enlaces pp en modulos cliente y rutas
  error con checkboxes y su anchura
  sprint3 pantallas de rutas
  refactor dataPicker
  bug fixed in dataPicker
  route basic data structure
This commit is contained in:
Carlos 2017-11-03 17:59:07 +01:00
commit ced9739150
40 changed files with 405 additions and 49 deletions

View File

@ -11,8 +11,12 @@
<vn-vertical pad-large>
<vn-title>Address</vn-title>
<vn-horizontal>
<vn-check vn-one label="enabled" field="$ctrl.address.isEnabled"></vn-check>
<vn-check vn-one label="Is equalizated" field="$ctrl.address.isEqualizated"></vn-check>
<vn-one>
<vn-check label="enabled" field="$ctrl.address.isEnabled"></vn-check>
</vn-one>
<vn-one>
<vn-check label="Is equalizated" field="$ctrl.address.isEqualizated"></vn-check>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Consignee" field="$ctrl.address.consignee" vn-focus></vn-textfield>

View File

@ -27,8 +27,12 @@
<vn-textfield vn-one label="Crédito asegurado" field="$ctrl.client.creditInsurance" vn-acl="administrative"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-check vn-one label="Recargo de equivalencia" field="$ctrl.client.equalizationTax" vn-acl="administrative"></vn-check>
<vn-check vn-one label="Vies" field="$ctrl.client.vies" vn-acl="administrative"></vn-check>
<vn-one>
<vn-check label="Recargo de equivalencia" field="$ctrl.client.equalizationTax" vn-acl="administrative"></vn-check>
</vn-one>
<vn-one>
<vn-check label="Vies" field="$ctrl.client.vies" vn-acl="administrative"></vn-check>
</vn-one>
</vn-horizontal>
</vn-vertical>
</vn-card>
@ -36,9 +40,15 @@
<vn-vertical pad-large>
<vn-title>Documentación</vn-title>
<vn-horizontal>
<vn-check vn-one label="Recibido core VNH" field="$ctrl.client.coreVnh" vn-acl="administrative"></vn-check>
<vn-check vn-one label="Recibido core VNL" field="$ctrl.client.coreVnl" vn-acl="administrative"></vn-check>
<vn-check vn-one label="Recibido B2B VNL" field="$ctrl.client.sepaVnl" vn-acl="administrative"></vn-check>
<vn-one>
<vn-check label="Recibido core VNH" field="$ctrl.client.coreVnh" vn-acl="administrative"></vn-check>
</vn-one>
<vn-one>
<vn-check label="Recibido core VNL" field="$ctrl.client.coreVnl" vn-acl="administrative"></vn-check>
</vn-one>
<vn-one>
<vn-check label="Recibido B2B VNL" field="$ctrl.client.sepaVnl" vn-acl="administrative"></vn-check>
</vn-one>
</vn-horizontal>
</vn-vertical>
</vn-card>

View File

@ -1,9 +1,9 @@
<vn-card>
<vn-vertical class="margin-medium" pad-medium-top pad-medium-bottom>
<vn-horizontal>
<vn-one>
<a vn-one ui-sref="clients">
<i class="material-icons descriptor-icon">person</i>
</vn-one>
</a>
<vn-vertical vn-two>
<div class="margin-none">{{::$ctrl.client.id}}</div>
<div class="margin-none">{{$ctrl.client.name}}</div>

View File

@ -10,8 +10,12 @@
<vn-vertical pad-large>
<vn-title>Fiscal data</vn-title>
<vn-horizontal>
<vn-check vn-one label="Facturar" field="$ctrl.client.hasToInvoice"></vn-check>
<vn-check vn-one label="Factura impresa" field="$ctrl.client.invoiceByEmail"></vn-check>
<vn-one>
<vn-check label="Facturar" field="$ctrl.client.hasToInvoice"></vn-check>
</vn-one>
<vn-one>
<vn-check label="Factura impresa" field="$ctrl.client.invoiceByEmail"></vn-check>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-two label="Domicilio fiscal" field="$ctrl.client.street" vn-focus></vn-textfield>

View File

@ -8,9 +8,15 @@
<form name="form" ng-submit="watcher.submit()" pad-medium>
<vn-card>
<vn-vertical pad-large>
<vn-title>Web access</vn-title>
<vn-check label="Enable web access" field="$ctrl.account.active"></vn-check>
<vn-textfield label="User" class="margin-medium-top" field="$ctrl.account.name" vn-focus></vn-textfield>
<vn-one>
<vn-title>Web access</vn-title>
</vn-one>
<vn-one>
<vn-check label="Enable web access" field="$ctrl.account.active"></vn-check>
</vn-one>
<vn-one>
<vn-textfield label="User" class="margin-medium-top" field="$ctrl.account.name" vn-focus></vn-textfield>
</vn-one>
</vn-vertical>
</vn-card>
<vn-button-bar>

View File

@ -2,6 +2,7 @@ import {module as _module} from '../module';
import * as resolveFactory from '../lib/resolveDefaultComponents';
import * as normalizerFactory from '../lib/inputAttrsNormalizer';
import * as util from '../lib/util';
import './style.css';
const _NAME = 'check';
export const NAME = util.getName(_NAME);

View File

@ -0,0 +1,3 @@
vn-check {
float: left;
}

View File

@ -1,19 +1,21 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<div
class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"
tabindex="1"
ng-focus="$ctrl.hasFocus = true"
ng-blur="$ctrl.hasFocus = false"
ng-mouseenter="$ctrl.hasMouseIn = true"
ng-mouseleave="$ctrl.hasMouseIn = false"
>
<input type="text"
class="mdl-textfield__input"
name="{{::$ctrl.name}}"
ng-model="$ctrl.modelView"
ng-disabled="{{!$ctrl.enabled}}"
rule="{{::$ctrl.rule}}"/>
<button
type="button"
class="mdl-chip__action ng-hide"
tabindex="-1"
translate-attr="{title: 'Clear'}"
ng-show="$ctrl.modelView"
ng-click="$ctrl.onClear()"
>
<i class="material-icons">clear</i>
</button>
<label class="mdl-textfield__label">{{::$ctrl.label | translate}}</label>
rule="{{::$ctrl.rule}}"/>
<div class="mdl-chip__action">
<i class="material-icons" ng-if="$ctrl.isTimePicker" ng-click="$ctrl.vp.open()">query_builder</i>
<i class="material-icons pointer" ng-show="$ctrl.modelView&&($ctrl.hasFocus||$ctrl.hasMouseIn)" ng-click="$ctrl.onClear()">clear</i>
</div>
<label class="mdl-textfield__label" translate>{{$ctrl.label}}</label>
</div>

View File

@ -27,7 +27,9 @@ class DatePicker extends Component {
this.enabled = true;
this._modelView = null;
this._model = undefined;
this._optionsChecked = false;
this.hasFocus = false;
this.hasMouseIn = false;
componentHandler.upgradeElement($element[0].firstChild);
}
@ -37,7 +39,8 @@ class DatePicker extends Component {
set model(value) {
this._model = value;
if (value && !this.modelView) {
let initialDateFormat = (this.iniOptions && this.iniOptions.dateFormat) ? this.iniOptions.dateFormat : 'Y-m-d';
let options = this._getOptions();
let initialDateFormat = (options && options.dateFormat) ? options.dateFormat : 'Y-m-d';
let format = this._formatFlat2Angular(initialDateFormat);
this.modelView = this.$filter('date')(value, format);
}
@ -135,9 +138,12 @@ class DatePicker extends Component {
}
}
$onInit() {
if (!this.iniOptions)
_getOptions() {
if (this.iniOptions && this._optionsChecked) {
return this.iniOptions;
} else if (!this.iniOptions) {
this.iniOptions = {};
}
if (!this.iniOptions.locale)
this.iniOptions.locale = this.$translate.use();
@ -157,9 +163,14 @@ class DatePicker extends Component {
}
);
}
this._optionsChecked = true;
return this.iniOptions;
}
if (this.input)
this.vp = new Flatpickr(this.input, this.iniOptions);
$onInit() {
this.iniOptions = this._getOptions();
this.isTimePicker = (this.iniOptions && this.iniOptions.enableTime && this.iniOptions.noCalendar);
this.vp = new Flatpickr(this.input, this.iniOptions);
}
$onDestroy() {
if (this.vp)

View File

@ -12,12 +12,12 @@ describe('Component vnDatePicker', () => {
angular.mock.module('client');
});
beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$timeout_) => {
beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$timeout_, _$translate_) => {
$componentController = _$componentController_;
$scope = $rootScope.$new();
$timeout = _$timeout_;
$element = angular.element(`<div><input></div>`);
$translate = {};
$translate = _$translate_;
controller = $componentController('vnDatePicker', {$scope, $element, $translate, $timeout});
}));

View File

@ -1,6 +1,10 @@
vn-date-picker {
div {
outline: none; //remove chrome outline
}
.mdl-chip__action {
position: absolute;
width: auto;
top: 0px;
right: -6px;
margin: 22px 0px;
@ -8,5 +12,7 @@ vn-date-picker {
}
.material-icons {
font-size: 18px;
float: right;
margin-right: 5px;
}
}

View File

@ -1,5 +1,8 @@
<div class="icon-menu">
<vn-icon-button icon="{{::$ctrl.icon}}"></vn-icon-button>
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored icon-square icon-menu__button">
<vn-icon vn-none icon="{{::$ctrl.icon}}"></vn-icon>
<vn-icon vn-none class="icon-menu__arrow_down" icon="keyboard_arrow_down" ng-click="$ctrl.showDropDown = true"></vn-icon>
</button>
<div ng-if="!$ctrl.findMore">
<vn-drop-down
items="$ctrl.items"

View File

@ -1,3 +1,12 @@
vn-icon-menu{
position: relative;
.icon-menu__button {
padding: 0 10px;
}
vn-icon{
float: left;
}
vn-icon.icon-menu__arrow_down{
margin:2px 0 0 5px;
}
}

1
client/locator/index.js Normal file
View File

@ -0,0 +1 @@
export * from './src/locator';

View File

@ -0,0 +1,13 @@
{
"module": "locator",
"name": "Locator",
"icon": "add_location",
"validations" : false,
"routes": [
{
"url": "/locator",
"state": "locator",
"component": "vn-locator-index"
}
]
}

View File

@ -0,0 +1,39 @@
<vn-card margin-large>
<vn-vertical pad-medium>
<vn-horizontal vn-one margin-large-bottom class="locator-header">
<vn-title vn-one>Routes locator</vn-title>
<form vn-two vn-horizontal class="filterPanel" ng-submit="$ctrl.searchRoutes()">
<vn-textfield vn-one label="Filter" model="$ctrl.search"></vn-textfield>
<vn-icon
vn-none
margin-medium-right
pad-medium-top
icon="keyboard_arrow_down"
ng-click="$ctrl.moreFilters($event)">
</vn-icon>
<vn-button vn-none pad-small-top label="Filtrar" ng-click="$ctrl.searchRoutes()"></vn-button>
</form>
<vn-one vn-horizontal>
<vn-one></vn-one>
<vn-autocomplete vn-two
initial-value="$ctrl.filter.warehouseFk"
show-field="name"
value-field="id"
field="$ctrl.filter.warehouseFk"
url="/production/api/Warehouses/production"
on-change = "$ctrl.onChangeWareHouse(item)"
label="Store">
</vn-autocomplete>
<vn-icon-button vn-none pad-ten-top margin-medium-left icon="refresh" ng-click="$ctrl.refreshRoutes()"></vn-icon-button>
</vn-one>
</vn-horizontal>
<vn-horizontal vn-one margin-large-bottom>
<vn-one>
<vn-locator-actions routes="$ctrl.routes" states="$ctrl.states" hour-items="$ctrl.hourItems"></vn-locator-actions>
</vn-one>
<vn-two></vn-two>
</vn-horizontal>
<vn-locator-table check-all="$ctrl.checkAll" routes="$ctrl.routes" footer="$ctrl.footer"></vn-locator-table>
</vn-vertical>
</vn-card>

View File

@ -0,0 +1,17 @@
import ngModule from '../module';
class LocatorIndex {
constructor($state) {
this.$state = $state;
this.routes = [
{id: 1, zoneFk: 1, postalcode: 46006, order: 1, preparado: '25/08', entrada: '26/08', ticket: 1547892, routeFk: 9999, alias: 'Flores Vendrell', bultos: 12, m3: 0.23},
{id: 2, zoneFk: 1, postalcode: 46006, order: 1, preparado: '25/08', entrada: '26/08', ticket: 1547892, routeFk: 9999, alias: 'Flores Vendrell', bultos: 12, m3: 0.23}
];
}
}
LocatorIndex.$inject = ['$state'];
ngModule.component('vnLocatorIndex', {
template: require('./index.html'),
controller: LocatorIndex
});

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,5 @@
{
"Routes locator": "Localizador de rutas",
"Filter": "Filtro",
"Store": "Almacén"
}

View File

@ -0,0 +1,14 @@
<vn-horizontal class="actionPanel">
<vn-none margin-medium-right>
<vn-icon-button icon="local_shipping"></vn-icon-button>
</vn-none>
<vn-none margin-medium-right>
<vn-icon-menu icon="local_shipping" selected="$ctrl.actionRoute" items="[{id:1,name:'test_01'},{id:2,name:'test_02'}]"></vn-icon-menu>
</vn-none>
<vn-none margin-medium-right>
</vn-none>
<vn-none margin-medium-right>
</vn-none>
</vn-horizontal>

View File

@ -0,0 +1,13 @@
import ngModule from '../module';
class LocatorActions {
constructor($state) {
this.$state = $state;
}
}
LocatorActions.$inject = ['$state'];
ngModule.component('vnLocatorActions', {
template: require('./locator-actions.html'),
controller: LocatorActions
});

View File

@ -0,0 +1,41 @@
<vn-vertical>
<vn-grid-header on-order="$ctrl.onOrder(field, order)">
<vn-column-header vn-none min-none>
<vn-multi-check check-all="$ctrl.checkAll" models="$ctrl.routes" options="[{id:'all',name:'Todos'},{id:'any',name:'Ninguno'}]"></vn-multi-check>
</vn-column-header>
<vn-column-header vn-one pad-medium-h field="zoneFk" text="Zona"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="postalcode" text="Postal Code"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="order" text="Order"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="preparado" text="Preparado"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="entrada" text="Entrada"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="ticket" text="Ticket"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="routeFk" text="ID de ruta"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="alias" text="Alias"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="bultos" text="Bultos"></vn-column-header>
<vn-column-header vn-one pad-medium-h field="m3" text="m3"></vn-column-header>
</vn-grid-header>
<vn-twoe class="list list-content">
<vn-vertical class="list list-element text-center" ng-repeat="route in $ctrl.routes">
<vn-horizontal>
<vn-none pad-medium-h></vn-none>
<vn-one pad-medium-h>{{::route.zoneFk}}</vn-one>
<vn-one pad-medium-h>{{::route.postalcode}}</vn-one>
<vn-one pad-medium-h>{{::route.order}}</vn-one>
<vn-one pad-medium-h>{{::route.preparado}}</vn-one>
<vn-one pad-medium-h>{{::route.entrada}}</vn-one>
<vn-one pad-medium-h>{{::route.ticket}}</vn-one>
<vn-one pad-medium-h>{{::route.routeFk}}</vn-one>
<vn-one pad-medium-h>{{::route.alias}}</vn-one>
<vn-one pad-medium-h>{{::route.bultos}}</vn-one>
<vn-one pad-medium-h>{{::route.m3}}</vn-one>
</vn-horizontal>
<vn-horizontal margin-small-top>
<vn-none>
<vn-check model="route.checked"></vn-check>
</vn-none>
<vn-one></vn-one>
<vn-six text-left pad-small border-solid>Direccion: </vn-twoe>
</vn-horizontal>
</vn-vertical>
</vn-one>
</vn-vertical>

View File

@ -0,0 +1,16 @@
import ngModule from '../module';
class LocatorTable {
constructor($state) {
this.$state = $state;
}
}
LocatorTable.$inject = ['$state'];
ngModule.component('vnLocatorTable', {
template: require('./locator-table.html'),
bindings: {
routes: '<'
},
controller: LocatorTable
});

View File

@ -0,0 +1,5 @@
export * from './module';
import './index/index';
import './locator-actions/locator-actions';
import './locator-table/locator-table';

View File

@ -0,0 +1,5 @@
import {ng} from 'vendor';
import 'core';
const ngModule = ng.module('locator', []);
export default ngModule;

View File

@ -4,5 +4,6 @@
"core": [],
"client": [],
"production": [],
"route": []
"route": [],
"locator": []
}

View File

@ -13,7 +13,8 @@
{
"url": "/list",
"state": "routes.index",
"component": "vn-route-index"
"component": "vn-route-index",
"acl": ["employee"]
},
{
"url": "/create",
@ -34,7 +35,7 @@
"route": "$ctrl.route"
},
"menu": {
"description": "Datos básicos",
"description": "Basic data",
"icon": "person"
}
},
@ -46,7 +47,7 @@
"route": "$ctrl.route"
},
"menu": {
"description": "Datos logísticos",
"description": "Logistic data",
"icon": "local_shipping"
}
},
@ -58,7 +59,7 @@
"route": "$ctrl.route"
},
"menu": {
"description": "Tickets asignados",
"description": "Assigned tickets",
"icon": "assignment"
}
}

View File

@ -0,0 +1,37 @@
<vn-watcher
vn-id="watcher"
data="$ctrl.route"
form="form"
>
</vn-watcher>
<form name="form" pad-medium>
<vn-card>
<vn-vertical pad-large>
<vn-title>Basic data</vn-title>
<vn-horizontal>
<vn-date-picker vn-one label="Date" model="$ctrl.route.date"></vn-date-picker>
<vn-autocomplete vn-one
label="Agency"
url="/route/api/Agencies"
field="$ctrl.route.agency"
>
</vn-autocomplete>
<vn-autocomplete vn-one
field="$ctrl.route.driver"
url="/route/api/Vehicles/activeDrivers"
label="Driver"></vn-autocomplete>
<vn-autocomplete vn-one
field="$ctrl.route.vehicle"
url="/route/api/Vehicles/comboVehicles"
label="Vehicle"
order="tradeMark ASC"
filter="{where: {isActive:1, warehouseFk:1}}"
></vn-autocomplete>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
</vn-button-bar>
</form>

View File

@ -0,0 +1,8 @@
import ngModule from '../module';
ngModule.component('vnRouteBasicData', {
template: require('./basic-data.html'),
bindings: {
route: '<'
}
});

View File

@ -8,11 +8,11 @@
<vn-card>
<vn-vertical class="margin-medium" pad-medium-top pad-medium-bottom>
<vn-horizontal>
<vn-one>
<a vn-one ui-sref="routes.index">
<i class="material-icons descriptor-icon">local_shipping</i>
</vn-one>
</a>
<vn-vertical vn-two>
<div class="margin-none"><span translate>Ruta</span> {{::$ctrl.route.id}}</div>
<div class="margin-none"><span translate>Route</span> {{::$ctrl.route.id}}</div>
<div class="margin-none">{{$ctrl.route.date | date:'dd/MM/yyyy'}}</div>
</vn-vertical>
</vn-horizontal>

View File

View File

@ -1,3 +1,17 @@
{
"Routes" : "Rutas"
"Basic data": "Datos básicos",
"Logistic data": "Datos logísticos",
"Assigned tickets": "Tickets asignados",
"Routes" : "Rutas",
"Route" : "Ruta",
"Date": "Fecha",
"Agency": "Agencia",
"Driver": "Conductor",
"Vehicle": "Vehículo",
"Start Hour" : "Hora Inicio",
"End Hour": "Hora Fin",
"Start Km": "Km Inicio",
"End Km": "Km Fin",
"Packages": "Bultos",
"Route document": "Documento de Ruta"
}

View File

@ -0,0 +1,28 @@
<vn-watcher
vn-id="watcher"
data="$ctrl.route"
form="form"
>
</vn-watcher>
<form name="form" pad-medium>
<vn-card>
<vn-vertical pad-large>
<vn-title>Logistic data</vn-title>
<vn-horizontal>
<vn-date-picker vn-one label="Start Hour" model="$ctrl.route.startHour" ini-options="{enableTime: true, noCalendar: true, enableSeconds: false, dateFormat: 'H:i'}"></vn-date-picker>
<vn-date-picker vn-one label="End Hour" model="$ctrl.route.endHour" ini-options="{enableTime: true, noCalendar: true, enableSeconds: false, dateFormat: 'H:i'}"></vn-date-picker>
<vn-textfield vn-one label="Start Km" model="$ctrl.route.starKm"></vn-textfield>
<vn-textfield vn-one label="End Km" model="$ctrl.route.endKm"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Packages" model="$ctrl.route.packages"></vn-textfield>
<vn-textfield vn-one label="Route document" model="$ctrl.route.document"></vn-textfield>
<vn-textfield vn-one label="M3" model="$ctrl.route.m3"></vn-textfield>
<vn-one></vn-one>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
</vn-button-bar>
</form>

View File

@ -0,0 +1,8 @@
import ngModule from '../module';
ngModule.component('vnRouteLogisticData', {
template: require('./logistic-data.html'),
bindings: {
route: '<'
}
});

View File

@ -5,3 +5,6 @@ import './index/index';
import './search-panel/search-panel';
import './create/create';
import './card/card';
import './basic-data/basic-data';
import './logistic-data/logistic-data';
import './tickets/tickets';

View File

@ -0,0 +1,7 @@
<vn-one pad-medium>
<vn-card>
<vn-vertical pad-large>
<vn-title>Assigned tickets</vn-title>
</vn-vertical>
</vn-card>
</vn-one>

View File

@ -0,0 +1,8 @@
import ngModule from '../module';
ngModule.component('vnRouteTickets', {
template: require('./tickets.html'),
bindings: {
route: '<'
}
});

View File

@ -2,6 +2,6 @@
<a ui-sref="{{$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.icon}}</i>
<span>{{$ctrl.item.description}}</span>
<span translate>{{$ctrl.item.description}}</span>
</a>
</li>

View File

@ -11,5 +11,6 @@
"Clients": "Clientes",
"Routes" : "Rutas",
"Production" : "Producción",
"Modules access" : "Acceso a módulos"
"Modules access" : "Acceso a módulos",
"Locator": "Localizador"
}

View File

@ -32,3 +32,14 @@ export const route = () => {
};
core.splitingRegister.register('route', route);
export const locator = () => {
return new Promise(resolve => {
require.ensure([], () => {
require('locator');
resolve('locator');
}, 'locator');
});
};
core.splitingRegister.register('locator', locator);