Auto increment field value based on another field

Hi!! I have a doctype called Planning form and child table Planning Form line in it. So In Child table whenever a field called phase is created a new sequence number should be created like 001,002,003.

How can i achieve this? Kindly help

Thanks in advance!!