4856-worker.time-control #1375
|
@ -372,28 +372,30 @@ class Controller extends Section {
|
||||||
week: weekNumberValue
|
week: weekNumberValue
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// const filter = {
|
|
||||||
// where: {
|
this.$http.get('WorkerTimeControlMails', {filter})
|
||||||
// and: [
|
|
||||||
// {workerFk: parseInt(this.$params.id)},
|
|
||||||
// {year: this.date.getFullYear()},
|
|
||||||
// {week: weekNumberValue - 1}
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
this.$http.get('WorkerTimeControlMails/findOne', {filter})
|
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const state = res.data.state;
|
const [data] = res.data;
|
||||||
|
if (!data) return;
|
||||||
|
|
||||||
|
const state = data.state;
|
||||||
if (this.weekNumber == weekNumberValue) {
|
if (this.weekNumber == weekNumberValue) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
this.reason = res.data.reason;
|
this.reason = data.reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == 'CONFIRMED') {
|
if (state == 'CONFIRMED') {
|
||||||
weekNumber.classList.add('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';
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,5 +35,13 @@ vn-worker-time-control {
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirmed {
|
.confirmed {
|
||||||
color: #97B92F;
|
color: #97B92F;
|
||||||
|
}
|
||||||
|
|
||||||
|
.revise {
|
||||||
|
color: #f61e1e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sended {
|
||||||
|
color: #d19b25;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue