The maximum length of nifaas (post-partum bleeding) is forty days, after which the woman is taahir (pure) and she may pray and fast and her husband may have intercourse with her, even if there is bleeding. This blood that comes after forty days is a haemorrhage, not nifaas.
This has been discussed with evidence in the answer to question no. 10488.
Based on that, your fasting after doing the operation is valid, even if there is bleeding.
You have to make up the first week of Ramadaan when you did not fast.
With regard to the prayers that you did not offer after the forty days (of nifaas) ended, you do not have to make them up, in sha Allaah.
See the answer to question no. 45648.
And Allaah knows best.