diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 8ccb24f8..7e5a7999 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -1014,7 +1014,6 @@ class ExportsView(View): return export_ids[export_id]() def find_devices(self): - # import pdb; pdb.set_trace() sql = """ select lot_device.device_id as id from {schema}.share_lot as share inner join {schema}.lot_device as lot_device diff --git a/ereuse_devicehub/static/js/main_inventory.build.js b/ereuse_devicehub/static/js/main_inventory.build.js index 0032f649..389f4377 100644 --- a/ereuse_devicehub/static/js/main_inventory.build.js +++ b/ereuse_devicehub/static/js/main_inventory.build.js @@ -30,6 +30,10 @@ $(document).ready(() => { ; select_shift(); // $('#selectLot').selectpicker(); + + $("#filter").on("change", () => { + $("#submit_filter").click(); + }); }); class TableController { @@ -211,8 +215,8 @@ function removeLot() { } function select_shift() { - const chkboxes = $('.deviceSelect'); - var lastChecked = null; + const chkboxes = $(".deviceSelect"); + let lastChecked = null; chkboxes.click(function (e) { if (!lastChecked) { lastChecked = this; @@ -324,17 +328,16 @@ function export_file(type_file) { function export_actions_erasure(type_file) { const actions = TableController.getSelectedDevices(); - const actions_id = $.map(actions, (x) => $(x).attr("data-action-erasure")).join(","); + const actions_id = $.map(actions, x => $(x).attr("data-action-erasure")).join(","); if (actions_id) { - const url = `/inventory/export/${type_file}/?ids=${actions_id}`; + const url = "/inventory/export/".concat(type_file, "/?ids=").concat(actions_id); window.location.href = url; } else { $("#exportAlertModal").click(); } } - class lotsSearcher { static enable() { if (this.lotsSearchElement) this.lotsSearchElement.disabled = false; @@ -663,19 +666,14 @@ async function processSelectedDevices() { return lot; }); - listHTML.html(""); const lot_temporary = lots.filter(lot => !lot.transfer && !lot.trade); appendMenu(lot_temporary, listHTML, templateLot, selectedDevices, actions, "Temporary"); - const lot_incoming = lots.filter(lot => lot.transfer && lot.transfer == "Incoming"); appendMenu(lot_incoming, listHTML, templateLot, selectedDevices, actions, "Incoming"); - const lot_outgoing = lots.filter(lot => lot.transfer && lot.transfer == "Outgoing"); appendMenu(lot_outgoing, listHTML, templateLot, selectedDevices, actions, "Outgoing"); - lotsSearcher.enable(); - } catch (error) { console.log(error); listHTML.html("