#1045 ticket.datos basicos

This commit is contained in:
Carlos Jimenez Ruiz 2019-01-24 15:41:48 +01:00
parent 1337e0e92f
commit 7096273800
2 changed files with 19 additions and 5 deletions

View File

@ -19,7 +19,7 @@
value-field="id"
field="$ctrl.ticket.addressFk">
<tpl-item>{{::nickname}}
<span ng-show="city || province">- {{::city}} ({{::province.name}})</span>
<span ng-show="city || province || street">- {{::street}} - {{::city}} - {{::province.name}} - {{::agencyMode.name}}</span>
</tpl-item>
</vn-autocomplete>
<vn-autocomplete vn-one

View File

@ -35,6 +35,8 @@ class Controller {
get clientFk() {
if (this.ticket)
return this.ticket.clientFk;
return null;
}
set shipped(value) {
@ -45,6 +47,8 @@ class Controller {
get shipped() {
if (this.ticket)
return this.ticket.shipped;
return null;
}
set landed(value) {
@ -55,6 +59,8 @@ class Controller {
get landed() {
if (this.ticket)
return this.ticket.landed;
return null;
}
onChangeShipped(value) {
@ -94,6 +100,12 @@ class Controller {
scope: {
fields: ['name']
}
},
{
relation: 'agencyMode',
scope: {
fields: ['name']
}
}
]
};
@ -107,10 +119,11 @@ class Controller {
}
async onStepChange(state) {
if (this.isFormInvalid())
if (this.isFormInvalid()) {
return this.vnApp.showError(
this.$translate.instant('Some fields are invalid')
);
}
let query = `/ticket/api/sales/${this.ticket.id}/priceDifference`;
let data = {
@ -126,10 +139,11 @@ class Controller {
return true;
}, res => {
if (res.data.error.message === 'NO_AGENCY_AVAILABLE')
if (res.data.error.message === 'NO_AGENCY_AVAILABLE') {
this.vnApp.showMessage(
this.$translate.instant(`There's no available agency for this landing date`)
);
}
});
}