I think $350 is a reasonable cost for a bike shop to do the work they likely quoted (though it was probably an overestimation of what was actually needed). Assuming a new derailleur front and rear ($60 in parts), a new chain ($25 in parts), a new cassette ($30 in parts), and double that for labor to install and adjust...that's $230 in parts and labor. Depending on what was "slipping" during pedaling, they could have diagnosed a bad freehub as well, which would probably be another $50-100 in parts and labor (they have to remove it from the hub, which involves bearing work). That's potentially $280-330 in parts and labor, which is in the ballpark of their quote. Again...it all depends on what they diagnosed or quoted.
Derailleurs very rarely need complete replacement and it's likely those could have been adjusted to satisfaction. It's obviously hard to know without the bike...and it's water under the bridge now.