function GetContractByDept(deptid, actName, actNum, beginTime, endTime, operator, oppOperator, pageIndex, pageSize) {
$("#ContractList tbody tr").remove();
$("#selectAll").get(0).checked = false;
$.ajax({
url: 'Action.ashx?t=GetContractByDeptId',
data: { deptid: deptid, actName: actName, actNum: actNum, beginTime: beginTime, endTime: endTime, operator: operator, oppOperator: oppOperator, pageIndex: pageIndex, pageSize: pageSize },
type: 'POST',
dataType: "json",
success: function (result) {
if (result.success) {
$(result.data).each(function (index) {
var html = "";
html += "<tr>";
html += "<td><input type='button' class='btnPower' value='查看权限' data-url='ContractDeptUser.aspx?id=" + this.ID + "&OwnerName=" + this.OwnerDisplayName + "&OwnerTime=" + this.CreateTime + "' data-name='" + this.ContractName + "'/></td>";
html += "<td><input type='checkbox' name='chkDname' value='" + this.ID + "' data-contractName='" + this.ContractName + "' /></td>";
html += "<td>" + this.FileType + "</td>";
html += "<td>" + this.ContractName + "</td>";
html += "<td>" + this.FileSize + "</td>";
html += "<td>" + this.OwnerDisplayName + "</td>";
html += "<td>" + this.CreateTime + "</td>";
html += "</tr> ";
$("#ContractList tbody").append(html);
});
$("#pageIndex").val(result.pageIndex);
$("#pageSize").val(result.pageSize);
$("#recordCount").val(result.recordCount);
$("#pageCount").val(Math.ceil(result.recordCount / result.pageSize));
$(".dispalyPageIndex").text(result.pageIndex);
$("#displayPageSize").text(result.pageSize);
$("#dispalyPageCount").text($("#pageCount").val());
$("#displaRrecordCount").text($("#recordCount").val());
if ($("#ContractList tbody tr").length < 1) {
$("#ContractList tbody").html("<tr><td colspan='7' style='color:red;text-align:center;' >暂无数据</td></tr>");
}
$("input[name='chkDname']").click(function () {
if (!$(this).isChecked) {
$("#selectAll").prop("checked", false);
}
var chsub = $("input[name='chkDname']").length;
var checkedsub = $("input[name='chkDname']:checked").length;
if (chsub == checkedsub) {
$("#selectAll").prop("checked", true);
}
});
$(".btnPower").click(function () {
var url = $(this).attr("data-url");
var name = $(this).attr("data-name");
layer.open({
type: 2,
title: name,
shadeClose: true,
shade: 0.4,
area: ['680px', '350px'],
content: url
});
})
} else {
$("#ContractList tbody").html("<tr><td colspan='7' style='color:red;text-align:center;' >暂无数据</td></tr>");
}
}
});
}