Files
jikimo_sf/sf_manufacturing/static/src/js/customRFID.js
2024-08-20 10:42:36 +08:00

19 lines
535 B
JavaScript

var RFID = ''
$(document).off('keydown')
$(document).on('keydown', 'body.o_web_client', function (e) {
setTimeout(() => {
RFID = ''
}, 200)
if(e.key == 'Enter' && e.keyCode == 13 || e.key == 'Tab' && e.keyCode == 9){
console.log(RFID)
if(!RFID || RFID.length <= 3) return;
$('[name="button_start"]').trigger('click')
setTimeout(() => {
$('.o_dialog .modal-footer .btn-primary').trigger('click')
}, 50)
RFID = ''
return;
}
RFID += e.key
})