Under the background of severe air pollution and energy shortage, electric vehicles (EVs) are promising vehicles to support green supply chain and clean production. In the world, the renewal of EVs has become a general trend. Therefore, the concern about EVs is a hot issue at present, but EVs have the characteristics of limited driving distance and long charging time. When the EVs are used in logistics transportation, these characteristics have a significant impact on the vehicle routing problems. Therefore, based on the research experience of traditional vehicle routing optimization, combining with the characteristics of EVs, this paper presents an optimal problem of electric vehicle routes with time windows based on two charging methods and it also designs a mathematical model which was caused by early and late arrival as the objective function to minimize the transportation cost, vehicle use cost, power supply cost, and penalty cost. The model is solved using an ant colony algorithm. Finally, the ant colony algorithm is tested and analysed with an example.