The EP has the right to make amendments to proposed legislation, its not simply a yes no vote.
In fact what is described as "Parliament surprisingly voted to replace blanket mass surveillance with targeted monitoring of suspects following judicial involvement" is exactly the EP voting to amend the Commission proposal on an extension of existing itermim rules with text that explicitly limits the scope.