 



function setpopuser(result, uid, username, displayname, tel, email, staffcode, dept) {
    result = result.split("!")[0];
    var _result = result.split("$");
    if (uid != "") {
        $('#' + uid).val(_result[0]);
    }
    if (username != "") {
        $('#' + username).val(_result[1]);
    }

    if (displayname != "") {
        $('#' + displayname).val(_result[2]);
    }

    if (tel != "") {
        $('#' + tel).val(_result[3]);
    }


    if (email != "") {
        $('#' + email).val(_result[4]);
    }


    if (staffcode != "") {
        $('#' + staffcode).val(_result[5]);
    }

    if (dept != "") {
        $('#' + dept).val(_result[6]);
    }
     

} 




function isselect() {

    var checked = 0;
    var allvalue = '';

    var _c = 0;
    $(".ck_item").each(

     function () {
         if ($(this).is(':checked')) {
             checked++;

             if (checked > 1) {
                 allvalue += ',' + $(this).val();
             }
             else {
                 allvalue = $(this).val();
             }
         }

     });

    $("#hf_ids").val(allvalue);

    if (checked > 0) {
        return true;
    }
    else {
        layer.alert('请至少选择一条记录', 12);
        return false;
    }

}



function selectall() {
    var checkFlag = $("#cb_selectall").is(':checked');

    $(".ck_item").each(
        function () {
            if ($(this).prop('disabled') == false) {
                $(this).prop("checked", checkFlag);
            }
        }
        );

}

function popusers()
{
   Pop('Pop_Users.aspx',950,580,'选择人员');
}

function Pop(_src, _width, _height, _title) {
    if (!_width)
    {
        _width = 500;
    }

    if (!_height)
    {
        _height = 380;
    }

    if (!_title)
    {
        _title = "信息说明";
    }
 

    layer.open({
        type: 2,
        title: _title,
        shadeClose: true,
        shade: 0.8,
        area: [_width + 'px', _height + 'px'],
        content: _src
    });
 
}


function ept(url) { 
    Pop(url, 600, 450, "导出"); 
}



function closedept(cont) {
    $(".department").val($(cont).html());
    layer.closeAll();
}
 
  