ticket create now takes clientFk from params #643
|
@ -101,7 +101,7 @@ class Controller extends Component {
|
||||||
|
|
||||||
this.$http.get(`Agencies/getAgenciesWithWarehouse`, {params}).then(res => {
|
this.$http.get(`Agencies/getAgenciesWithWarehouse`, {params}).then(res => {
|
||||||
this.agencies = res.data;
|
this.agencies = res.data;
|
||||||
const defaultAgency = this.agencies.find(agency=> {
|
const defaultAgency = this.agencies.find(agency => {
|
||||||
return agency.agencyModeFk == this.defaultAddress.agencyModeFk;
|
return agency.agencyModeFk == this.defaultAddress.agencyModeFk;
|
||||||
});
|
});
|
||||||
if (defaultAgency)
|
if (defaultAgency)
|
||||||
|
|
|
@ -166,7 +166,7 @@
|
||||||
vn-tooltip="Payment on account..."
|
vn-tooltip="Payment on account..."
|
||||||
tooltip-position="left">
|
tooltip-position="left">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
<a ui-sref="ticket.create" vn-bind="+">
|
<a ui-sref="ticket.create($ctrl.clientParams())" vn-bind="+">
|
||||||
<vn-button class="round md vn-mb-sm"
|
<vn-button class="round md vn-mb-sm"
|
||||||
icon="add"
|
icon="add"
|
||||||
vn-tooltip="New ticket"
|
vn-tooltip="New ticket"
|
||||||
|
|
|
@ -151,6 +151,14 @@ export default class Controller extends Section {
|
||||||
|
|
||||||
return [minHour, maxHour];
|
return [minHour, maxHour];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clientParams() {
|
||||||
|
if (this.$params.q) {
|
||||||
|
const params = JSON.parse(this.$params.q);
|
||||||
|
if (params.clientFk) return {clientFk: params.clientFk};
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Controller.$inject = ['$element', '$scope', 'vnReport'];
|
Controller.$inject = ['$element', '$scope', 'vnReport'];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue