If a Warlock forgoes an attack to let his Pact of the Chain familiar attack does it occur immediately?

Action Surge+Two Weapon Fighting+Haste at 20th level how many att does this yield?

Does a Wild Surge effect replace the effect of the spell cast triggering it or both effect happens?