In order to precisely obtain the impact of nutritional elements on lettuce yield and quality, in the present study, a nutrient solution formula suitable for lettuce hydroponic production was development using response surface methodology based on the determination for micro-elements in three growth stages and taking the interaction between elements into account. Then, the formula was optimized and validated, aiming for the goal of improving lettuce yield and quality. The results showed that 200 healthy lettuce leaves contained similar amounts of macro-elements, and there was no significant difference in the unit content of micro-elements among the seedling, rosette, and harvest stages. Quadratic regression models between shoot fresh weight, SPAD value, soluble sugar content, Vc content, and nutrient content were established (R2 = 0.91, 0.95, 0.98, and 0.81, respectively). The optimal concentrations of P, K, Ca, and Mg obtained by multi-objective optimization of the quadratic regression models for fresh weight, SPAD value, soluble sugar content, and Vc content were 2.71 mmol·L−1, 6.42 mmol·L−1, 5.58 mmol·L−1, and 7.11 mmol·L−1, respectively. The nutrient solution formula (T1) was found to be the optimal nutrient solution formula for improving lettuce growth and quality. Overall, we developed a specific and targeted nutrient solution formulation for lettuce; this formulation not only meets lettuce’s demand for nutrients, but also improves lettuce yield and quality, providing more choices for lettuce production in a region with high salts and high pH in the irrigation water.