function GetList1(page, size) {
var tr = "";
var Code = $(‘#Code‘).val();
var Cname = $(‘#Cus_name‘).val();
var State = $(‘#State‘).val();
ajaxHelper(‘/Refunds/Refunds?Page=‘ + page + ‘&Size=‘ + size + ‘&Cname=‘ + Cname + ‘&Ocode=‘ + Code + ‘&State=‘ + State, ‘GET‘, null).done(function (dt) {
var totalCount = dt.totalCount;
var totalPages = dt.totalPages;
var i = 1;
var date = eval(dt.data);
var f = "‘";
$(date).each(function (index, item) {
tr += ‘<tr id=‘ + item.Id + ‘">‘ +
‘<td>‘ + (i / 1 + (page * size) / 1) / 1 + ‘</td>‘ +
‘<td>‘ + item.Code + ‘</td>‘ +
‘<td>‘ + item.Cus_name + ‘</td>‘ +
‘<td>‘ + item.Startss + ‘</td>‘ +
‘<td>‘ + item.odcount + ‘</td>‘ +
‘<td>‘ + item.odPrice + ‘</td>‘ +
‘<td>‘ + item.CreatoinTime + ‘</td>‘ +
‘<td>‘ + item.UserName + ‘</td>‘ +
‘<td>‘ + item.OperationTime + ‘</td>‘ +
‘<td>‘ + item.Name + ‘</td>‘ +
‘<td>‘ + ‘<a style="cursor:pointer;" onclick="Subscribe1(‘ + f + item.Id + f + ‘)">编辑</a>‘ + ‘</td>‘ +
‘</tr>‘;
i++;
});
$(‘#refunds‘).html(tr);
$(‘#totalCount‘).html(totalCount);
$(‘#totalPages‘).html(totalPages);
$(‘#pageIndex‘).html(page / 1 + 1);
paging(page, totalPages, size);
});
}
function Opageturning(type) {
var totalPages = $(‘#totalPages‘).text();//页面数
var totalCount = $(‘#totalCount‘).text();//记录数
var pageIndex = $(‘#pageIndex‘).text();//当前页
var pageIndexs = 0;
if (type == 1) { //首页
pageIndexs = 0;
}
if (type == 2) {
//上一页
if (pageIndex - 1 > 0) {
pageIndexs = pageIndex - 2;
} else {
pageIndexs = 0;
}
}
if (type == 3) {
//下一页
if ((pageIndex - 0) < (totalPages - 0)) {
pageIndexs = pageIndex;
} else {
pageIndexs = totalPages - 1
}
}
if (type == 4) {
//尾页
pageIndexs = totalPages - 1;
}
GetList(pageIndexs, pagesize);
}
var psize;
function paging(pageIndex, totalPages, size) {
psize = size;
var pagdiv = "";
var f = "‘";
var pagdiv2 = "";
var pagdiv3 = "";
for (var i = 0; i < totalPages ; i++) {
if (i == pageIndex) {
pagdiv += ‘<div id="pag‘ + i + ‘" class="pag" onclick="pag(‘ + i + ‘,‘ + size + ‘)" >‘ + (i + 1) / 1 + ‘</div>‘;
} else if (i < 7 && pageIndex < 5) {
pagdiv += ‘<div id="pag‘ + i + ‘" class="paging" onclick="pag(‘ + i + ‘,‘ + size + ‘)" >‘ + (i + 1) / 1 + ‘</div>‘;
} else if (pageIndex >= 5 && pageIndex - i <= 3 && pageIndex - i >= -3) {
pagdiv += ‘<div id="pag‘ + i + ‘" class="paging" onclick="pag(‘ + i + ‘,‘ + size + ‘)" >‘ + (i + 1) / 1 + ‘</div>‘;
}
}
$(‘#pages‘).html(pagdiv2 + pagdiv + pagdiv3);
};
function pag(pageIndex, size, divid) {
$(‘#‘ + divid).attr("class", "pag")
GetList(pageIndex, size);
}