1383 lines
41 KiB
Plaintext
1383 lines
41 KiB
Plaintext
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
|
||
@Html.AntiForgeryToken()
|
||
@{
|
||
<style>
|
||
.sendSelectDate {
|
||
border-color: #ff4e4e !important;
|
||
background-color: #ffe4e4 !important;
|
||
}
|
||
|
||
.modal-dialog {
|
||
width: 90% !important;
|
||
}
|
||
|
||
.select2-container {
|
||
width: 100% !important;
|
||
}
|
||
|
||
.modal-footer {
|
||
border-top: unset !important;
|
||
}
|
||
|
||
.modal .modal-dialog .modal-content .modal-footer {
|
||
padding-top: unset !important;
|
||
}
|
||
|
||
/* p {
|
||
direction: ltr !important;
|
||
text-align: right !important;
|
||
}*/
|
||
|
||
input[type=radio]:hover {
|
||
cursor: pointer;
|
||
}
|
||
|
||
::-webkit-scrollbar {
|
||
width: 8px;
|
||
}
|
||
|
||
::-webkit-scrollbar-track {
|
||
background: #dfdfdf;
|
||
border-radius: 5px;
|
||
}
|
||
|
||
::-webkit-scrollbar-thumb {
|
||
background: brown;
|
||
border-radius: 5px;
|
||
}
|
||
/* .se .select2-container {
|
||
width: 75% !important;
|
||
}*/
|
||
|
||
/* .se .select2-container--default .select2-selection--single {
|
||
border-radius: 0px 22px 22px 0px !important;
|
||
border: 1px solid #a5a3a3 !important;
|
||
}*/
|
||
|
||
hr {
|
||
margin-top: 10px;
|
||
margin-bottom: 10px;
|
||
border-top: 1px solid #d3d3d3;
|
||
}
|
||
|
||
.checkbox + .checkbox, .radio + .radio {
|
||
margin-top: 0px !important;
|
||
}
|
||
|
||
.radio {
|
||
margin-top: 0px !important;
|
||
}
|
||
/* .radio {
|
||
margin: 5px 20px 5px 20px !important;
|
||
}*/
|
||
/* .form-control {
|
||
width: 75% !important;
|
||
display: inline-block;
|
||
}
|
||
*/
|
||
/*----------------------------*/
|
||
#EmployerFullName table {
|
||
width: 100%;
|
||
height: 150px;
|
||
text-align: center;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
#EmployerFullName th, td {
|
||
padding: 10px 20px;
|
||
}
|
||
|
||
#EmployerFullName td:nth-child(odd) {
|
||
border-bottom: 1px solid #fff;
|
||
background-color: #bed3ca;
|
||
text-align: right;
|
||
}
|
||
|
||
#EmployerFullName tr:hover {
|
||
background-color: rgb(108, 186, 250);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
#thh table {
|
||
width: 100%;
|
||
height: 150px;
|
||
text-align: center;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
#thh th, td {
|
||
padding: 10px 20px;
|
||
}
|
||
|
||
#thh th {
|
||
background-color: #bdbdbd;
|
||
text-align: center;
|
||
}
|
||
|
||
#thh td:nth-child(odd) {
|
||
border-left: 1px solid #fff;
|
||
width: 40%;
|
||
text-align: center;
|
||
}
|
||
|
||
#thh td:nth-child(even) {
|
||
text-align: center;
|
||
}
|
||
|
||
#thh th:nth-child(odd) {
|
||
border-left: 1px solid #fff;
|
||
}
|
||
|
||
#thh tr:nth-child(even) {
|
||
background-color: #bed3ca;
|
||
}
|
||
|
||
#thh tr {
|
||
background-color: rgb(224, 227, 228);
|
||
}
|
||
|
||
#thh tr:hover {
|
||
background-color: rgb(108, 186, 250);
|
||
}
|
||
|
||
#thh2 table {
|
||
width: 100%;
|
||
height: 150px;
|
||
text-align: center;
|
||
margin: 0 auto;
|
||
}
|
||
|
||
#thh2 th, td {
|
||
padding: 10px 20px;
|
||
}
|
||
|
||
#thh2 th {
|
||
background-color: #bdbdbd;
|
||
text-align: center;
|
||
}
|
||
|
||
#thh2 td:nth-child(odd) {
|
||
border-left: 1px solid #fff;
|
||
width: 40%;
|
||
text-align: center;
|
||
}
|
||
|
||
#thh2 td:nth-child(even) {
|
||
text-align: center;
|
||
}
|
||
|
||
#thh2 th:nth-child(odd) {
|
||
border-left: 1px solid #fff;
|
||
}
|
||
|
||
#thh2 tr:nth-child(odd) {
|
||
background-color: #dcdbaf;
|
||
}
|
||
|
||
#thh2 tr:nth-child(even) {
|
||
background-color: rgb(224, 227, 228);
|
||
}
|
||
|
||
#thh2 tr:hover {
|
||
background-color: rgb(108, 186, 250);
|
||
}
|
||
|
||
.buttonInside {
|
||
position: relative;
|
||
}
|
||
|
||
#btnOk {
|
||
position: absolute;
|
||
left: 12px;
|
||
top: 32px;
|
||
padding: 6px;
|
||
color: #464646 !important;
|
||
border-radius: 8px 0px 0px 8px;
|
||
border-top: 0px;
|
||
border-bottom: 0px;
|
||
border-left: 0px;
|
||
background-color: #ededed;
|
||
border-color: #c9c4c4;
|
||
font-size: 11px;
|
||
font-family: 'IranSans' !important;
|
||
}
|
||
|
||
#createProcess {
|
||
background-color: #fdfdfd;
|
||
height: 100px;
|
||
border-radius: 15px;
|
||
margin: 10px 2px 10px 2px;
|
||
box-shadow: 0px 1px 15px 0 #a8d7b1;
|
||
}
|
||
.progress-bar {
|
||
color: #fff!important;
|
||
font-size: 17px !important;
|
||
line-height: 23px !important;
|
||
border-radius: 10px !important;
|
||
|
||
}
|
||
|
||
.hasCheckoutSet {
|
||
background-color: #ffb715 !important;
|
||
}
|
||
.noExtention{
|
||
background-color: #ffc8c8 !important;
|
||
}
|
||
</style>
|
||
|
||
}
|
||
@{
|
||
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
|
||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||
<script src="~/lib/select2/js/select2.js"></script>
|
||
<script src="~/lib/select2/js/i18n/fa.js"></script>
|
||
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
|
||
|
||
|
||
<link href="~/lib/select2/css/select2.css" rel="stylesheet"/>
|
||
}
|
||
|
||
<div class="row">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
|
||
|
||
</div>
|
||
<input type="hidden" id="userID" asp-for="@Model.UserId" value="@Model.UserId"/>
|
||
<div class="modal-body">
|
||
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
|
||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تصفیه حساب </legend>
|
||
|
||
<form id="my_form" asp-page="./Index" asp-page-handler="Create" autocomplete="off"
|
||
method="get"
|
||
data-ajax="true"
|
||
data-ajax-method="get"
|
||
data-ajax-update="#panel"
|
||
data-ajax-mode="replace"
|
||
data-ajax-url="@Url.Page("./Index", "LoadContracts")">
|
||
@*<div id="progress-bar" class="progress" style="display: none;">
|
||
<div style="background-color: #28a711" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||
</div>*@
|
||
<div class="row">
|
||
|
||
|
||
<div class="col-md-4">
|
||
<label> نام کارگاه </label>
|
||
<div class="form-group se" dir="rtl">
|
||
|
||
<select id="getWorkshopWithName" onchange="loadWorkshopWithName()" class="form-control select-city" asp-for="WorkshopId" asp-items="@Model.WorkshopNameSelectList">
|
||
<option value="WorkshopIds"> انتخاب کارگاه </option>
|
||
|
||
</select>
|
||
|
||
@*<a class="btn btn-info btn-rounded waves-effect waves-light" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #257212; border-color: #545353; font-size: 14px; margin-right: -3px; font-family: 'IranSans' !important;" onclick="show()">تایید</a>*@
|
||
</div>
|
||
<span asp-validation-for="WorkshopId" class="error"></span>
|
||
</div>
|
||
|
||
<div class="col-md-4">
|
||
<label>کد بایگانی کارگاه</label>
|
||
<div class="form-group se" dir="rtl">
|
||
|
||
<select id="getWorkshopWithCode" onchange="loadWorkshopWithCode()" class="form-control select-city" asp-for="WorkshopId" asp-items="@Model.WorkshopCodeSelectList">
|
||
<option value="WorkshopIds"> انتخاب کد کارگاه </option>
|
||
|
||
</select>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
<div class="col-md-4">
|
||
<label>نام پرسنل</label>
|
||
<div id="person">
|
||
<div class="form-group se person" dir="rtl">
|
||
|
||
<select id="getPersonnel" onchange="loadPersonnel()" class="form-control select-city" asp-for="EmployeeId" asp-items="@Model.EmployeeSelectList">
|
||
<option value="0"> انتخاب پرسنل </option>
|
||
|
||
</select>
|
||
<input type="hidden" id="FatherName" asp-for="FathersName"/>
|
||
<input type="hidden" id="PersonnelNationalCode" asp-for="NationalCode"/>
|
||
<input type="hidden" id="PersonnelDateOfBirth" asp-for="DateOfBirth"/>
|
||
<input type="hidden" id="ArchiveCode" asp-for="ArchiveCode"/>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<span asp-validation-for="EmployeeId" class="error"></span>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<div class="row" dir="rtl">
|
||
<div class="col-sm-4 pull-right" dir="rtl">
|
||
<span class="form-group" style="width: 30% !important; display: inline-block; font-size: 14px !important;">
|
||
|
||
انتخاب تاریخ
|
||
|
||
</span>
|
||
<span class="form-group" style="width: 30% !important; display: inline-block">
|
||
|
||
<select class="form-control" id="sendYearly" asp-for="Year" style="width: 100% !important">
|
||
<option value="0"> سال </option>
|
||
@foreach (var item in Model.Yearlist)
|
||
{
|
||
<option style="font-family: 'IranSans' !important;" value="@item"> @item </option>
|
||
}
|
||
</select>
|
||
|
||
</span>
|
||
<span class="form-group" style="width: 33% !important; display: inline-block">
|
||
|
||
<select class="form-control" id="sendMonth" asp-for="Month" style="width: 100% !important">
|
||
<option value="0"> ماه</option>
|
||
<option value="01"> فروردین</option>
|
||
<option value="02"> اردیبهشت</option>
|
||
<option value="03"> خرداد</option>
|
||
<option value="04"> تیر</option>
|
||
<option value="05"> مرداد</option>
|
||
<option value="06"> شهریور</option>
|
||
<option value="07"> مهر</option>
|
||
<option value="08"> آبان</option>
|
||
<option value="09"> آذر</option>
|
||
<option value="10"> دی</option>
|
||
<option value="11"> بهمن</option>
|
||
<option value="12"> اسفند</option>
|
||
</select>
|
||
|
||
</span>
|
||
</div>
|
||
<div class="col-sm-4 pull-right" dir="rtl">
|
||
<div class="form-group" id="start1" style="width: 100% !important; margin: 0 auto;">
|
||
<input dir="ltr" disabled="disabled" id="sendStartDisabled" onchange="startValidcheck(this);" maxlength="10" style="text-align: center; width: 100%" placeholder="تاریخ شروع" class="form-control" asp-for="ContractStart"/>
|
||
<input type="hidden" id="sendStart" />
|
||
</div>
|
||
</div>
|
||
<div class="col-sm-4 pull-right" dir="rtl">
|
||
<div class="form-group" id="end1" style="width: 100% !important; margin: 0 auto;">
|
||
<input dir="ltr" disabled="disabled" id="sendEndDisabled" onchange="endValidcheck(this);" maxlength="10" style="text-align: center;width: 100%" placeholder="تاریخ پایان" class="form-control" asp-for="ContractEnd" />
|
||
<input type="hidden" id="sendEnd" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="row" dir="rtl">
|
||
<div class="col-md-1 pull-left">
|
||
<a class="btn btn-success btn-rounded waves-effect waves-light" onclick="sendData()" style="float: left;">انتخاب</a>
|
||
<input type="submit" form="my_form" value="Search" name="Search" id="select" style="display: none"/>
|
||
</div>
|
||
|
||
<div class="col-md-11">
|
||
<span id="montAndYearError"></span>
|
||
</div>
|
||
</div>
|
||
<hr style=" margin-top: 12px;margin-bottom: 12px;"/>
|
||
<div id="createProcess" class="row progress-bar-striped progBar" style="display: none">
|
||
<div class="form-group" style="padding: 0px 10px;">
|
||
<span style="text-align: center">
|
||
<h3 style="font-size: 15px;
|
||
color: #767575;
|
||
margin-top: 20px;
|
||
margin-bottom: 15px;">
|
||
<span> درصد پیشرفت عملیات کارگاه </span><span> </span> <span id="processWorkshopName"></span>
|
||
</h3>
|
||
</span>
|
||
|
||
|
||
<div class="progress" style="height: 20px">
|
||
<div id="progress-bar-w" style="background-color: rgb(16 170 18)" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</form>
|
||
|
||
|
||
<form id="createForm" asp-page="./Index" asp-page-handler="Create" autocomplete="off" id="sub"
|
||
method="post"
|
||
data-ajax="true"
|
||
data-ajax-method="post"
|
||
data-callback="">
|
||
|
||
<div class="row">
|
||
|
||
<div class="col-sm-12">
|
||
<div class="panel panel-default">
|
||
<div class="panel-heading">
|
||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i><span id="loading"></span> لیست قرارداد ها</h3>
|
||
</div>
|
||
<div class="panel-body">
|
||
<div class="row">
|
||
<div class="col-sm-12 col-sm-12 col-xs-12" style="max-height: 300px; overflow-y: scroll; direction: ltr; max-width: 99%;">
|
||
<table id="datatable" class="table table-striped table-bordered" style="direction: rtl">
|
||
<thead style="background-color: #ecefee">
|
||
<tr>
|
||
|
||
<th style="font-size: 10px !important" class="sizeSet">#</th>
|
||
<th style="font-size: 10px !important" class="sizeSet decorCheckbox">
|
||
<input class="checkboxtitle" type="checkbox" id="checkSelect1" disabled="disabled"/>
|
||
</th>
|
||
<th style="font-size: 10px !important" class="sizeSet">شماره پرسنلی</th>
|
||
<th style="font-size: 10px !important" class="sizeSet">شماره قرارداد</th>
|
||
<th style="font-size: 10px !important" class="sizeSet"> توضیحات </th>
|
||
<th style="font-size: 10px !important" class="sizeSet">کارگاه</th>
|
||
<th style="font-size: 10px !important" class="sizeSet"> پرسنل </th>
|
||
<th style="font-size: 10px !important" class="sizeSet">آغاز قرارداد</th>
|
||
<th style="font-size: 10px !important" class="sizeSet">پایان قرارداد</th>
|
||
<th style="font-size: 10px !important" class="sizeSet"> ترک کار </th>
|
||
<th style="font-size: 10px !important" class="sizeSet"> - </th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="panel">
|
||
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<input type="hidden" class="sendConvertYear" name="ConvertYear"/>
|
||
<input type="hidden" class="sendConvertMonth" name="ConvertMonth"/>
|
||
<input type="hidden" class="sendContarctStart" name="ContarctStart"/>
|
||
<input type="hidden" class="sendContractEnd" name="ContractEnd"/>
|
||
<input type="hidden" class="sendConvertContractStart" name="ConvertContractStart"/>
|
||
<input type="hidden" class="sendConvertContractEnd" name="ConvertContractEnd"/>
|
||
<div id="listOfContract" style="display: none">
|
||
|
||
</div>
|
||
|
||
@*<input type="hidden" asp-for="id" value="id"/>*@
|
||
<div class="modal-footer" style="margin-bottom: 10px">
|
||
|
||
<a href="#" onclick="final()" class="btn btn-success btn-rounded waves-effect waves-light final">ثبت نهایی</a>
|
||
|
||
<button type="button" onclick="closeModal()" class="btn btn-default btn-rounded waves-effect waves-light m-b-5">بستن</button>
|
||
|
||
@* <input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none" /> *@
|
||
|
||
|
||
</div>
|
||
|
||
</form>
|
||
</fieldset>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
@* <script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script> *@
|
||
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
|
||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||
<script src="~/lib/select2/js/select2.js"></script>
|
||
<script src="~/lib/select2/js/i18n/fa.js"></script>
|
||
|
||
|
||
|
||
<link href="~/lib/select2/css/select2.css" rel="stylesheet"/>
|
||
|
||
<script src="~/js/signalr/dist/browser/signalr.js"></script>
|
||
<script>
|
||
$('#select').on('click',
|
||
function() {
|
||
const html = ` <span dir="rtl" id="listwaiting" style="padding-right: 10px">
|
||
<i class="ion-loading-a" style="font-size: 16px"> </i> در حال بارگذاری
|
||
</span>`;
|
||
$('#createProcess').hide();
|
||
$('#processWorkshopName').text($("#getWorkshopWithName").find("option:selected").text());
|
||
$('#progress-bar-w').css("width", 0 + "%");
|
||
$('#progress-bar-w').text(0 + '%');
|
||
const myTable = $(".mytable");
|
||
myTable.remove();
|
||
$('#loading').append(html);
|
||
|
||
});
|
||
|
||
|
||
@*setInterval(function () {
|
||
$.ajax({
|
||
dataType: 'json',
|
||
type: "GET",
|
||
url: '@Url.Page("/Company/Checkouts/Index", "Progress")',
|
||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||
|
||
success: function (progress) {
|
||
if (progress !== 300) {
|
||
var progressBarValue = $("#progress-bar .progress-bar");
|
||
progressBarValue.css("width", progress + "%");
|
||
}
|
||
}
|
||
});
|
||
}, 1000);*@
|
||
</script>
|
||
<script>
|
||
|
||
$('.final').attr('disabled', 'disabled');
|
||
$('.final').css("background-color", "gray");
|
||
$('.byStep').attr('disabled', 'disabled');
|
||
$('.byStep').css("background-color", "unset");
|
||
$('.byStepButton').attr('disabled', 'disabled');
|
||
$('.byStepButton').css("background-color", "gray");
|
||
$('#sendYearly').click(function() {
|
||
if ($('#sendYearly').val() != "0") {
|
||
$('#sendStart').attr('disabled', 'disabled');
|
||
$('#sendEnd').attr('disabled', 'disabled');
|
||
$('#sendStart').val("");
|
||
$('#sendEnd').val("");
|
||
$('#sendStart').css("background-color", "unset");
|
||
$('#sendEnd').css("background-color", "unset");
|
||
|
||
} else {
|
||
$('#sendStart').removeAttr('disabled');
|
||
$('#sendEnd').removeAttr('disabled');
|
||
$('#sendStart').css("background-color", "white");
|
||
$('#sendEnd').css("background-color", "white");
|
||
}
|
||
|
||
});
|
||
$('#sendMonth').click(function() {
|
||
if ($('#sendMonth').val() != "0") {
|
||
$('#sendStart').attr('disabled', 'disabled');
|
||
$('#sendEnd').attr('disabled', 'disabled');
|
||
$('#sendStart').val("");
|
||
$('#sendEnd').val("");
|
||
$('#sendStart').css("background-color", "unset");
|
||
$('#sendEnd').css("background-color", "unset");
|
||
|
||
|
||
} else {
|
||
$('#sendStart').removeAttr('disabled');
|
||
$('#sendEnd').removeAttr('disabled');
|
||
$('#sendStart').css("background-color", "white");
|
||
$('#sendEnd').css("background-color", "white");
|
||
}
|
||
|
||
});
|
||
$('#sendYear2').click(function() {
|
||
if ($('#sendYear2').val() != "0") {
|
||
$('#sendContractStart2').attr('disabled', 'disabled');
|
||
$('#sendContractEnd2').attr('disabled', 'disabled');
|
||
$('#sendContractStart2').val("");
|
||
$('#sendContractEnd2').val("");
|
||
$('#sendContractStart2').css("background-color", "unset");
|
||
$('#sendContractEnd2').css("background-color", "unset");
|
||
|
||
} else {
|
||
$('#sendContractStart2').removeAttr('disabled');
|
||
$('#sendContractEnd2').removeAttr('disabled');
|
||
$('#sendContractStart2').css("background-color", "white");
|
||
$('#sendContractEnd2').css("background-color", "white");
|
||
}
|
||
|
||
});
|
||
$('#sendMonth2').click(function() {
|
||
if ($('#sendMonth2').val() != "0") {
|
||
$('#sendContractStart2').attr('disabled', 'disabled');
|
||
$('#sendContractEnd2').attr('disabled', 'disabled');
|
||
$('#sendContractStart2').val("");
|
||
$('#sendContractEnd2').val("");
|
||
$('#sendContractStart2').css("background-color", "unset");
|
||
$('#sendContractEnd2').css("background-color", "unset");
|
||
|
||
} else {
|
||
$('#sendContractStart2').removeAttr('disabled');
|
||
$('#sendContractEnd2').removeAttr('disabled');
|
||
$('#sendContractStart2').css("background-color", "white");
|
||
$('#sendContractEnd2').css("background-color", "white");
|
||
}
|
||
|
||
});
|
||
|
||
|
||
</script>
|
||
<script>
|
||
|
||
$(document).ready(function() {
|
||
var currentUser = Number($('#userID').val());
|
||
console.log(currentUser);
|
||
setTimeout(function() {
|
||
connectToGroup(currentUser);
|
||
|
||
},
|
||
2000);
|
||
});
|
||
var connection = new signalR.HubConnectionBuilder().withUrl("/trackingCheckoutHub").build();
|
||
|
||
|
||
// const workshopId = document.getElementById("getWorkshopWithName").value;
|
||
// console.log(" userId = " + currentUser);
|
||
// console.log(" workshopId = " + workshopId);
|
||
|
||
// let sumIds = currentUser + workshopId;
|
||
// let res = Number(sumIds);
|
||
|
||
connection.start().then(function() {
|
||
console.log("connect.....!");
|
||
}).catch(function(err) {
|
||
return console.error(err.toString());
|
||
});
|
||
|
||
function connectToGroup(id) {
|
||
connection.invoke("send", id)
|
||
.catch(function(err) {
|
||
console.error(err.toString());
|
||
});
|
||
console.log(`connected to group...${id}`);
|
||
|
||
}
|
||
|
||
connection.on('showStatus',
|
||
function(percent) {
|
||
console.log(percent);
|
||
$('#progress-bar-w').css("width", percent + "%");
|
||
$('#progress-bar-w').text(percent + '%');
|
||
});
|
||
|
||
function closeModal() {
|
||
|
||
|
||
$("#MainModal").modal('hide');
|
||
$("#btnSearch").click();
|
||
}
|
||
|
||
function final() {
|
||
|
||
$('.item1').remove();
|
||
|
||
const checkboxId = document.getElementsByName("cheking");
|
||
for (var i = 0, n = checkboxId.length; i < n; i++) {
|
||
if (checkboxId[i].checked) {
|
||
$('#listOfContract').append(
|
||
`<input class="item1" type="hidden" value="${checkboxId[i].value}" name="ContractsId[${i}]"/>`
|
||
);
|
||
} else {
|
||
$('#listOfContract').append(
|
||
`<input class="item1" type="hidden" value="${0}" name="ContractsId[${i}]"/>`
|
||
);
|
||
}
|
||
|
||
}
|
||
if (checkboxId.length > 0) {
|
||
|
||
$('.sendConvertYear').val($('#sendYearly').val());
|
||
$('.sendConvertMonth').val($('#sendMonth').val());
|
||
$('.sendContarctStart').val($('#sendContractStart2').val());
|
||
$('.sendContractEnd').val($('#sendContractEnd2').val());
|
||
$('.sendConvertContractStart').val($('#sendContractStart2').val());
|
||
$('.sendConvertContractEnd').val($('#sendContractEnd2').val());
|
||
|
||
$('#sendFinaly').click();
|
||
$('#sendFinaly').attr('disabled', 'disabled');
|
||
$('.final').attr('disabled', 'disabled');
|
||
$('.final').css("background-color", "gray");
|
||
$('.byStep').attr('disabled', 'disabled');
|
||
$('.byStep').css("background-color", "unset");
|
||
$('.byStepButton').attr('disabled', 'disabled');
|
||
$('.byStepButton').css("background-color", "gray");
|
||
$('#createForm').submit();
|
||
// $('#sub').on('submit', function(e) {
|
||
// e.preventDefault();
|
||
// });
|
||
|
||
} else {
|
||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "هیچ قراردادی برای تصفیه انتخاب نشده است");
|
||
}
|
||
|
||
}
|
||
|
||
$('#createForm').submit(function(e) {
|
||
$('#createProcess').show();
|
||
|
||
e.preventDefault();
|
||
e.stopImmediatePropagation();
|
||
$.ajax({
|
||
//async: false,
|
||
type: "POST",
|
||
url: $(this).attr('action'),
|
||
data: $(this).serialize(),
|
||
success: function(response) {
|
||
if (response.isSuccedded == true) {
|
||
|
||
|
||
$("#panel").find('.mytable').remove();
|
||
$.Notification.autoHideNotify('success', 'top center', response.message);
|
||
$('.final').removeAttr("disabled");
|
||
$('.final').css("background-color", "");
|
||
} else {
|
||
$.Notification.autoHideNotify('error', 'top center', response.message);
|
||
}
|
||
}
|
||
});
|
||
return false;
|
||
});
|
||
|
||
</script>
|
||
|
||
|
||
<script>
|
||
$(document).ready(function() {
|
||
$(".select-city2").select2({
|
||
language: "fa",
|
||
dir: "rtl"
|
||
});
|
||
|
||
})
|
||
|
||
|
||
</script>
|
||
<script type="text/javascript">
|
||
|
||
async function loadWorkshopWithName() {
|
||
/* loadPersonnel();*/
|
||
const nameId = document.getElementById("getWorkshopWithName").value;
|
||
const nameIndex = document.getElementById("getWorkshopWithName");
|
||
|
||
|
||
const myArray = document.getElementById('getWorkshopWithName').options.selectedIndex;
|
||
document.getElementById("getWorkshopWithCode").options.selectedIndex = myArray;
|
||
const codeId = document.getElementById("getWorkshopWithCode");
|
||
const archiveCodee = codeId.options[codeId.selectedIndex];
|
||
|
||
document.getElementById("select2-getWorkshopWithCode-container").innerHTML = archiveCodee.text;
|
||
|
||
/*removeR();*/
|
||
//$('#InsurancCode').empty();
|
||
//$('#Address').empty();
|
||
//$('#State').empty();
|
||
//$('#City').empty();
|
||
//$('#adres').empty();
|
||
$('#getPersonnel').empty().append('<option selected="selected" value="0" >انتخاب پرسنل</option>');
|
||
|
||
$('#archiveCode').val(archiveCodee.text);
|
||
|
||
//var myArray = document.getElementById('getWorkshopWithName');
|
||
//let intext = myArray.options[myArray.selectedIndex].value;
|
||
|
||
//var listArray = [];
|
||
//var EmployerArray = [];
|
||
|
||
//var workshopEmployer = [];
|
||
if (nameId != "WorkshopIds") {
|
||
$.ajax({
|
||
//contentType: 'application/json; charset=utf-8',
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("/Company/Contracts/Index", "LoadWorkshops")',
|
||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||
data: { "id": nameId },
|
||
|
||
success: function(response) {
|
||
var items2 = [];
|
||
|
||
$.each(response,
|
||
function(key, val) {
|
||
items2.push({ id: key, vall: val });
|
||
|
||
});
|
||
|
||
|
||
//document.getElementById("InsurancCode").innerHTML = items2[1].vall;
|
||
document.getElementById("ArchiveCode").innerHTML = items2[2].vall;
|
||
//document.getElementById("State").innerHTML = items2[3].vall;
|
||
//document.getElementById("City").innerHTML = items2[4].vall;
|
||
//document.getElementById("Address").innerHTML = items2[5].vall;
|
||
|
||
|
||
//document.getElementById("adres").innerHTML = items2[6].vall;
|
||
|
||
|
||
$('#employerId').val(response.empList[0].id);
|
||
//for (var e = 0; e < response.empList.length; e++) {
|
||
|
||
// if (response.empList[e].nationalId === "*" || response.empList[e].registerId === "*") {
|
||
// $('#FullName').append(
|
||
// '<div class="r" style="background-color: #b5c9c0;padding: 3px;border-radius: 5px;margin-bottom:3px;"> <span> کارفرما </span> : <span>' + response.empList[e].fullName + '</span> <span style="padding-right:20px;">کد ملی </span> : <span>' + response.empList[e].nationalcode + '</span> <span style="padding-right:20px;">شماره شناسنامه </span> : <span>' + response.empList[e].idNumber + '</span></div>'
|
||
// );
|
||
|
||
// } else {
|
||
// $('#FullName').append(
|
||
// '<div class="r" style="background-color: #b5c9c0;padding: 3px;border-radius: 5px;margin-bottom:3px;"> <span> کارفرما </span> : <span>' + response.empList[e].fullName + '</span> <span style="padding-right:20px;">شناسه ملی </span> : <span>' + response.empList[e].nationalId + '</span> <span style="padding-right:20px;">شماره ثبت </span> : <span>' + response.empList[e].registerId + '</span></div>'
|
||
// );
|
||
|
||
// }
|
||
|
||
//}
|
||
|
||
$.each(response.employeeList,
|
||
function(i, item) {
|
||
$('#getPersonnel').append($('<option>',
|
||
{
|
||
value: item.id,
|
||
text: item.employeeFullName
|
||
}));
|
||
});
|
||
|
||
|
||
},
|
||
failure: function(response) {
|
||
console.log(5, response);
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
}
|
||
|
||
async function loadWorkshopWithCode() {
|
||
|
||
const myArray = document.getElementById('getWorkshopWithCode').options.selectedIndex;
|
||
document.getElementById("getWorkshopWithName").options.selectedIndex = myArray;
|
||
const getNameId = document.getElementById("getWorkshopWithName");
|
||
const getWithName = getNameId.options[getNameId.selectedIndex];
|
||
|
||
document.getElementById("select2-getWorkshopWithName-container").innerHTML = getWithName.text;
|
||
|
||
loadWorkshopWithName();
|
||
}
|
||
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
|
||
|
||
async function loadPersonnel() {
|
||
const id = document.getElementById("getPersonnel").value;
|
||
const workshopId = document.getElementById("getWorkshopWithName").value;
|
||
|
||
if (workshopId == "WorkshopIds") {
|
||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا کارگاه را انتخاب نمایید");
|
||
}
|
||
|
||
if (id > 0 && workshopId != "WorkshopIds") {
|
||
$.ajax({
|
||
//contentType: 'application/json; charset=utf-8',
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("/Company/Contracts/Index", "LoadPersonel")',
|
||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||
data: { "id": id, "workshopId": workshopId },
|
||
|
||
success: function(response) {
|
||
var items2 = [];
|
||
$.each(response,
|
||
function(key, val) {
|
||
items2.push({ id: key, vall: val });
|
||
|
||
});
|
||
//if (items2[8].vall == "")
|
||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا تاریخ شروع به کار را در بخش پرسنل <br/>برای این شخص و کارگاه مورد نظر ایجاد نموده و سپس اقدام به ایجاد قرارداد نمایید");
|
||
document.getElementById("FatherName").innerHTML = items2[1].vall;
|
||
document.getElementById("PersonnelNationalCode").innerHTML = items2[2].vall;
|
||
/* document.getElementById("PersonnelIdNumber").innerHTML = items2[3].vall;*/
|
||
document.getElementById("PersonnelDateOfBirth").innerHTML = items2[4].vall;
|
||
//document.getElementById("PersonnelState").innerHTML = items2[5].vall;
|
||
//document.getElementById("PersonnelCity").innerHTML = items2[6].vall;
|
||
//document.getElementById("PersonnelAddress").innerHTML = items2[7].vall;
|
||
//document.getElementById("getWorkDate").value = items2[8].vall;
|
||
//document.getElementById("getWorkDateDisable").value = items2[8].vall;
|
||
//document.getElementById("getWorkDateHide").value = items2[8].vall;
|
||
|
||
|
||
},
|
||
failure: function(response) {
|
||
console.log(5, response);
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
}
|
||
|
||
|
||
</script>
|
||
<script>
|
||
var start1valid = false;
|
||
var end1valid = false;
|
||
|
||
function startValidcheck(inputField) {
|
||
|
||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||
fixNumbers = function(str) {
|
||
if (typeof str === 'string') {
|
||
for (let i = 0; i < 10; i++) {
|
||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||
}
|
||
}
|
||
return str;
|
||
};
|
||
let getdate = inputField.value;
|
||
|
||
var m1, m2;
|
||
var y1, y2, y3, y4;
|
||
var d1, d2;
|
||
var s1, s2;
|
||
for (var i = 0; i < getdate.length; i++) {
|
||
if (i === 0) {
|
||
y1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 1) {
|
||
y2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 2) {
|
||
y3 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 3) {
|
||
y4 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 4) {
|
||
s1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 5) {
|
||
m1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 6) {
|
||
m2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 7) {
|
||
s2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 8) {
|
||
d1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 9) {
|
||
d2 = fixNumbers(getdate[i]);
|
||
}
|
||
|
||
}
|
||
var yRes = y1 + y2 + y3 + y4;
|
||
var year = parseInt(yRes);
|
||
var mRes = m1 + m2;
|
||
var month = parseInt(mRes);
|
||
var dRes = d1 + d2;
|
||
var day = parseInt(dRes);
|
||
var FixResult = yRes + s1 + mRes + s2 + dRes;
|
||
var test = checkEnValid(inputField.value);
|
||
|
||
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
|
||
|
||
|
||
if (isValid) {
|
||
inputField.style.backgroundColor = '#a6e9a6';
|
||
start1valid = true;
|
||
|
||
|
||
$('#sendYearly').attr('disabled', 'disabled');
|
||
$('#sendMonth').attr('disabled', 'disabled');
|
||
$('#sendYearly').val("0");
|
||
$('#sendMonth').val("0");
|
||
$('#sendYearly').css("background-color", "unset");
|
||
$('#sendMonth').css("background-color", "unset");
|
||
|
||
|
||
} else {
|
||
|
||
if (inputField.value != "") {
|
||
inputField.style.backgroundColor = '#f94c4c';
|
||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||
start1valid = false;
|
||
}
|
||
if (inputField.value == "") {
|
||
$('#sendStart').css("background-color", "white");
|
||
$('#montAndYearError').append(
|
||
'<h5 class="cvError2" style="color: red; display: none">okStart</h5>'
|
||
);
|
||
}
|
||
if (inputField.value == "" && $('.cvError2').html() == "okEnd") {
|
||
|
||
$('#sendYearly').removeAttr('disabled');
|
||
$('#sendMonth').removeAttr('disabled');
|
||
$('#sendYearly').css("background-color", "white");
|
||
$('#sendMonth').css("background-color", "white");
|
||
|
||
$('#sendEnd').removeClass('sendSelectDate');
|
||
$('#sendStart').removeClass('sendSelectDate');
|
||
$('.cvError2').remove();
|
||
}
|
||
start1valid = false;
|
||
|
||
|
||
}
|
||
return start1valid;
|
||
|
||
}
|
||
|
||
function endValidcheck(inputField) {
|
||
|
||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||
fixNumbers = function(str) {
|
||
if (typeof str === 'string') {
|
||
for (let i = 0; i < 10; i++) {
|
||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||
}
|
||
}
|
||
return str;
|
||
};
|
||
let getdate = inputField.value;
|
||
|
||
var m1, m2;
|
||
var y1, y2, y3, y4;
|
||
var d1, d2;
|
||
var s1, s2;
|
||
for (var i = 0; i < getdate.length; i++) {
|
||
if (i === 0) {
|
||
y1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 1) {
|
||
y2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 2) {
|
||
y3 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 3) {
|
||
y4 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 4) {
|
||
s1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 5) {
|
||
m1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 6) {
|
||
m2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 7) {
|
||
s2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 8) {
|
||
d1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 9) {
|
||
d2 = fixNumbers(getdate[i]);
|
||
}
|
||
|
||
}
|
||
var yRes = y1 + y2 + y3 + y4;
|
||
var year = parseInt(yRes);
|
||
var mRes = m1 + m2;
|
||
var month = parseInt(mRes);
|
||
var dRes = d1 + d2;
|
||
var day = parseInt(dRes);
|
||
var FixResult = yRes + s1 + mRes + s2 + dRes;
|
||
var test = checkEnValid(inputField.value);
|
||
|
||
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
|
||
|
||
|
||
if (isValid && test) {
|
||
inputField.style.backgroundColor = '#a6e9a6';
|
||
end1valid = true;
|
||
|
||
$('#sendYearly').attr('disabled', 'disabled');
|
||
$('#sendMonth').attr('disabled', 'disabled');
|
||
$('#sendYearly').val("0");
|
||
$('#sendMonth').val("0");
|
||
$('#sendYearly').css("background-color", "unset");
|
||
$('#sendMonth').css("background-color", "unset");
|
||
|
||
} else {
|
||
|
||
if (inputField.value != "") {
|
||
inputField.style.backgroundColor = '#f94c4c';
|
||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||
end1valid = false;
|
||
}
|
||
if (inputField.value == "") {
|
||
$('#sendEnd').css("background-color", "white");
|
||
$('#montAndYearError').append(
|
||
'<h5 class="cvError2" style="color: red; display: none">okEnd</h5>'
|
||
);
|
||
|
||
}
|
||
if (inputField.value == "" && $('.cvError2').html() == "okStart") {
|
||
|
||
$('#sendYearly').removeAttr('disabled');
|
||
$('#sendMonth').removeAttr('disabled');
|
||
$('#sendYearly').css("background-color", "white");
|
||
$('#sendMonth').css("background-color", "white");
|
||
$('#sendEnd').removeClass('sendSelectDate');
|
||
$('#sendStart').removeClass('sendSelectDate');
|
||
$('.cvError2').remove();
|
||
|
||
}
|
||
}
|
||
return end1valid;
|
||
|
||
}
|
||
|
||
function checkEnValid(fixDate) {
|
||
|
||
persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||
fixNumbers = function(str) {
|
||
if (typeof str === 'string') {
|
||
for (let i = 0; i < 10; i++) {
|
||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||
}
|
||
}
|
||
return str;
|
||
};
|
||
let getdate = fixDate;
|
||
var result;
|
||
var m1, m2;
|
||
var y1, y2, y3, y4;
|
||
var d1, d2;
|
||
for (var i = 0; i < getdate.length; i++) {
|
||
if (i === 0) {
|
||
y1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 1) {
|
||
y2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 2) {
|
||
y3 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 3) {
|
||
y4 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 5) {
|
||
m1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 6) {
|
||
m2 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 8) {
|
||
d1 = fixNumbers(getdate[i]);
|
||
}
|
||
if (i === 9) {
|
||
d2 = fixNumbers(getdate[i]);
|
||
}
|
||
|
||
}
|
||
var yRes = y1 + y2 + y3 + y4;
|
||
var year = parseInt(yRes);
|
||
var mRes = m1 + m2;
|
||
var month = parseInt(mRes);
|
||
var dRes = d1 + d2;
|
||
var day = parseInt(dRes);
|
||
var recevedDate = yRes + "/" + mRes + "/" + day;
|
||
if (month <= 6) {
|
||
result = yRes + "/" + mRes + "/31";
|
||
} else if (month > 6 && month < 12) {
|
||
result = yRes + "/" + mRes + "/30";
|
||
} else if (month === 12) {
|
||
switch (year) {
|
||
case 1346:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1350:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1354:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1358:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1362:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1366:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1370:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1375:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1379:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1383:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1387:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1391:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1395:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1399:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1403:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1408:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1412:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1416:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1420:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1424:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1428:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1432:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1436:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1441:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
case 1445:
|
||
result = yRes + "/" + mRes + "/30";
|
||
break;
|
||
default:
|
||
result = yRes + "/" + mRes + "/29";
|
||
|
||
}
|
||
|
||
|
||
}
|
||
|
||
|
||
if (result == recevedDate) {
|
||
return true;
|
||
} else {
|
||
return false;
|
||
}
|
||
|
||
}
|
||
|
||
async function sendData() {
|
||
var checkSendWorkshop = false;
|
||
|
||
if (!isNaN($('#getWorkshopWithName').val())) {
|
||
|
||
checkSendWorkshop = true;
|
||
} else if (!isNaN($('#workshopwithcode').val())) {
|
||
|
||
checkSendWorkshop = true;
|
||
}
|
||
|
||
|
||
if (checkSendWorkshop == true) {
|
||
if ($('#sendMonth').val() != "0" && $('#sendYearly').val() == "0") {
|
||
$('#sendYearly').addClass('sendSelectDate');
|
||
$('#montAndYearError').append(
|
||
'<h5 class="cvError" style="color: red;">لطفا سال را انتخاب کنید</h5>'
|
||
);
|
||
$('#sendYearly').click(function() {
|
||
if ($('#sendYearly').val() != "0") {
|
||
$('#sendYearly').removeClass('sendSelectDate');
|
||
$('.cvError').remove();
|
||
}
|
||
if ($('#sendMonth').val() == "0" && $('#sendYearly').val() == "0") {
|
||
$('#sendYearly').removeClass('sendSelectDate');
|
||
$('#sendMonth').removeClass('sendSelectDate');
|
||
$('.cvError').remove();
|
||
}
|
||
|
||
});
|
||
} else if ($('#sendMonth').val() == "0" && $('#sendYearly').val() != "0") {
|
||
$('#sendMonth').addClass('sendSelectDate');
|
||
$('#montAndYearError').append(
|
||
'<h5 class="cvError" style="color: red;">لطفا ماه را انتخاب کنید</h5>'
|
||
);
|
||
$('#sendMonth').click(function() {
|
||
if ($('#sendMonth').val() != "0") {
|
||
$('#sendMonth').removeClass('sendSelectDate');
|
||
$('.cvError').remove();
|
||
}
|
||
if ($('#sendMonth').val() == "0" && $('#sendYearly').val() == "0") {
|
||
$('#sendYearly').removeClass('sendSelectDate');
|
||
$('#sendMonth').removeClass('sendSelectDate');
|
||
$('.cvError').remove();
|
||
}
|
||
|
||
});
|
||
} else {
|
||
if ($('#sendStart').val() != "" && $('#sendEnd').val() == "") {
|
||
$('#sendEnd').addClass('sendSelectDate');
|
||
$('#montAndYearError').append(
|
||
'<h5 class="cvError" style="color: red; margin-right: 80%;">لطفا تاریخ پایان را وارد کنید</h5>'
|
||
);
|
||
$('#sendEnd').on('change',
|
||
function() {
|
||
if ($('#sendEnd').val() != "") {
|
||
$('#sendEnd').removeClass('sendSelectDate');
|
||
$('.cvError').remove();
|
||
}
|
||
|
||
|
||
});
|
||
} else if ($('#sendStart').val() == "" && $('#sendEnd').val() != "") {
|
||
$('#sendStart').addClass('sendSelectDate');
|
||
$('#montAndYearError').append(
|
||
'<h5 class="cvError" style="color: red; margin-right: 45%;">لطفا تاریخ شروع را وارد کنید</h5>'
|
||
);
|
||
$('#sendStart').on('change',
|
||
function() {
|
||
if ($('#sendStart').val() != "") {
|
||
$('#sendStart').removeClass('sendSelectDate');
|
||
$('.cvError').remove();
|
||
}
|
||
|
||
|
||
});
|
||
} else if ($('#sendStart').val() != "" && $('#sendEnd').val() != "" && start1valid == false) {
|
||
|
||
} else if ($('#sendStart').val() != "" && $('#sendEnd').val() != "" && end1valid == false) {
|
||
|
||
} else {
|
||
$('.formStep').remove();
|
||
$('.ConvertErr').remove();
|
||
|
||
$('#convertError').append(
|
||
'<input type="hidden" class="formStep" value="select" name="FormStep"/>'
|
||
);
|
||
$('#select').click();
|
||
$('.byStep').removeAttr('disabled');
|
||
$('.byStepButton').removeAttr('disabled');
|
||
$('.byStep').css({ 'background-color': '' });
|
||
$('.byStepButton').css({ 'background-color': '' });
|
||
$('.final').removeAttr('disabled');
|
||
$('.final').css({ "background-color": '' });
|
||
}
|
||
|
||
/* window.location.href = url1 + url2 + u2 + u3 + u4 + u5 + u6 + u7;*/
|
||
|
||
}
|
||
} else {
|
||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " انتخاب کارگاه اجباری است ");
|
||
}
|
||
|
||
|
||
}
|
||
|
||
</script> |