ticket create now takes clientFk from params
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-06-08 17:30:00 +02:00
parent 43ddd509b6
commit f969323a86
3 changed files with 10 additions and 2 deletions

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'];