Merge remote-tracking branch 'origin/Feature/Leave/CreateLeaveStyleChanges'

This commit is contained in:
SamSys
2025-04-22 22:45:26 +03:30
7 changed files with 273 additions and 198 deletions

View File

@@ -55,28 +55,29 @@
<div id="cardSectionLeave" class="card px-2 border blur">
<div class="row my-3">
<div class="col-12 col-md-8 d-block d-sm-flex">
<div class="d-flex align-items-center mb-2">
<label class="d-flex justify-content-center align-items-center">نوع مرخصی:</label>
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center my-1">
<div class="d-flex align-items-center">
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
<div class="col-12 col-md-8">
<label class="d-flex justify-content-start align-items-center">نوع مرخصی:</label>
<div class="d-block d-sm-flex">
<div class="d-flex align-items-center mb-2">
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center my-1">
<div class="d-flex align-items-center">
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
</label>
</div>
</div>
<div class="my-1">
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
<div class="my-1">
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
</div>
<div class="ms-sm-4" id="dailyType">
<div class="ms-sm-4" id="dailyType">
<div class="d-flex align-items-center">
<label class="d-block d-sm-flex justify-content-center align-items-center" for="inputGroup-morakhasi-time">مدت مرخصی:</label>
<div class="inputGroup-morakhasi-time d-flex align-items-center">
@@ -92,8 +93,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-4 mt-2 mt-md-0" id="rotatingShiftSection" style="display: none">
<div class="col-12 col-md-4 mt-2 mt-md-0 disable" id="rotatingShiftSection">
<div>
<input type="hidden" asp-for="HasRollCall" id="HasRollCall">
<input type="hidden" name="SelectedShift.StartTime" id="SelectedShift_StartTime" />

View File

@@ -45,28 +45,29 @@
<div id="cardSectionLeave" class="card border p-1">
<div class="row my-3">
<div class="col-12 col-md-8 d-block d-sm-flex">
<div class="d-flex align-items-center">
<label class="d-flex justify-content-center align-items-center">نوع مرخصی:</label>
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center mb-2">
<div class="col-12 col-md-8">
<label class="d-flex justify-content-start align-items-center">نوع مرخصی:</label>
<div class="d-block d-sm-flex">
<div class="d-flex align-items-center mb-2">
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center mb-2">
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
</label>
</div>
</div>
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
</div>
<div class="ms-sm-4" id="dailyType">
<div class="ms-sm-4" id="dailyType">
<div class="d-flex align-items-center">
<label class="d-block d-sm-flex justify-content-center align-items-center" for="inputGroup-morakhasi-time">مدت مرخصی:</label>
<div class="inputGroup-morakhasi-time d-flex align-items-center">
@@ -82,8 +83,9 @@
</div>
</div>
</div>
</div>
<div class="col-12 col-md-4 mt-2 mt-md-0" id="rotatingShiftSection" style="display: none">
</div>
</div>
<div class="col-12 col-md-4 mt-2 mt-md-0 dis" id="rotatingShiftSection">
<div>
<input type="hidden" asp-for="HasRollCall" id="HasRollCall">
<input type="hidden" name="SelectedShift.StartTime" id="SelectedShift_StartTime" />
@@ -217,7 +219,7 @@
});
$('#employeeSelect').on('change', function () {
$('#rotatingShiftSection').hide();
$('#rotatingShiftSection').addClass('disable');
$('#HasRollCall').val(false);
previousStartDate = "";
$('#SelectedShift_StartTime').val('');
@@ -237,9 +239,9 @@
const dateRegex = /^\d{4}\/\d{2}\/\d{2}$/;
if (dateRegex.test(startDateValue) && startDateValue !== previousStartDate) {
previousStartDate = startDateValue;
rotatingShift(startDateValue);
}
}
rotatingShift();
});
$('#rotatingShift').on('change', function () {
@@ -253,6 +255,7 @@
$(document).on("change", ".LeaveType", function () {
if ($('#paid').is(':checked')) {
$('#dailyType').css('visibility', 'visible');
rotatingShift();
}
if ($('#sick').is(':checked')) {
@@ -262,6 +265,7 @@
$('#end_date_estehghaghi').show();
$('.time_paid').hide();
}
rotatingShift();
}
});
@@ -270,11 +274,13 @@
if ($('#daily').is(':checked')) {
$('#end_date_estehghaghi').show();
$('.time_paid').hide();
rotatingShift();
}
if ($('#hourly').is(':checked')) {
$('#end_date_estehghaghi').hide();
$('.time_paid').show();
rotatingShift();
}
});
//******************** شرط استحقاقی و استعلاجی ********************
@@ -871,36 +877,46 @@
}
});
function rotatingShift(startDateValue) {
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
.then(response => {
$('#HasRollCall').val(response.hasRollCall);
function rotatingShift() {
var startDateValue = $('#StartLeave').val();
$('#rotatingShiftSection').addClass('disable');
if (response.hasRollCall) {
$('#rotatingShiftSection').show();
if ($('#paid').is(':checked') && $('#daily').is(':checked') && startDateValue.length === 10) {
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
.then(response => {
$('#HasRollCall').val(response.hasRollCall);
shiftsList.forEach(function (item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').hide();
if (response.hasRollCall) {
$('#rotatingShiftSection').removeClass('disable');
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
}, 3500);
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
shiftsList.forEach(function (item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').addClass('disable');
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
},
3500);
}
}
}
});
});
} else {
$('#rotatingShiftSection').addClass('disable');
}
}
</script>

View File

@@ -46,28 +46,29 @@
<div id="cardSectionLeave" class="card border p-1">
<div class="row my-3">
<div class="col-12 col-md-8 d-block d-sm-flex">
<div class="d-flex align-items-center">
<label class="d-flex justify-content-center align-items-center">نوع مرخصی:</label>
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center mb-2">
<div class="col-12 col-md-8">
<label class="d-flex justify-content-start align-items-center">نوع مرخصی:</label>
<div class="d-block d-sm-flex">
<div class="d-flex align-items-center mb-2">
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center mb-2">
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
</label>
</div>
</div>
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
</div>
<div class="ms-sm-4" id="dailyType">
<div class="ms-sm-4" id="dailyType">
<div class="d-flex align-items-center">
<label class="d-block d-sm-flex justify-content-center align-items-center" for="inputGroup-morakhasi-time">مدت مرخصی:</label>
<div class="inputGroup-morakhasi-time d-flex align-items-center">
@@ -83,8 +84,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-4 mt-2 mt-md-0" id="rotatingShiftSection" style="display: none">
<div class="col-12 col-md-4 mt-2 mt-md-0 disable" id="rotatingShiftSection">
<div>
<input type="hidden" asp-for="HasRollCall" id="HasRollCall">
<input type="hidden" name="SelectedShift.StartTime" id="SelectedShift_StartTime" asp-for="SelectedShift.StartTime" />

View File

@@ -37,45 +37,47 @@
<div id="cardSectionLeave" class="card border p-1 blur">
<div class="row my-3">
<div class="col-12 col-md-8 d-block d-sm-flex">
<div class="d-flex align-items-center">
<label class="d-flex justify-content-center align-items-center">نوع مرخصی:</label>
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center mb-2">
<div class="col-12 col-md-8">
<label class="d-flex justify-content-start align-items-center mb-2">نوع مرخصی:</label>
<div class="d-block d-sm-flex">
<div class="d-flex align-items-center">
<div class="inputGroup-morakhasi-type d-flex flex-sm-column">
<div class="d-flex align-items-center mb-2">
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
</label>
</div>
</div>
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="paid" value="استحقاقی" checked>
<label class="form-check-label" for="paid">
استحقاقی
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
<div>
<input class="form-check-input LeaveType" type="radio" asp-for="LeaveType" id="sick" value="استعلاجی">
<label class="form-check-label" for="sick">
استعلاجی
</label>
</div>
</div>
</div>
<div class="ms-sm-4" id="dailyType">
<div class="d-flex align-items-center">
<label class="d-block d-sm-flex justify-content-center align-items-center" for="inputGroup-morakhasi-time">مدت مرخصی:</label>
<div class="inputGroup-morakhasi-time d-flex align-items-center">
<input class="form-check-input LeaveTime" type="radio" asp-for="PaidLeaveType" id="daily" value="روزانه" checked>
<label class="form-check-label" for="daily">
روزانه
</label>
<div class="ms-sm-4" id="dailyType">
<div class="d-flex align-items-center">
<label class="d-block d-sm-flex justify-content-center align-items-center" for="inputGroup-morakhasi-time">مدت مرخصی:</label>
<div class="inputGroup-morakhasi-time d-flex align-items-center">
<input class="form-check-input LeaveTime" type="radio" asp-for="PaidLeaveType" id="daily" value="روزانه" checked>
<label class="form-check-label" for="daily">
روزانه
</label>
<input class="form-check-input LeaveTime" type="radio" asp-for="PaidLeaveType" id="hourly" value="ساعتی">
<label class="form-check-label" for="hourly">
ساعتی
</label>
<input class="form-check-input LeaveTime" type="radio" asp-for="PaidLeaveType" id="hourly" value="ساعتی">
<label class="form-check-label" for="hourly">
ساعتی
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-4 mt-2 mt-md-0" id="rotatingShiftSection" style="display: none">
<div class="col-12 col-md-4 mt-2 mt-md-0 disable" id="rotatingShiftSection">
<div>
<input type="hidden" asp-for="HasRollCall" id="HasRollCall">
<input type="hidden" name="SelectedShift.StartTime" id="SelectedShift_StartTime" />

