$(function () {
initialPage();
getGrid();
});
function initialPage() {
$(window).resize(function() {
$('#dataGrid').bootstrapTable('resetView', {height: $(window).height()-56});
});
}
var ino=0;
function getGrid() {
$('#dataGrid').bootstrapTableEx({
url: '../../student/list?_' + $.now(),
height: $(window).height()-56,
striped: true,
showColumns:true,//表格列筛选
queryParams: function(params){
ino = (params.pageNumber-1)*params.pageSize+1;
params.linkType = vm.linkType;
params.enSchoolType = vm.enSchoolType;
params.checkType = vm.checkType;
params.househoSchdistrict = vm.househoDistrictId;
params.houseSchdistrict = vm.houseDistrictId;
params.houseType = vm.houseType;
params.checkDateSort = vm.checkDateSort;
params.keyword = vm.keyword;
return params;
},
responseHandler:function(res){ // res为从服务器请求到的数据
result=res;
return res;
},
columns: [
{checkbox: true},
{field: "i", title: "序号", width: "3%",
formatter: function () {
return ino++;
}
},
{field : "name", title : "姓名", width : "5%"},
{field : "idCardNo", title : "身份证号", width : "4%"},
{field : "enSchoolType", title : "入学类型", width : "4%"},
{field : "househoSchdistrictName", title : "户籍所属学区", width : "9%"},
{field : "householdAddress", title : "户籍地址", width : "15%"},
{field : "houseSchdistrictName", title : "房产所属学区", width : "10%"},
{field : "houseAddress", title : "房产地址", width : "15%"},
{field : "houseType", title : "房产类型", width : "9%"}},
{field : "createDate", title : "提交时间", width : "10%"},
{field : "checkedname", title : "审核人", width : "6%"},
{field : "checkedDate", title : "审核时间", width : "7%"},
{field : "isMeets", title : "审核状态", width : "4%",
formatter:function(value,row){
if(row.isChecking =="0"){
if (row.isMeets == "1"){
return '<span class="label label-primary">待审核</span>';
} else if (row.isMeets == "2"){
return '<span class="label label-danger">未通过</span>';
} else if (row.isMeets == "3"){
return '<span class="label label-success">已通过</span>';
} else if (row.isMeets == "5"){
return '<span class="label label-warning">挂起中</span>';
} else if (row.isMeets == "9"){
return '<span class="label label-warning">冻结中</span>';
}
}else{
return '<span class="label label-warning">审核中</span>';
}
}},
{field: 'id',title: '操作', width: "3%", events: operateEvents,formatter:operateFormatter}
]
})
}
function operateFormatter(value, row, index) {
return [
'<a class="checkStudent" href="javascript:void(0)" title="审核">',
'审核',
'</a>'
].join('');
}
window.operateEvents = {
'click .checkStudent': function (e, value, row, index) {
if(row.isChecking=="1"&&vm.user.userId!=row.checkedBy){
dialogMsg("信息正在审核中,不能操作","error");
}else{
//打开相应审核页面
openOnNewTab("base/student/check.html?id="+row.id,row.id,row.name);
}
}
};