Added autocomplete on bank entity
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Jorge Padawan 2021-02-17 12:07:04 +01:00
parent a2ad1887a4
commit f10092d2cf
3 changed files with 12 additions and 8 deletions

View File

@ -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));

View File

@ -32,7 +32,7 @@
<vn-icon-button
icon="add_circle"
vn-tooltip="New bank entity"
ng-click="bankentity.open()">
ng-click="$ctrl.showBankEntity($event, $index)">
</vn-icon-button>
</append>
<vn-none>
@ -62,6 +62,6 @@
</form>
<!-- New bankentity dialog -->
<vn-new-bank-entity
vn-id="bankentity"
vn-id="bankEntity"
on-response="$ctrl.onResponse($response)">
</vn-new-bank-entity>

View File

@ -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() {