refs #5918 fix: permite reenviar el correo si ha dado fallo
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-07-21 12:58:44 +02:00
parent eb963ff993
commit 8267daef3a
2 changed files with 33 additions and 0 deletions

View File

@ -97,6 +97,8 @@
ng-if="$ctrl.reason && ($ctrl.isHimSelf || $ctrl.isHr)"
ng-click="reason.show()">
</vn-button>
</vn-button-bar>
<vn-button-bar ng-show="$ctrl.canResend" class="vn-w-lg">
<vn-button
label="Resend"
ng-click="sendEmailConfirmation.show()"

View File

@ -89,6 +89,7 @@ class Controller extends Section {
this.fetchHours();
this.getWeekData();
this.isMailSended();
}
getWeekData() {
@ -111,6 +112,36 @@ class Controller extends Section {
});
}
isMailSended() {
const filter = {
where: {
year: this._date.getFullYear(),
week: this.getWeekNumber(this._date)
}
};
this.$http.get('WorkerTimeControlMails', {filter})
.then(res => {
if (!res.data.length) {
this.canResend = false;
return;
}
const filter = {
where: {
workerFk: this.$params.id
},
include: {
relation: 'department'
}
};
this.$http.get('WorkerDepartments', {filter})
.then(res => {
const department = res.data[0].department;
if (department.isTeleworking) this.canResend = true;
});
});
}
/**
* Worker hours data
*/