246 lines
11 KiB
JavaScript
246 lines
11 KiB
JavaScript
var lengthMenu = 0;
|
|
|
|
$(document).ready(function () {
|
|
loadInsuredEmployeesWithoutContract();
|
|
loadMenuAnime();
|
|
|
|
$("#clickAbsentTab").click(function () {
|
|
$('.cutWorkFlowLists, .lunchBreakWorkFlowLists, .undefinedWorkFlowLists, .overlappingLeavesLists').fadeOut(200, function () {
|
|
$('.absentWorkFlowLists').fadeIn(200);
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
function loadMenuAnime() {
|
|
var tabsNewAnim = $('#navbar-animmenu');
|
|
var selectorNewAnim = $('#navbar-animmenu').find('li').length;
|
|
var activeItemNewAnim = tabsNewAnim.find('.active');
|
|
var activeHeightNewAnimHeight = activeItemNewAnim.innerHeight();
|
|
var itemPosNewAnimTop = activeItemNewAnim.position();
|
|
$(".verti-selector").css({
|
|
"top": itemPosNewAnimTop.top + "px",
|
|
"height": activeHeightNewAnimHeight + "px"
|
|
});
|
|
|
|
$('.active').each(function () {
|
|
var targetForm = $(this).data('target');
|
|
$('#' + targetForm).show();
|
|
});
|
|
|
|
if (lengthMenu === 1) {
|
|
if ($('.main-navbar li').hasClass('lastRole')) {
|
|
$('.verti-selector .top').addClass('last-role');
|
|
$('#hideCircle').css('border-radius', '25px 0 0 0');
|
|
} else {
|
|
$('.verti-selector .top').removeClass('last-role');
|
|
$('#hideCircle').css('border-radius', '0 0 0 0');
|
|
}
|
|
}
|
|
|
|
$("#navbar-animmenu").on("click", "li", function (e) {
|
|
if ($(this).hasClass('lastRole')) {
|
|
//$('.verti-selector .top').addClass('last-role');
|
|
$('#hideCircle').css('border-radius', '25px 0 0 0');
|
|
} else {
|
|
//$('.verti-selector .top').removeClass('last-role');
|
|
$('#hideCircle').css('border-radius', '0 0 0 0');
|
|
}
|
|
|
|
$('#navbar-animmenu ul li').removeClass("active");
|
|
$(this).addClass('active');
|
|
|
|
var activeHeightNewAnimHeight = $(this).innerHeight();
|
|
var itemPosNewAnimTop = $(this).position();
|
|
$(".verti-selector").css({
|
|
"top": itemPosNewAnimTop.top + "px",
|
|
"height": activeHeightNewAnimHeight + "px"
|
|
});
|
|
|
|
$('.form-section').hide();
|
|
$('.accountListHead').text($(this).find('a').text());
|
|
var targetForm = $(this).data('target');
|
|
$('#' + targetForm).show();
|
|
|
|
});
|
|
}
|
|
|
|
$(document).on('click', ".openActionMain", function () {
|
|
$('.toggle').not($(this).find('.toggle')).removeClass('open');
|
|
|
|
$(this).next().find(".operations-btns-main").slideToggle(500);
|
|
$(".operations-btns-main").not($(this).next().find(".operations-btns-main")).slideUp(500);
|
|
|
|
$(this).find('.toggle').toggleClass('open');
|
|
});
|
|
|
|
$(document).on('click', ".openAction", function () {
|
|
if (window.matchMedia('(max-width: 768px)').matches) {
|
|
$(this).next().find(".operations-btns").slideToggle(500);
|
|
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
|
|
}
|
|
});
|
|
|
|
function loadInsuredEmployeesWithoutContract() {
|
|
var mainIndexNum = 1;
|
|
|
|
var html = ``;
|
|
$.ajax({
|
|
async: false,
|
|
contentType: 'charset=utf-8',
|
|
|
|
dataType: 'json',
|
|
type: 'GET',
|
|
url: loadInsuredEmployeesWithoutContractUrl,
|
|
headers: { "RequestVerificationToken": antiForgeryToken },
|
|
success: function (response) {
|
|
var data = response.data;
|
|
|
|
if (response.success) {
|
|
if (data.length > 0) {
|
|
data.forEach(function (item) {
|
|
html += `
|
|
<div class="Rtable-row Rtable-row--head align-items-center d-flex sticky openActionMain" onclick="loadInsuredEmployeesWithoutContractByWorkshopId(${item.workshopId})" style="background: #58B3B3;border: none !important; cursor: pointer; ">
|
|
<div class="col-2 col-md-4 text-start">
|
|
<div class="Rtable-cell width1">
|
|
<div class="Rtable-cell--content">
|
|
<span class="d-flex justify-content-center align-items-center justify-content-center" style="background: #deffff;margin: 0 10px 0 0;">
|
|
${mainIndexNum++}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-8 col-md-4 text-center d-flex">
|
|
<div class="col-10 text-start">
|
|
<div class="Rtable-cell column-heading text-center justify-content-center">
|
|
<span>${item.workshopName}</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-2 text-center">
|
|
<div class="Rtable-cell column-heading text-center justify-content-center">
|
|
<span class="number-of-count">${item.insuredEmployeesWithoutContractCount}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-2 col-md-4 text-end">
|
|
<span class="toggle">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M15 18L9 12L15 6" stroke-width="2" stroke-linecap="round" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
</div>`;
|
|
|
|
html += `<div class="w-100 operation-div">
|
|
<div class="operations-btns-main workshopId_${item.workshopId}" style="padding: 1px 10px 0 10px; background: rgb(255, 255, 255); box-shadow: none;width: 100%;">
|
|
</div></div>`;
|
|
});
|
|
|
|
} else {
|
|
html += `<div class="container-fluid">
|
|
<div class="row p-lg-2 p-auto">
|
|
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
|
|
<div class="">
|
|
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
|
<h5>اطلاعاتی وجود ندارد.</h5>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>`;
|
|
}
|
|
|
|
$('#loadInsuredEmployeesWithoutContract').html(html);
|
|
$('#loadInsuredEmployeesWithoutContractMobile').html(html);
|
|
}
|
|
},
|
|
failure: function (response) {
|
|
console.log(response);
|
|
}
|
|
});
|
|
}
|
|
|
|
function loadInsuredEmployeesWithoutContractByWorkshopId(id) {
|
|
var html = ``;
|
|
$.ajax({
|
|
async: false,
|
|
contentType: 'charset=utf-8',
|
|
dataType: 'json',
|
|
type: 'GET',
|
|
url: loadInsuredEmployeesWithoutContractByWorkshopIdUrl,
|
|
data: { 'workshopId': id },
|
|
headers: { "RequestVerificationToken": antiForgeryToken },
|
|
success: function (response) {
|
|
var data = response.data;
|
|
if (response.success) {
|
|
if (data.length > 0) {
|
|
data.forEach(function (item, i) {
|
|
html += `<div></div>
|
|
<div class="Rtable-row align-items-center position-relative workflow-list employee-row">
|
|
<div class="Rtable-cell width1">
|
|
<div class="Rtable-cell--heading d-none">
|
|
ردیف
|
|
</div>
|
|
<div class="Rtable-cell--content">
|
|
<span class="d-flex justify-content-center align-items-center justify-content-center table-number">
|
|
${i + 1}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="Rtable-cell width2">
|
|
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
|
<div class="Rtable-cell--content employee-name">
|
|
${item.employeeFullName}
|
|
<p class="m-0 mt-2 d-block d-md-none">تاریخ پایان بیمه ${item.insuranceEndDateFa}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="Rtable-cell width3 d-none d-md-block">
|
|
<div class="Rtable-cell--content text-center">
|
|
<div class="d-md-none d-none">پیغام: </div>
|
|
<div class="d-flex ms-1">تاریخ پایان بیمه ${item.insuranceEndDateFa}</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="Rtable-cell position-relative width4 bg-filter d-flex justify-content-end">
|
|
<div class="Rtable-cell--content text-center d-block d-md-flex align-items-center gap-1 h-100">
|
|
|
|
<button type="button" class="btn-workflow-leave">
|
|
<span class="mx-1">مرخصی</span>
|
|
</button>
|
|
|
|
<button type="button" class="btn-workflow-absent">
|
|
<span class="mx-1">غیبت</span>
|
|
</button>
|
|
|
|
<button class="btn-workflow-rollcall-edit position-relative" >
|
|
<span class="mx-1">ویرایش</span>
|
|
</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>`;
|
|
});
|
|
|
|
} else {
|
|
html += `<div class="container-fluid">
|
|
<div class="row p-lg-2 p-auto">
|
|
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
|
|
<div class="">
|
|
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
|
<h5>اطلاعاتی وجود ندارد.</h5>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>`;
|
|
}
|
|
|
|
$(`.workshopId_${id}`).html(html);
|
|
}
|
|
},
|
|
failure: function (response) {
|
|
console.log(response);
|
|
}
|
|
});
|
|
} |