The Catalan club announced that the deal was worth two million euros (£1.6m) and contains a buy-back clause. The move will be completed once Dos Santos completes a medical.
The Mexican international made just 14 first-team appearances for Barca in five seasons and has called time on his career with the club to join his brother Giovani at Villarreal.
Earlier in the summer, the 24-year-old turned down the chance to move to Real Sociedad as part of the deal that saw goalkeeper Claudio Bravo join Barcelona.
Dos Santos is the latest La Masia graduate to leave Barcelona, following the second departure of Cesc Fabregas and the exits of Carles Puyol and Victor Valdes earlier this summer.