tricks with hours deleted and changed order
gitea/salix/test This commit looks good
Details
gitea/salix/test This commit looks good
Details
This commit is contained in:
parent
e7ca55fea3
commit
52c64e9c1d
|
@ -99,11 +99,13 @@ module.exports = Self => {
|
|||
|
||||
let teamIds = [];
|
||||
|
||||
if (worker.collegues().length) {
|
||||
if (worker.collegues().length && ctx.args.myTeam) {
|
||||
worker.collegues().forEach(collegue => {
|
||||
teamIds.push(collegue.collegueFk);
|
||||
});
|
||||
} else {
|
||||
}
|
||||
|
||||
if (ctx.args.mine || (worker.collegues().length === 0 && ctx.args.myTeam)) {
|
||||
worker = await Self.app.models.Worker.findOne({
|
||||
fields: ['id'],
|
||||
where: {userFk: ctx.req.accessToken.userId}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
url="/ticket/api/Tickets/filter"
|
||||
limit="20"
|
||||
data="tickets"
|
||||
order="shipped DESC, clientFk"
|
||||
order="shipped ASC, clientFk"
|
||||
auto-load="false">
|
||||
</vn-crud-model>
|
||||
<div class="content-block">
|
||||
|
|
|
@ -12,28 +12,25 @@ export default class Controller {
|
|||
this.goToTurns('ticket.weekly');
|
||||
}, name: 'Turns', always: true},
|
||||
];
|
||||
this.filter = {};
|
||||
|
||||
if (!$stateParams.q) {
|
||||
let today = new Date();
|
||||
let offset = today.getTimezoneOffset() * 60000;
|
||||
today.setHours(0, 0, 0, 0);
|
||||
today.setTime(today.getTime() - offset);
|
||||
|
||||
let tomorrow = new Date(today);
|
||||
tomorrow.setHours(23, 59, 59, 999);
|
||||
tomorrow.setTime(tomorrow.getTime() - offset);
|
||||
|
||||
let sixDays = new Date(today);
|
||||
sixDays.setDate(today.getDate() + 6);
|
||||
sixDays.setHours(23, 59, 59, 999);
|
||||
sixDays.setTime(sixDays.getTime() - offset);
|
||||
|
||||
this.filter = {mine: true, from: today, to: sixDays};
|
||||
this.filter = Object.assign(this.filter, {myTeam: true, from: today, to: sixDays});
|
||||
}
|
||||
}
|
||||
|
||||
$postLink() {
|
||||
if (this.filter)
|
||||
if (this.filter && this.filter != {})
|
||||
this.onSearch(this.filter);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue