diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 1fadb93f54..e064044eb2 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -372,28 +372,30 @@ class Controller extends Section { week: weekNumberValue } }; - // const filter = { - // where: { - // and: [ - // {workerFk: parseInt(this.$params.id)}, - // {year: this.date.getFullYear()}, - // {week: weekNumberValue - 1} - // ] - // } - // }; - this.$http.get('WorkerTimeControlMails/findOne', {filter}) + + this.$http.get('WorkerTimeControlMails', {filter}) .then(res => { - const state = res.data.state; + const [data] = res.data; + if (!data) return; + + const state = data.state; if (this.weekNumber == weekNumberValue) { this.state = state; - this.reason = res.data.reason; + this.reason = data.reason; } + if (state == 'CONFIRMED') { weekNumber.classList.add('confirmed'); - weekNumber.setAttribute('vn-tooltip', 'Conforme'); + weekNumber.setAttribute('title', 'Conforme'); + } + if (state == 'REVISE') { + weekNumber.classList.add('revise'); + weekNumber.setAttribute('title', 'No conforme'); + } + if (state == 'SENDED') { + weekNumber.classList.add('sended'); + weekNumber.setAttribute('title', 'Pendiente'); } - if (state == 'REVISE') weekNumber.style.color = '#FF4444'; - if (state == 'SENDED') weekNumber.style.color = '#E65F00'; }); } diff --git a/modules/worker/front/time-control/style.scss b/modules/worker/front/time-control/style.scss index d39f8418b3..000a3b144d 100644 --- a/modules/worker/front/time-control/style.scss +++ b/modules/worker/front/time-control/style.scss @@ -35,5 +35,13 @@ vn-worker-time-control { } .confirmed { - color: #97B92F; + color: #97B92F; +} + +.revise { + color: #f61e1e; +} + +.sended { + color: #d19b25; }