PingAnYeXianSZCG_Web 前端代码

SafetyTable.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>不安全信息统计表</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="../css/init.css" rel="stylesheet" />
  8. <script src="../Script/Common/huayi.load.js"></script>
  9. <script src="../Script/Common/huayi.config.js"></script>
  10. <link href="../css/Table/table1.css" rel="stylesheet" />
  11. <script src="../css/laydate/laydate.js"></script>
  12. <style>
  13. .LY:hover {
  14. color: #fff;
  15. }
  16. .LY:active {
  17. color: #fff!important;
  18. }
  19. #Task thead tr th {
  20. color: #fff;
  21. background-color: #1ab394;
  22. text-align: center;
  23. }
  24. .sc_btn{
  25. line-height: 34px;
  26. }
  27. </style>
  28. </head>
  29. <body class="gray-bg">
  30. <div class="wrapper wrapper-content animated fadeInRight">
  31. <div class="daoHang clearfix">
  32. <div class="dhLeft">
  33. <sapn><i class="syIcon"></i>位置:
  34. <a id="ReIndex">首页</a>&gt;
  35. <a href="javaScript:;">外呼管理</a>&gt;
  36. <a href="" style="color: #000;">不安全信息统计表</a>
  37. </sapn>
  38. </div>
  39. </div>
  40. <div class="th-box">
  41. <div class="seach-box fr">
  42. <ul>
  43. <li>
  44. <label for="">开始时间:</label>
  45. <input type="text" id="ss_kssj" class="photo laydate-icon" />
  46. </li>
  47. <li>
  48. <label for="">结束时间:</label>
  49. <input type="text" id="ss_jssj" class="photo laydate-icon" />
  50. </li>
  51. <li>
  52. <a class="sc_btn seach">搜索</a>
  53. </li>
  54. <li>
  55. <a class="sc_btn export">导出</a>
  56. </li>
  57. </ul>
  58. </div>
  59. </div>
  60. <div style="width: 100%;padding: 10px;">
  61. <div class="table-head">
  62. <table id="Task" class="table table-hover table-striped table-bordered table-condensed">
  63. <thead>
  64. <tr>
  65. <th data-field="xiangzhen" data-align="center">乡镇</th>
  66. <th data-field="dianhua" data-align="center"> 电话</th>
  67. <th data-field="zhiye" data-align="center"> 职业</th>
  68. <th data-field="yuanyin" data-align="center">原因</th>
  69. </tr>
  70. </thead>
  71. </table>
  72. </div>
  73. </div>
  74. </div>
  75. <script>
  76. $(document).ready(function() {
  77. laydate.skin('molv');
  78. laydate({
  79. elem: '#ss_kssj',
  80. event: 'focus',
  81. });
  82. laydate({
  83. elem: '#ss_jssj',
  84. event: 'focus'
  85. });
  86. var date = getNowDate();
  87. $("#ss_kssj").val(date);
  88. $("#ss_jssj").val(date);
  89. IndexCategoryGe();
  90. $(".seach").click(function(){
  91. IndexCategoryGe();
  92. })
  93. //$('#ReIndex').click(function(){
  94. //top.home_index();
  95. //})
  96. })
  97. //问卷列表
  98. function IndexCategoryGe() {
  99. $.ajax({
  100. url: huayi.config.callcenter_url + 'Questionnaire/GetUnsafeInfo',
  101. type: 'get',
  102. data: {
  103. startdate: $("#ss_kssj").val(),
  104. enddate: $("#ss_jssj").val(),
  105. token: $.cookie("token")
  106. },
  107. dataType: "json",
  108. async: true,
  109. success: function (returnValue) {
  110. //异步获取数据
  111. //console.log(returnValue);
  112. var resultData1 = returnValue.data;
  113. //console.log(resultData1);
  114. $('#Task').bootstrapTable('load',resultData1);
  115. }
  116. });
  117. $('#Task').bootstrapTable('destroy').bootstrapTable({striped: true});
  118. }
  119. //导出功能
  120. $('.export').click(function() {
  121. // var S= $("#ss_kssj").val();
  122. // var E=$("#ss_jssj").val();
  123. // if(!S&&!E){
  124. // layer.alert("选择时间");
  125. // }else{
  126. dcexcel(this);
  127. // }
  128. })
  129. function dcexcel(obj) {
  130. var url = huayi.config.callcenter_url + "/Questionnaire/GetUnsafeInfoExpt?token=" + $.cookie("token");
  131. url += "&startdate=" + $("#ss_kssj").val()+"&enddate="+$("#ss_jssj").val();
  132. obj.href = url;
  133. console.log(url);
  134. }
  135. function getNowDate() {
  136. var NowDate;
  137. var myDate = new Date();
  138. myDate.getYear(); //获取当前年份(2位)
  139. var YY = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
  140. var MM = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
  141. var DD = myDate.getDate(); //获取当前日(1-31)
  142. myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
  143. myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数)
  144. myDate.getHours(); //获取当前小时数(0-23)
  145. myDate.getMinutes(); //获取当前分钟数(0-59)
  146. myDate.getSeconds(); //获取当前秒数(0-59)
  147. myDate.getMilliseconds(); //获取当前毫秒数(0-999)
  148. myDate.toLocaleDateString(); //获取当前日期
  149. var mytime = myDate.toLocaleTimeString(); //获取当前时间
  150. myDate.toLocaleString(); //获取日期与时间
  151. NowDate = YY + "-" + MM + "-" + DD;
  152. return NowDate;
  153. }
  154. </script>
  155. </body>
  156. </html>