ticket create now takes clientFk from params #643

Merged
joan merged 2 commits from 2946-ticket_create_from_client_tickets into dev 2021-06-09 09:42:56 +00:00
3 changed files with 10 additions and 2 deletions
Showing only changes of commit f969323a86 - Show all commits

View File

@ -101,7 +101,7 @@ class Controller extends Component {
this.$http.get(`Agencies/getAgenciesWithWarehouse`, {params}).then(res => {
this.agencies = res.data;
const defaultAgency = this.agencies.find(agency=> {
const defaultAgency = this.agencies.find(agency => {
return agency.agencyModeFk == this.defaultAddress.agencyModeFk;
});
if (defaultAgency)

View File

@ -166,7 +166,7 @@
vn-tooltip="Payment on account..."
tooltip-position="left">
</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"
icon="add"
vn-tooltip="New ticket"

View File

@ -151,6 +151,14 @@ export default class Controller extends Section {
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'];