2276-travel_summary - e2e in progress #457

Merged
carlosjr merged 8 commits from 2276-travel_summary into dev 2020-11-17 17:13:13 +00:00
4 changed files with 44 additions and 28 deletions
Showing only changes of commit a7c830d87a - Show all commits

View File

@ -7,6 +7,47 @@ class Controller extends Section {
super($element, $); super($element, $);
} }
get travelId() {
return this._travelId;
}
set travelId(value) {
this._travelId = value;
if (value) this.loadData();
}
loadData() {
const filter = {
fields: [
'id',
'ref',
'shipped',
'landed',
'totalEntries',
'agencyFk',
'warehouseInFk',
'warehouseOutFk',
'cargoSupplierFk'
],
include: [
{
relation: 'warehouseIn',
scope: {
fields: ['name']
}
}, {
relation: 'warehouseOut',
scope: {
fields: ['name']
}
}
]
};
return this.$http.get(`Travels/${this.travelId}`, {filter})
.then(res => this.travel = res.data);
}
onCloneAccept() { onCloneAccept() {
const params = JSON.stringify({ const params = JSON.stringify({
ref: this.travel.ref, ref: this.travel.ref,
@ -26,6 +67,6 @@ ngModule.vnComponent('vnTravelDescriptorMenu', {
template: require('./index.html'), template: require('./index.html'),
controller: Controller, controller: Controller,
bindings: { bindings: {
travel: '<', travelId: '<',
} }
}); });

View File

@ -0,0 +1 @@
Clone travel: Clonar envío

View File

@ -2,7 +2,7 @@
module="travel" module="travel"
description="$ctrl.travel.ref"> description="$ctrl.travel.ref">
<slot-dot-menu> <slot-dot-menu>
<vn-travel-descriptor-menu travel="$ctrl.travel"/> <vn-travel-descriptor-menu travel-id="$ctrl.travel.id"/>
</slot-dot-menu> </slot-dot-menu>
<slot-body> <slot-body>
<div class="attributes"> <div class="attributes">
@ -36,11 +36,6 @@
</vn-quick-link> </vn-quick-link>
</div> </div>
<div ng-transclude="btnTwo"> <div ng-transclude="btnTwo">
<vn-quick-link
tooltip="All entries with current supplier"
state="['entry.index', {q: $ctrl.entryFilter}]"
icon="icon-entry">
</vn-quick-link>
</div> </div>
<div ng-transclude="btnThree"> <div ng-transclude="btnThree">
</div> </div>

View File

@ -22,27 +22,6 @@ class Controller extends Descriptor {
return travelFilter; return travelFilter;
} }
get entryFilter() {
let travel = this.travel;
if (!travel || !travel.landed) return null;
const date = new Date(travel.landed);
date.setHours(0, 0, 0, 0);
const from = new Date(date.getTime());
from.setDate(from.getDate() - 10);
const to = new Date(date.getTime());
to.setDate(to.getDate() + 10);
return JSON.stringify({
supplierFk: this.travel.cargoSupplierFk,
from,
to
});
}
loadData() { loadData() {
const filter = { const filter = {
fields: [ fields: [