318216fe50a3d5736b31dbb672fe7a84d7a22650.svn-base 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var grid=null;
  2. var gridData='';
  3. function resolveUrl(){
  4. var encondeCondition=window.location.search;
  5. var condition= decodeURI(encondeCondition.substring(1,encondeCondition.length));
  6. var conditionArr=condition.split("&");
  7. var condJson={};
  8. for(var item in conditionArr){
  9. var temArr=conditionArr[item].split("=");
  10. condJson[temArr[0]]=temArr[1];
  11. }
  12. return condJson;
  13. }
  14. function getNowFormatDate() {
  15. var date = allGetServerTime();
  16. var year = date.getFullYear();
  17. var month = date.getMonth() + 1;
  18. var strDate = date.getDate();
  19. var hour=date.getHours();
  20. var currentdate ="截至"+ year + "年"+ month + "月"+ strDate
  21. + "日" + hour + "时";
  22. return currentdate;
  23. }
  24. $(function() {
  25. var dpids =resolveUrl().dept_id;
  26. var Url = '/nwyj/ws/duty/DutyRecordsService/per_getsonDept';
  27. $.ajax({
  28. url : Url,
  29. data : dpids,
  30. dataType : "json",
  31. type : "post",
  32. success : function(data) {
  33. $("#tim").html(getNowFormatDate);
  34. gridData=data;
  35. initComplete();
  36. },
  37. error : function() {
  38. top.Dialog.alert("访问数据库出错,稍后再试!");
  39. }
  40. });
  41. });
  42. function initComplete(){
  43. grid = $("#maingrid").quiGrid({
  44. columns:[
  45. { display: '单位', name: 'deptname', align: 'center', width: "32%"},
  46. { display: '抢修人员<br>(本地)',name: 'person_bd', align: 'center' , width: "33%"},
  47. { display: '抢修人员<br>(跨区)', name: 'person_kq', align: 'center', width: "33%"}
  48. ],
  49. data:gridData,
  50. multihead:true,
  51. checkbox : false,
  52. width : "100%",
  53. //height: "100%",
  54. pageSize : 10,
  55. usePager : false,
  56. percentWidthMode : true,
  57. alternatingRow: false,
  58. rowAttrRender: function(rowdata, rowindex, rowid){
  59. return rowdata["__index"] % 2 == 0 ? "style='background-color:#212749;'" : "style='background-color:#2C3A54;'" ;
  60. }
  61. });
  62. }