I've done such back of the envelope calculations myself in the past, and found things coming out far more favourably for the electric car. I also think it's fair to say you can choose the cleanness of the electricity you use if you use Ecotricity, who use profits to green up the grid.
However, the professionals stepped in last year and made such back of the envelope calculations meaningless.
If you charge electric cars using pure coal, then the lifecycle CO2 emissions are similar (but slightly higher) than diesel. If you charge using anything else, then EVs wipe the floor with diesel.
Proper publication
https://www.sciencedirect.com/science/article/pii/S2352146517305513?via%3Dihub
Thinktank version:
https://www.transportenvironment.org/sites/te/files/publications/2017_10_EV_LCA_briefing_final.pdf
Figure 3 in the thinktank version compares across EU countries energy mixes. All come out in favour of EVs.