2022-01-11 10:21:17 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
$(".deviceSelect").on("change", deviceSelect);
|
|
|
|
// $('#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-03 10:32:12 +00:00
|
|
|
$("#removeLotModal .text-danger").show();
|
|
|
|
$("#removeLotModal .btn-primary").hide();
|
2022-01-25 11:53:36 +00:00
|
|
|
$("#addingTagModal .text-danger").show();
|
|
|
|
$("#addingTagModal .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-03 10:32:12 +00:00
|
|
|
$("#removeLotModal .text-danger").hide();
|
|
|
|
$("#removeLotModal .btn-primary").removeClass('d-none');
|
|
|
|
$("#removeLotModal .btn-primary").show();
|
2022-01-25 11:53:36 +00:00
|
|
|
$("#addingTagModal .text-danger").hide();
|
|
|
|
$("#addingTagModal .btn-primary").removeClass('d-none');
|
2021-12-30 11:41:37 +00:00
|
|
|
}
|
|
|
|
$.map($(".devicesList"), function(x) {
|
|
|
|
$(x).val(devices_id);
|
|
|
|
});
|
|
|
|
}
|
2022-01-03 12:40:30 +00:00
|
|
|
|
2022-01-25 13:39:15 +00:00
|
|
|
function removeTag() {
|
|
|
|
var devices = $(".deviceSelect").filter(':checked');
|
|
|
|
var devices_id = $.map(devices, function(x) { return $(x).attr('data')});
|
|
|
|
console.log(devices_id);
|
|
|
|
if (devices_id.length > 0) {
|
|
|
|
var url = "/inventory/tag/devices/"+devices_id[0]+"/del/";
|
|
|
|
window.location.href = url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-03 12:40:30 +00:00
|
|
|
function newAction(action) {
|
2022-01-04 11:56:28 +00:00
|
|
|
console.log(action);
|
2022-01-03 12:40:30 +00:00
|
|
|
}
|