refs #5206 version with plane added, needs to implement general search
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
be1993cf8b
commit
dbe42e3bf4
|
@ -26,7 +26,7 @@ Value should have at most %s characters: El valor debe tener un máximo de %s ca
|
||||||
Enter a new search: Introduce una nueva búsqueda
|
Enter a new search: Introduce una nueva búsqueda
|
||||||
No results: Sin resultados
|
No results: Sin resultados
|
||||||
Ups! It seems there was an error: ¡Vaya! Parece que ha habido un error
|
Ups! It seems there was an error: ¡Vaya! Parece que ha habido un error
|
||||||
General search: Busqueda general
|
General search: Búsqueda general
|
||||||
January: Enero
|
January: Enero
|
||||||
February: Febrero
|
February: Febrero
|
||||||
March: Marzo
|
March: Marzo
|
||||||
|
|
|
@ -5,6 +5,13 @@
|
||||||
<vn-travel-search-panel
|
<vn-travel-search-panel
|
||||||
model="model">
|
model="model">
|
||||||
</vn-travel-search-panel>
|
</vn-travel-search-panel>
|
||||||
|
<vn-crud-model
|
||||||
|
vn-id="model"
|
||||||
|
url="Travels/filter"
|
||||||
|
limit="20"
|
||||||
|
order="shipped DESC, landed DESC"
|
||||||
|
auto-load="true">
|
||||||
|
</vn-crud-model>
|
||||||
<vn-data-viewer
|
<vn-data-viewer
|
||||||
model="model"
|
model="model"
|
||||||
class="vn-mb-xl vn-w-xl">
|
class="vn-mb-xl vn-w-xl">
|
||||||
|
@ -16,10 +23,10 @@
|
||||||
<vn-th field="agencyModeFk">Agency</vn-th>
|
<vn-th field="agencyModeFk">Agency</vn-th>
|
||||||
<vn-th field="warehouseOutFk">Warehouse Out</vn-th>
|
<vn-th field="warehouseOutFk">Warehouse Out</vn-th>
|
||||||
<vn-th field="shipped" center shrink-date>Shipped</vn-th>
|
<vn-th field="shipped" center shrink-date>Shipped</vn-th>
|
||||||
<vn-th field="isDelivered" center>Delivered</vn-th>
|
<vn-th shrink></vn-th>
|
||||||
<vn-th field="warehouseInFk">Warehouse In</vn-th>
|
<vn-th field="warehouseInFk">Warehouse In</vn-th>
|
||||||
<vn-th field="landed" center shrink-date>Landed</vn-th>
|
<vn-th field="landed" center shrink-date>Landed</vn-th>
|
||||||
<vn-th field="isReceived" center>Received</vn-th>
|
<vn-th shrink></vn-th>
|
||||||
<vn-th shrink></vn-th>
|
<vn-th shrink></vn-th>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-thead>
|
</vn-thead>
|
||||||
|
@ -35,14 +42,26 @@
|
||||||
{{::travel.shipped | date:'dd/MM/yyyy'}}
|
{{::travel.shipped | date:'dd/MM/yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td center><vn-check ng-model="travel.isDelivered" disabled="true"></vn-check></vn-td>
|
<vn-td shrink>
|
||||||
|
<vn-icon
|
||||||
|
icon="flight_takeoff"
|
||||||
|
translate-attr="{title: 'Delivered'}"
|
||||||
|
ng-class="{active: travel.isDelivered}">
|
||||||
|
</vn-icon>
|
||||||
|
</vn-td>
|
||||||
<vn-td expand>{{::travel.warehouseInName}}</vn-td>
|
<vn-td expand>{{::travel.warehouseInName}}</vn-td>
|
||||||
<vn-td center shrink-date>
|
<vn-td center shrink-date>
|
||||||
<span class="chip {{$ctrl.compareDate(travel.landed)}}">
|
<span class="chip {{$ctrl.compareDate(travel.landed)}}">
|
||||||
{{::travel.landed | date:'dd/MM/yyyy'}}
|
{{::travel.landed | date:'dd/MM/yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td center><vn-check ng-model="travel.isReceived" disabled="true"></vn-check></vn-td>
|
<vn-td shrink>
|
||||||
|
<vn-icon
|
||||||
|
icon="flight_land"
|
||||||
|
translate-attr="{title: 'Received'}"
|
||||||
|
ng-class="{active: travel.isReceived}">
|
||||||
|
</vn-icon>
|
||||||
|
</vn-td>
|
||||||
<vn-td shrink>
|
<vn-td shrink>
|
||||||
<vn-horizontal class="buttons">
|
<vn-horizontal class="buttons">
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import ngModule from '../module';
|
import ngModule from '../module';
|
||||||
import Section from 'salix/components/section';
|
import Section from 'salix/components/section';
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
export default class Controller extends Section {
|
export default class Controller extends Section {
|
||||||
preview(travel) {
|
preview(travel) {
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
|
vn-travel-index {
|
||||||
|
vn-icon {
|
||||||
|
color: $color-font-secondary
|
||||||
|
}
|
||||||
|
|
||||||
|
vn-icon.active {
|
||||||
|
color: $color-success
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,17 +1,4 @@
|
||||||
<vn-crud-model
|
|
||||||
vn-id="model"
|
|
||||||
url="Travels/filter"
|
|
||||||
limit="20"
|
|
||||||
order="shipped DESC, landed DESC">
|
|
||||||
</vn-crud-model>
|
|
||||||
<vn-portal slot="topbar">
|
<vn-portal slot="topbar">
|
||||||
<vn-searchbar
|
|
||||||
vn-focus
|
|
||||||
info="Search travels by id"
|
|
||||||
model="model"
|
|
||||||
fetch-params="$ctrl.fetchParams($params)"
|
|
||||||
suggested-filter="$ctrl.filterParams">
|
|
||||||
</vn-searchbar>
|
|
||||||
</vn-portal>
|
</vn-portal>
|
||||||
<vn-portal slot="menu">
|
<vn-portal slot="menu">
|
||||||
<vn-left-menu></vn-left-menu>
|
<vn-left-menu></vn-left-menu>
|
||||||
|
|
|
@ -4,28 +4,6 @@ import ModuleMain from 'salix/components/module-main';
|
||||||
export default class Travel extends ModuleMain {
|
export default class Travel extends ModuleMain {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.filterParams = {
|
|
||||||
scopeDays: 1
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
fetchParams($params) {
|
|
||||||
if (!Object.entries($params).length)
|
|
||||||
$params.scopeDays = 1;
|
|
||||||
|
|
||||||
if (typeof $params.scopeDays === 'number') {
|
|
||||||
const shippedFrom = Date.vnNew();
|
|
||||||
shippedFrom.setHours(0, 0, 0, 0);
|
|
||||||
|
|
||||||
const shippedTo = new Date(shippedFrom.getTime());
|
|
||||||
shippedTo.setDate(shippedTo.getDate() + $params.scopeDays);
|
|
||||||
shippedTo.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
Object.assign($params, {shippedFrom, shippedTo});
|
|
||||||
}
|
|
||||||
|
|
||||||
return $params;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,18 @@
|
||||||
<vn-side-menu side="right">
|
<vn-side-menu side="right">
|
||||||
<vn-horizontal class="input">
|
<vn-horizontal class="input">
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
label="Reference"
|
label="General search"
|
||||||
ng-model="$ctrl.filter.ref"
|
info="Search travels by id"
|
||||||
ng-change="$ctrl.addFilters()">
|
ng-model="$ctrl.search"
|
||||||
|
ng-keydown="$ctrl.onKeyPress($event, 'search')">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal class="input horizontal">
|
<vn-horizontal class="input horizontal">
|
||||||
<vn-input-number
|
<vn-input-number
|
||||||
min="0"
|
min="0"
|
||||||
label="Total entries"
|
label="Total entries"
|
||||||
ng-model="$ctrl.filter.totalEntries"
|
ng-model="$ctrl.totalEntries"
|
||||||
ng-change="$ctrl.addFilters()">
|
ng-keydown="$ctrl.onKeyPress($event, 'totalEntries')">
|
||||||
</vn-input-number>
|
|
||||||
<vn-input-number
|
|
||||||
min="0"
|
|
||||||
label="Travel id"
|
|
||||||
ng-model="$ctrl.filter.id"
|
|
||||||
ng-change="$ctrl.addFilters()">
|
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal class="input horizontal">
|
<vn-horizontal class="input horizontal">
|
||||||
|
@ -61,12 +56,9 @@
|
||||||
label="Days onward"
|
label="Days onward"
|
||||||
ng-model="$ctrl.filter.scopeDays"
|
ng-model="$ctrl.filter.scopeDays"
|
||||||
on-change="$ctrl.changeScopeDays()"
|
on-change="$ctrl.changeScopeDays()"
|
||||||
display-controls="true">
|
display-controls="true"
|
||||||
|
info="Cannot choose a range of dates and days onward at the same time">
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
<vn-icon color-marginal
|
|
||||||
icon="info"
|
|
||||||
vn-tooltip="Cannot choose a range of dates and days onward at the same time">
|
|
||||||
</vn-icon>
|
|
||||||
</div>
|
</div>
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
<vn-horizontal class="input horizontal">
|
<vn-horizontal class="input horizontal">
|
||||||
|
@ -103,11 +95,11 @@
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<div class="chips">
|
<div class="chips">
|
||||||
<vn-chip
|
<vn-chip
|
||||||
ng-if="$ctrl.filter.ref"
|
ng-if="$ctrl.filter.search"
|
||||||
removable="true"
|
removable="true"
|
||||||
on-remove="$ctrl.removeParamFilter('ref')"
|
on-remove="$ctrl.removeParamFilter('search')"
|
||||||
class="colored">
|
class="colored">
|
||||||
<span>{{$ctrl.$t('Reference')}}: {{$ctrl.filter.ref}}</span>
|
<span>Id/{{$ctrl.$t('Reference')}}: {{$ctrl.filter.search}}</span>
|
||||||
</vn-chip>
|
</vn-chip>
|
||||||
<vn-chip
|
<vn-chip
|
||||||
ng-if="$ctrl.filter.totalEntries"
|
ng-if="$ctrl.filter.totalEntries"
|
||||||
|
@ -116,13 +108,6 @@
|
||||||
class="colored">
|
class="colored">
|
||||||
<span>{{$ctrl.$t('Total entries')}}: {{$ctrl.filter.totalEntries}}</span>
|
<span>{{$ctrl.$t('Total entries')}}: {{$ctrl.filter.totalEntries}}</span>
|
||||||
</vn-chip>
|
</vn-chip>
|
||||||
<vn-chip
|
|
||||||
ng-if="$ctrl.filter.id"
|
|
||||||
removable="true"
|
|
||||||
on-remove="$ctrl.removeParamFilter('id')"
|
|
||||||
class="colored">
|
|
||||||
<span>{{$ctrl.$t('Travel id')}}: {{$ctrl.filter.id}}</span>
|
|
||||||
</vn-chip>
|
|
||||||
<vn-chip
|
<vn-chip
|
||||||
ng-if="agency.selection"
|
ng-if="agency.selection"
|
||||||
removable="true"
|
removable="true"
|
||||||
|
|
|
@ -5,6 +5,28 @@ import './style.scss';
|
||||||
class Controller extends SearchPanel {
|
class Controller extends SearchPanel {
|
||||||
constructor($, $element) {
|
constructor($, $element) {
|
||||||
super($, $element);
|
super($, $element);
|
||||||
|
this.filter = {};
|
||||||
|
this.filterParams = {
|
||||||
|
scopeDays: 1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchParams($params) {
|
||||||
|
if (!Object.entries($params).length)
|
||||||
|
$params.scopeDays = 1;
|
||||||
|
|
||||||
|
if (typeof $params.scopeDays === 'number') {
|
||||||
|
const shippedFrom = Date.vnNew();
|
||||||
|
shippedFrom.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
const shippedTo = new Date(shippedFrom.getTime());
|
||||||
|
shippedTo.setDate(shippedTo.getDate() + $params.scopeDays);
|
||||||
|
shippedTo.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
Object.assign($params, {shippedFrom, shippedTo});
|
||||||
|
}
|
||||||
|
|
||||||
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
changeShipped() {
|
changeShipped() {
|
||||||
|
@ -23,9 +45,18 @@ class Controller extends SearchPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
removeParamFilter(param) {
|
removeParamFilter(param) {
|
||||||
|
if (this[param]) this[param] = null;
|
||||||
this.filter[param] = null;
|
this.filter[param] = null;
|
||||||
this.addFilters();
|
this.addFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onKeyPress($event, param) {
|
||||||
|
console.log('event');
|
||||||
|
if ($event.key === 'Enter') {
|
||||||
|
this.filter[param] = this[param];
|
||||||
|
this.addFilters();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnTravelSearchPanel', {
|
ngModule.vnComponent('vnTravelSearchPanel', {
|
||||||
|
|
Loading…
Reference in New Issue