send missed merge

This commit is contained in:
MahanCh
2025-05-13 22:05:41 +03:30
parent 30c70c83b2
commit ffa728d05d
4 changed files with 114 additions and 62 deletions

View File

@@ -4,58 +4,59 @@
}
<div class="modal-content" style="height: auto;">
<div class="modal-header d-block text-center position-relative">
<div class="modal-header d-block text-center position-relative">
<button type="button" class="btn-close position-absolute text-start closeConfirmModal"></button>
<h5 class="modal-title" id="morakhasiEstehghaghiModalLabel" style="font-size: 19px;">تغییرات انجام شده آماده اعمال می باشد</h5>
</div>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div>
<p class="m-0">پرسنل زیر بصورت سفارشی قبلا تنظیم شده اند:</p>
</div>
<div class="employee-item">
<ul id="loadEmployeeItem"></ul>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div>
<p class="m-0">پرسنل زیر بصورت سفارشی قبلا تنظیم شده اند:</p>
</div>
<div class="employee-item">
<ul id="loadEmployeeItem"></ul>
</div>
<div class="mt-3 d-flex align-items-center justify-content-between">
<p class="m-0">آیا تغییرات کنونی شامل پرسنل بالا بشود؟</p>
<div class="form-group my-1">
<p class="m-0">آیا تغییرات کنونی شامل پرسنل بالا بشود؟</p>
<div class="form-group my-1">
<input type="radio" name="IsShiftChanged" id="YesConfirm" class="form-check-input modal2" value="true" />
<label for="YesConfirm">بله</label>
</div>
<div class="form-group my-1">
</div>
<div class="form-group my-1">
<input type="radio" name="IsShiftChanged" id="NotConfirm" class="form-check-input modal2" value="false" />
<label for="NotConfirm">خیر</label>
</div>
</div>
</div>
</div>
<label for="NotConfirm">خیر</label>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row mt-3">
<div class="col-6">
<button type="button" class="btn-secondary w-100 closeConfirmModal">انصراف</button>
</div>
<div class="col-6">
<div class="position-relative">
<div class="row mt-3">
<div class="col-6">
<button type="button" class="btn-secondary w-100 closeConfirmModal">انصراف</button>
</div>
<div class="col-6">
<div class="position-relative">
<button type="button" class="btn-primary w-100 disable" id="finalSaveRollCallSetting" onclick="ajaxConfirm()">ثبت نهایی</button>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var loadEmployeesIsSettingChangeAjax = '@Url.Page("./Grouping", "EmployeeIsChangeList")';
var ajaxEmployeesHaveToChangeUrl = `@Url.Page("./Grouping", "EmployeesHaveToChange")`;
var ajaxValidateGroupEditUrl = `@Url.Page("./Grouping", "ValidateGroupEdit")`;
</script>
<script src="~/assetsclient/pages/rollcall/js/confirmemployeechange.js?ver=@clientVersion"></script>

View File

@@ -233,3 +233,10 @@ input:focus {
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}
.hasPaySlip {
background-color: #ffe6e6 !important;
border: 1px solid #ff9999 !important;
color: #b30000;
font-weight: bold;
}

View File

@@ -175,4 +175,30 @@ function updateRowIndexes() {
$('.btn-card').each(function (index) {
$(this).text(index + 1);
});
}
function updateListEmployeeOrderByCheckout(paidIds = []) {
const rows = [];
$('#employeeTable .TaleRowCell').each(function () {
const $row = $(this);
const employeeId = parseInt($row.find('input[name="EmployeeId[]"]').val());
const isPaid = paidIds.includes(employeeId);
if (isPaid) {
$row.addClass('hasPaySlip');
} else {
$row.removeClass('hasPaySlip');
}
rows.push({ element: $row, isPaid });
});
rows.sort((a, b) => b.isPaid - a.isPaid);
$('#employeeTable').empty();
rows.forEach(({ element }) => {
$('#employeeTable').append(element);
});
updateRowIndexes();
}

View File

@@ -851,48 +851,65 @@ async function postChangeEditGroup() {
FromDate: $('[name="FromDate[]"]').eq(index).val()
});
});
const response = await $.ajax({
const responseValid = await $.ajax({
dataType: 'json',
type: 'POST',
url: ajaxEditGroupSave,
url: ajaxValidateGroupEditUrl,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { ...saveData, reCalculateCommand: command }
data: { command }
});
if (response.success) {
isShiftChangedGlobal = true;
if (responseValid.success) {
const responseEditGroup = await $.ajax({
dataType: 'json',
type: 'POST',
url: ajaxEditGroupSave,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { ...saveData, reCalculateCommand: command }
});
if (responseEditGroup.success) {
isShiftChangedGlobal = true;
$('.alert-success-msg').show();
$('.alert-success-msg p').text(responseEditGroup.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
loadDataAjax();
$('#btn-register').addClass('disable');
$('#MainModal').modal('hide');
$('#ConfirmRecalculationLoading').hide();
$('.btn-confirm').removeClass('disable');
//}
} else {
$('.alert-msg').show();
$('.alert-msg p').text(responseEditGroup.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
$('#ConfirmRecalculationLoading').hide();
$('.btn-confirm').removeClass('disable');
}
} else {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
$('.alert-success-msg p').text(responseValid.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
loadDataAjax();
$('#btn-register').addClass('disable');
$('#MainModal').modal('hide');
$('#ConfirmRecalculationLoading').hide();
$('.btn-confirm').removeClass('disable');
//}
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
$('#ConfirmRecalculationLoading').hide();
// Updating the employees that who has checkout
updateListEmployeeOrderByCheckout(responseValid.data);
$('.btn-confirm').removeClass('disable');
}
}
async function saveReCalculateValues(command) {
var btnConfirm = $('.btn-confirm').addClass('disable');
@@ -908,6 +925,7 @@ async function saveReCalculateValues(command) {
headers: { "RequestVerificationToken": antiForgeryToken },
data: { command: command },
});
if (response.success) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);