where do I go and what do I need?
If the employer is solid and provides you with a job offer.; take it and visit PSB in Tianfu Square. They will guide you and explain the process.
I prefer not to leave the country to apply the permit
Well, work visa based resident permit to family reunion based resident permit is possible. Not sure about if it’s doable vice versa (since you need a lot more paperwork to get the work permit). Check with PSB as soon as possible.