Second step, add component bankEntity
This commit is contained in:
parent
31f18db72d
commit
5e201419f8
|
@ -2,7 +2,7 @@
|
|||
vn-id="model"
|
||||
url="SupplierAccounts"
|
||||
fields="['id', 'supplierFk', 'iban', 'bankEntityFk']"
|
||||
link="{bankEntityFk: $ctrl.$params.id}"
|
||||
link="{supplierFk: $ctrl.$params.id}"
|
||||
include="$ctrl.include"
|
||||
data="$ctrl.supplierAccounts"
|
||||
auto-load="true">
|
||||
|
|
|
@ -38,13 +38,6 @@ class Controller extends Section {
|
|||
return this.$http.patch(query, this.newBankEntity)
|
||||
.then(res => this.supplierAccount.bankEntityFk = res.data.id);
|
||||
}
|
||||
|
||||
onResponse(response) {
|
||||
this.supplier.postcode = response.code;
|
||||
this.supplier.city = response.city;
|
||||
this.supplier.provinceFk = response.provinceFk;
|
||||
this.supplier.countryFk = response.countryFk;
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnSupplierAccount', {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<vn-dialog class="edit"
|
||||
vn-id="bankentityDialog"
|
||||
vn-id="bankEntityDialog"
|
||||
on-open="$ctrl.onOpen()"
|
||||
on-accept="$ctrl.onAccept()"
|
||||
message="New bank entity">
|
||||
|
@ -9,7 +9,7 @@
|
|||
<vn-textfield
|
||||
vn-one
|
||||
vn-focus
|
||||
vn-id="entityname"
|
||||
vn-id="entityName"
|
||||
label="Name"
|
||||
ng-model="$ctrl.location.name"
|
||||
required="true">
|
||||
|
@ -35,6 +35,6 @@
|
|||
</tpl-body>
|
||||
<tpl-buttons>
|
||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||
<button id= "savePostcode" response="accept" translate>Save</button>
|
||||
<button id= "saveBankEntity" response="accept" translate>Save</button>
|
||||
</tpl-buttons>
|
||||
</vn-dialog>
|
||||
|
|
|
@ -4,12 +4,11 @@ import './style.scss';
|
|||
|
||||
class Controller extends Component {
|
||||
open() {
|
||||
this.$.bankentityDialog.show();
|
||||
this.$.bankEntityDialog.show();
|
||||
}
|
||||
|
||||
onOpen() {
|
||||
this.location = {};
|
||||
this.$.bankentity.focus();
|
||||
}
|
||||
|
||||
onCountryResponse(response) {
|
||||
|
@ -22,7 +21,7 @@ class Controller extends Component {
|
|||
throw new Error(`The country can't be empty`);
|
||||
|
||||
this.$http.patch(`bankentities`, this.location).then(() => {
|
||||
this.vnApp.showMessage(this.$t('The bankentity has been created. You can save the data now'));
|
||||
this.vnApp.showMessage(this.$t('The bank entity has been created. You can save the data now'));
|
||||
this.emit('response', {$response: this.location});
|
||||
});
|
||||
} catch (e) {
|
||||
|
|
|
@ -27,7 +27,7 @@ describe('Supplier', () => {
|
|||
controller.onAccept();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.vnApp.showMessage).toHaveBeenCalledWith('The bankentity has been created. You can save the data now');
|
||||
expect(controller.vnApp.showMessage).toHaveBeenCalledWith('The bank entity has been created. You can save the data now');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@ import './search-panel';
|
|||
import './summary';
|
||||
import './basic-data';
|
||||
import './fiscal-data';
|
||||
import './bankentity';
|
||||
import './account';
|
||||
import './contact';
|
||||
import './log';
|
||||
|
|
Loading…
Reference in New Issue