var grid=null;
var gridData='';
function resolveUrl(){
var encondeCondition=window.location.search;
var condition= decodeURI(encondeCondition.substring(1,encondeCondition.length));
var conditionArr=condition.split("&");
var condJson={};
for(var item in conditionArr){
var temArr=conditionArr[item].split("=");
condJson[temArr[0]]=temArr[1];
}
return condJson;
}
function getNowFormatDate() {
var date = allGetServerTime();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
var hour=date.getHours();
var currentdate ="截至"+ year + "年"+ month + "月"+ strDate
+ "日" + hour + "时";
return currentdate;
}
$(function() {
var dpids =resolveUrl().dept_id;
var Url = '/nwyj/ws/duty/DutyRecordsService/per_getsonDept';
$.ajax({
url : Url,
data : dpids,
dataType : "json",
type : "post",
success : function(data) {
$("#tim").html(getNowFormatDate);
gridData=data;
initComplete();
},
error : function() {
top.Dialog.alert("访问数据库出错,稍后再试!");
}
});
});
function initComplete(){
grid = $("#maingrid").quiGrid({
columns:[
{ display: '单位', name: 'deptname', align: 'center', width: "32%"},
{ display: '抢修人员
(本地)',name: 'person_bd', align: 'center' , width: "33%"},
{ display: '抢修人员
(跨区)', name: 'person_kq', align: 'center', width: "33%"}
],
data:gridData,
multihead:true,
checkbox : false,
width : "100%",
//height: "100%",
pageSize : 10,
usePager : false,
percentWidthMode : true,
alternatingRow: false,
rowAttrRender: function(rowdata, rowindex, rowid){
return rowdata["__index"] % 2 == 0 ? "style='background-color:#212749;'" : "style='background-color:#2C3A54;'" ;
}
});
}