Task allocation is the key factor in the spraying pesticides process using unmanned aerial vehicles (UAVs), and maximizing the effects of pesticide spraying is the goal of optimizing UAV pesticide spraying. In this study, we first introduce each UAV's kinematic constraint and extend the Euclidean distance between fields to the Dubins path distance. We then analyze the two factors affecting the pesticide spraying effects, which are the type of pesticides and the temperature during the pesticide spraying. The time window of the pesticide spraying is dynamically generated according to the temperature and is introduced to the pesticide spraying efficacy function. Finally, according to the extensions, we propose a team orienteering problem with variable time windows and variable profits model. We propose the genetic algorithm to solve the above model and give the methods of encoding, crossover, and mutation in the algorithm. The experimental results show that this model and its solution method have clear advantages over the common manual allocation strategy and can provide the same results as those of the enumeration method in small-scale scenarios. In addition, the results also show that the algorithm parameter can affect the solution, and we provide the optimal parameters configuration for the algorithm.