Files
Backend-Api/ServiceHost/Areas/Client/Pages/Company/RollCall/PrintAllCaseHistoryWithPersonnel.cshtml

260 lines
11 KiB
Plaintext

@model CompanyManagment.App.Contracts.RollCall.EmployeeRollCallsByMonthViewModel
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
int i = 1;
}
<link href="~/assetsclient/pages/rollcall/css/printallcasehistorywithpersonnel.css?ver=@clientVersion" rel="stylesheet" />
<form asp-page="./Index" asp-page-handler="Details"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-header d-block text-center position-relative">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<h6 class="m-0">پرینت حضور و غیاب انفرادی @Model.PersianMonthName ماه @Model.PersianYear</h6>
</div>
```````
<div class="modal-body" id="divTablescrollbar">
<div class="row main-table">
<div class="table-container tbl-body col-12 print" id="printThis">
<table class="table table-bordered" style="border-radius: 0 0 9px 9px;direction: rtl;padding: 0;">
<colgroup>
<col class="colgp-1">
<col class="colgp-2">
<col class="colgp-3">
<col class="colgp-4">
<col class="colgp-5">
<col class="colgp-6">
<col class="colgp-7">
</colgroup>
<thead>
<tr>
<th colspan="7" class="col-md-12" style="border-radius: 10px 10px 0 0;">
<div class="row titleSection" style="padding-bottom: 10px;">
<div class="col-3 text-start">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 621.6 721.91" width="55px">
<defs>
<linearGradient id="linear-gradient" x1="0" y1="481.82" x2="621.6" y2="481.82" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#30c1c1" />
<stop offset="1" stop-color="#087474" />
</linearGradient>
<linearGradient id="linear-gradient-2" x1="217.07" y1="187.47" x2="523.83" y2="187.47" xlink:href="#linear-gradient" />
<linearGradient id="linear-gradient-3" x1="1.3" y1="146.6" x2="395.56" y2="146.6" xlink:href="#linear-gradient" />
</defs>
<polygon class="cls-3" points="0 328.82 129.91 244.95 129.91 453.87 310.8 562.4 488.4 453.87 488.4 355.2 310.8 355.2 488.4 241.73 621.6 241.73 621.6 541.02 310.8 721.91 0 541.02 0 328.82" />
<polygon class="cls-1" points="217.07 309.16 217.07 192.4 426.8 65.78 523.83 123.33 217.07 309.16" />
<polyline class="cls-2" points="308.61 0 395.56 47.69 1.3 293.19 1.3 184.66 308.61 0" />
</svg>
</div>
<div class="col-6 text-center">
<div style="display: inline-block;">
<div style="position: relative;text-align: center;bottom: 10px;">
<span class="titleH1">موسسه نور دادمهر گستر کاسپین</span>
<div style="position: absolute;left: 0;font-size: 14px;">شماره ثبت: 1727</div>
</div>
</div>
</div>
<div class="col-3 text-end">
<p style="letter-spacing: 1.4px;font-size: 13px;margin: 0 0 2px 0;">www.gozareshgir.ir</p>
<p class="m-0" style="font-size: 13px;">سامانه هوشمند گزارشگیر</p>
</div>
</div>
</th>
</tr>
<tr>
<th colspan="7" style="background-color: #fff;">
<div class="row px-2">
<div class="col-4 text-start">
<div style="display: inline-block;">
<div style="position: relative; text-align: center; margin: 1px auto;">
<span style="font-size: 13px; margin: 0">@Model.PersianMonthName</span>
<span style="font-size: 13px; margin: 0">@Model.PersianYear</span>
</div>
</div>
</div>
<div class="col-4 text-center">
<div style="display: inline-block;">
<div style="position: relative; text-align: center; margin: 1px auto;">
<span style="font-size: 13px; margin: 0">@Model.RollCalls.FirstOrDefault()?.EmployeeFullName</span>
</div>
</div>
</div>
<div class="col-4 text-end">
<div style="display: inline-block;">
<div style="position: relative; text-align: center; margin: 1px auto;">
<span style="font-size: 13px; margin: 0">شماره پرسنلی: </span>
<span style="font-size: 13px; margin: 0">@Model.RollCalls.FirstOrDefault()?.PersonnelCode</span>
</div>
</div>
</div>
</div>
</th>
</tr>
<tr>
<th style="font-size: 11px !important; text-align: center"> ردیف</th>
<th style="font-size: 11px !important; text-align: center"> تاریخ </th>
<th style="font-size: 11px !important; text-align: center"> تاخیر در ورود </th>
<th style="font-size: 11px !important; text-align: center"> ورود </th>
<th style="font-size: 11px !important; text-align: center"> خروج </th>
<th style="font-size: 11px !important; text-align: center"> تعجیل در خروج </th>
<th style="font-size: 11px !important; text-align: center"> مجموع ساعات کاری </th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.RollCalls)
{
<tr>
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
@i
@{
i += 1;
}
</td>
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
<span class="m-0">@item.DayOfWeekFa</span>
<span class="m-0">@item.DateFa</span>
</td>
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
@if (item.RollCallTimesList.Any())
{
@foreach (var rollCallItem in item.RollCallTimesList)
{
<div>@(rollCallItem.EntryTimeDifferences ?? "-")</div>
}
}
else
{
<span>-</span>
}
</td>
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
@if (item.RollCallTimesList.Any())
{
@foreach (var rollCallItem in item.RollCallTimesList)
{
<div>@(rollCallItem.StartDate ?? "-")</div>
}
}
else
{
<span>-</span>
}
</td>
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
@if (item.RollCallTimesList.Any())
{
@foreach (var rollCallItem in item.RollCallTimesList)
{
<div>@(rollCallItem.EndDate ?? "-")</div>
}
}
else
{
<span>-</span>
}
</td>
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
@if (item.RollCallTimesList.Any())
{
@foreach (var rollCallItem in item.RollCallTimesList)
{
<div>@(rollCallItem.ExitTimeDifferences ?? "-")</div>
}
}
else
{
<span>-</span>
}
</td>
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
@item.TotalWorkingHours
</td>
</tr>
}
<tr>
<th colspan="7" style="background-color: #fff;">
<div class="row px-2">
<div class="col-4 text-start">
</div>
<div class="col-4 text-center">
</div>
<div class="col-4 text-end">
<span style="font-size: 13px; margin: 0">مجموع ساعات کارکرد: @Model.TotalWorkingHours</span>
</div>
</div>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<div class="container-fluid">
<div class="row">
<div class="col-12 text-center">
<div class="d-flex justify-content-start gap-2">
<button type="button" class="btn btn-rounded text-white" data-bs-dismiss="modal" aria-label="Close" style="background-color: #454D5C;">بستن فرم</button>
<button id="btnPrint" type="button" class="btn btn-success btn-rounded px-4">پرینت</button>
<a class="btn btn-success btn-rounded text-white px-4"style="gap:2px;" href="@Url.Page("./CaseHistory", "DownloadCaseHistoryWithPersonnelExcel")&firstRecordToPrintStartDateFa=@(Model.RollCalls.LastOrDefault()?.DateFa)&lastRecordToPrintEndDateFa=@(Model.RollCalls.FirstOrDefault()?.DateFa)&employeeId=@(Model.RollCalls.FirstOrDefault().EmployeeId)">خروجی EXCEL</a>
</div>
</div>
</div>
</div>
</div>
</form>
<script>
function downloadExcel(year, month, employeeId)
{
// var urlDownload = `@Url.Page("./CaseHistory", "DownloadCaseHistoryWithPersonnelExcel", new { yearFa = Model.PersianYear, monthFaName = Model.PersianMonthName, employeeId= Model.RollCalls.FirstOrDefault()?.EmployeeId })`;
var urlDownload = `@Url.Page("./CaseHistory", "DownloadCaseHistoryWithPersonnelExcel")`;
AjaxUrlContentModal(urlDownload + `&yearFa=${year}&monthFaName=${month}&employeeId=${employeeId}`);
}
$(document).ready(function() {
$('.loading').hide();
});
if (window.matchMedia('(max-width: 767px)').matches) {
$(document).ready(function() {
window.onbeforeprint = (event) => {
$("#MainModal").modal("hide");
}
document.getElementById("MainModal").style.visibility = "hidden";
setTimeout(function () {
printElement(document.getElementById("printThis"));
},500);
});
} else {
document.getElementById("btnPrint").onclick = function () {
printElement(document.getElementById("printThis"));
}
}
function printElement(elem) {
var domClone = elem.cloneNode(true);
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
</script>