diff --git a/front/salix/components/bank-entity/index.js b/front/salix/components/bank-entity/index.js index e42e5a6ea7..192ebe0467 100644 --- a/front/salix/components/bank-entity/index.js +++ b/front/salix/components/bank-entity/index.js @@ -6,6 +6,7 @@ class Controller extends Component { open() { this.$.bankEntityDialog.show(); } + resetData() { this.data = {}; } @@ -15,9 +16,9 @@ class Controller extends Component { if (!this.data.countryFk) throw new Error(`The country can't be empty`); - this.$http.post(`bankEntities`, this.data).then(() => { + this.$http.post(`bankEntities`, this.data).then(res => { this.vnApp.showMessage(this.$t('The bank entity has been created. You can save the data now')); - this.emit('response', {$response: this.data}); + this.emit('response', {$response: res.data}); }); } catch (e) { this.vnApp.showError(this.$t(e.message)); diff --git a/modules/supplier/front/account/index.html b/modules/supplier/front/account/index.html index 6248da2e28..577fa4e877 100644 --- a/modules/supplier/front/account/index.html +++ b/modules/supplier/front/account/index.html @@ -32,7 +32,7 @@ + ng-click="$ctrl.showBankEntity($event, $index)"> @@ -62,6 +62,6 @@ \ No newline at end of file diff --git a/modules/supplier/front/account/index.js b/modules/supplier/front/account/index.js index 85b00d25c3..2a2fa00695 100644 --- a/modules/supplier/front/account/index.js +++ b/modules/supplier/front/account/index.js @@ -19,14 +19,17 @@ class Controller extends Section { } onResponse(response) { - this.name = response.name; - console.log(this.name); + console.log(response); + const data = this.$.model.data; + const supplierAccount = data[this.currentRowIndex]; + supplierAccount.bankEntityFk = response.id; } - showBankEntity(event) { + showBankEntity(event, $index) { if (event.defaultPrevented) return; event.preventDefault(); - this.$.bankEntity.show(); + this.currentRowIndex = $index; + this.$.bankEntity.open(); } onBankEntityAccept() {