To vegetable production in field, climate is the major factor causing fluctuations of vegetable supply. A programming model with multi-objectives of balanced supply, maximum economic profit and minimum cultivated land areas based on demand of the market and the yearly climate variation is established. The quantitative influence of the climate as a random factor on the supply is considered. This has further enhanced the predictability and reliability of the programming model. The optimization of vegetable production in Shanghai obtained from simulation could reduce the imbalance between the demand and supply by 12%, cut 3.24 million yuan of government deficit and save 1264×104m2 of cultivated land