Dishwasher Repair

I would like to fix this dishwasher from this problem. When the unit finishes the wash cycle and tries to move on to the rinse cycle you need to open the door and close it again for it to continue. If not the timer counts down to zero and never finishes the cycle. The water is still in the bottom and everything is still wet. If I open and close the door the cycle goes to completion. Should I replace the control pannal or door switch?