add isInvalid to leave entity - set query filter for it
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
data-action="ReloadLeave">
|
||||
|
||||
<input type="hidden" asp-for="@Model.WorkshopId" />
|
||||
<input type="hidden" asp-for="@Model.IsInvallid" id="isInvalid" />
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
@@ -208,6 +209,8 @@
|
||||
var computeLeaveDailyAjax = `@Url.Page("/Company/Employees/Leave", "ComputeLeaveDaily")`;
|
||||
var employeeListAjax = `@Url.Page("Index", "EmployeeList")`;
|
||||
var hasRotatingShiftAjax = `@Url.Page("/Company/Employees/Leave", "HasRotatingShift")`;
|
||||
var checkCanCreateInvalidUrl = `@Url.Page("/Company/Employees/Leave","CheckIsInvalidLeave")`;
|
||||
|
||||
</script>
|
||||
|
||||
<script src="~/assetsclient/pages/employees/js/createleave.js?ver=@clientVersion"></script>
|
||||
|
||||
@@ -315,7 +315,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-span-2 md-col-span-2"><input type="text" class="form-control date start-date" asp-for="SearchModel.StartLeave" placeholder="تاریخ شروع"></div>
|
||||
<div class="col-span-1 md-col-span-2"><input type="text" class="form-control date start-date" asp-for="SearchModel.StartLeave" placeholder="تاریخ شروع"></div>
|
||||
<div class="col-span-2 md-col-span-2"><input type="text" class="form-control date end-date" asp-for="SearchModel.EndLeave" placeholder="تاریخ پایان"></div>
|
||||
|
||||
<div class="col-span-2 md-col-span-3">
|
||||
|
||||
@@ -15,7 +15,9 @@ using System.Text.RegularExpressions;
|
||||
using _0_Framework.Infrastructure;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.HolidayItem;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
using CompanyManagment.App.Contracts.RollCallService;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
{
|
||||
@@ -49,10 +51,12 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly long _workshopId;
|
||||
private readonly IHolidayItemApplication _holidayItemApplication;
|
||||
private readonly IRollCallServiceApplication _rollCallServiceApplication;
|
||||
public int PageIndex;
|
||||
|
||||
#region Initial Data
|
||||
public LeaveModel(IWorkshopApplication workshopApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, ILeaveApplication leaveApplication, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher, IHttpContextAccessor contextAccessor, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication)
|
||||
public LeaveModel(IWorkshopApplication workshopApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, ILeaveApplication leaveApplication, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher, IHttpContextAccessor contextAccessor, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IHolidayItemApplication holidayItemApplication, IRollCallServiceApplication rollCallServiceApplication)
|
||||
{
|
||||
_workshopApplication = workshopApplication;
|
||||
_employeeApplication = employeeApplication;
|
||||
@@ -62,6 +66,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
_contextAccessor = contextAccessor;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_holidayItemApplication = holidayItemApplication;
|
||||
_rollCallServiceApplication = rollCallServiceApplication;
|
||||
_authHelper = authHelper;
|
||||
|
||||
|
||||
@@ -166,6 +172,35 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
PrintID = result.SendId
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostCheckIsInvalidLeave(string startDate)
|
||||
{
|
||||
bool isInHoliday = false;
|
||||
bool canCreateInvalid = false;
|
||||
var dateTimeGr = startDate.ToGeorgianDateTime();
|
||||
if (dateTimeGr.DayOfWeek == DayOfWeek.Friday)
|
||||
{
|
||||
isInHoliday = true;
|
||||
}else if (_holidayItemApplication.IsHoliday(dateTimeGr))
|
||||
{
|
||||
isInHoliday = true;
|
||||
};
|
||||
|
||||
if (isInHoliday)
|
||||
{
|
||||
var rollCallService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(_workshopId);
|
||||
if (rollCallService != null)
|
||||
{
|
||||
canCreateInvalid =rollCallService.HasCustomizeCheckoutService == "true";
|
||||
}
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isInHoliday,
|
||||
canCreateInvalid
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Check If Valide To Edit
|
||||
|
||||
@@ -329,7 +329,8 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(item.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (item.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
<div class="row">
|
||||
<div class="col-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; width: 60%; font-size: 12px; text-align: center;"> @item.ContractNo</fieldset></div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(item.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (item.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -298,7 +298,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(Model.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (Model.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
<div class="row">
|
||||
<div class="col-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(Model.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (Model.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -548,6 +548,7 @@ svg {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-global-item {
|
||||
padding: 4px 10px;
|
||||
cursor: pointer;
|
||||
@@ -567,4 +568,101 @@ svg {
|
||||
|
||||
.dropdown-global.active .dropdown-global-content {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
/* --------------------------------------------------------------------------------Invalid-------------------------------------------------------------------------------------- */
|
||||
|
||||
/* the code below is for the dropdown menu */
|
||||
.wrapper-dropdown-invalid {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 3px 7px;
|
||||
border-radius: 7px;
|
||||
background: #ffffff;
|
||||
color: #575a5d;
|
||||
border: 1px solid #DADADA;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 16px;
|
||||
margin-top: -2px;
|
||||
border-width: 6px 6px 0 6px;
|
||||
border-style: solid;
|
||||
border-color: #fff transparent;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid {
|
||||
transition: 0.3s;
|
||||
position: absolute;
|
||||
top: 120%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
z-index: 99;
|
||||
border-radius: 15px;
|
||||
background: inherit;
|
||||
-webkit-transform-origin: top;
|
||||
-moz-transform-origin: top;
|
||||
-ms-transform-origin: top;
|
||||
transform-origin: top;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
height: auto;
|
||||
overflow: auto;
|
||||
scrollbar-width: none;
|
||||
scrollbar-color: #dfe3ea #fff;
|
||||
border: 1px solid #DADADA;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid li {
|
||||
padding: 0 10px;
|
||||
line-height: 36px;
|
||||
overflow: hidden;
|
||||
transition: all .1s ease;
|
||||
margin: 2px 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.dropdown-invalid {
|
||||
padding: 0.5rem !important;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid li:hover {
|
||||
background-color: #3ad1d1;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid .active {
|
||||
background-color: #3ad1d1;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid.active .dropdown-invalid {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ $(document).ready(function () {
|
||||
return data.text;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".select2OptionShift").select2({
|
||||
language: "fa",
|
||||
dir: "rtl",
|
||||
@@ -27,12 +27,12 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
ajaxPersonals();
|
||||
ajaxPersonals();
|
||||
$("#cardSectionLeave div *").prop('disabled', true);
|
||||
|
||||
document.getElementById("MainModal").style.visibility = "visible";
|
||||
document.getElementById("MainModal").style.visibility = "visible";
|
||||
|
||||
$('#employeeSelectList').on('change', function () {
|
||||
$('#employeeSelectList').on('change', function () {
|
||||
$('#rotatingShiftSection').addClass('disable');
|
||||
$('#HasRollCall').val(false);
|
||||
previousStartDate = "";
|
||||
@@ -65,7 +65,7 @@ $(document).ready(function () {
|
||||
$('#SelectedShift_EndTime').val(endTime || '');
|
||||
});
|
||||
|
||||
$('#employeeSelectList').change(function () {
|
||||
$('#employeeSelectList').change(function () {
|
||||
var selectValue = $('#employeeSelectList').val();
|
||||
|
||||
if (selectValue === '') {
|
||||
@@ -78,64 +78,64 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
$(document).on("change", ".LeaveType", function () {
|
||||
if ($('#paid').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'visible');
|
||||
rotatingShift();
|
||||
}
|
||||
|
||||
if ($('#sick').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'hidden');
|
||||
$('#daily').prop('checked', true);
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
}
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
$(document).on("change", ".LeaveType", function () {
|
||||
if ($('#paid').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'visible');
|
||||
rotatingShift();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// شرط ساعتی و روزانه
|
||||
$(document).on("change", ".LeaveTime", function () {
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
if ($('#sick').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'hidden');
|
||||
$('#daily').prop('checked', true);
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
}
|
||||
rotatingShift();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#hourly').is(':checked')) {
|
||||
$('#end_date_estehghaghi').hide();
|
||||
$('.time_paid').show();
|
||||
// شرط ساعتی و روزانه
|
||||
$(document).on("change", ".LeaveTime", function () {
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
rotatingShift();
|
||||
}
|
||||
});
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
}
|
||||
|
||||
if ($('#hourly').is(':checked')) {
|
||||
$('#end_date_estehghaghi').hide();
|
||||
$('.time_paid').show();
|
||||
rotatingShift();
|
||||
}
|
||||
});
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
|
||||
|
||||
//******************** بلور کردن باکس ********************
|
||||
$('#IsAccepted').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
//******************** بلور کردن باکس ********************
|
||||
$('#IsAccepted').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if ($('#IsAccepted').is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
//******************** بلور کردن باکس ********************
|
||||
if ($('#IsAccepted').is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
//******************** بلور کردن باکس ********************
|
||||
|
||||
$(document).on("change", "#IsAccepted", function () {
|
||||
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
@@ -149,7 +149,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$('#save').on('click', function () {
|
||||
$('#save').on('click', function () {
|
||||
|
||||
var hasRollCallInput = $("#HasRollCall").val();
|
||||
var rotatingShiftInput = $("#rotatingShift").val();
|
||||
@@ -166,91 +166,128 @@ $(document).ready(function () {
|
||||
}
|
||||
}
|
||||
|
||||
$("#descriptionAcceptedCheck").on("change", function () {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
$("#descriptionAcceptedCheck").on("change", function () {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
|
||||
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
var descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
var descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا توضیحات در صورت عدم موافقت را پر کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
return false;
|
||||
}
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا توضیحات در صورت عدم موافقت را پر کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($('.errored').length < 1) {
|
||||
$('#saveFinaly').click();
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا خطاها را برطرف کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
});
|
||||
if ($('.errored').length < 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: checkCanCreateInvalidUrl,
|
||||
headers: {"RequestVerificationToken": antiForgeryToken},
|
||||
data: {"startDate": $('#StartLeave').val()},
|
||||
success: function (response) {
|
||||
debugger;
|
||||
if (response.isInHoliday) {
|
||||
if (response.canCreateInvalid) {
|
||||
swal({
|
||||
title: "در قانون کار کشور ایجاد مرخصی در روز های تعطیل فاقد اعتبار میباشد، و فقط در فیش های حقوقی غیر رسمی قابل استفاده میباشند. آیا میخواهید ادامه دهید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('#isInvalid').val("true");
|
||||
$('#saveFinaly').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (response.isInHoliday === false) {
|
||||
$('#saveFinaly').click();
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
//$('#saveFinaly').click();
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا خطاها را برطرف کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
});
|
||||
|
||||
$(".date").on('input', function () {
|
||||
var value = $(this).val();
|
||||
$(this).val(convertPersianNumbersToEnglish(value));
|
||||
}).mask("0000/00/00");
|
||||
$('.date').on('input', function () {
|
||||
let startDate = this.value;
|
||||
if (startDate.length === 10) {
|
||||
let submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
$(".date").on('input', function () {
|
||||
var value = $(this).val();
|
||||
$(this).val(convertPersianNumbersToEnglish(value));
|
||||
}).mask("0000/00/00");
|
||||
$('.date').on('input', function () {
|
||||
let startDate = this.value;
|
||||
if (startDate.length === 10) {
|
||||
let submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
|
||||
$(this).removeClass('errored');
|
||||
if ($('#StartLeave').val() != '' && $('#EndLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
$(this).removeClass('errored');
|
||||
if ($('#StartLeave').val() != '' && $('#EndLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
});
|
||||
|
||||
$('input:radio[name="PaidLeaveType"]').change(function () {
|
||||
if ($(this).is(':checked') && $(this).val() == 'روزانه') {
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$('.endLeaveLabal').show();
|
||||
$('#StartHoures').removeClass("invalidTime");
|
||||
$('#StartHoures').val('');
|
||||
$('#EndHours').removeClass("invalidTime");
|
||||
$('#EndHours').val('');
|
||||
$("#endLeave").show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
} else if ($(this).is(':checked') && $(this).val() == 'ساعتی') {
|
||||
$("#endLeave").val('');
|
||||
$("#endLeave").attr("disabled", "disabled");
|
||||
$("#endLeave").hide();
|
||||
$('.endLeaveLabal').hide();
|
||||
$("#hours").removeAttr("disabled");
|
||||
$('.sumHourseDiv').show();
|
||||
$('.sumDaysDiv').hide();
|
||||
}
|
||||
});
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
$('input:radio[name="PaidLeaveType"]').change(function () {
|
||||
if ($(this).is(':checked') && $(this).val() == 'روزانه') {
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$('.endLeaveLabal').show();
|
||||
$('#StartHoures').removeClass("invalidTime");
|
||||
$('#StartHoures').val('');
|
||||
$('#EndHours').removeClass("invalidTime");
|
||||
$('#EndHours').val('');
|
||||
$("#endLeave").show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
} else if ($(this).is(':checked') && $(this).val() == 'ساعتی') {
|
||||
$("#endLeave").val('');
|
||||
$("#endLeave").attr("disabled", "disabled");
|
||||
$("#endLeave").hide();
|
||||
$('.endLeaveLabal').hide();
|
||||
$("#hours").removeAttr("disabled");
|
||||
$('.sumHourseDiv').show();
|
||||
$('.sumDaysDiv').hide();
|
||||
}
|
||||
});
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
@@ -264,6 +301,7 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$("#StartHoures, #EndHours").on("keyup", validateTimeOrder);
|
||||
|
||||
function parseTimeToMinutes(time) {
|
||||
const [hours, minutes] = time.split(':').map(Number);
|
||||
return hours * 60 + minutes;
|
||||
@@ -301,121 +339,122 @@ $(document).ready(function () {
|
||||
return true;
|
||||
}
|
||||
|
||||
//$('#StartHoures').on("keyup", function () {
|
||||
// var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
// if (isValid) {
|
||||
// $(this).addClass("validTime");
|
||||
// $(this).removeClass("invalidTime");
|
||||
// if ($('#EndHours').hasClass('validTime') && $('#EndHours').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
//$('#EndHours').on("keyup", function () {
|
||||
// var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
// if (isValid) {
|
||||
// $(this).addClass("validTime");
|
||||
// $(this).removeClass("invalidTime");
|
||||
// if ($('#StartHoures').hasClass('validTime') && $('#StartHoures').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
//$('#StartHoures').on("keyup", function () {
|
||||
// var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
// if (isValid) {
|
||||
// $(this).addClass("validTime");
|
||||
// $(this).removeClass("invalidTime");
|
||||
// if ($('#EndHours').hasClass('validTime') && $('#EndHours').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
//$('#EndHours').on("keyup", function () {
|
||||
// var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
// if (isValid) {
|
||||
// $(this).addClass("validTime");
|
||||
// $(this).removeClass("invalidTime");
|
||||
// if ($('#StartHoures').hasClass('validTime') && $('#StartHoures').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
//$('#employeeSelect').change(function () {
|
||||
// var selectValue = $('#employeeSelect').val();
|
||||
//
|
||||
// if (selectValue == '') {
|
||||
// $('#cardSectionLeave').addClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', true);
|
||||
// } else {
|
||||
// $('#cardSectionLeave').removeClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', false);
|
||||
// $('#descriptionAcceptedCheck').attr('disabled', true);
|
||||
// }
|
||||
//});
|
||||
|
||||
//$('#employeeSelect').change(function () {
|
||||
// var selectValue = $('#employeeSelect').val();
|
||||
//
|
||||
// if (selectValue == '') {
|
||||
// $('#cardSectionLeave').addClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', true);
|
||||
// } else {
|
||||
// $('#cardSectionLeave').removeClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', false);
|
||||
// $('#descriptionAcceptedCheck').attr('disabled', true);
|
||||
// }
|
||||
//});
|
||||
|
||||
});
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
// inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
if (isValid && test1) {
|
||||
// inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
//$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
//$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
$('#StartLeave').addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا تاریخ را بصورت صحیح وارد کنید');
|
||||
@@ -424,161 +463,161 @@ function dateValidcheck(inputField1) {
|
||||
$('.alert-msg p').text("");
|
||||
$('#StartLeave').removeClass("errored");
|
||||
}, 3500);
|
||||
start1valid = false;
|
||||
}
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function computeHourse() {
|
||||
@@ -588,9 +627,9 @@ function computeHourse() {
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: computeLeaveHourlyAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "startHours": $('#StartHoures').val(), "endHours": $('#EndHours').val() },
|
||||
url: computeLeaveHourlyAjax,
|
||||
headers: {"RequestVerificationToken": antiForgeryToken},
|
||||
data: {"startHours": $('#StartHoures').val(), "endHours": $('#EndHours').val()},
|
||||
success: function (response) {
|
||||
let res = `<span class="res">${response.res}</span>`;
|
||||
$('.sumHours').append(res);
|
||||
@@ -608,9 +647,9 @@ function computeDays() {
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: computeLeaveDailyAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "startDay": $('#StartLeave').val(), "endDay": $('#EndLeave').val() },
|
||||
url: computeLeaveDailyAjax,
|
||||
headers: {"RequestVerificationToken": antiForgeryToken},
|
||||
data: {"startDay": $('#StartLeave').val(), "endDay": $('#EndLeave').val()},
|
||||
success: function (response) {
|
||||
if (response.status == false) {
|
||||
$('.sumDays').addClass("note");
|
||||
@@ -635,11 +674,11 @@ function ajaxPersonals() {
|
||||
$("#cardSectionLeave div *").prop('disabled', true);
|
||||
var employees = response.data;
|
||||
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
|
||||
employees.forEach(function (employee) {
|
||||
var black = employee.black ? "blackSelect" : "";
|
||||
employees.forEach(function (employee) {
|
||||
var black = employee.black ? "blackSelect" : "";
|
||||
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
|
||||
});
|
||||
$('#employeeSelectList').html(employeeOptionsHtml);
|
||||
$('#employeeSelectList').html(employeeOptionsHtml);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@@ -648,15 +687,13 @@ function ajaxPersonals() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function rotatingShift() {
|
||||
var startDateValue = $('#StartLeave').val();
|
||||
$('#rotatingShiftSection').addClass('disable');
|
||||
|
||||
if ($('#paid').is(':checked') && $('#daily').is(':checked') && startDateValue.length === 10) {
|
||||
|
||||
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
|
||||
ajaxService.get(hasRotatingShiftAjax, {employeeId: currentEmployeeId, startDateTime: startDateValue})
|
||||
.then(response => {
|
||||
$('#HasRollCall').val(response.hasRollCall);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user