f03233dca8cb77a376f57c23ea4d8f95bde7cd76.svn-base 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. function getNowFormatDate() {
  2. var date = allGetServerTime();
  3. var year = date.getFullYear();
  4. var month = date.getMonth() + 1;
  5. var strDate = date.getDate();
  6. var hour=date.getHours();
  7. var currentdate = year + "."+ month + "."+ strDate;
  8. return "("+currentdate+")";
  9. }
  10. $(function() {
  11. $("#tim").html(getNowFormatDate);
  12. var DrillUrl = '/nwyj/ws/duty/DutyRecordsService/countDuty';
  13. //目前传后台id固定,为了测试数据效果
  14. var params = '1';
  15. $.ajax({
  16. url : DrillUrl,
  17. data : params,
  18. dataType : "json",
  19. type : "post",
  20. success : function(data) {
  21. //dept=JSON.stringify(data);
  22. var lengths = data.length;
  23. for(var i=0;i<lengths;i++){
  24. var td1 = "<td class='tdyell'>" + data[i].dept + "</td>";
  25. var td2 = "<td class='tdyell2'>" + data[i].leader_name+ "</td>";
  26. var td3 = "<td class='tdyell2'>" + data[i].leader_tel + "</td>";
  27. var td4 = "<td class='tdyell2'>" + data[i].name + "</td>";
  28. var td5 = "<td class='tdyell2'>" + data[i].telephone + "</td>";
  29. var td6 = "<td class='tdyell2'>" + data[i].duty_way + "</td>";
  30. $(".tr1").append(td1);
  31. $(".tr2").append(td2);
  32. $(".tr3").append(td3);
  33. $(".tr4").append(td4);
  34. $(".tr5").append(td5);
  35. $(".tr6").append(td6);
  36. }
  37. },
  38. error : function() {
  39. top.Dialog.alert("获取数据失败!");
  40. }
  41. });
  42. });
  43. function searchHandler(){
  44. if($("#timed").val()==''){
  45. return;
  46. }
  47. $(".tr1").empty();
  48. $(".tr2").empty();
  49. $(".tr3").empty();
  50. $(".tr4").empty();
  51. $(".tr5").empty();
  52. $(".tr6").empty();
  53. $(".tr1").append("<td class='td0' id='td0'>值班部门</td>");
  54. $(".tr2").append("<td class='td1' id='td1'>值班领导</td>");
  55. $(".tr3").append("<td class='td1' id='td1'>领导电话</td>");
  56. $(".tr4").append("<td class='td1' id='td1'>值班成员</td>");
  57. $(".tr5").append("<td class='td1' id='td1'>联系电话</td>");
  58. $(".tr6").append("<td class='td1' id='td1'>值班方式</td>");
  59. var queryTime=$("#timed").val();
  60. var arr=queryTime.split('-');
  61. var timm="("+arr[0]+"."+arr[1]+"."+arr[2]+")";
  62. $("#tim").html("");
  63. $("#tim").html(timm);
  64. var DrillUrl = '/nwyj/ws/crud/CRUDService/queryQui';
  65. var starttimed=queryTime+" 00:00";
  66. var endtimed=queryTime+" 23:59";
  67. var params = {
  68. listId : "335",
  69. condition : "IS_DEL='0' and RELEASE='1' and OPER_TIME between '"+starttimed+"' and '"+endtimed+"'"
  70. };
  71. $.ajax({
  72. url : DrillUrl,
  73. data : params,
  74. dataType : "json",
  75. type : "post",
  76. success : function(data) {
  77. var lengths=data.rows.length;
  78. for(var i=0;i<lengths;i++){
  79. var td1 = "<td class='tdyell'>" + data.rows[i].DEPT_NAMES_335_SHOW + "</td>";
  80. var queryDept=data.rows[i].FD_OBJECTID_335;
  81. var params = {
  82. listId : "336",
  83. condition : "IS_DEL='0' and duty_id = " +queryDept
  84. };
  85. $.ajax({
  86. url : DrillUrl,
  87. data : params,
  88. dataType : "json",
  89. type : "post",
  90. success : function(data) {
  91. var lengths=data.rows.length;
  92. for(var i=0;i<lengths;i++){
  93. var td2 = "<td class='tdyell2'>" + data.rows[i].LEADER_NAME_336+ "</td>";
  94. var td3 = "<td class='tdyell2'>" + data.rows[i].LEADER_TEL_336 + "</td>";
  95. var td4 = "<td class='tdyell2'>" + data.rows[i].NAME_336 + "</td>";
  96. var td5 = "<td class='tdyell2'>" + data.rows[i].TELEPHONE_336 + "</td>";
  97. var td6 = "<td class='tdyell2'>" + data.rows[i].DUTY_WAY_336_SHOW + "</td>";
  98. $(".tr1").append(td1);
  99. $(".tr2").append(td2);
  100. $(".tr3").append(td3);
  101. $(".tr4").append(td4);
  102. $(".tr5").append(td5);
  103. $(".tr6").append(td6);
  104. }
  105. },
  106. error : function() {
  107. top.Dialog.alert("获取数据失败!");
  108. }
  109. });
  110. }
  111. },
  112. error : function() {
  113. top.Dialog.alert("获取数据失败!");
  114. }
  115. });
  116. }