View File

@@ -33,7 +33,7 @@ $(document).ready(function () {
document.getElementById("MainModal").style.visibility = "visible";
$('#employeeSelectList').on('change', function () {
$('#rotatingShiftSection').hide();
$('#rotatingShiftSection').addClass('disable');
$('#HasRollCall').val(false);
previousStartDate = "";
$('#SelectedShift_StartTime').val('');
@@ -53,9 +53,9 @@ $(document).ready(function () {
const dateRegex = /^\d{4}\/\d{2}\/\d{2}$/;
if (dateRegex.test(startDateValue) && startDateValue !== previousStartDate) {
previousStartDate = startDateValue;
rotatingShift(startDateValue);
}
}
rotatingShift();
});
$('#rotatingShift').on('change', function () {
@@ -82,6 +82,7 @@ $(document).ready(function () {
$(document).on("change", ".LeaveType", function () {
if ($('#paid').is(':checked')) {
$('#dailyType').css('visibility', 'visible');
rotatingShift();
}
if ($('#sick').is(':checked')) {
@@ -91,6 +92,7 @@ $(document).ready(function () {
$('#end_date_estehghaghi').show();
$('.time_paid').hide();
}
rotatingShift();
}
});
@@ -99,11 +101,13 @@ $(document).ready(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();
}
});
//******************** شرط استحقاقی و استعلاجی ********************
@@ -643,36 +647,46 @@ function ajaxPersonals() {
});
}
function rotatingShift(startDateValue) {
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
.then(response => {
$('#HasRollCall').val(response.hasRollCall);
if (response.hasRollCall) {
$('#rotatingShiftSection').show();
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
function rotatingShift() {
var startDateValue = $('#StartLeave').val();
$('#rotatingShiftSection').addClass('disable');
shiftsList.forEach(function (item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').hide();
if ($('#paid').is(':checked') && $('#daily').is(':checked') && startDateValue.length === 10) {
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
}, 3500);
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
.then(response => {
$('#HasRollCall').val(response.hasRollCall);
if (response.hasRollCall) {
$('#rotatingShiftSection').removeClass('disable');
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
shiftsList.forEach(function (item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').addClass('disable');
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
},
3500);
}
}
}
});
});
} else {
$('#rotatingShiftSection').addClass('disable');
}
}

View File

@@ -23,7 +23,7 @@ $(document).ready(function () {
});
$('#employeeSelect').on('change', function () {
$('#rotatingShiftSection').hide();
$('#rotatingShiftSection').addClass('disable');
$('#HasRollCall').val(false);
previousStartDate = "";
$('#SelectedShift_StartTime').val('');
@@ -43,9 +43,9 @@ $(document).ready(function () {
const dateRegex = /^\d{4}\/\d{2}\/\d{2}$/;
if (dateRegex.test(startDateValue) && startDateValue !== previousStartDate) {
previousStartDate = startDateValue;
rotatingShift(startDateValue);
}
}
rotatingShift();
});
$('#rotatingShift').on('change', function () {
@@ -59,6 +59,7 @@ $(document).ready(function () {
$(document).on("change", ".LeaveType", function () {
if ($('#paid').is(':checked')) {
$('#dailyType').css('visibility', 'visible');
rotatingShift();
}
if ($('#sick').is(':checked')) {
@@ -68,6 +69,7 @@ $(document).ready(function () {
$('#end_date_estehghaghi').show();
$('.time_paid').hide();
}
rotatingShift();
}
});
@@ -76,11 +78,13 @@ $(document).ready(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();
}
});
//******************** شرط استحقاقی و استعلاجی ********************
@@ -736,36 +740,45 @@ function ajaxPersonals() {
});
}
function rotatingShift(startDateValue) {
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 })
.then(response => {
$('#HasRollCall').val(response.hasRollCall);
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
.then(response => {
$('#HasRollCall').val(response.hasRollCall);
if (response.hasRollCall) {
$('#rotatingShiftSection').show();
if (response.hasRollCall) {
$('#rotatingShiftSection').removeClass('disable');
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
shiftsList.forEach(function (item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').hide();
shiftsList.forEach(function(item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${
item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').addClass('disable');
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
}, 3500);
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function() {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
},
3500);
}
}
}
});
});
} else {
$('#rotatingShiftSection').addClass('disable');
}
}

View File

@@ -5,10 +5,21 @@ $(document).ready(function () {
$('.loading').hide();
document.getElementById("MainModal").style.visibility = "visible";
$(".select2Option").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#MainModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
document.getElementById("MainModal").style.visibility = "visible";
rotatingShift();
var startLeaveInput = $('#StartLeave').val();
rotatingShift(startLeaveInput);
$('#StartLeave').on('keyup', function () {
const startDateValue = $(this).val();
@@ -16,9 +27,9 @@ $(document).ready(function () {
const dateRegex = /^\d{4}\/\d{2}\/\d{2}$/;
if (dateRegex.test(startDateValue) && startDateValue !== previousStartDate) {
previousStartDate = startDateValue;
rotatingShift(startDateValue);
}
}
rotatingShift();
});
$('#rotatingShift').on('change', function () {
@@ -32,6 +43,7 @@ $(document).ready(function () {
$(document).on("change", ".LeaveType", function () {
if ($('#paid').is(':checked')) {
$('#dailyType').css('visibility', 'visible');
rotatingShift();
}
if ($('#sick').is(':checked')) {
@@ -41,6 +53,7 @@ $(document).ready(function () {
$('#end_date_estehghaghi').show();
$('.time_paid').hide();
}
rotatingShift();
}
});
@@ -49,11 +62,13 @@ $(document).ready(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();
}
});
//******************** شرط استحقاقی و استعلاجی ********************
@@ -701,36 +716,47 @@ $(document).ready(function () {
});
});
function rotatingShift(startDateValue) {
function rotatingShift() {
var currentEmployeeId = $('#employeeId').val();
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
.then(response => {
$('#HasRollCall').val(response.hasRollCall);
console.log(response);
if (response.hasRollCall) {
$('#rotatingShiftSection').show();
var startDateValue = $('#StartLeave').val();
$('#rotatingShiftSection').addClass('disable');
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
if ($('#paid').is(':checked') && $('#daily').is(':checked') && startDateValue.length === 10) {
shiftsList.forEach(function (item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').hide();
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
.then(response => {
console.log(response)
$('#HasRollCall').val(response.hasRollCall);
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
}, 3500);
if (response.hasRollCall) {
$('#rotatingShiftSection').removeClass('disable');
var shiftsList = response.shifts;
var shiftsOptionsHtml = '<option selected disabled>انتخاب شیفت ...</option>';
shiftsList.forEach(function (item) {
shiftsOptionsHtml += `<option value="${item.startTime}|${item.endTime}">${item.startTime} الی ${item.endTime}</option>`;
});
$('#rotatingShift').html(shiftsOptionsHtml);
} else {
$('#rotatingShiftSection').addClass('disable');
if (response.message) {
$('#StartLeave').addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text("");
$('#StartLeave').removeClass("errored");
},
3500);
}
}
}
});
});
} else {
$('#rotatingShiftSection').addClass('disable');
}
}