Gov. J.B. Pritzker pledged to sign the bill, which is part of an effort by Democratic state lawmakers to address gun violence.