631 lines
30 KiB
Plaintext
631 lines
30 KiB
Plaintext
@model CompanyManagment.App.Contracts.MasterPetition.EditMasterPetition
|
||
|
||
<style>
|
||
/* .modal-dialog {
|
||
width: 94% !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;
|
||
}
|
||
|
||
.error {
|
||
font-size: 14px !important;
|
||
}
|
||
</style>
|
||
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
|
||
<form asp-page="./Index" asp-page-handler="CreateOrEditMasterPetition" id="workshops" autocomplete="off"
|
||
method="post"
|
||
data-ajax="true"
|
||
data-callback=""
|
||
data-action="Refresh"
|
||
enctype="multipart/form-data">
|
||
<input asp-for="Id" hidden/>
|
||
<input asp-for="BoardType_Id" hidden/>
|
||
<input asp-for="File_Id" hidden/>
|
||
@if (Model.BoardType_Id == 1)
|
||
{
|
||
<input asp-for="BoardProcessingStage" value="1" hidden/>
|
||
}
|
||
else
|
||
{
|
||
<input asp-for="BoardProcessingStage" value="2" hidden/>
|
||
}
|
||
<div class="modal-body">
|
||
<div class="row">
|
||
<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>
|
||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert; margin: 15px">
|
||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> مشخصات پرونده </legend>
|
||
<div class="row">
|
||
<input asp-for="FileData.Id" hidden/>
|
||
@*<div class="col-md-3">
|
||
<div class="form-group">
|
||
<label asp-for="FileData.ArchiveNo" class="control-label"> شماره بایگانی </label>
|
||
<input type="text" class="form-control" asp-for="FileData.ArchiveNo" readonly>
|
||
<span asp-validation-for="FileData.ArchiveNo" class="error"></span>
|
||
</div>
|
||
</div>*@
|
||
<div class="col-md-3">
|
||
<div class="form-group">
|
||
<label asp-for="FileData.FileClass" class="control-label"> کلاسه پرونده </label>
|
||
<input type="text" class="form-control" asp-for="FileData.FileClass" readonly>
|
||
<span asp-validation-for="FileData.FileClass" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-3">
|
||
<div class="form-group">
|
||
<label asp-for="FileData.Reqester" class="control-label"> موکل </label>
|
||
<input type="text" class="form-control" value="@Model.FileData.ClientFullName" readonly>
|
||
@*<select class="form-control select2-tag" asp-for="FileData.Client" readonly>
|
||
<option value="-1">@Model.FileData.ClientFullName</option>
|
||
</select>*@
|
||
</div>
|
||
</div>
|
||
<div class="col-md-3">
|
||
<div class="form-group">
|
||
<label asp-for="FileData.Reqester" class="control-label"> طرف مقابل </label>
|
||
<input type="text" class="form-control" value="@Model.FileData.OppositePersonFullName" readonly>
|
||
@*<select class="form-control select2-tag" asp-for="FileData.Client" readonly>
|
||
<option value="-1">@Model.FileData.ClientFullName</option>
|
||
</select>*@
|
||
</div>
|
||
</div>
|
||
<div class="col-md-3">
|
||
<div class="form-group">
|
||
<label asp-for="MasterName" class="control-label"> نام کارشناس </label>
|
||
<input type="text" class="form-control" asp-for="MasterName">
|
||
<span asp-validation-for="MasterName" class="error"></span>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert; margin: 15px">
|
||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 220px; text-align: center;"> جزئیات پرداخت کارشناسی </legend>
|
||
<div id="penaltyTitles" class="row m-t-15">
|
||
<div class="col-sm-12 m-b-4">
|
||
<a id="btnPopModal-1" href="#showmodal=@Url.Page("./Index", "CreateOrEditFileTitle", new { Type = "masterPetition" })" class="col-xs-3 pull-right btn btn-success btn-rounded waves-effect waves-light w-100" style=" background-color: #f5f5f5; font-size: 13px; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; margin-bottom: 15px">
|
||
+ ایجاد عنوان جدید
|
||
</a>
|
||
</div>
|
||
@for (var i = 0; i < Model.CreateMasterPenaltyTitle.Count; i++)
|
||
{
|
||
<div class="d-flex">
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterPenaltyTitle[i].Title" class="control-label"> عنوان </label>
|
||
}
|
||
<input type="text" class="form-control" asp-for="CreateMasterPenaltyTitle[i].Title" onfocus="getSugesstedTitles(this, 'masterPetition')">
|
||
<span asp-validation-for="CreateMasterPenaltyTitle[i].Title" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="penaltyTitleDates">
|
||
<div class="col-md-1 penaltyTitles">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterPenaltyTitle[i].Day" class="control-label"> روز </label>
|
||
}
|
||
<input type="text" class="form-control day" asp-for="CreateMasterPenaltyTitle[i].Day" onfocusout="removeExtraData()">
|
||
<span asp-validation-for="CreateMasterPenaltyTitle[i].Day" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterPenaltyTitle[i].FromDate" class="control-label"> از تاریخ </label>
|
||
}
|
||
<input type="text" class="form-control date penaltyTitleFromDate" asp-for="CreateMasterPenaltyTitle[i].FromDate" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this), false); removeExtraData();" style="width: 100%; text-align: center">
|
||
<span asp-validation-for="CreateMasterPenaltyTitle[i].FromDate" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterPenaltyTitle[i].ToDate" class="control-label"> تا تاریخ </label>
|
||
}
|
||
<input type="text" class="form-control date penaltyTitleToDate" asp-for="CreateMasterPenaltyTitle[i].ToDate" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this), true, false); removeExtraData();" style="width: 100%; text-align: center">
|
||
<span asp-validation-for="CreateMasterPenaltyTitle[i].ToDate" class="error"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterPenaltyTitle[i].PaidAmount" class="control-label" style="font-size: smaller"> علی الحساب پرداختی </label>
|
||
}
|
||
<input type="text" class="form-control" asp-for="CreateMasterPenaltyTitle[i].PaidAmount" onkeyup="numberWithCommas(this)">
|
||
<span asp-validation-for="CreateMasterPenaltyTitle[i].PaidAmount" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterPenaltyTitle[i].RemainingAmount" class="control-label"> مبلغ باقیمانده </label>
|
||
}
|
||
<input type="text" class="form-control remainingAmount" asp-for="CreateMasterPenaltyTitle[i].RemainingAmount" onkeyup="numberWithCommas(this)" onfocusout="SumRemainingAmounts()">
|
||
<span asp-validation-for="CreateMasterPenaltyTitle[i].RemainingAmount" class="error"></span>
|
||
</div>
|
||
</div>
|
||
@if (i != 0)
|
||
{
|
||
<div class="col-md-1" onclick="removeRow(this, 'penaltyTitles', 'penaltyTitles');">
|
||
<i class="fa fa-minus-circle fa-2x" style="color: red; position: absolute; top: 4px cursor: pointer;"></i>
|
||
</div>
|
||
}
|
||
</div>
|
||
}
|
||
|
||
<div class="col-md-8 penaltyTitlesFormButton"></div>
|
||
<div class="col-md-4">
|
||
<a onclick="addNewFormPenaltyTitles('penaltyTitlesFormButton')" class="btn btn-rounded btn-success waves-effect waves-light col-xs-12 m-b-30">+ افزودن جزئیات دادنامه</a>
|
||
</div>
|
||
<div class="col-md-12">
|
||
<div class="form-group">
|
||
<label asp-for="Description" class="control-label"> توضیحات </label>
|
||
<textarea class="form-control" asp-for="Description"></textarea>
|
||
<span asp-validation-for="Description" class="error"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert; margin: 15px">
|
||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 230px; text-align: center;"> احراز سابقه توسط کارشناس </legend>
|
||
<div id="recordVerification" class="row m-t-15">
|
||
|
||
@for (var i = 0; i < Model.CreateMasterWorkHistory.Count; i++)
|
||
{
|
||
<div class="d-felx">
|
||
<div class="col-md-2 recordVerification">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterWorkHistory[i].FromDate" class="control-label"> از تاریخ </label>
|
||
}
|
||
<input type="text" class="form-control date" asp-for="CreateMasterWorkHistory[i].FromDate" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this) , false)" style="width: 100%; text-align: center">
|
||
<span asp-validation-for="CreateMasterWorkHistory[i].FromDate" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 recordVerification">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterWorkHistory[i].ToDate" class="control-label"> تا تاریخ </label>
|
||
}
|
||
<input type="text" class="form-control date" asp-for="CreateMasterWorkHistory[i].ToDate" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this), true, false)" style="width: 100%; text-align: center">
|
||
<span asp-validation-for="CreateMasterWorkHistory[i].ToDate" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="row col-md-4 workingHours" style="margin: 0">
|
||
<div class="col-md-6 recordVerification">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterWorkHistory[i].WorkingHoursPerDay" class="control-label"> ساعت کار در روز </label>
|
||
}
|
||
<input type="text" class="form-control workingHoursPerDay" asp-for="CreateMasterWorkHistory[i].WorkingHoursPerDay" onfocusout="removeExtraData()">
|
||
<span asp-validation-for="CreateMasterWorkHistory[i].WorkingHoursPerDay" class="error"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 recordVerification">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterWorkHistory[i].WorkingHoursPerWeek" class="control-label" style="font-size: smaller"> ساعت کار در هفته </label>
|
||
}
|
||
<input type="text" class="form-control workingHoursPerWeek" asp-for="CreateMasterWorkHistory[i].WorkingHoursPerWeek" onfocusout="removeExtraData()">
|
||
<span asp-validation-for="CreateMasterWorkHistory[i].WorkingHoursPerWeek" class="error"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-3 recordVerification">
|
||
<div class="form-group">
|
||
@if (i == 0)
|
||
{
|
||
<label asp-for="CreateMasterWorkHistory[i].Description" class="control-label"> توضیحات </label>
|
||
}
|
||
<textarea class="form-control" asp-for="CreateMasterWorkHistory[i].Description"></textarea>
|
||
<span asp-validation-for="CreateMasterWorkHistory[i].Description" class="error"></span>
|
||
</div>
|
||
</div>
|
||
@if (i != 0)
|
||
{
|
||
<div class="col-md-1" onclick="removeRow(this, 'recordVerification', 'recordVerification');">
|
||
<i class="fa fa-minus-circle fa-2x" style="color: red; position: absolute; top: 4px cursor: pointer;"></i>
|
||
</div>
|
||
}
|
||
</div>
|
||
}
|
||
|
||
<div class="col-md-8 addRecordVerificationFormButton"></div>
|
||
<div class="col-md-4">
|
||
<a onclick="addNewFormWorkhistory('addRecordVerificationFormButton')" class="btn btn-rounded btn-success waves-effect waves-light col-xs-12 m-b-30">+ افزودن احراز سابقه</a>
|
||
</div>
|
||
|
||
<div class="col-md-12">
|
||
<div class="form-group">
|
||
<label asp-for="WorkHistoryDescription" class="control-label"> توضیحات </label>
|
||
<textarea class="form-control" asp-for="WorkHistoryDescription"></textarea>
|
||
<span asp-validation-for="WorkHistoryDescription" class="error"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<div style="float: left">
|
||
<a class="btn btn-default btn-rounded waves-effect waves-light" data-dismiss="modal">بستن</a>
|
||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
|
||
</div>
|
||
|
||
@if (Model.Id != 0)
|
||
{
|
||
<a class="btn btn-danger btn-rounded waves-effect waves-light" onclick="removeMasterPetition()"> حذف کارشناسی </a>
|
||
}
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
|
||
<script>
|
||
|
||
$(document).ready(function() {
|
||
|
||
$('.modal-dialog').addClass('modal-lg');
|
||
//CreateDatePicker('#PetitionIssuanceDate', `#NotificationPetitionDate`);
|
||
|
||
//var i = 0;
|
||
//$(".recordVerification").each(function() {
|
||
// CreateDatePicker(`#CreateMasterWorkHistory_${i}__FromDate`, `#CreateMasterWorkHistory_${i}__ToDate`)
|
||
|
||
// i++;
|
||
//})
|
||
|
||
//i = 0;
|
||
//$(".penaltyTitles").each(function() {
|
||
// CreateDatePicker(`#CreateMasterPenaltyTitle_${i}__FromDate`, `#CreateMasterPenaltyTitle_${i}__ToDate`)
|
||
|
||
// i++;
|
||
//})
|
||
});
|
||
|
||
$('.modal').on('hidden.bs.modal',
|
||
function() {
|
||
$('.modal-dialog').removeClass('modal-lg');
|
||
});
|
||
|
||
$(".select2-tag").select2({
|
||
language: "fa",
|
||
dir: "rtl"
|
||
});
|
||
|
||
</script>
|
||
<script>
|
||
|
||
//var penaltyTitleCounter = @Model.CreateMasterPenaltyTitle.Count - 1;
|
||
//var workhistoryCounter = @Model.CreateMasterWorkHistory.Count - 1;
|
||
|
||
function addNewFormWorkhistory(flag) {
|
||
|
||
const workhistoryCounter = $("#recordVerification input[name$='.WorkingHoursPerDay']").length;
|
||
//var content = $("#" + dataType + " ." + dataType);
|
||
////var cn = $(content[i]).clone(true);
|
||
|
||
////$(cn).find('label').html('تاریخ نوبت ' + turns[$(content).size()/3 - 1] + ' رسیدگی');
|
||
|
||
////$(cn).insertBefore("#" + dataType + " .addProceedingSessionFormButton");
|
||
//$(content[i]).clone().insertBefore("#" + dataType + " ." + flag);
|
||
//$(content[1]).clone().insertBefore("#" + dataType + " ." + flag);
|
||
//$(content[2]).clone().insertBefore("#" + dataType + " ." + flag);
|
||
//$(content[3]).clone().insertBefore("#" + dataType + " ." + flag);
|
||
//$(content[4]).clone().insertBefore("#" + dataType + " ." + flag);
|
||
|
||
//workhistoryCounter++;
|
||
|
||
const html = `<div class="d-flex">
|
||
<div class="col-md-2 recordVerification">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterWorkHistory_${workhistoryCounter}__FromDate"> از تاریخ </label> -->
|
||
<input type="text" class="form-control date" id="CreateMasterWorkHistory_${workhistoryCounter}__FromDate" name="CreateMasterWorkHistory[${workhistoryCounter}].FromDate" value="" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this), false)" style="width: 100%; text-align: center">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterWorkHistory[${workhistoryCounter}].FromDate" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 recordVerification">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterWorkHistory_${workhistoryCounter}__ToDate"> تا تاریخ </label> -->
|
||
<input type="text" class="form-control date" id="CreateMasterWorkHistory_${workhistoryCounter}__ToDate" name="CreateMasterWorkHistory[${workhistoryCounter}].ToDate" value="" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this), true, false)" style="width: 100%; text-align: center">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterWorkHistory[${workhistoryCounter}].ToDate" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="row col-md-4 workingHours" style="margin: 0">
|
||
<div class="col-md-6 recordVerification">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterWorkHistory_${workhistoryCounter}__WorkingHoursPerDay"> ساعت کار در روز </label> -->
|
||
<input type="text" class="form-control workingHoursPerDay" id="CreateMasterWorkHistory_${workhistoryCounter}__WorkingHoursPerDay" name="CreateMasterWorkHistory[${workhistoryCounter}].WorkingHoursPerDay" value="" onfocusout="removeExtraData()">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterWorkHistory[${workhistoryCounter}].WorkingHoursPerDay" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 recordVerification">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterWorkHistory_${workhistoryCounter}__WorkingHoursPerWeek"> ساعت کار در هفته </label> -->
|
||
<input type="text" class="form-control workingHoursPerWeek" id="CreateMasterWorkHistory_${workhistoryCounter}__WorkingHoursPerWeek" name="CreateMasterWorkHistory[${workhistoryCounter}].WorkingHoursPerWeek" value="" onfocusout="removeExtraData()">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterWorkHistory[${workhistoryCounter}].WorkingHoursPerWeek" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-3 recordVerification">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterWorkHistory_${workhistoryCounter}__Description"> توضیحات </label> -->
|
||
<textarea class="form-control" id="CreateMasterWorkHistory_${workhistoryCounter}__Description" name="CreateMasterWorkHistory[${workhistoryCounter}].Description"></textarea>
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterWorkHistory[${workhistoryCounter}].Description" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-1" onclick="removeRow(this, 'recordVerification', 'recordVerification');">
|
||
<i class="fa fa-minus-circle fa-2x" style="color: red; position: absolute; top: 4px; cursor: pointer;"></i>
|
||
</div>
|
||
</div>`;
|
||
|
||
$(html).insertBefore(`.${flag}`);
|
||
|
||
//CreateDatePicker(`#CreateMasterWorkHistory_${workhistoryCounter}__FromDate`, `#CreateMasterWorkHistory_${workhistoryCounter}__ToDate`)
|
||
// $(`#CreateMasterWorkHistory_${workhistoryCounter}__FromDate`).persianDatepicker({
|
||
// format: 'YYYY/MM/DD',
|
||
// initialValueType: 'persian',
|
||
// initialValue: false,
|
||
// 'position': [-270, 25],
|
||
// autoClose: true,
|
||
|
||
// calendar: {
|
||
// persian: {
|
||
// leapYearMode: 'astronomical'
|
||
// }
|
||
// },
|
||
|
||
// onSelect: function(dateStr)
|
||
// {
|
||
// //$(`#CreateMasterWorkHistory_${workhistoryCounter}__ToDate`).val(dateStr);
|
||
// $(`#CreateMasterWorkHistory_${workhistoryCounter}__ToDate`).persianDatepicker({
|
||
// minDate: new Date(dateStr),
|
||
// format: 'YYYY/MM/DD',
|
||
// initialValueType: 'persian',
|
||
// initialValue: false,
|
||
// 'position': [-270, 25],
|
||
// autoClose: true,
|
||
// calendar: {
|
||
// persian: {leapYearMode: 'astronomical'}
|
||
// }
|
||
// })
|
||
// }
|
||
//});
|
||
}
|
||
|
||
function addNewFormPenaltyTitles(flag) {
|
||
|
||
const penaltyTitleCounter = $("#penaltyTitles input[name$='.Title']").length;
|
||
//penaltyTitleCounter++;
|
||
|
||
const html = `<div class="d-flex">
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterPenaltyTitle_${penaltyTitleCounter}__Title"> عنوان </label> -->
|
||
<input type="text" class="form-control" id="CreateMasterPenaltyTitle_${penaltyTitleCounter}__Title" name="CreateMasterPenaltyTitle[${penaltyTitleCounter}].Title" value="">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterPenaltyTitle[${penaltyTitleCounter}].Title" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="penaltyTitleDates">
|
||
<div class="col-md-1 penaltyTitles">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterPenaltyTitle_${penaltyTitleCounter}__Day"> روز </label> -->
|
||
<input type="text" class="form-control day" id="CreateMasterPenaltyTitle_${penaltyTitleCounter}__Day" name="CreateMasterPenaltyTitle[${penaltyTitleCounter}].Day" value="" onfocusout="removeExtraData()">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterPenaltyTitle[${penaltyTitleCounter}].Day" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterPenaltyTitle_${penaltyTitleCounter}__FromDate"> از تاریخ </label> -->
|
||
<input type="text" class="form-control date penaltyTitleFromDate" id="CreateMasterPenaltyTitle_${penaltyTitleCounter}__FromDate" name="CreateMasterPenaltyTitle[${penaltyTitleCounter}].FromDate" value="" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this), false); removeExtraData();" style="width: 100%; text-align: center">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterPenaltyTitle[${penaltyTitleCounter}].FromDate" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterPenaltyTitle_${penaltyTitleCounter}__ToDate"> تا تاریخ </label> -->
|
||
<input type="text" class="form-control date penaltyTitleToDate" id="CreateMasterPenaltyTitle_${penaltyTitleCounter}__ToDate" name="CreateMasterPenaltyTitle[${penaltyTitleCounter}].ToDate" value="" dir="ltr" maxlength="10" onchange="validDate(this);" onfocusout="CompareDates($(this), true, false); removeExtraData();" style="width: 100%; text-align: center">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterPenaltyTitle[${penaltyTitleCounter}].ToDate" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterPenaltyTitle_${penaltyTitleCounter}__PaidAmount" style="font-size: smaller"> علی الحساب پرداختی </label> -->
|
||
<input type="text" class="form-control" id="CreateMasterPenaltyTitle_${penaltyTitleCounter}__PaidAmount" name="CreateMasterPenaltyTitle[${penaltyTitleCounter}].PaidAmount" value="" onkeyup="numberWithCommas(this)">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterPenaltyTitle[${penaltyTitleCounter}].PaidAmount" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-2 penaltyTitles">
|
||
<div class="form-group">
|
||
<!-- <label class="control-label" for="CreateMasterPenaltyTitle_${penaltyTitleCounter}__RemainingAmount"> مبلغ باقیمانده </label> -->
|
||
<input type="text" class="form-control remainingAmount" id="CreateMasterPenaltyTitle_${penaltyTitleCounter}__RemainingAmount" name="CreateMasterPenaltyTitle[${penaltyTitleCounter}].RemainingAmount" value=""
|
||
onfocusout="SumRemainingAmounts()" onkeyup="numberWithCommas(this)">
|
||
<span class="error field-validation-valid" data-valmsg-for="CreateMasterPenaltyTitle[${penaltyTitleCounter}].RemainingAmount" data-valmsg-replace="true"></span>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-1" onclick="removeRow(this, 'penaltyTitles', 'penaltyTitles');">
|
||
<i class="fa fa-minus-circle fa-2x" style="color: red; position: absolute; top: 4px; cursor: pointer;"></i>
|
||
</div>
|
||
</div>`;
|
||
|
||
$(html).insertBefore(`.${flag}`);
|
||
|
||
//CreateDatePicker(`#CreateMasterPenaltyTitle_${penaltyTitleCounter}__FromDate`, `#CreateMasterPenaltyTitle_${penaltyTitleCounter}__ToDate`)
|
||
//$(`#CreateMasterPenaltyTitle_${penaltyTitleCounter}__FromDate`).persianDatepicker({
|
||
// format: 'YYYY/MM/DD',
|
||
// initialValueType: 'persian',
|
||
// initialValue: false,
|
||
// 'position': [-270, 25],
|
||
// autoClose: true,
|
||
|
||
// calendar: {
|
||
// persian: {
|
||
// leapYearMode: 'astronomical'
|
||
// }
|
||
// },
|
||
|
||
// onSelect: function(dateStr)
|
||
// {
|
||
// $(`#CreateMasterPenaltyTitle_${penaltyTitleCounter}__ToDate`).persianDatepicker({
|
||
// minDate: new Date(dateStr),
|
||
// format: 'YYYY/MM/DD',
|
||
// initialValueType: 'persian',
|
||
// initialValue: false,
|
||
// //'position': [-270, 25],
|
||
// autoClose: true,
|
||
|
||
// calendar: {
|
||
// persian: {leapYearMode: 'astronomical'}
|
||
// }
|
||
// })
|
||
// }
|
||
|
||
//});
|
||
|
||
}
|
||
|
||
//function insertMinDate(dateFrom, dateTo){
|
||
// console.log(dateFrom, dateTo)
|
||
|
||
// $(`#${dateTo}`).persianDatepicker({
|
||
// minDate: $(`#${dateFrom}`).value,
|
||
// //minDate: "۱۴۰۱/۰۶/۲۸",
|
||
// });
|
||
//}
|
||
|
||
function SumRemainingAmounts() {
|
||
var remainingAmounts = 0;
|
||
$('.remainingAmount').each(function() {
|
||
|
||
if ($(this).val() != '')
|
||
remainingAmounts += parseInt($(this).val().split(',').join(""));
|
||
});
|
||
|
||
$('.totalPenaltyTitles').val(remainingAmounts);
|
||
//console.log($('.totalPenaltyTitles').val())
|
||
numberWithCommas($('.totalPenaltyTitles'));
|
||
}
|
||
|
||
function removeExtraData() {
|
||
$('.workingHoursPerDay').focusout(function() {
|
||
|
||
if ($(this).val() != null || $(this).val() != 0) {
|
||
|
||
$(this).parents('.workingHours').find('.workingHoursPerWeek').val("");
|
||
}
|
||
});
|
||
$('.workingHoursPerWeek').focusout(function() {
|
||
|
||
if ($(this).val() != null || $(this).val() != 0) {
|
||
|
||
$(this).parents('.workingHours').find('.workingHoursPerDay').val("");
|
||
}
|
||
});
|
||
|
||
$('.day').focusout(function() {
|
||
|
||
if ($(this).val() != null || $(this).val() != 0) {
|
||
|
||
$(this).parents('.penaltyTitleDates').find('.penaltyTitleFromDate').val("");
|
||
$(this).parents('.penaltyTitleDates').find('.penaltyTitleToDate').val("");
|
||
}
|
||
});
|
||
|
||
$('.penaltyTitleFromDate').focusout(function() {
|
||
|
||
if ($(this).val() != null || $(this).val() != 0) {
|
||
|
||
$(this).parents('.penaltyTitleDates').find('.day').val("");
|
||
}
|
||
});
|
||
|
||
$('.penaltyTitleToDate').focusout(function() {
|
||
|
||
if ($(this).val() != null || $(this).val() != 0) {
|
||
|
||
$(this).parents('.penaltyTitleDates').find('.day').val("");
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
function removeMasterPetition() {
|
||
|
||
const id = document.getElementById("Id").value;
|
||
|
||
swal({
|
||
title: "",
|
||
text: "آیا از حذف تمامی اطلاعات کارشناسی مطمئن هستید؟",
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بله",
|
||
cancelButtonText: "خیر",
|
||
closeOnConfirm: true,
|
||
closeOnCancel: true
|
||
},
|
||
function(isConfirm) {
|
||
if (isConfirm) {
|
||
|
||
$.ajax({
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("./Index", "RemoveMasterPetition")',
|
||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||
data: { "id": id },
|
||
|
||
success: function(response) {
|
||
console.log(response);
|
||
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
|
||
setTimeout(function() {
|
||
location.reload();
|
||
},
|
||
1200);
|
||
|
||
},
|
||
failure: function(response) {
|
||
console.log(5, response);
|
||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
|
||
}
|
||
|
||
</Script> |