This looks wrong. I think it should be:
"Voulez-vous acheter des légumes?"
1."Oui,je veux acheter des légumes."
2."Non,je ne veux pas acheter de légumes."
This is not an question of whether it is countable or uncountable. 'Légumes' are countable, and in the plural here, so they need an 's' at the end .
The phrase 'des légumes' means 'vegetables' or 'some vegetables'. This is the form used in the question and in the affirmative answer "Oui, je veux acheter des légumes."
In the second answer, 'des' changes to 'de' -"Non,je ne veux pas acheter de légumes." - because this is a negative sentence. It's similar to the sentence 'I don't want to buy any vegetables' . The form changes following a negative construction.