Your best option to separate payroll into departments is to use the 'Class' feature. You would create a class for each department and then apply that Class to each person's payroll profile in the 'Payroll Info' tab. Your standard P & L would still show your payroll expenses as a lump sum in one GL account, but you could create sub-reports showing the breakdowns by Department/Class. There are quite a few different reports you could use, but it all depends on your preferences for how you'd like the information to display. Whichever report you choose to use, just filter by Class and you will get the information you're looking for.
It is also possible to set up different GL accounts for each department, but there are a few extra steps to get proper financial reporting, simply because for the built-in Vacation Accrued, Vacation Used, Bank Time accrued & used (if you use it) and CPP & EI items, QB only allows one Payroll Item for each, and they are default and are linked to only one GL expense account each. So the salaries and/or hourly wages would all go into the correct GL accounts because you would have separate Payroll Items for each department, but, for example, Vacation Expense would only go to one GL account. You would have to choose one account for the items mentioned previously, and then do GJE's at the end of each month to move those amounts into your desired GL accounts for each department. I do this every month and it is very simple, because I have created memorized reports showing Vacation Expense, Bank Time, CPP & EI for each class. I create my JE's from these reports by crediting the expense acct that they are currently posting to, and debiting the GL account I want. I just print my reports each month, and the corresponding JE's I make to move the expenses to the correct accounts. It really sounds more difficult than it is. If you require any further help with this, please let me know and I can walk you through it.