

  


function ShowCalendar(txt) {
    laydate();
}





function popUser(result, uid, username, displayname, dept, tel, email, staffcode) {

    var _result = result.split("$");
    if (uid != "") {
        $('#' + uid).val(_result[0]);
    }
    if (username != "") {
        $('#' + username).val(_result[1]);
    }

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

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

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

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

    if (staffcode != "") {
        $('#' + staffcode).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(obj) {
    var checkFlag = $(obj).is(':checked');

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

}








 






function op(action, url, popTitle, returnUrl, showIFrame) {

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

        if (action == "get") {
            return;
        }

        if (action == "delete") {
            return;
        }



        if (showIFrame) {
            ShowIframeNoScroll(url + "&ids=" + allvalue + "&returnUrl=" + returnUrl, "500", "350", popTitle);
        }
        else {
            location.href = url + "&ids=" + allvalue;
        }
   

}




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

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

}



function ept(url) {
    // window.open(url, null, 'left=200,top=200,width=450,height=350')
    // return false;
    Pop(url, 450, 350, "导出/导入数据");

}


