The water crisis is one of the three crises that is persecuting the world. China is among the countries that face severe water shortages. Water scarcity and water pollution have seriously affected China's sustainable development in terms of the economy and society. Water resources per capita of China are only one quarter of world's average, and as much as 70% of China's rivers, lakes, and reservoirs are affected by pollution. Due to limited water resources, a crucial issue for the sustainable development of river basins relates to how to optimally allocate water resources and achieve a coordinated development of the economy, society, and ecology. On the basis of defining water consumption for production, living, and ecology, this chapter proposes a framework for forecasting and optimally allocating water consumption for production, living, and ecology (WPLE) in integrated water-ecosystem-economy system. Using Zhangye, in the middle reaches of the Heihe River Basin as the case study area, we forecasted and optimally allocated WPLE under three development scenarios, i.e., the conventional development scenario (CDS), the economy-priority development scenario (EPDS), and the environment sustainable development scenario (ESDS). In 2010, the proportions of WPLE in Zhangye were 87.73%, 2.74%, and 9.53%, respectively. In 2020, the proportions of WPLE will be 74.80%, 4.50%, and 20.70% under the CDS; 76.16%, 5.27%, and 18.57% under the EPDS; and 74.99%, 4.51%, and 20.50% under the ESDS. In the future, the proportion of production water consumption of Zhangye will drastically decrease, while the proportion of ecology water consumption will significantly increase. The main contradiction of the coevolution of WPLE of Zhangye is the competitiveness of production and living water consumption with ecology water consumption. Keywords Water allocation scheme Á Production water Á Living water Á Ecology water Á Water-ecosystem-economy system Á Scenario analysis Á Genetic algorithm Á Heihe River Basin Á Zhangye Water consumption Production water Living water Ecology water Agriculture Industry Industrial production water Agricultural irrigation water Rural areas Urban areas Urban population water Rural population water Artificial areas Natural areas Natural water and natural vegetation water Irrigation water and evaporation for artificial ecological grassland and woodland Rural livestocks water