$(document).off('click', '.batch-btn').on('click', '.batch-btn', function()
{
    const type   = $(this).data('type');
    const dtable = zui.DTable.query($('#linkRequirementList'));
    const checkedList = dtable.$.getChecks();
    if(!checkedList.length) return;

    const form = new FormData();
    checkedList.forEach((id) => form.append(type + 'IdList[]', id));

    $.ajaxSubmit({url: $(this).data('url'), data: form});
});

window.changeOption = function()
{
    const product  = $('[name=product]').val();
    const toLane   = $('[name=toLane]').val();
    const url      = $.createLink('pi', 'linkrequirementtoplan', `piID=${piID}&productID=${product}&columnID=${columnID}&toLane=${toLane}`);

    loadTarget(url, '.linkrequirement-modal-body');
}
