73 lines
2.2 KiB
JavaScript
73 lines
2.2 KiB
JavaScript
function choosePlane(maxPersonnelId) {
|
|
var maxPersonnelVal = Number(maxPersonnelId);
|
|
var parameter = '&maxId=' + maxPersonnelVal;
|
|
var url = OTPActionUrl;
|
|
window.location.href = url + parameter;
|
|
}
|
|
|
|
function choosePlaneFree() {
|
|
if (employeeCount > 0) {
|
|
window.location.href = OTPActionFreeUrl;
|
|
} else {
|
|
$('.alert-msg').show();
|
|
$('.alert-msg p').text('هیچ پرسنلی در کارگاه وجود ندارد');
|
|
setTimeout(function () {
|
|
$('.alert-msg').hide();
|
|
$('.alert-msg p').text('');
|
|
}, 3500);
|
|
}
|
|
}
|
|
|
|
$(document).on('click', '.gwb-card', function () {
|
|
var index = $(this).index();
|
|
var $clickedCard = $(this).find('.click');
|
|
|
|
$('.click').removeClass('active');
|
|
$clickedCard.addClass('active');
|
|
|
|
var isPaymentBoxVisible = $('#paymentIncDecBox').is(':visible');
|
|
var isPackageVisible = $('.card-grid-package').is(':visible');
|
|
|
|
$('.card-grid-package').slideUp("slow");
|
|
$('#paymentIncDecBox').slideUp("slow");
|
|
|
|
if (index === 2) {
|
|
if (!isPaymentBoxVisible) {
|
|
$('#paymentIncDecBox').slideDown("slow");
|
|
}
|
|
} else {
|
|
if (!isPackageVisible) {
|
|
$('.card-grid-package').slideDown("slow");
|
|
}
|
|
}
|
|
})
|
|
|
|
|
|
$(document).ready(function () {
|
|
$(document).on('click', '.increment', function () {
|
|
var $input = $(this).siblings('.increDecreInput');
|
|
var currentValue = parseInt($input.val());
|
|
|
|
$input.val(currentValue + 1);
|
|
updateTotalAmount(currentValue + 1);
|
|
$('#addMaxPerson').text(Number($('#addMaxPerson').text()) + 1);
|
|
});
|
|
|
|
$(document).on('click', '.decrement', function () {
|
|
var $input = $(this).siblings('.increDecreInput');
|
|
var currentValue = parseInt($input.val());
|
|
|
|
if (currentValue > 0) {
|
|
$input.val(currentValue - 1);
|
|
updateTotalAmount(currentValue - 1);
|
|
$('#addMaxPerson').text(Number($('#addMaxPerson').text()) - 1);
|
|
}
|
|
});
|
|
|
|
function updateTotalAmount(quantity) {
|
|
var pricePerPerson = 350000;
|
|
var totalAmount = quantity * pricePerPerson;
|
|
|
|
$('.increDecreTxt3').text(totalAmount.toLocaleString() + ' تومان');
|
|
}
|
|
}); |