305 lines
19 KiB
JavaScript
305 lines
19 KiB
JavaScript
function openCreateLeftWorkSingleEmployeeModal(employeeId, fullName) {
|
|
AjaxUrlContentModal(`/Client/Company/Employees/EmployeeList?handler=CreateLeftWorkSingleEmployee&employeeId=${encodeURIComponent(employeeId)}&fullName=${encodeURIComponent(fullName)}`);
|
|
}
|
|
|
|
function openCreateLeftWorkEmployeeModal() {
|
|
AjaxUrlContentModal('/Client/Company/Employees/EmployeeList?handler=CreateLeftWorkEmployee');
|
|
}
|
|
|
|
function openCreateEmployeeModal() {
|
|
AjaxUrlContentModal('/Client/Company/Employees/EmployeeList?handler=CreateEmployee');
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
var nationalCode = '';
|
|
var employeeFullName = '';
|
|
|
|
loadEmployee(nationalCode, employeeFullName);
|
|
});
|
|
|
|
$('#searchBtn, .btn-search-mobile').click(function () {
|
|
$('#loadEmployeesAjax').html('');
|
|
|
|
var isMobile = $(this).hasClass('btn-search-mobile');
|
|
var nationalCode = isMobile ? $('#NationalCodeMobile').val().trim() : $('#NationalCode').val().trim();
|
|
var employeeFullName = isMobile ? $('#EmployeeFullNameMobile').val().trim() : $('#EmployeeFullNamePersonal').val().trim();
|
|
|
|
if (nationalCode !== '' || employeeFullName !== '') {
|
|
$('#filterRemove, #filterRemoveMobile').removeClass('disable');
|
|
} else {
|
|
$('#filterRemove, #filterRemoveMobile').addClass('disable');
|
|
}
|
|
|
|
if (isMobile) {
|
|
$('#searchModal').modal('toggle');
|
|
}
|
|
|
|
loadEmployee(nationalCode, employeeFullName);
|
|
});
|
|
|
|
function loadEmployee(nationalCode, employeeFullName) {
|
|
var html = '';
|
|
var index = 0;
|
|
|
|
$.ajax({
|
|
async: true,
|
|
contentType: 'charset=utf-8',
|
|
dataType: 'json',
|
|
type: 'GET',
|
|
url: employeesAjaxLoadData,
|
|
data: {
|
|
'SearchModel.NationalCode': nationalCode,
|
|
'SearchModel.EmployeeFullName': employeeFullName
|
|
},
|
|
headers: { "RequestVerificationToken": antiForgeryToken },
|
|
success: function (response) {
|
|
var employeeList = response.data.personnelInfoViewModels;
|
|
|
|
if (response.success) {
|
|
employeeList.forEach(function(item) {
|
|
index++;
|
|
html += `
|
|
<div></div>
|
|
<div class="Rtable-row align-items-center openAction ${item.black ? "withdraw" : ""} ${item.createdByClient ? "pendingPersonnel" : ""} ${item.lefWorkTemp ? "leftWorkSectionDiv" : ""} " id="EmployeesListIntro">
|
|
<div class="Rtable-cell width1">
|
|
<div class="Rtable-cell--content">
|
|
<span class="d-flex justify-content-center">
|
|
${index}
|
|
<div class="d-none idPersonnel">${item.employeeId}</div>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="Rtable-cell width2">
|
|
<div class="Rtable-cell--content text-start">${item.fullName}</div>
|
|
</div>
|
|
<div class="Rtable-cell d-xxl-block d-none width3">
|
|
<div class="Rtable-cell--content text-center">${item.personnelCode}</div>
|
|
</div>`;
|
|
if (item.createdByClient) {
|
|
html += `<div class="Rtable-cell widthAllPending">
|
|
<div class="Rtable-cell--content text-center pendingStatus">درحال بررسی</div>
|
|
</div>
|
|
</div>
|
|
`;
|
|
} else if (item.lefWorkTemp) {
|
|
html += `
|
|
<div class="Rtable-cell widthleftWorking">
|
|
<div class="Rtable-cell--content text-center pendingStatus">درحال بررسی ترک کار</div>
|
|
</div>
|
|
</div>`;
|
|
} else {
|
|
html += `<div class="Rtable-cell d-md-block d-none width4">
|
|
<div class="Rtable-cell--content text-center">`;
|
|
if (item.maritalStatus) {
|
|
html += `<div>${item.maritalStatus}</div>`;
|
|
} else {
|
|
html += `<div>-</div>`;
|
|
}
|
|
html += `</div>
|
|
</div>
|
|
<div class="Rtable-cell d-md-block d-none width5">
|
|
<div class="Rtable-cell--content text-center">${item.nationalCode}</div>
|
|
</div>
|
|
<div class="Rtable-cell d-xxl-block d-none width6">
|
|
<div class="Rtable-cell--content text-center">${item.idNumber}</div>
|
|
</div>
|
|
<div class="Rtable-cell d-md-block d-none width7">
|
|
<div class="Rtable-cell--content text-center">${item.dateOfBirthFa}</div>
|
|
</div>
|
|
<div class="Rtable-cell d-xxl-block d-none width8">
|
|
<div class="Rtable-cell--content text-start">${item.fatherName}</div>
|
|
</div>
|
|
<div class="Rtable-cell d-md-block d-none width9">
|
|
<div class="Rtable-cell--content text-center">${item.childrenList.length}</div>
|
|
</div>
|
|
<div class="Rtable-cell d-xxl-block d-none width12">
|
|
<div class="Rtable-cell--content text-center">`;
|
|
if (item.lastStartContractWork) {
|
|
html += `<div>${item.lastStartContractWork}</div>`;
|
|
} else {
|
|
html += `<div>-</div>`;
|
|
}
|
|
html += `</div>
|
|
</div>
|
|
<div class="Rtable-cell d-xxl-block d-none width13">
|
|
<div class="Rtable-cell--content text-center">`;
|
|
if (item.lastLeftContractWork) {
|
|
html += `<div>${item.lastLeftContractWork}</div>`;
|
|
} else {
|
|
html += `<div>-</div>`;
|
|
}
|
|
html += `</div>
|
|
</div>
|
|
<div class="Rtable-cell d-xxl-block d-none width14">
|
|
<div class="Rtable-cell--content text-center">`;
|
|
if (item.lastStartInsuranceWork) {
|
|
html += `<div>${item.lastStartInsuranceWork}</div>`;
|
|
} else {
|
|
html += `<div>-</div>`;
|
|
}
|
|
html += `</div>
|
|
</div>
|
|
<div class="Rtable-cell d-xxl-block d-none width15">
|
|
<div class="Rtable-cell--content text-center">`;
|
|
if (item.lastLeftInsuranceWork) {
|
|
html += `<div>${item.lastLeftInsuranceWork}</div>`;
|
|
} else {
|
|
html += `<div>-</div>`;
|
|
}
|
|
html += `</div>
|
|
</div>
|
|
<div class="Rtable-cell width10">
|
|
<div class="Rtable-cell--content text-center">`;
|
|
if (item.contractPerson) {
|
|
html +=
|
|
`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<circle cx="12" cy="12" r="9" fill="#BEF264" />
|
|
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
|
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
|
</svg>`;
|
|
} else {
|
|
html +=
|
|
`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
|
|
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
|
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
|
</svg>`;
|
|
}
|
|
html += `</div>
|
|
</div>
|
|
<div class="Rtable-cell width11">
|
|
<div class="Rtable-cell--content text-center">`;
|
|
if (item.insurancePerson) {
|
|
html +=
|
|
`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<circle cx="12" cy="12" r="9" fill="#BEF264" />
|
|
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
|
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
|
</svg>`;
|
|
} else {
|
|
html +=
|
|
`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
|
|
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
|
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
|
</svg>`;
|
|
}
|
|
html += `</div>
|
|
</div>
|
|
|
|
<div class="Rtable-cell width16">
|
|
<div class="Rtable-cell--content text-end d-flex justify-content-end">
|
|
|
|
<button class="btn-leftwork ${item.black ? "disable" : ""}" type="button" onclick="openCreateLeftWorkSingleEmployeeModal(${item.employeeId}, '${item.fullName}')">
|
|
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M14.375 18.2085C14.375 16.0914 11.8006 14.3752 8.625 14.3752C5.44936 14.3752 2.875 16.0914 2.875 18.2085M16.2917 13.4168L18.2083 11.5002M18.2083 11.5002L20.125 9.5835M18.2083 11.5002L16.2917 9.5835M18.2083 11.5002L20.125 13.4168M8.625 11.5002C6.50791 11.5002 4.79167 9.78388 4.79167 7.66683C4.79167 5.54974 6.50791 3.8335 8.625 3.8335C10.7421 3.8335 12.4583 5.54974 12.4583 7.66683C12.4583 9.78388 10.7421 11.5002 8.625 11.5002Z" stroke="#475569" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
</button>
|
|
|
|
<button class="btn-print" type="button" onclick="AjaxUrlContentModal('/Client/Company/EmployeeList?handler=PrintOnePersonnelInfo&employeeId=${item.employeeId}');">
|
|
<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>
|
|
<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>
|
|
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round"></path>
|
|
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round"></path>
|
|
<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"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="operation-div w-100" style="margin: -2px 0 0 0;">
|
|
<div class="operations-btns">
|
|
<div class="container-fluid px-0">
|
|
<div class="row d-grid grid-personal align-items-center g-2">
|
|
<div class="col text-center">
|
|
<a class="loadingButton" onclick="AjaxUrlContentModal('@Url.Page("./Index", "PrintOnePersonnelInfo", new { employeeId = @item.EmployeeId })');" style="cursor:pointer" id="btnCardLeaveIntro">
|
|
<div class="card card-btn">
|
|
<div class="d-flex align-items-center justify-content-start p-1 imgP">
|
|
<img src="~/AssetsClient/images/personalList.png" alt="leave" class="img-fluid" width="50px"/>
|
|
<div class="text-start ms-2">
|
|
<div class="card-title">جزئیات پرسنل</div>
|
|
<p class="m-0 card-description d-none d-md-block">مشاهده و پرینت جزئیات پرسنل</p>
|
|
</div>
|
|
</div>
|
|
<div class="spinner-loading loading" style="display: none;">
|
|
<span class="spinner-border spinner-border-sm text-white" role="status" aria-hidden="true"></span>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
@* <div class="col text-center">
|
|
<a class="loadingButton" asp-page="/Company/Employees/Leave" asp-route-workshopId="@item.WorkshopId" asp-route-employeeId="@item.EmployeeId" style="cursor:pointer" id="btnCardLeaveIntro">
|
|
<div class="card card-btn">
|
|
<div class="d-flex align-items-center justify-content-start p-1 imgP">
|
|
<img src="~/AssetsClient/images/icons/leave.png" alt="leave" class="img-fluid" width="50px"/>
|
|
<div class="text-start ms-2">
|
|
<div class="card-title">عملیات مربوط به مرخصی</div>
|
|
<p class="m-0 card-description d-none d-md-block">لیست مرخصی - ثبت مرخصی</p>
|
|
</div>
|
|
</div>
|
|
<div class="spinner-loading loading" style="display: none;">
|
|
<span class="spinner-border spinner-border-sm text-white" role="status" aria-hidden="true"></span>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div> *@
|
|
|
|
<div class="col text-center">
|
|
<a class="loadingButton" onclick="AjaxUrlContentModal('@Url.Page("./Index", "LeaveCreate", new { employeeId = @item.EmployeeId, workshopId = @item.WorkshopId })');" style="cursor:pointer" id="btnCardLeaveIntro">
|
|
<div class="card card-btn">
|
|
<div class="d-flex align-items-center justify-content-start p-1 imgP">
|
|
<img src="~/AssetsClient/images/icons/leave.png" alt="leave" class="img-fluid" width="50px"/>
|
|
<div class="text-start ms-2">
|
|
<div class="card-title">ثبت مرخصی</div>
|
|
</div>
|
|
</div>
|
|
<div class="spinner-loading loading" style="display: none;">
|
|
<span class="spinner-border spinner-border-sm text-white" role="status" aria-hidden="true"></span>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
<div class="col text-center">
|
|
<a class="loadingButton" onclick="AjaxUrlContentModal('@Url.Page("./Index", "ContractCheckoutStatus", new { employeeId = @item.EmployeeId, workshopId = @item.WorkshopId })');" style="cursor:pointer" id="btnCardStatusIntro">
|
|
<div class="card card-btn">
|
|
<div class="d-flex align-items-center justify-content-start p-1 imgP">
|
|
<img src="~/AssetsClient/images/icons/statistics.png" alt="statistics" class="img-fluid" width="50px"/>
|
|
<div class="text-start ms-2">
|
|
<div class="card-title">گزارش وضعیت</div>
|
|
<p class="m-0 card-description d-none d-md-block">گزارش وضعیت قرارداد و تصفیه حساب</p>
|
|
</div>
|
|
</div>
|
|
<div class="spinner-loading loading" style="display: none;">
|
|
<span class="spinner-border spinner-border-sm text-white" role="status" aria-hidden="true"></span>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>`;
|
|
}
|
|
});
|
|
|
|
$('#loadEmployeesAjax').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>`;
|
|
$('#loadEmployeesAjax').append(html);
|
|
}
|
|
},
|
|
failure: function (response) {
|
|
console.log(response);
|
|
}
|
|
});
|
|
} |