This commit is contained in:
parent
1739a71e0d
commit
8e1d594a13
|
@ -1,10 +1,14 @@
|
|||
<vn-crud-model auto-load="true"
|
||||
vn-id="model"
|
||||
<vn-crud-model vn-id="model" auto-load="true" auto-save="true"
|
||||
url="claim/api/ClaimEnds"
|
||||
filter="$ctrl.filter"
|
||||
data="$ctrl.salesClaimed">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-crud-model auto-load="true"
|
||||
url="/claim/api/ClaimDestinations"
|
||||
data="claimDestinations">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-card class="vn-mb-md vn-pa-lg vn-w-lg" style="text-align: right"
|
||||
ng-if="$ctrl.salesClaimed.length > 0">
|
||||
<vn-label-value label="Total claimed"
|
||||
|
@ -28,7 +32,6 @@
|
|||
translate-attr="{title: 'Imports ticket lines'}">
|
||||
</vn-button>
|
||||
<vn-range
|
||||
vn-one
|
||||
label="Responsability"
|
||||
min-label="Company"
|
||||
max-label="Sales/Client"
|
||||
|
@ -82,14 +85,12 @@
|
|||
</span>
|
||||
</vn-td>
|
||||
<vn-td>
|
||||
<vn-autocomplete vn-one
|
||||
id="claimDestinationFk"
|
||||
<vn-autocomplete vn-one id="claimDestinationFk"
|
||||
ng-model="saleClaimed.claimDestinationFk"
|
||||
url="/claim/api/ClaimDestinations"
|
||||
data="claimDestinations"
|
||||
fields="['id','description']"
|
||||
value-field="id"
|
||||
show-field="description"
|
||||
on-change="$ctrl.setClaimDestination(saleClaimed.id, value)">
|
||||
show-field="description">
|
||||
</vn-autocomplete>
|
||||
</vn-td>
|
||||
<vn-td>{{::saleClaimed.sale.ticket.landed | date: 'dd/MM/yyyy'}}</vn-td>
|
||||
|
|
|
@ -19,7 +19,8 @@ class Controller {
|
|||
}
|
||||
}
|
||||
},
|
||||
{relation: 'claimBeggining'}
|
||||
{relation: 'claimBeggining'},
|
||||
{relation: 'claimDestination'}
|
||||
]
|
||||
};
|
||||
this.resolvedState = 3;
|
||||
|
@ -82,16 +83,6 @@ class Controller {
|
|||
this.calculateTotals();
|
||||
}
|
||||
|
||||
setClaimDestination(id, claimDestinationFk) {
|
||||
if (claimDestinationFk) {
|
||||
let params = {id: id, claimDestinationFk: claimDestinationFk};
|
||||
let query = `claim/api/ClaimEnds/`;
|
||||
this.$http.patch(query, params).then(() => {
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
calculateTotals() {
|
||||
this.claimedTotal = 0;
|
||||
this.salesClaimed.forEach(sale => {
|
||||
|
|
Loading…
Reference in New Issue