1285 lines
97 KiB
JavaScript
1285 lines
97 KiB
JavaScript
var pageIndexJs = 0;
|
||
var searchName = '';
|
||
var searchStartDateTime = '';
|
||
var searchEndDateTime = '';
|
||
var listTypeDataInput = '';
|
||
var groupTypeDataInput = '';
|
||
var loadData = true;
|
||
var isMobile = "false";
|
||
var groupData = false;
|
||
|
||
$(document).ready(function () {
|
||
loadRewardList();
|
||
ajaxPersonals();
|
||
|
||
|
||
$(".select2OptionIndex").select2({
|
||
language: "fa",
|
||
dir: "rtl"
|
||
});
|
||
|
||
$(".select2OptionIndexMobile").select2({
|
||
language: "fa",
|
||
dir: "rtl",
|
||
dropdownParent: $('#searchModal'),
|
||
templateResult: function (data, container) {
|
||
if (data.element) {
|
||
$(container).addClass($(data.element).attr("class"));
|
||
}
|
||
return data.text;
|
||
}
|
||
});
|
||
|
||
$(".form-control-date").each(function () {
|
||
let element = $(this);
|
||
element.on('input', function () {
|
||
let value = convertPersianNumbersToEnglish(element.val());
|
||
element.val(value);
|
||
});
|
||
|
||
new Cleave(this, {
|
||
date: true,
|
||
delimiter: '/',
|
||
datePattern: ['Y', 'm', 'd']
|
||
});
|
||
});
|
||
|
||
//******************** انتخاب همه ی چک باکس ها ********************
|
||
$(".checkAll").change(function () {
|
||
//let dataValYear = $('#year').val();
|
||
//let dataValMonth = $('#month').val();
|
||
//let dataValPersonel = Number($('#employeeId').val());
|
||
|
||
//if ((dataValYear == '' || dataValMonth == '') && dataValPersonel == 0) {
|
||
//$('#dropdown-year').addClass("errored");
|
||
//$('#dropdown-month').addClass("errored");
|
||
|
||
//$(this).prop('checked', false);
|
||
//$('.alert-msg').show();
|
||
//$('.alert-msg p').text('جهت انتخاب گروهی قراردادها ابتدا میبایست سال و ماه مورد نظر را انتخاب نمائید.');
|
||
//setTimeout(function () {
|
||
// $('.alert-msg').hide();
|
||
// $('.alert-msg p').text('');
|
||
// $('#dropdown-year').removeClass("errored");
|
||
// $('#dropdown-month').removeClass("errored");
|
||
//},
|
||
//3500);
|
||
//} else {
|
||
//loadAllToPrint();
|
||
$('input:checkbox').not(this).not("#group, #list").prop('checked', this.checked);
|
||
|
||
|
||
//}
|
||
});
|
||
|
||
$("input:checkbox").not("#group,#list,.checkAll").change(function () {
|
||
if ($("input:checkbox").not("#group,#list,.checkAll").filter(":not(:checked)").length) {
|
||
$(".checkAll").prop("checked", false);
|
||
} else {
|
||
$(".checkAll").prop("checked", true);
|
||
}
|
||
});
|
||
//******************** انتخاب همه ی چک باکس ها ********************
|
||
|
||
//*********************ستون نام پرسنل در حالتی که فقط اسم پرسنل هست باید هاید بشه************************
|
||
$("#searchJustName").hide();
|
||
|
||
//************تنظیم چک باکس تایپ لیست*******************
|
||
$('#group, #groupMobile').change(function () {
|
||
if ($(this).is(':checked')) {
|
||
$('#list , #listMobile').prop('checked', false);
|
||
}
|
||
});
|
||
|
||
$('#list, #listMobile').change(function () {
|
||
if ($(this).is(':checked')) {
|
||
$('#group , #groupMobile').prop('checked', false);
|
||
}
|
||
});
|
||
//************تنظیم چک باکس تایپ لیست*******************
|
||
|
||
});
|
||
|
||
$(document).on('click', ".openAction", function () {
|
||
if (window.matchMedia('(max-width: 767px)').matches) {
|
||
$(this).next().find(".operations-btns").slideToggle(500);
|
||
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
|
||
}
|
||
});
|
||
|
||
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
|
||
isMobile = $(this).hasClass('btn-search-click-mobile');
|
||
|
||
searchStartDateTime = isMobile ? $('#start-date-mobile').val() : $('#start-date').val();
|
||
searchEndDateTime = isMobile ? $('#end-date-mobile').val() : $('#end-date').val();
|
||
searchName = isMobile ? $('#employeeSelectIndexMobile') : $('#employeeSelectIndex');
|
||
|
||
listTypeDataInput = isMobile ? $('#listMobile') : $('#list');
|
||
groupTypeDataInput = isMobile ? $('#groupMobile') : $('#group');
|
||
|
||
if (listTypeDataInput[0].checked == false && groupTypeDataInput[0].checked == false) {
|
||
if (isMobile) {
|
||
$("#listMobile").next('label').addClass('errored');
|
||
$("#groupMobile").next('label').addClass('errored');
|
||
} else {
|
||
$("#list").next('label').addClass('errored');
|
||
$("#group").next('label').addClass('errored');
|
||
}
|
||
|
||
$('.alert-msg').show();
|
||
$('.alert-msg p').text('برای جستجوی لیست باید نوع آن را مشخص کنید.');
|
||
setTimeout(function () {
|
||
$('.alert-msg').hide();
|
||
$('.alert-msg p').text('');
|
||
$('#group, #list, #listMobile, #groupMobile').next('label').removeClass('errored');
|
||
|
||
}, 3500);
|
||
return;
|
||
}
|
||
|
||
if ((searchStartDateTime === '' && searchEndDateTime !== '') || (searchStartDateTime !== '' && searchEndDateTime === '')) {
|
||
if (isMobile) {
|
||
$('#start-date-mobile').addClass("errored");
|
||
$('#end-date-mobile').addClass("errored");
|
||
} else {
|
||
$('#start-date').addClass("errored");
|
||
$('#end-date').addClass("errored");
|
||
$('.select2.select2-container .select2-selection').addClass("errored");
|
||
}
|
||
|
||
$('.alert-msg').show();
|
||
$('.alert-msg p').text('برای جستجوی تاریخ، می بایست تاریخ شروع و پایان یا پرسنل را مشخص نمایید');
|
||
setTimeout(function () {
|
||
$('.alert-msg').hide();
|
||
$('.alert-msg p').text('');
|
||
$('#start-date, #end-date, .select2.select2-container .select2-selection ,#start-date-mobile, #end-date-mobile').removeClass("errored");
|
||
|
||
}, 3500);
|
||
return;
|
||
}
|
||
|
||
if (((searchName.val() === "0") && ((searchStartDateTime === '' && searchEndDateTime === '')))) {
|
||
if (isMobile) {
|
||
$('#start-date-mobile').addClass("errored");
|
||
$('#end-date-mobile').addClass("errored");
|
||
} else {
|
||
$('#start-date').addClass("errored");
|
||
$('#end-date').addClass("errored");
|
||
$('.select2.select2-container .select2-selection').addClass("errored");
|
||
}
|
||
|
||
$('.alert-msg').show();
|
||
$('.alert-msg p').text('برای جستجوی تاریخ، می بایست تاریخ شروع و پایان یا پرسنل را مشخص نمایید');
|
||
setTimeout(function () {
|
||
$('.alert-msg').hide();
|
||
$('.alert-msg p').text('');
|
||
$('#start-date, #end-date, .select2.select2-container .select2-selection ,#start-date-mobile, #end-date-mobile').removeClass("errored");
|
||
|
||
}, 3500);
|
||
return;
|
||
}
|
||
|
||
$('.btn-clear-filter').removeClass('disable');
|
||
if (searchName.val() === "0" && searchStartDateTime === "" && searchEndDateTime === "") {
|
||
$('.btn-clear-filter').addClass('disable');
|
||
}
|
||
|
||
if (isMobile) {
|
||
$('#searchModal').modal('hide');
|
||
}
|
||
|
||
groupData = $("#group,#groupMobile").is(":checked") ? true : false;
|
||
|
||
pageIndexJs = 0;
|
||
$('#rewardListAjax').html('');
|
||
$('#rewardEmployeesList').html('');
|
||
$('#PageIndex').val(0);
|
||
loadRewardList();
|
||
});
|
||
|
||
$(document).on('click', '.btn-clear-filter', function () {
|
||
window.location.reload();
|
||
});
|
||
|
||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||
$('.d-none.d-md-block .employeeName').on('input', function () {
|
||
var desktopInput = $(this).val();
|
||
$('#searchModal .employeeName').val(desktopInput);
|
||
});
|
||
$('#searchModal .employeeName').on('input', function () {
|
||
var mobileInput = $(this).val();
|
||
$('.d-none.d-md-block .employeeName').val(mobileInput);
|
||
});
|
||
|
||
|
||
|
||
$('.d-none.d-md-block #start-date').on('input change', function () {
|
||
var desktopStartDate = $(this).val();
|
||
$('#searchModal #start-date-mobile').val(desktopStartDate);
|
||
});
|
||
$('#searchModal #start-date-mobile').on('input change', function () {
|
||
var mobileStartDate = $(this).val();
|
||
$('.d-none.d-md-block #start-date').val(mobileStartDate);
|
||
});
|
||
|
||
|
||
$('.d-none.d-md-block #end-date').on('input change', function () {
|
||
var desktopEndDate = $(this).val();
|
||
$('#searchModal #end-date-mobile').val(desktopEndDate);
|
||
});
|
||
$('#searchModal #end-date-mobile').on('input change', function () {
|
||
var mobileEndDate = $(this).val();
|
||
$('.d-none.d-md-block #end-date').val(mobileEndDate);
|
||
});
|
||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||
|
||
|
||
$('.goToTop').on('click', function () {
|
||
$('html, body').animate({ scrollTop: 0 }, 360);
|
||
return false;
|
||
});
|
||
|
||
$(window).scroll(function () {
|
||
if ($(window).scrollTop() + $(window).height() > $(document).height() - 600) {
|
||
loadRewardList();
|
||
}
|
||
|
||
if ($(this).scrollTop() > 100) {
|
||
$('.goToTop').show().fadeIn();
|
||
} else {
|
||
$('.goToTop').fadeOut().hide();
|
||
}
|
||
});
|
||
|
||
function ajaxPersonals() {
|
||
$.ajax({
|
||
url: employeeListAjax,
|
||
type: 'GET',
|
||
success: function (response) {
|
||
if (response.success) {
|
||
var employees = response.data;
|
||
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
|
||
employees.forEach(function (employee) {
|
||
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
|
||
});
|
||
$('#employeeSelectIndex').html(employeeOptionsHtml);
|
||
$('#employeeSelectIndexMobile').html(employeeOptionsHtml);
|
||
} else {
|
||
$('.alert-msg').show();
|
||
$('.alert-msg p').text(response.message);
|
||
setTimeout(function () {
|
||
$('.alert-msg').hide();
|
||
$('.alert-msg p').text('');
|
||
}, 3500);
|
||
}
|
||
},
|
||
error: function (xhr, status, error) {
|
||
console.error(xhr.responseText);
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
//*************ajax calls base on list or group ***************
|
||
function loadRewardList() {
|
||
var pageIndex = Number($('#PageIndex').val());
|
||
var html = '';
|
||
|
||
var searchViewModel = {
|
||
'PageIndex': pageIndex,
|
||
'EmployeeId': $('#employeeSelectIndex').val(),
|
||
'StartDate': $('#start-date').val(),
|
||
'EndDate': $('#end-date').val(),
|
||
'ShowAsGrouped':groupData,
|
||
}
|
||
|
||
|
||
var b = pageIndexJs % 30;
|
||
|
||
if (b === 0) {
|
||
$.ajax({
|
||
async: false,
|
||
contentType: 'charset=utf-8',
|
||
dataType: 'json',
|
||
type: 'GET',
|
||
url: rewardGroupLoadDataAjax ,
|
||
data: searchViewModel,
|
||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||
success: function (response) {
|
||
var loadRewardListData = response.data;
|
||
|
||
if (loadRewardListData.rewardListViewModels !== null || loadRewardListData.rewardsGroupedByDate !== null || loadRewardListData.rewardsGroupedByEmployee !== null ) {
|
||
if ($("#group").is(":checked")) {
|
||
$("#LoadRewardList").hide();
|
||
$("#LoadRewardListWithEmployee").removeClass("d-none");
|
||
htmlLoadGroupType(loadRewardListData);
|
||
|
||
} else if ($("#groupMobile").is(":checked")) {
|
||
htmlLoadGroupTypeMobile(loadRewardListData);
|
||
|
||
} else {
|
||
if (loadRewardListData.rewardListViewModels.length > 0) {
|
||
$("#LoadRewardList").show();
|
||
$("#LoadRewardListWithEmployee").addClass("d-none");
|
||
htmlLoadSimpleListData(loadRewardListData.rewardListViewModels);
|
||
}
|
||
}
|
||
} else {
|
||
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
|
||
<div class="">
|
||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||
</div>
|
||
</div>`;
|
||
$('#rewardListAjax').append(html);
|
||
$('#rewardEmployeesList').append(html);
|
||
}
|
||
},
|
||
failure: function (response) {
|
||
console.log(response);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
//*************ajax calls base on list button or group button***************
|
||
|
||
|
||
//************* 3 Template for Desktop***************
|
||
|
||
function htmlLoadSimpleListData(loadRewardListData) {
|
||
var html = '';
|
||
//var pageIndex = Number($('#PageIndex').val());
|
||
|
||
if (loadRewardListData.length > 0) {
|
||
loadRewardListData.forEach(function (item) {
|
||
var n = pageIndexJs + 1;
|
||
html += `<div></div>
|
||
<div class="Rtable-row align-items-center openAction" id="Employees">
|
||
<div class="Rtable-cell width1 widthNumberCustom1">
|
||
<label for="${n}" class="Rtable-cell--content prevent-select">
|
||
<span class="d-flex justify-content-center align-items-center justify-content-center gap-2 spanCounter">
|
||
<input id="${n}" type="checkbox" class="form-check-input foo" name="foo" value="${item.id}">
|
||
${n}
|
||
</span>
|
||
</label>
|
||
</div>
|
||
|
||
<div class="Rtable-cell d-md-block d-none width7">
|
||
<div class="Rtable-cell--content ">${item.grantDateFa}</div>
|
||
</div>
|
||
<div class="Rtable-cell width2">
|
||
<div class="Rtable-cell--content text-start">${item.employeeFullName}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-flex d-none width3 text-center">
|
||
<div class="Rtable-cell--content ">${item.personnelCode}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width4">
|
||
<div class="Rtable-cell--content ">${item.title ?? "-"}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width6">
|
||
<div class="tooltipfull-container">
|
||
<div class="Rtable-cell--content ellipsed" style="width: 280px;">${item.description}</div>
|
||
<span class="tooltipfull">
|
||
<span>${item.description}</span>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width5">
|
||
<div class="Rtable-cell--content ">${item.amount + " ریال"}</div>
|
||
</div>
|
||
|
||
<div class="Rtable-cell width8">
|
||
<div class="Rtable-cell--content align-items-center justify-content-end d-flex text-end">
|
||
<button type="button" class="btn-print d-md-none d-none" onclick="printReward()">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
|
||
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
|
||
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
|
||
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
|
||
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
|
||
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
|
||
</svg>
|
||
</button>
|
||
${editPermission ?
|
||
`<button data-edit-id="${item.id}" class="btn-edit position-relative d-md-block d-none">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>`
|
||
:
|
||
`<button class="btn-edit position-relative d-md-block d-none disable">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>`}
|
||
|
||
|
||
${deletePermission ?
|
||
`<button data-remove-id="${item.id}" type="button" class="btn-delete removeReward d-md-block d-none">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>`
|
||
:
|
||
`<button type="button" class="btn-delete removeReward d-md-block d-none disable">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>`}
|
||
|
||
|
||
|
||
|
||
<button type="button" class="btn-operation-more btn-open-div position-relative d-md-none d-block">
|
||
<span class="align-items-center d-flex justify-content-center">
|
||
<span class="mx-1">عملیات</span>
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="currentColor">
|
||
<circle cx="8.4001" cy="8.39922" r="1.2" transform="rotate(90 8.4001 8.39922)"/>
|
||
<circle cx="8.4001" cy="4.39922" r="1.2" transform="rotate(90 8.4001 4.39922)"/>
|
||
<circle cx="8.4001" cy="12.3992" r="1.2" transform="rotate(90 8.4001 12.3992)"/>
|
||
</svg>
|
||
</span>
|
||
</button>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="operation-div w-100">
|
||
<div class="operations-btns">
|
||
<div class="row p-0">
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<span class="span1">شماره پرسنلی:</span>
|
||
<span class="span1">${item.personnelCode}</span>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<span class="span1">عنوان:</span>
|
||
<span class="span1">${item.title ?? "-"}</span>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<span class="span1">توضیحات:</span>
|
||
<span class="span1">${item.description}</span>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<span class="span1">تاریخ:</span>
|
||
<span class="span1">${item.grantDateFa}</span>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<span class="span1">مبلغ:</span>
|
||
<span class="span1">${item.amount + " ریال"}</span>
|
||
</div>
|
||
<div class="col-md-12 col-12 text-center">
|
||
<button type="button" class="btn-print d-none" onclick="printReward()">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
|
||
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
|
||
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
|
||
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
|
||
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
|
||
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
|
||
</svg>
|
||
<span class="mx-1">پرینت</span>
|
||
</button>
|
||
|
||
${editPermission ?
|
||
`<button data-edit-id="${item.id}" class="btn-edit position-relative">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>`
|
||
:
|
||
`<button class="btn-edit position-relative disable">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>`}
|
||
|
||
${deletePermission ?
|
||
`<button data-remove-id="${item.id}" type="button" class="btn-delete removeReward">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>`
|
||
:
|
||
`<button type="button" class="btn-delete removeReward disable">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>`}
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>`;
|
||
pageIndexJs++;
|
||
});
|
||
|
||
|
||
//pageIndexJs = pageIndex + responsePageIndex;
|
||
$('#PageIndex').val(pageIndexJs);
|
||
|
||
$('#rewardListAjax').append(html);
|
||
} else {
|
||
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
|
||
<div class="">
|
||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||
</div>
|
||
</div>`;
|
||
$('#rewardListAjax').append(html);
|
||
$('#rewardEmployeesList').append(html);
|
||
}
|
||
}
|
||
|
||
function htmlLoadGroupType(loadRewardListData) {
|
||
if (searchName.val() === "0" && (searchStartDateTime && searchEndDateTime)) {//in filter bar only date is valid
|
||
$(".searchByBoth").hide();
|
||
$("#searchJustNameMiddleTab").hide();
|
||
$("#searchJustNameFirstTab").show();
|
||
} else if (searchName.val() !== "0" && (searchStartDateTime && searchEndDateTime)) {//in filter bar personnel and date are valid
|
||
$(".searchByBoth").show();
|
||
$("#searchJustNameFirstTab").hide();
|
||
$("#searchJustNameMiddleTab").show();
|
||
|
||
} else if (searchName.val() !== "0" && (!searchStartDateTime && !searchEndDateTime)){//in filter bar only personnel is valid
|
||
$("#searchJustNameFirstTab").hide();
|
||
$("#searchJustNameMiddleTab").show();
|
||
$(".searchByBoth").show();
|
||
}
|
||
|
||
if ($("#group").is(":checked")) {
|
||
if ((searchEndDateTime && searchStartDateTime) && searchName.val() === "0") {
|
||
htmlLoadWithEmployeeDataByFullname(loadRewardListData.rewardsGroupedByEmployee);
|
||
} else {
|
||
htmlLoadWithEmployeeDataByDate(loadRewardListData.rewardsGroupedByDate);
|
||
}
|
||
}
|
||
}
|
||
|
||
function htmlLoadWithEmployeeDataByDate(loadRewardListData) {
|
||
//var pageIndex = Number($('#PageIndex').val());
|
||
var html = '';
|
||
var n = 1;
|
||
|
||
if (loadRewardListData.length > 0) {
|
||
loadRewardListData.forEach(function (itemRewards) {
|
||
n = 1;
|
||
html += `<div></div>
|
||
<div class="reward-grid-list personal-grid-row d-grid gap-2 grid-cols-12 w-100">
|
||
<div class="Rtable-row align-items-center col-span-2">
|
||
<div class="Rtable-cell width1">
|
||
<div class="Rtable-cell--content text-center">
|
||
${itemRewards.year}
|
||
</div>
|
||
</div>
|
||
<div class="Rtable-cell width2">
|
||
<div class="Rtable-cell--content text-center">
|
||
${itemRewards.month}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-span-8 position-relative">`;
|
||
|
||
itemRewards.rewards.forEach(function (item) {
|
||
|
||
html += `<div class=" w-100">
|
||
|
||
<div class="Rtable-row align-items-center openAction" id="Employees">
|
||
<div class="Rtable-cell width5">
|
||
<label for="${n}" class="Rtable-cell--content prevent-select">
|
||
<span class="d-flex justify-content-center align-items-center justify-content-center gap-2 spanCounter">
|
||
<input id="${item.id}" type="checkbox" class="form-check-input foo" name="foo" value="${itemRewards.id}">
|
||
${n}
|
||
</span>
|
||
</label>
|
||
</div>
|
||
<div class="Rtable-cell width3">
|
||
<div class="Rtable-cell--content">${item.employeeName}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-flex d-none width3 justify-content-center">
|
||
<div class="Rtable-cell--content">${item.personnelCode}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width4">
|
||
<div class="Rtable-cell--content " style="text-overflow: ellipsis;overflow: hidden;width: 90%;white-space: nowrap;">${item.title ?? "-"}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width4">
|
||
<div class="tooltipfull-container">
|
||
<div class="Rtable-cell--content ellipsed" style="width: 100px;">${item.description}</div>
|
||
<span class="tooltipfull">
|
||
<span>${item.description}</span>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width4">
|
||
<div class="Rtable-cell--content ">${item.grantDateFa}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width6">
|
||
<div class="Rtable-cell--content ">${item.amount + " ریال"}</div>
|
||
</div>
|
||
<div class="Rtable-cell width7">
|
||
<div class="Rtable-cell--content align-items-center justify-content-end d-flex text-end">
|
||
<button type="button" class="btn-print d-md-none d-none" onclick="printReward()">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
|
||
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
|
||
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
|
||
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
|
||
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
|
||
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
|
||
</svg>
|
||
</button>
|
||
|
||
${editPermission ?
|
||
`
|
||
<button data-edit-id="${itemRewards.id}" class="btn-edit position-relative d-md-block d-none">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>
|
||
`
|
||
:
|
||
|
||
`
|
||
<button class="btn-edit position-relative d-md-block d-none disable">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>
|
||
`
|
||
}
|
||
|
||
|
||
|
||
|
||
${deletePermission ?
|
||
`
|
||
<button data-remove-id="${itemRewards.id}" type="button" class="btn-delete removeReward d-md-block d-none">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>
|
||
`
|
||
:
|
||
`
|
||
<button type="button" class="btn-delete removeReward d-md-block d-none disable">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>
|
||
`
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<button type="button" class="btn-operation-more btn-open-div position-relative d-md-none d-block">
|
||
<span class="align-items-center d-flex justify-content-center">
|
||
<span class="mx-1">عملیات</span>
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="currentColor">
|
||
<circle cx="8.4001" cy="8.39922" r="1.2" transform="rotate(90 8.4001 8.39922)"/>
|
||
<circle cx="8.4001" cy="4.39922" r="1.2" transform="rotate(90 8.4001 4.39922)"/>
|
||
<circle cx="8.4001" cy="12.3992" r="1.2" transform="rotate(90 8.4001 12.3992)"/>
|
||
</svg>
|
||
</span>
|
||
</button>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>`;
|
||
pageIndexJs++;
|
||
n++
|
||
|
||
});
|
||
|
||
html += `</div>`
|
||
html += `
|
||
<div class="Rtable-row align-items-center col-span-2">
|
||
<div class="Rtable-cell width1 ">
|
||
<div class="Rtable-cell--content text-center">
|
||
${itemRewards.totalAmount + " ریال"}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>`;
|
||
html += `</div>`;
|
||
});
|
||
|
||
|
||
//pageIndexJs = pageIndex + responsePageIndex;
|
||
$('#PageIndex').val(pageIndexJs);
|
||
|
||
$('#rewardEmployeesList').append(html);
|
||
} else {
|
||
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
|
||
<div class="">
|
||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||
</div>
|
||
</div>`;
|
||
$('#rewardListAjax').append(html);
|
||
$('#rewardEmployeesList').append(html);
|
||
}
|
||
}
|
||
|
||
function htmlLoadWithEmployeeDataByFullname(loadRewardListData) {
|
||
//var pageIndex = Number($('#PageIndex').val());
|
||
var html = '';
|
||
var n = 1;
|
||
|
||
if (loadRewardListData.length > 0) {
|
||
loadRewardListData.forEach(function (itemRewards) {
|
||
n = 1;
|
||
html += `
|
||
<div class="reward-grid-list personal-grid-row d-grid gap-2 grid-cols-12 w-100">
|
||
<div class="Rtable-row align-items-center col-span-2">
|
||
<div class="Rtable-cell width1">
|
||
<div class="Rtable-cell--content">
|
||
<div class="text-center">
|
||
${itemRewards.employeeName}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="col-span-8 position-relative">`;
|
||
|
||
|
||
|
||
html += `<div class=" w-100">`
|
||
itemRewards.rewards.forEach(function (item) {
|
||
html += `<div class="Rtable-row align-items-center openAction" id="Employees">
|
||
<div class="Rtable-cell width5">
|
||
<label for="${n}" class="Rtable-cell--content prevent-select">
|
||
<span class="d-flex justify-content-center align-items-center justify-content-center gap-2 spanCounter">
|
||
<input id="${item.id}" type="checkbox" class="form-check-input foo" name="foo" value="${item.id}">
|
||
${n}
|
||
</span>
|
||
</label>
|
||
</div>
|
||
<div class="Rtable-cell d-md-flex d-none width3 justify-content-center">
|
||
<div class="Rtable-cell--content">${item.personnelCode}22</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width4">
|
||
<div class="Rtable-cell--content " style="text-overflow: ellipsis;overflow: hidden;width: 90%;white-space: nowrap;">${item.title ?? '-'}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width4">
|
||
<div class="tooltipfull-container">
|
||
<div class="Rtable-cell--content ellipsed" style="width: 100px;">${item.description}</div>
|
||
<span class="tooltipfull">
|
||
<span>${item.description}</span>
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width4">
|
||
<div class="Rtable-cell--content ">${item.grantDate}</div>
|
||
</div>
|
||
<div class="Rtable-cell d-md-block d-none width6">
|
||
<div class="Rtable-cell--content ">${item.amount + " ریال"}</div>
|
||
</div>
|
||
<div class="Rtable-cell width7">
|
||
<div class="Rtable-cell--content align-items-center justify-content-end d-flex text-end">
|
||
<button type="button" class="btn-print d-md-none d-none" onclick="printReward()">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
|
||
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
|
||
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
|
||
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
|
||
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
|
||
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
|
||
</svg>
|
||
</button>
|
||
${editPermission ?
|
||
`<button data-edit-id="${item.id}" class="btn-edit position-relative d-md-block d-none">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>`
|
||
:
|
||
`<button class="btn-edit position-relative d-md-block d-none disable">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>`}
|
||
|
||
|
||
${deletePermission ?
|
||
`<button data-remove-id="${item.id}" type="button" class="btn-delete removeReward d-md-block d-none">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>`
|
||
:
|
||
`<button type="button" class="btn-delete removeReward d-md-block d-none disable">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>`}
|
||
|
||
</div>
|
||
</div>
|
||
</div>`
|
||
pageIndexJs++;
|
||
n++
|
||
})
|
||
html += `</div>`;
|
||
|
||
|
||
html += `</div>`
|
||
html += `
|
||
<div class="Rtable-row align-items-center col-span-2">
|
||
<div class="Rtable-cell width1 ">
|
||
<div class="Rtable-cell--content text-center">
|
||
${itemRewards.totalAmount + " ریال"}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>`;
|
||
html += `</div>`;
|
||
|
||
});
|
||
|
||
|
||
//pageIndexJs = pageIndex + responsePageIndex;
|
||
$('#PageIndex').val(pageIndexJs);
|
||
|
||
$('#rewardEmployeesList').append(html);
|
||
} else {
|
||
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
|
||
<div class="">
|
||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||
</div>
|
||
</div>`;
|
||
$('#rewardListAjax').append(html);
|
||
$('#rewardEmployeesList').append(html);
|
||
}
|
||
}
|
||
|
||
//************* 3 Template for Desktop ***************
|
||
|
||
//**************** 2 template for Mobile**********************
|
||
function htmlLoadGroupTypeMobile(loadRewardListData) {
|
||
|
||
if ($("#groupMobile").is(":checked")) {
|
||
if ((searchEndDateTime && searchStartDateTime) && searchName.val() === "0") {
|
||
htmlLoadWithEmployeeMobileDataByFullname(loadRewardListData.rewardsGroupedByEmployee);
|
||
} else {
|
||
htmlLoadWithEmployeeMobileDataByDate(loadRewardListData.rewardsGroupedByDate);
|
||
}
|
||
}
|
||
}
|
||
function htmlLoadWithEmployeeMobileDataByFullname(loadRewardListData) {
|
||
//var pageIndex = Number($('#PageIndex').val());
|
||
var html = '';
|
||
var n = 1;
|
||
if (loadRewardListData) {
|
||
loadRewardListData.forEach(function (item) {
|
||
|
||
html += `
|
||
<div></div>
|
||
<div class="Rtable-row align-items-center position-relative openAction">
|
||
<div class="w-100 d-flex align-items-center justify-content-between">
|
||
|
||
<div class="d-flex justify-content-center align-items-center justify-content-between">
|
||
<div class="Rtable-cell Rtable-cell--content">
|
||
<label for="${n}" class="Rtable-cell--content prevent-select">
|
||
<span class="d-flex justify-content-center align-items-center justify-content-center gap-2 spanCounter">
|
||
<input id="${item.id}" type="checkbox" class="form-check-input foo" name="foo" value="${item.id}">
|
||
${n}
|
||
</span>
|
||
</label>
|
||
<span class="mx-sm-2">
|
||
${item.employeeName}
|
||
</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="Rtable-cell--content d-flex justify-content-end align-items-center">
|
||
<div class="Rtable-cell--heading d-block text-center">
|
||
<button class="btn-details" type="button">
|
||
<svg width="22" height="22" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M9.39779 5.55805C9.46429 5.63785 9.56279 5.68398 9.66667 5.68398H10.3333C10.8041 5.68398 11.1396 5.68417 11.4038 5.7022C11.6649 5.72002 11.8307 5.75407 11.9648 5.80958C12.3691 5.97705 12.6903 6.29826 12.8577 6.70256C12.9132 6.83657 12.9473 7.0024 12.9651 7.2635C12.9831 7.52773 12.9833 7.86325 12.9833 8.33398C12.9833 8.80471 12.9831 9.14023 12.9651 9.40447C12.9473 9.66556 12.9132 9.8314 12.8577 9.96541C12.6903 10.3697 12.3691 10.6909 11.9648 10.8584C11.8307 10.9139 11.6649 10.948 11.4038 10.9658C11.1396 10.9838 10.8041 10.984 10.3333 10.984H7.2C6.63417 10.984 6.23085 10.9837 5.9149 10.9579C5.60305 10.9324 5.40726 10.8838 5.25092 10.8041C4.94045 10.646 4.68803 10.3935 4.52984 10.0831C4.45018 9.92672 4.40157 9.73094 4.37609 9.41908C4.35027 9.10313 4.35 8.69981 4.35 8.13398V6.05808C4.35 5.35995 4.35354 5.08568 4.41626 4.8711C4.57419 4.33073 4.99674 3.90818 5.53711 3.75024C5.75169 3.68753 6.02596 3.68398 6.7241 3.68398C7.06744 3.68398 7.20079 3.68501 7.32383 3.70469C7.62934 3.75355 7.91497 3.88733 8.14809 4.09076C8.24197 4.17268 8.32814 4.27446 8.54793 4.53822L9.39779 5.55805Z" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round" />
|
||
<path d="M11.3333 10.6673V10.934C11.3333 11.7741 11.3333 12.1941 11.1698 12.515C11.026 12.7972 10.7966 13.0267 10.5143 13.1705C10.1935 13.334 9.77341 13.334 8.93333 13.334H4.4C3.55992 13.334 3.13988 13.334 2.81901 13.1705C2.53677 13.0267 2.3073 12.7972 2.16349 12.515C2 12.1941 2 11.7741 2 10.934V7.73398C2 6.89391 2 6.47387 2.16349 6.153C2.3073 5.87076 2.53677 5.64128 2.81901 5.49747C3.13988 5.33398 3.55992 5.33398 4.4 5.33398H4.66667" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round" />
|
||
</svg>
|
||
<span>نمایش جزئیات</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="operation-div w-100">
|
||
<div class="operations-btns">
|
||
<div class="container-fluid px-0">
|
||
<div class="row">`;
|
||
item.rewards.forEach(function (rewardItem) {
|
||
html += `
|
||
<div class="col-12">
|
||
<div class="leaveDiv">
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>نام پرسنل</div>
|
||
<div class="">${item.employeeName}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>تاریخ</div>
|
||
<div class="">${rewardItem.grantDate}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>شماره پرسنلی</div>
|
||
<div class="">
|
||
${rewardItem.personnelCode}
|
||
</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>عنوان</div>
|
||
<div>${rewardItem.title ?? "-"}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>توضیحات</div>
|
||
<div>${rewardItem.description}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>مبلغ</div>
|
||
<div>${rewardItem.amount + " ریال"}</div>
|
||
</div>
|
||
|
||
<div class="col-md-12 col-12 text-center">
|
||
<button data-edit-id="${rewardItem.employeeId}" class="btn-edit position-relative">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>
|
||
<button type="button" class="btn-print d-none" onclick="printSalaryAid()">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
|
||
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
|
||
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
|
||
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
|
||
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
|
||
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
|
||
</svg>
|
||
<span class="mx-1">پرینت</span>
|
||
</button>
|
||
<button data-remove-id="${rewardItem.employeeId}" type="button" class="btn-delete removeSalaryAid">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<div class="lineMobile mt-3 mb-2"></div>
|
||
</div>
|
||
`;
|
||
});
|
||
html += `
|
||
<div class="col-12">
|
||
<div class="leaveDiv">
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>مجموع مبالغ</div>
|
||
<div class="">${item.totalAmount + " ریال"}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`;
|
||
pageIndexJs++;
|
||
n++;
|
||
});
|
||
//pageIndexJs = pageIndex + responsePageIndex;
|
||
$('#PageIndex').val(pageIndexJs);
|
||
|
||
$('#rewardListAjax').append(html);
|
||
} else {
|
||
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
|
||
<div class="">
|
||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||
</div>
|
||
</div>`;
|
||
$('#rewardListAjax').append(html);
|
||
$('#rewardEmployeesList').append(html);
|
||
}
|
||
|
||
|
||
}
|
||
|
||
function htmlLoadWithEmployeeMobileDataByDate(loadRewardListData) {
|
||
//var pageIndex = Number($('#PageIndex').val());
|
||
var html = '';
|
||
var n = 1;
|
||
|
||
if (loadRewardListData) {
|
||
loadRewardListData.forEach(function (item) {
|
||
|
||
html += `
|
||
<div></div>
|
||
<div class="Rtable-row align-items-center position-relative openAction">
|
||
<div class="w-100 d-flex align-items-center justify-content-between">
|
||
|
||
<div class="d-flex justify-content-center align-items-center justify-content-between">
|
||
<div class="Rtable-cell Rtable-cell--content">
|
||
<label for="${n}" class="Rtable-cell--content prevent-select">
|
||
<span class="d-flex justify-content-center align-items-center justify-content-center gap-2 spanCounter">
|
||
<input id="${item.id}" type="checkbox" class="form-check-input foo" name="foo" value="${item.id}">
|
||
${n}
|
||
</span>
|
||
</label>
|
||
<span class="mx-1">
|
||
${item.year}
|
||
</span>
|
||
<span class="mx-sm-2">
|
||
${item.month}
|
||
</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="Rtable-cell--content d-flex justify-content-end align-items-center">
|
||
<div class="Rtable-cell--heading d-block text-center">
|
||
<button class="btn-details" type="button">
|
||
<svg width="22" height="22" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M9.39779 5.55805C9.46429 5.63785 9.56279 5.68398 9.66667 5.68398H10.3333C10.8041 5.68398 11.1396 5.68417 11.4038 5.7022C11.6649 5.72002 11.8307 5.75407 11.9648 5.80958C12.3691 5.97705 12.6903 6.29826 12.8577 6.70256C12.9132 6.83657 12.9473 7.0024 12.9651 7.2635C12.9831 7.52773 12.9833 7.86325 12.9833 8.33398C12.9833 8.80471 12.9831 9.14023 12.9651 9.40447C12.9473 9.66556 12.9132 9.8314 12.8577 9.96541C12.6903 10.3697 12.3691 10.6909 11.9648 10.8584C11.8307 10.9139 11.6649 10.948 11.4038 10.9658C11.1396 10.9838 10.8041 10.984 10.3333 10.984H7.2C6.63417 10.984 6.23085 10.9837 5.9149 10.9579C5.60305 10.9324 5.40726 10.8838 5.25092 10.8041C4.94045 10.646 4.68803 10.3935 4.52984 10.0831C4.45018 9.92672 4.40157 9.73094 4.37609 9.41908C4.35027 9.10313 4.35 8.69981 4.35 8.13398V6.05808C4.35 5.35995 4.35354 5.08568 4.41626 4.8711C4.57419 4.33073 4.99674 3.90818 5.53711 3.75024C5.75169 3.68753 6.02596 3.68398 6.7241 3.68398C7.06744 3.68398 7.20079 3.68501 7.32383 3.70469C7.62934 3.75355 7.91497 3.88733 8.14809 4.09076C8.24197 4.17268 8.32814 4.27446 8.54793 4.53822L9.39779 5.55805Z" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round" />
|
||
<path d="M11.3333 10.6673V10.934C11.3333 11.7741 11.3333 12.1941 11.1698 12.515C11.026 12.7972 10.7966 13.0267 10.5143 13.1705C10.1935 13.334 9.77341 13.334 8.93333 13.334H4.4C3.55992 13.334 3.13988 13.334 2.81901 13.1705C2.53677 13.0267 2.3073 12.7972 2.16349 12.515C2 12.1941 2 11.7741 2 10.934V7.73398C2 6.89391 2 6.47387 2.16349 6.153C2.3073 5.87076 2.53677 5.64128 2.81901 5.49747C3.13988 5.33398 3.55992 5.33398 4.4 5.33398H4.66667" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round" />
|
||
</svg>
|
||
<span>نمایش جزئیات</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="operation-div w-100">
|
||
<div class="operations-btns">
|
||
<div class="container-fluid px-0">
|
||
<div class="row">`;
|
||
item.rewards.forEach(function (rewardItem) {
|
||
html += `
|
||
<div class="col-12">
|
||
<div class="leaveDiv">
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>نام پرسنل</div>
|
||
<div class="">${rewardItem.employeeName}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>تاریخ</div>
|
||
<div class="">${rewardItem.grantDateFa}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>شماره پرسنلی</div>
|
||
<div class="">
|
||
${rewardItem.personnelCode}
|
||
</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>عنوان</div>
|
||
<div>${rewardItem.title ?? "-"}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>توضیحات</div>
|
||
<div>${rewardItem.description}</div>
|
||
</div>
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>مبلغ</div>
|
||
<div>${rewardItem.amount + " ریال"}</div>
|
||
</div>
|
||
|
||
<div class="col-md-12 col-12 text-center">
|
||
<button data-edit-id="${rewardItem.employeeId}" class="btn-edit position-relative">
|
||
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
|
||
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
|
||
</svg>
|
||
<span class="mx-1">ویرایش</span>
|
||
</button>
|
||
<button type="button" class="btn-print d-none" onclick="printSalaryAid()">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
|
||
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
|
||
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
|
||
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
|
||
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
|
||
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
|
||
</svg>
|
||
<span class="mx-1">پرینت</span>
|
||
</button>
|
||
<button data-remove-id="${rewardItem.employeeId}" type="button" class="btn-delete removeSalaryAid">
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
|
||
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
|
||
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
|
||
</svg>
|
||
<span class="mx-1">حذف</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<div class="lineMobile mt-3 mb-2"></div>
|
||
</div>
|
||
`;
|
||
});
|
||
html += `
|
||
<div class="col-12">
|
||
<div class="leaveDiv">
|
||
<div class="d-flex align-items-center justify-content-between">
|
||
<div>مجموع مبالغ</div>
|
||
<div class="">${item.totalAmount + " ریال"}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`;
|
||
pageIndexJs++;
|
||
n++;
|
||
});
|
||
//pageIndexJs = pageIndex + responsePageIndex;
|
||
$('#PageIndex').val(pageIndexJs);
|
||
|
||
$('#rewardListAjax').append(html);
|
||
} else {
|
||
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
|
||
<div class="">
|
||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||
</div>
|
||
</div>`;
|
||
$('#rewardListAjax').append(html);
|
||
$('#rewardEmployeesList').append(html);
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
//**************** 2 template for Mobile**********************
|
||
|
||
function openCreateRewardModal() {
|
||
var goTo = `#showmodal=/Client/Company/Reward/Index?handler=Create`;
|
||
window.location.href = goTo;
|
||
}
|
||
|
||
$(document).on('click', '.btn-edit', function () {
|
||
var id = $(this).data('edit-id');
|
||
var goTo = `#showmodal=/Client/Company/Reward/Index?id=${id}&handler=Edit`;
|
||
window.location.href = goTo;
|
||
});
|
||
|
||
$(document).on('click', '.btn-delete', function () {
|
||
var id = $(this).data('remove-id');
|
||
swal({
|
||
title: "آیا از حذف اطمینان دارید؟",
|
||
text: "",
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بله",
|
||
cancelButtonText: "خیر",
|
||
closeOnConfirm: true,
|
||
closeOnCancel: true
|
||
}, function (isConfirm) {
|
||
if (isConfirm) {
|
||
removeAjax(id);
|
||
}
|
||
});
|
||
});
|
||
|
||
function removeAjax(id) {
|
||
var ID = Number(id);
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: removeRewardAjax,
|
||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||
data: { id: ID },
|
||
success: function (response) {
|
||
if (response.isSuccess) {
|
||
$('.alert-success-msg').show();
|
||
$('.alert-success-msg p').text(response.message);
|
||
setTimeout(function () {
|
||
$('.alert-success-msg').hide();
|
||
$('.alert-success-msg p').text('');
|
||
}, 1000);
|
||
|
||
|
||
$('#rewardListAjax').html('');
|
||
$('#PageIndex').val(0);
|
||
pageIndexJs = 0;
|
||
loadRewardList();
|
||
} else {
|
||
$('.alert-msg').show();
|
||
$('.alert-msg p').text(response.message);
|
||
setTimeout(function () {
|
||
$('.alert-msg').hide();
|
||
$('.alert-msg p').text('');
|
||
}, 3500);
|
||
}
|
||
},
|
||
error: function (err) {
|
||
console.log(err);
|
||
}
|
||
});
|
||
}
|