The measure passed on an overwhelming bipartisan vote, the last action in the House before lawmakers departed to campaign ahead of the November midterm elections.