fix(problems): problems filter was not working properly on sales monitor
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Refs: 3040
This commit is contained in:
parent
4db25bf722
commit
04a817c4f9
|
@ -264,10 +264,35 @@ module.exports = Self => {
|
||||||
FROM tmp.filter f
|
FROM tmp.filter f
|
||||||
LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id`);
|
LEFT JOIN tmp.ticket_problems tp ON tp.ticketFk = f.id`);
|
||||||
|
|
||||||
if (args.problems != undefined && (!args.from && !args.to))
|
const hasProblems = args.problems;
|
||||||
|
if (hasProblems != undefined && (!args.from && !args.to))
|
||||||
throw new UserError('Choose a date range or days forward');
|
throw new UserError('Choose a date range or days forward');
|
||||||
|
|
||||||
let condition;
|
let problemsFilter;
|
||||||
|
if (hasProblems === true) {
|
||||||
|
problemsFilter = {or: [
|
||||||
|
{'tp.isFreezed': true},
|
||||||
|
{'tp.risk': {gt: 0}},
|
||||||
|
{'tp.hasTicketRequest': true},
|
||||||
|
{'tp.hasComponentLack': true},
|
||||||
|
{'tp.isTaxDataChecked': false},
|
||||||
|
{'tp.isAvailable': false}
|
||||||
|
]};
|
||||||
|
} else if (hasProblems === false) {
|
||||||
|
problemsFilter = {and: [
|
||||||
|
{'tp.isFreezed': false},
|
||||||
|
{'tp.risk': 0},
|
||||||
|
{'tp.hasTicketRequest': false},
|
||||||
|
{'tp.hasComponentLack': false},
|
||||||
|
{'tp.isTaxDataChecked': true},
|
||||||
|
{'tp.isAvailable': true}
|
||||||
|
]};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (problemsFilter)
|
||||||
|
stmt.merge(conn.makeWhere(problemsFilter));
|
||||||
|
|
||||||
|
/* let condition;
|
||||||
let hasProblem;
|
let hasProblem;
|
||||||
let range;
|
let range;
|
||||||
let hasWhere;
|
let hasWhere;
|
||||||
|
@ -289,13 +314,11 @@ module.exports = Self => {
|
||||||
|
|
||||||
let problems = {[condition]: [
|
let problems = {[condition]: [
|
||||||
{'tp.isFreezed': hasProblem},
|
{'tp.isFreezed': hasProblem},
|
||||||
{'tp.risk': hasProblem},
|
{'tp.risk': hasProblem ? {gt: 0} : null},
|
||||||
{'tp.hasTicketRequest': hasProblem},
|
{'tp.hasTicketRequest': hasProblem},
|
||||||
|
{'tp.hasComponentLack': hasProblem},
|
||||||
{'tp.isAvailable': range}
|
{'tp.isAvailable': range}
|
||||||
]};
|
]}; */
|
||||||
|
|
||||||
if (hasWhere)
|
|
||||||
stmt.merge(conn.makeWhere(problems));
|
|
||||||
|
|
||||||
stmt.merge(conn.makeOrderBy(filter.order));
|
stmt.merge(conn.makeOrderBy(filter.order));
|
||||||
stmt.merge(conn.makeLimit(filter));
|
stmt.merge(conn.makeLimit(filter));
|
||||||
|
|
|
@ -51,6 +51,11 @@
|
||||||
class="clickable vn-tr search-result"
|
class="clickable vn-tr search-result"
|
||||||
ui-sref="ticket.card.summary({id: {{::ticket.id}}})" target="_blank">
|
ui-sref="ticket.card.summary({id: {{::ticket.id}}})" target="_blank">
|
||||||
<vn-td class="icon-field">
|
<vn-td class="icon-field">
|
||||||
|
<!-- {{ticket.isFreezed}}
|
||||||
|
{{ticket.risk}}
|
||||||
|
{{ticket.hasTicketRequest}}
|
||||||
|
{{ticket.hasComponentLack}}
|
||||||
|
{{ticket.isAvailable}} -->
|
||||||
<vn-icon
|
<vn-icon
|
||||||
ng-show="::ticket.isTaxDataChecked === 0"
|
ng-show="::ticket.isTaxDataChecked === 0"
|
||||||
translate-attr="{title: 'No verified data'}"
|
translate-attr="{title: 'No verified data'}"
|
||||||
|
|
Loading…
Reference in New Issue