this.disabled=true;
<button type="button" class="btn btn-outline-danger" onclick="this.disabled=true; undoCheckout('BKDZ8TKD');">undo</button>