2022-01-04 11:56:28 +00:00
|
|
|
$(document) .ready(function() {
|
2021-12-30 11:41:37 +00:00
|
|
|
$(".deviceSelect").on("change", deviceSelect);
|
2021-12-30 12:55:11 +00:00
|
|
|
// $('#selectLot').selectpicker();
|
2021-12-30 11:41:37 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
function deviceSelect() {
|
|
|
|
var devices = $(".deviceSelect").filter(':checked');
|
|
|
|
var devices_id = $.map(devices, function(x) { return $(x).attr('data')}).join(",");
|
|
|
|
if (devices_id == "") {
|
|
|
|
$("#addingLotModal .text-danger").show();
|
|
|
|
$("#addingLotModal .btn-primary").hide();
|
2022-01-05 11:13:44 +00:00
|
|
|
|
2022-01-03 10:32:12 +00:00
|
|
|
$("#removeLotModal .text-danger").show();
|
|
|
|
$("#removeLotModal .btn-primary").hide();
|
2022-01-05 11:13:44 +00:00
|
|
|
|
|
|
|
$("#actionModal .text-danger").show();
|
|
|
|
$("#actionModal .btn-primary").hide();
|
2021-12-30 11:41:37 +00:00
|
|
|
} else {
|
|
|
|
$("#addingLotModal .text-danger").hide();
|
|
|
|
$("#addingLotModal .btn-primary").removeClass('d-none');
|
|
|
|
$("#addingLotModal .btn-primary").show();
|
2022-01-05 11:13:44 +00:00
|
|
|
|
2022-01-03 10:32:12 +00:00
|
|
|
$("#removeLotModal .text-danger").hide();
|
|
|
|
$("#removeLotModal .btn-primary").removeClass('d-none');
|
|
|
|
$("#removeLotModal .btn-primary").show();
|
2022-01-05 11:13:44 +00:00
|
|
|
|
|
|
|
$("#actionModal .text-danger").hide();
|
|
|
|
$("#actionModal .btn-primary").removeClass('d-none');
|
|
|
|
$("#actionModal .btn-primary").show();
|
2022-01-10 14:53:11 +00:00
|
|
|
|
|
|
|
$("#allocateModal .text-danger").hide();
|
|
|
|
$("#allocateModal .btn-primary").removeClass('d-none');
|
|
|
|
$("#allocateModal .btn-primary").show();
|
2021-12-30 11:41:37 +00:00
|
|
|
}
|
|
|
|
$.map($(".devicesList"), function(x) {
|
|
|
|
$(x).val(devices_id);
|
|
|
|
});
|
|
|
|
}
|
2022-01-03 12:40:30 +00:00
|
|
|
|
|
|
|
function newAction(action) {
|
2022-01-05 15:00:13 +00:00
|
|
|
$("#actionModal #type").val(action);
|
|
|
|
$("#activeActionModal").click();
|
2022-01-03 12:40:30 +00:00
|
|
|
}
|
2022-01-10 14:53:11 +00:00
|
|
|
|
|
|
|
function newAllocate(action) {
|
|
|
|
$("#allocateModal #type").val(action);
|
|
|
|
$("#activeAllocateModal").click();
|
|
|
|
}
|