Files
Backend-Api/ServiceHost/Areas/Admin/Pages/Company/Checkouts/MainSearch.cshtml

1021 lines
46 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@model CompanyManagment.App.Contracts.Checkout.MainViewModel
@{
<style>
.btn-lime {
background-color: #84cc16;
border: 1px solid #84cc16;
}
.fulltext {
opacity: 0;
white-space: nowrap;
}
.ellipsed {
display: block;
width: 100%;
text-overflow: ellipsis;
overflow-x: clip;
white-space: nowrap;
}
.date-box {
display: flex;
align-items: center;
}
.tooltipfull-containerText {
cursor: pointer;
position: absolute;
display: inline-block;
right: -2px;
top: 13px;
}
.tooltip {
opacity: 0;
z-index: 99;
color: #fff;
width: 220px;
display: block;
font-size: 14px;
font-family: 'IranSans';
padding: 5px 10px;
border-radius: 3px;
text-align: center;
/*text-shadow: 1px 1px 2px #111;*/
background: #e67e22;
border: 1px solid #e67e22;
box-shadow: 0 0 3px rgba(0,0,0,0.5);
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
-ms-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
right: -50px;
bottom: 40px;
}
.tooltip:before, .tooltip:after {
content: '';
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #e67e22;
position: absolute;
bottom: -10px;
left: 70%;
}
.tooltip-container:hover .tooltip, a:hover .tooltip {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.tooltipfull {
opacity: 0;
z-index: 99;
color: #fff;
/* width: 180px;*/
display: block;
font-size: 12px;
font-family: 'IranSans';
padding: 5px 10px;
border-radius: 15px;
text-align: center;
/*text-shadow: 1px 1px 2px #111;*/
background: #950000;
border: 1px solid #950000;
box-shadow: 0 0 3px rgba(0,0,0,0.5);
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
/* -ms-transition: all .2s ease-in-out;*/
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
right: -2px;
bottom: 20px;
white-space: nowrap;
}
.tooltipfull:before, .tooltipfull:after {
content: '';
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #950000;
position: absolute;
bottom: -10px;
left: 50%;
}
.tooltipfull-containerText:hover .tooltipfull, a:hover .tooltipfull {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
</style>
var i = 1;
//int b = 0;
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
}
<input type="hidden" id="sercheCheck" value="@Model.WorkshopSearch" />
<table id="datatable" class="table table-striped table-bordered">
<thead style="background-color: #ecefee">
<tr class="sorting_asc_disabled sorting_desc_disabled ">
<th style="font-size: 10px !important" class="sizeSet sorting_asc_disabled sorting_asc_disabled">#</th>
<th permission="20217" style="font-size: 10px !important;" class="hidden-xs sizeSet sorting_asc_disabled sorting_asc_disabled">
<span class="tooltip-container">
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" />
<span class="tooltip"> با استفاده از این چک باکس می توانید تصفیه حساب ها را بصورت گروهی انتخاب کرده و سپس با کلیک بر روی دکمه حذف گروهی یا پرینت گروهی اقدام به حذف یا پرینت گروهی نمایید</span>
</span>
</th>
<th style="font-size: 10px !important;max-width: 30px;" class="sizeSet sorting_asc_disabled sorting_desc_disabled">سال</th>
<th style="font-size: 10px !important;max-width: 50px;" class="sizeSet sorting_asc_disabled sorting_desc_disabled"> ماه </th>
<th style="font-size: 10px !important" class="sizeSet sorting_asc_disabled sorting_desc_disabled">کارگاه</th>
<th style="font-size: 10px !important" class="sizeSet sorting_asc_disabled sorting_desc_disabled">پرسنل</th>
<th style="font-size: 10px !important; max-width: 105px !important" class="hidden-xs sizeSet sorting_asc_disabled sorting_asc_disabled"> کارفرما </th>
<th style="font-size: 10px !important" class="hidden-xs sizeSet sorting_asc_disabled sorting_desc_disabled">شماره کارگاه</th>
<th style="font-size: 10px !important" class="hidden-xs sizeSet sorting_asc_disabled sorting_desc_disabled">شروع قرارداد</th>
<th style="font-size: 10px !important" class="hidden-xs sizeSet sorting_asc_disabled sorting_desc_disabled">پایان قرارداد</th>
<th style="font-size: 10px !important;max-width: 50px;" class="sizeSet sorting_asc_disabled sorting_desc_disabled">روز کارکرد</th>
<th style="font-size: 10px !important" class="hidden-xs sizeSet sorting_asc_disabled sorting_desc_disabled">شماره قرارداد</th>
<th style="font-size: 10px !important" class="hidden-xs sizeSet sorting_asc_disabled sorting_desc_disabled">شماره پرسنلی</th>
<th style="font-size: 10px !important;max-width: 80px;" onclick="event.stopPropagation();" class="hidden-xs sizeSet sorting_asc_disabled sorting_desc_disabled">
<span class="tooltip2-container" permission="20216">
<button type="button" style="padding: 5px 7px 0px 7px;top: 2px" class="btn btn-icon waves-effect waves-light btn-success m-b-5 rad" id="checkSign" onclick="signatureAll()">
<i class="ion-checkmark-circled" style="color: #fff; font-size: 17px"></i>
</button>
<span class="tooltip2">
با استفاده از این دکمه می توانید تصفیه حساب ها را بصورت گروهی امضاء نمایید
</span>
</span>
<span class="tooltip2-container" permission="20222">
<button type="button" style="padding: 5px 7px 0px 7px;top: 2px" class="btn btn-icon waves-effect waves-light btn-danger m-b-5 rad" id="checkUnSign" onclick="deleteAllSignature()">
<i class="ion-close-circled" style="color: #fff;font-size: 17px"></i>
</button>
<span class="tooltip2">
با استفاده از این دکمه می توانید امضاء تصفیه حساب را بصورت گروهی حذف نمایید
</span>
</span>
</th>
<th style="font-size: 10px !important;max-width: 100px;" class="sorting_asc_disabled sorting_desc_disabled">
<a permission="20215" class="btn btn-danger pull-left rad deact" onclick="deleteAll()">
<i class="fa faSize fa-trash"></i>
</a>
<span class="act">
</span>
<a permission="20214" id="printAll" class="btn btn-info pull-left rad" style="margin-left:2px">
<i class="fa faSize fa-print"></i>
</a>
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.MainList)
{
<tr id="tr_@item.Id" class="@(item.IsBlockCantracingParty == "true" ? "bgGray" : "")">
<td style="font-size: 12px !important; text-align: center; width: 10px">@i </td>
<td class="hidden-xs" permission="20217" style="font-size: 12px !important; text-align: center; width: 4px">
<input type="checkbox" name="foo" class="foo" value="@item.Id" />
</td>
<td class="code-td">
<span class="ellipsed">
@item.Year
</span>
<div class="tooltipfull-containerText">
<p class="fulltext">
@item.Year
</p>
<span class="tooltipfull">
@item.Year
</span>
</div>
</td>
<td class="code-td">
<span class="ellipsed">
@item.Month
@{
<span>&nbsp;</span>
if(item.IsUpdateNeeded){
<i style="color: #cb1c1c; font-size:17px !important" class="fa fa-exclamation-triangle" aria-hidden="true"></i>
}
}
</span>
<div class="tooltipfull-containerText">
@{
if (item.IsUpdateNeeded)
{
foreach (var warning in item.CheckoutWarningMessageList)
{
<p class="fulltext">
@warning.WarningMessage
</p>
<span class="tooltipfull" style="right: -103px;bottom: 20px;">
@warning.WarningMessage
</span>
}
}
else
{
<p class="fulltext">
@item.Month
</p>
<span class="tooltipfull">
@item.Month
</span>
}
}
</div>
</td>
<td class="name-td">
<span class="ellipsed">
@item.WorkshopName
</span>
<div class="tooltipfull-containerText">
<p class="fulltext">
@item.WorkshopName
</p>
<span class="tooltipfull">
@item.WorkshopName
</span>
</div>
</td>
<td class="name-td">
<span class="ellipsed">
@item.EmployeeFullName
</span>
<div class="tooltipfull-containerText">
<p class="fulltext">
@item.EmployeeFullName
</p>
<span class="tooltipfull">
@item.EmployeeFullName
</span>
</div>
</td>
<td class="name-td hidden-xs employer1920">
<span class="ellipsed">
@item.EmployerName
</span>
<div class="tooltipfull-containerText">
<p class="fulltext">
@item.EmployerName
</p>
<span class="tooltipfull">
@item.EmployerName
</span>
</div>
</td>
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center; width: 40px">
@item.ArchiveCode
</td>
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center; width: 50px">
@item.ContractStart
</td>
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center; width: 50px">
@item.ContractEnd
</td>
<td class="code-td">
@item.SumOfWorkingDays
</td>
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center; max-width: 80px !important; width: 80px">
@item.ContractNo
</td>
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center; width: 30px;">
@item.PersonnelCode
</td>
<td class="hidden-xs" id="td_@item.Id" class="signSize" style="font-size: 12px !important; text-align: center;">
@if (item.HasSignCheckout)
{
@if (item.Signature == "1")
{
<a class="myLinkSign" name="foo1" value="@item.Id" style="font-size: 20px">
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
<input type="hidden" value="@item.Id" name="signed"/>
</a>
}
else
{
<a permission="20216" class="myLinkSign " name="foo2" value="@item.Id" style="font-size: 20px">
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
<input type="hidden" value="@item.Id" name="unsigned"/>
</a>
}
}
else
{
<a class="myLinkSign" style="font-size: 20px">
<i class="ion-checkmark-circled" style="color: #37baf6"></i>
</a>
}
</td>
@{
i++;
}
<td class="iconSize">
<div class="operation-td screen-view">
<a permission="20215" class="btn btn-danger pull-left rad @(item.IsBlockCantracingParty == "true" ? "disabled" : "")" onclick="deleteCheckout(this, @item.Id);">
<i class="fa faSize fa-trash"></i>
<input type="hidden" value="@item.Id" name="checkoutId" />
</a>
<a permission="20214" class="btn btn-info pull-left rad @(item.IsBlockCantracingParty=="true" && Model.IsSysManager == false ?"disabled":"")" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "PrintOne", new { item.Id })">
<i class="fa faSize fa-print"></i>
</a>
<a permission="20214" class="btn btn-lime pull-left rad @(item.IsBlockCantracingParty=="true" && Model.IsSysManager == false ?"disabled":"")" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "PrintLeave", new { item.Id })">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 6H6C4.11438 6 3.17157 6 2.58579 6.58579C2 7.17157 2 8.11438 2 10V13C2 13.4714 2 13.7071 2.14645 13.8536C2.29289 14 2.5286 14 3 14H7.7C7.84142 14 7.91213 14 7.95607 13.9561C8 13.9121 8 13.8414 8 13.7V13.5C8 12.5572 8 12.0858 8.29289 11.7929C8.58579 11.5 9.05719 11.5 10 11.5H14C14.9428 11.5 15.4142 11.5 15.7071 11.7929C16 12.0858 16 12.5572 16 13.5V13.7C16 13.8414 16 13.9121 16.0439 13.9561C16.0879 14 16.1586 14 16.3 14H20C20.9428 14 21.4142 14 21.7071 13.7071C22 13.4142 22 12.9428 22 12V10C22 8.11438 22 7.17157 21.4142 6.58579C20.8284 6 19.8856 6 18 6Z" fill="#ffffff" />
<path d="M7 3.73913C7 3.04725 7 2.70131 7.16382 2.45155C7.23899 2.33693 7.33693 2.23899 7.45155 2.16382C7.70131 2 8.04725 2 8.73913 2H15.2609C15.9528 2 16.2987 2 16.5485 2.16382C16.6631 2.23899 16.761 2.33693 16.8362 2.45155C17 2.70131 17 3.04725 17 3.73913C17 3.84291 17 3.8948 16.9754 3.93227C16.9642 3.94946 16.9495 3.96415 16.9323 3.97543C16.8948 4 16.8429 4 16.7391 4H7.26087C7.15709 4 7.1052 4 7.06773 3.97543C7.05054 3.96415 7.03585 3.94946 7.02457 3.93227C7 3.8948 7 3.84291 7 3.73913Z" fill="#ffffff" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 20.3371V13C5 12.0572 5 11.5858 5.29289 11.2929C5.58579 11 6.05719 11 7 11L17 11H17C17.9428 11 18.4142 11 18.7071 11.2929C19 11.5858 19 12.0572 19 13V20.3371C19 20.6411 19 20.7931 18.9005 20.8682C18.8011 20.9432 18.655 20.9014 18.3627 20.8179L18.3626 20.8179L18.3626 20.8179L15.6374 20.0392C15.5691 20.0197 15.535 20.01 15.5 20.01C15.465 20.01 15.4309 20.0197 15.3626 20.0392L12.1374 20.9608C12.0691 20.9802 12.035 20.99 12 20.99C11.965 20.99 11.9309 20.9802 11.8626 20.9608L8.63736 20.0392C8.56913 20.0197 8.53501 20.01 8.5 20.01C8.46499 20.01 8.43087 20.0197 8.36264 20.0392L5.63736 20.8179L5.63735 20.8179L5.63734 20.8179C5.34505 20.9014 5.1989 20.9432 5.09945 20.8682C5 20.7931 5 20.6411 5 20.3371ZM9 14C9 13.4477 9.44772 13 10 13L13 13C13.5523 13 14 13.4477 14 14C14 14.5523 13.5523 15 13 15L10 15C9.44772 15 9 14.5523 9 14ZM10 16C9.44772 16 9 16.4477 9 17C9 17.5523 9.44772 18 10 18L14.5 18C15.0523 18 15.5 17.5523 15.5 17C15.5 16.4477 15.0523 16 14.5 16L10 16Z" fill="#ffffff" />
</svg>
</a>
@* <a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")"
href="#showmodal=@Url.Page("./Index", "CustomSet", new { item.Id })">
<i class="md-attach-money" style="font-size: 22px; top: 2px; position: relative;"></i>
</a> *@
<a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")" href="#showmodal=@Url.Page("./Index", "RotatngShiftReportDesktop",new { @item.Id })">
<i class="md-attach-money" style="font-size: 22px; top: 2px; position: relative;"></i>
</a>
</div>
<div class="flexible-div op-td mobile-view" style="justify-content: flex-end;">
<div class="more-buttons flexible-div">
<a class="btn pull-left employee-operations">عملیات</a>
<div class="buttons-container">
<a permission="20215" class="btn btn-danger pull-left rad @(item.IsBlockCantracingParty == "true" ? "disabled" : "")" onclick="deleteCheckout(this, @item.Id);">
<i class="fa faSize fa-trash"></i>
<input type="hidden" value="@item.Id" name="checkoutId" />
</a>
<a permission="20214" class="btn btn-info pull-left rad @(item.IsBlockCantracingParty=="true" && Model.IsSysManager == false ?"disabled":"")" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "PrintOne", new { item.Id })">
<i class="fa faSize fa-print"></i>
</a>
<a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")" href="#showmodal=@Url.Page("./Index", "RotatngShiftReportMobile",new { @item.Id })">
<i class="md-attach-money" style="font-size: 22px; top: 2px; position: relative;"></i>
</a>
</div>
</div>
</div>
</td>
</tr>
}
</tbody>
</table>
<script>
$(document).ready(function() {
$(".datepicker-container").hide();
if ($('#datatable tbody tr .employee-operations').length > 0) {
$(window).on('resize',
function() {
if ($(window).width() < 768) {
locateButtonContainerMobile();
}
//if ($(window).width() > 768) {
// locateButtonContainer();
//}
});
$(document).on("click",
function(event) {
const target = $(event.target);
if (!target.closest(".buttons-container").length && !target.is(".employee-operations") && !target.is("#createLegal") && !target.is("#createLegal *") && !target.is("#LegalDetails") && !target.is("#LegalDetails *") && !target.is("#legalEdit") && !target.is("#legalEdit *") && !target.is("#createActual") && !target.is("#createActual *") && !target.is("#actualDetails") && !target.is("#actualDetails *") && !target.is("#actualEdit") && !target.is("#actualEdit *")
) {
$(".buttons-container").removeClass("active").addClass("reverse");
$(".more-buttons").removeClass("active");
setTimeout(function() {
$(".buttons-container").removeClass("reverse").css("display", "none");
},
200);
}
});
$(".employee-operations").on("click",
function() {
if ($(window).width() < 768) {
locateButtonContainerMobile();
}
//if ($(window).width() > 768) {
// locateButtonContainer();
//}
var buttonsContainer = $(this).next(".buttons-container");
if (buttonsContainer.hasClass("active")) {
buttonsContainer.removeClass("active").addClass("reverse");
$(this).closest(".more-buttons").removeClass("active");
setTimeout(function() {
buttonsContainer.removeClass("reverse").css("display", "none");
},
200);
} else {
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
$(this).closest(".more-buttons").addClass("active");
}
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
});
}
});
//function locateButtonContainer() {
// var beforePosition = $(".screen-view .employee-operations").position();
// var containerWidth = $('.screen-view .buttons-container').outerWidth();
// var containerHeight = $('.screen-view .buttons-container').outerHeight();
// var containerLeft = beforePosition.left + $(".screen-view .employee-operations").outerWidth() + 20;
// var containerTop = beforePosition.top + ($(".screen-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
// $('.screen-view .buttons-container').css({
// left: containerLeft,
// top: containerTop
// });
//}
function locateButtonContainerMobile() {
const beforePosition = $(".mobile-view .employee-operations").position();
const containerWidth = $('.mobile-view .buttons-container').outerWidth();
const containerHeight = $('.mobile-view .buttons-container').outerHeight();
const containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 20;
const containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
$('.mobile-view .buttons-container').css({
left: containerLeft,
top: containerTop
});
}
</script>
<script>
$(document).ready(function() {
const waitingLoad = $("#waiting");
waitingLoad.remove();
});
</script>
<script type="text/javascript">
if (document.getElementById("sercheCheck").value == "false") {
$(document).ready(function() {
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]],
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [13, 14] }
]
});
});
} else {
$(document).ready(function() {
$('#datatable').dataTable(
{
"lengthMenu": [[-1, 10, 50, 100, 25], ["All", 10, 50, 100, 25]],
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [13, 14] }
]
}
);
});
}
</script>
<script>
function selectori(source) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
if (document.getElementById("sercheCheck").value == "true") {
/* var selectCheckInput = document.querySelector('select[name="datatable_length"].input-sm');*/
const checkboxes = document.getElementsByName('foo');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
} else if (document.getElementById("sercheCheck").value == "false") {
//console.log(document.getElementById("sercheCheck").value);
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و جستجو را کلیک کنید ");
$("#checkSelect").prop("checked", false);
swal({
title: "لطفا در قسمت جستجوی تصفیه حساب یکی از آیتمهای کارگاه،سال یا ماه را انتخاب نموده و روی کلید جستجو کلیک کنید ",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
}
}
</script>
@* <script>
function selectori(source) {
if (document.getElementById("sercheCheck").value == "true") {
/* var selectCheckInput = document.querySelector('select[name="datatable_length"].input-sm');*/
let checkboxes = document.getElementsByName('foo');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
} else if (document.getElementById("sercheCheck").value == "false") {
console.log(document.getElementById("sercheCheck").value);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و جستجو را کلیک کنید ");
}
}
</script> *@
<script>
$('#printAll').on('click',
function() {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
$(".alarm").removeClass('alarm');
// if ($('#checkSelect').is(":checked")) {
if ($('#sercheCheck').val() === "true") {
var idlist = "";
$('.foo').each(function() {
if ($(this).is(":checked")) {
const a = $(this).val();
const b = a + "+";
idlist += b;
}
});
if (idlist.length > 0) {
const url = '@Url.Page("/Company/Checkouts/CheckoutPrintAll")';
window.location.href = url + '?idlist=' + idlist;
} else {
swal({
title: "هیچ تصفیه حسابی انتخاب نشده است ",
text: "لطفا از تیک های سمت راست جدول، تصفیه حسابهای مورد نظر را انتخاب کنید.",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
}
} else if ($('#sercheCheck').val() === "false") {
$("#checkSelect").prop("checked", false);
swal({
title: "لطفا در قسمت جستجوی تصفبه حساب یکی از آیتمهای کارگاه،سال یا ماه را انتخاب نموده و روی کلید جستجو کلیک کنید ",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
}
// } else {
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
// }
});
//function copyLinkcopyLink() {
// if (document.getElementById("checkSelect").checked == false) {
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
// } else {
// if (document.getElementById("sercheCheck").value == "true") {
// checkboxes = document.getElementsByName('foo');
// var url3 = '';
// var first = '';
// for (var i = 0, n = checkboxes.length; i < n; i++) {
// if (checkboxes[i].checked == true) {
// if (i === 0) {
// first = '?ids=' + checkboxes[i].value;
// } else {
// var u = '&ids=' + checkboxes[i].value;
// url3 = url3 + u;
// }
// }
// }
// var url1 = '#showmodal=';
// var url2 = '@Url.Page("/Company/Checkouts/CheckoutPrintAll")';
// window.location.href = url2 + first + url3;
// } else if (document.getElementById("sercheCheck").value == "false") {
// console.log(document.getElementById("sercheCheck").value);
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
// }
// }
//}
function deactiveAll() {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ تصفیه حسابی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "توجه داشته باشید با تایید این پیام تمامی تصفیه حساب های انتخاب شده بطور کامل از بانک اطلاعات حذف می شوند",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "تایید",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
const u2 = `&ids=${checkboxes2[i2].value}`;
url3b = url3b + u2;
}
}
/* var url1 = '#showmodal=';*/
const url2b = '@Url.Page("/Company/Checkouts/Index", "MultiRemoveCheckout")';
/* var url3 = document.getElementById('yearSend').value;*/
window.location.href = url2b + url3b;
}
});
} else if (document.getElementById("sercheCheck").value == "false") {
console.log(document.getElementById("sercheCheck").value);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
}
}
}
function removeOneCheckout(aTag) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: "توجه داشته باشید با تایید این پیام تصفیه حساب مورد نظر بطور کامل از بانک اطلاعات حذف می شود ",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "تایید",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
/* $("a.dell").click();*/
const inputTag = aTag.querySelector('input[name="checkoutId"]');
const chekoutId = inputTag.value;
let url3b = '';
const u2 = `&id=${chekoutId}`;
url3b = url3b + u2;
const url2b = '@Url.Page("/Company/Checkouts/Index", "RemoveOneCheckout")';
window.location.href = url2b + url3b;
} else {
}
});
}
</script>
<script>
//function reActiveAll() {
// if (document.getElementById("checkSelect").checked == false) {
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
// } else {
// if (document.getElementById("sercheCheck").value == "false") {
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
// } else if (document.getElementById("sercheCheck").value == "true") {
// swal({
// title: "آیا فعال نمودن این قراردادها اطمینان دارید؟",
// text: "",
// type: "warning",
// showCancelButton: true,
// confirmButtonColor: "#DD6B55",
// confirmButtonText: "بله",
// cancelButtonText: "خیر",
// closeOnConfirm: false
// },
// function(isConfirm) {
// if (isConfirm) {
// checkboxes2 = document.getElementsByName('foo');
// var url3b = '';
// for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
// if (checkboxes2[i2].checked == true) {
// var u2 = '&ids=' + checkboxes2[i2].value;
// url3b = url3b + u2;
// }
// }
// var url2b = '@Url.Page("/Company/Checkouts/Index", "GroupReActive")';
// window.location.href = url2b + url3b;
// }
// });
// }
// }
//}
</script>
<script>
function SignatureSelect() {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا از امضاء نمودن این قراردادها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
/* $("a.dell").click();*/
checkboxes2 = document.getElementsByName('unsigned');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
const u2 = `&ids=${checkboxes2[i2].value}`;
url3b = url3b + u2;
}
const url2b = '@Url.Page("/Company/Checkouts/Index", "GroupSign")';
window.location.href = url2b + url3b;
} else {
}
});
@*if (res == true) {
checkboxes2 = document.getElementsByName('unsigned');
var url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
var u2 = '&ids=' + checkboxes2[i2].value;
url3b = url3b + u2;
}
var url2b = '@Url.Page("/Company/Contracts/Index", "GroupSign")';
window.location.href = url2b + url3b;
}*@
@*else if (document.getElementById("checkSign").checked == false) {
signCheckboxes = document.getElementsByName('signed');
var url3h = '';
for (var b = 0, k = signCheckboxes.length; b < k; b++) {
var r = '&ids=' + signCheckboxes[b].value;
url3h = url3h + r;
}
var url2h = '@Url.Page("/Company/Contracts/Index", "GroupUnSign")';
window.location.href = url2h + url3h;
}*@
}
}
</script>
<script>
function SignatureSelect2() {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارگاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا حذف امضاء این قراردادها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
/* $("a.dell").click();*/
const checkboxes2 = document.getElementsByName('signed');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
const u2 = `&ids=${checkboxes2[i2].value}`;
url3b = url3b + u2;
}
const url2b = '@Url.Page("/Company/Checkouts/Index", "GroupUnSign")';
window.location.href = url2b + url3b;
} else {
}
});
}
}
</script>
<script>
$(document).ready(function() {
$('.myLinkSign').click(function(event) {
if ($(this).hasClass("disabled") === false) {
signAjax(event, this);
}
});
});
function signAjax(event, element) {
event.preventDefault();
if ($(element).find('input[name="unsigned"]').length > 0) { // اگر بدون امضاء بود به امضاء دار تبدیل شود
const signId = $(element).find('input[name="unsigned"]').val();
$.ajax({
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "Sign")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "Id": signId },
success: function(response) {
$(".alarm").removeClass('alarm');
var items2 = [];
$.each(response,
function(key, val) {
items2.push({ id: key, vall: val });
});
const check = items2[0].vall;
if (check === true) {
$(element).find('i').replaceWith('<i class="ion-checkmark-circled" style="color: #1f9c11"></i>');
// تغییر name در تگ input
$(element).find('input[name="unsigned"]').attr('name', 'signed');
}
}
});
} else if ($(element).find('input[name="signed"]').length > 0) { //اگر امضاء شده بود به بدون امضاء تبدیل شود
const unsignId = $(element).find('input[name="signed"]').val();
$.ajax({
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "UnSign")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "Id": unsignId },
success: function(response) {
$(".alarm").removeClass('alarm');
var items2 = [];
$.each(response,
function(key, val) {
items2.push({ id: key, vall: val });
});
const check = items2[0].vall;
if (check === true) {
$(element).find('i').replaceWith('<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>');
// تغییر name در تگ input
$(element).find('input[name="signed"]').attr('name', 'unsigned');
}
}
});
}
}
</script>