|
- function getDeptList() {
- $.ajax({
- url: "/dept",
- type: "get",
- success: function (result) {
- $.each(result.extend.deptList, function (index, item) {
- let ouid=item.ould;
- $("#staffOnline").append(
- '<div class="list-group"><a class="list-group-item active" data-toggle="collapse" href="#guideContent' + ouid + '">' + item.ouName + '</a>' +
- '<div id="guideContent' + ouid + '" class="collapse in">' +
- '</div>' +
- '</div>'
- );
- byouId(ouid);
- })
- sendLoginMessage();
- }
- })
- }
- function byouId(ouid){
- $.ajax({
- url: "/dept/byouid",
- data: "ouid="+ouid,
- async: false,//注意!!这个为必要的参数,不然这个会在上面的Ajax请求结束后才执行
- type: "get",
- success: function (result2) {
- $.each(result2.extend.deptList2, function (index2, item2) {
- $("#guideContent"+ouid).append(
- '<input type="checkbox" name="username" value="'+item2.sysEmployee.empName+'"/><span>'+item2.sysPost.postName+':'+item2.sysEmployee.trueName+'</br></span>'
- );
- });
- },
- })
- }
- `
复制代码 |
|