HOTFIX New order from Customer #3186
|
@ -70,10 +70,18 @@ export default class App {
|
|||
|
||||
if (this.logger.$params.q) {
|
||||
let tableValue = this.logger.$params.q;
|
||||
const q = JSON.parse(tableValue);
|
||||
if (typeof q === 'number')
|
||||
tableValue = JSON.stringify({id: tableValue});
|
||||
newRoute = newRoute.concat(`?table=${tableValue}`);
|
||||
if (Array.isArray(tableValue)) {
|
||||
const [key, param1, param2] = tableValue;
|
||||
const payload = key === 'createForm'
|
||||
? {[param1]: param2}
|
||||
: {[key]: param1};
|
||||
newRoute += `?${key}=${JSON.stringify(payload)}`;
|
||||
} else {
|
||||
const q = JSON.parse(tableValue);
|
||||
if (typeof q === 'number')
|
||||
tableValue = JSON.stringify({id: tableValue});
|
||||
newRoute = newRoute.concat(`?table=${tableValue}`);
|
||||
}
|
||||
} else if (!hasId && this.logger.$params.id && newRoute.indexOf(this.logger.$params.id) < 0)
|
||||
newRoute = newRoute.concat(`${this.logger.$params.id}`);
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
<div ng-transclude="btnThree">
|
||||
<vn-quick-link
|
||||
tooltip="New order"
|
||||
state="['order.create', {clientFk: $ctrl.id}]"
|
||||
state="['order.index', {q: ['createForm', 'clientFk', $ctrl.id]}]"
|
||||
icon="icon-basketadd">
|
||||
</vn-quick-link>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue