travel descriptor quicklinks
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
55a1ae0348
commit
c0b2ef9666
|
@ -37,6 +37,9 @@
|
|||
"m3": {
|
||||
"type": "Number"
|
||||
},
|
||||
"cargoSupplierFk": {
|
||||
"type": "Number"
|
||||
},
|
||||
"agencyModeFk": {
|
||||
"type": "Number",
|
||||
"mysql": {
|
||||
|
|
|
@ -24,5 +24,23 @@
|
|||
value="{{$ctrl.travel.totalEntries}}">
|
||||
</vn-label-value>
|
||||
</div>
|
||||
<div class="quicklinks">
|
||||
<div ng-transclude="btnOne">
|
||||
<vn-quick-link
|
||||
tooltip="All travels with current agency"
|
||||
state="['travel.index', {q: $ctrl.travelFilter}]"
|
||||
icon="local_airport">
|
||||
</vn-quick-link>
|
||||
</div>
|
||||
<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 ng-transclude="btnThree">
|
||||
</div>
|
||||
</div>
|
||||
</slot-body>
|
||||
</vn-descriptor-content>
|
||||
|
|
|
@ -10,6 +10,39 @@ class Controller extends Descriptor {
|
|||
this.entity = value;
|
||||
}
|
||||
|
||||
get travelFilter() {
|
||||
let travelFilter;
|
||||
const travel = this.travel;
|
||||
|
||||
if (travel && travel.agencyFk) {
|
||||
travelFilter = this.travel && JSON.stringify({
|
||||
agencyFk: this.travel.agencyFk
|
||||
});
|
||||
}
|
||||
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() {
|
||||
const filter = {
|
||||
fields: [
|
||||
|
@ -19,7 +52,8 @@ class Controller extends Descriptor {
|
|||
'landed',
|
||||
'totalEntries',
|
||||
'warehouseInFk',
|
||||
'warehouseOutFk'
|
||||
'warehouseOutFk',
|
||||
'cargoSupplierFk'
|
||||
],
|
||||
include: [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue