Bug #576 Cambiar los bindings del textfield
This commit is contained in:
parent
16dfaf8943
commit
17b70192af
|
@ -6,7 +6,7 @@
|
||||||
label="Discount"
|
label="Discount"
|
||||||
model="$ctrl.newDiscount"
|
model="$ctrl.newDiscount"
|
||||||
type="text"
|
type="text"
|
||||||
accept="$ctrl.updateDiscount()">
|
on-change="$ctrl.updateDiscount()">
|
||||||
<t-right-icons>
|
<t-right-icons>
|
||||||
<span class="filter">%</span>
|
<span class="filter">%</span>
|
||||||
</t-right-icons>
|
</t-right-icons>
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Controller {
|
||||||
this.$http = $http;
|
this.$http = $http;
|
||||||
this.$state = $state;
|
this.$state = $state;
|
||||||
this.vnApp = vnApp;
|
this.vnApp = vnApp;
|
||||||
this.translate = $translate;
|
this.$translate = $translate;
|
||||||
}
|
}
|
||||||
|
|
||||||
set edit(value) {
|
set edit(value) {
|
||||||
|
@ -37,7 +37,7 @@ class Controller {
|
||||||
let editLines = [];
|
let editLines = [];
|
||||||
let modified = false;
|
let modified = false;
|
||||||
for (let i = 0; i < this.edit.length; i++) {
|
for (let i = 0; i < this.edit.length; i++) {
|
||||||
if (this.newDiscount != this.edit[0].discount || this.bulk) {
|
if (this.newDiscount != this.edit[0].discount || this.bulk || !this.newDiscount) {
|
||||||
editLines.push({id: this.edit[i].id, discount: this.newDiscount, ticketFk: this.$state.params.id});
|
editLines.push({id: this.edit[i].id, discount: this.newDiscount, ticketFk: this.$state.params.id});
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
@ -45,14 +45,14 @@ class Controller {
|
||||||
if (modified) {
|
if (modified) {
|
||||||
this.$http.post(`/ticket/api/Sales/updateDiscount`, {editLines}).then(() => {
|
this.$http.post(`/ticket/api/Sales/updateDiscount`, {editLines}).then(() => {
|
||||||
this.hide();
|
this.hide();
|
||||||
this.vnApp.showSuccess(this.translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||||
this.clear();
|
this.clear();
|
||||||
modified = false;
|
modified = false;
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.vnApp.showError(this.translate.instant(e.data.error.message));
|
this.vnApp.showError(e.data.error.message);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.vnApp.showError(this.translate.instant('There is no changes to save'));
|
this.vnApp.showError(this.$translate.instant('There is no changes to save'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue