diff --git a/modules/supplier/front/agency-term/create/index.html b/modules/supplier/front/agency-term/create/index.html index 5d0dca4ef..f224edc0e 100644 --- a/modules/supplier/front/agency-term/create/index.html +++ b/modules/supplier/front/agency-term/create/index.html @@ -10,7 +10,7 @@ auto-load="true" url="Agencies" filter="$ctrl.filter" - data="agencies"> + data="$ctrl.agencies">
@@ -18,7 +18,7 @@ diff --git a/modules/supplier/front/agency-term/create/index.js b/modules/supplier/front/agency-term/create/index.js index f876f9003..efd5f913d 100644 --- a/modules/supplier/front/agency-term/create/index.js +++ b/modules/supplier/front/agency-term/create/index.js @@ -5,22 +5,29 @@ export default class Controller extends Section { constructor($element, $) { super($element, $); - this.filter = { - fields: [ - 'name' - ], - include: [{ - relation: 'supplierAgencyTerm', - where: { - supplierFk: 1 - } - }], + this.supplierAgencyTerm = { + supplierFk: this.$params.id }; + + this.filter = { + include: { + relation: 'supplierAgencyTerm', + scope: { + where: { + supplierFk: 1 + } + } + } + }; + } + + $onInit() { + console.log(this); } onSubmit() { this.$.watcher.submit().then(res => { - this.$state.go('supplier.card.address.index'); + this.$state.go('supplier.card.agencyTerm.index'); }); } } diff --git a/modules/supplier/front/agency-term/index/index.html b/modules/supplier/front/agency-term/index/index.html index b472aaf91..835de5cbf 100644 --- a/modules/supplier/front/agency-term/index/index.html +++ b/modules/supplier/front/agency-term/index/index.html @@ -68,14 +68,6 @@ - - - -