Sustainable wastewater treatment and recycling in membrane manufacturing