PingAnYeXianSZCG_Web 前端代码

Safety.html 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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="Reasons" data-align="center">原因</th>
  66. <th data-field="Counts" data-align="center"> 数量</th>
  67. <th data-field="Rates" data-align="center"> 比例(%)</th>
  68. </tr>
  69. </thead>
  70. </table>
  71. </div>
  72. </div>
  73. </div>
  74. <script>
  75. $(document).ready(function() {
  76. laydate.skin('molv');
  77. laydate({
  78. elem: '#ss_kssj',
  79. event: 'focus',
  80. });
  81. laydate({
  82. elem: '#ss_jssj',
  83. event: 'focus'
  84. });
  85. var date = getNowDate();
  86. $("#ss_kssj").val(date);
  87. $("#ss_jssj").val(date);
  88. IndexCategoryGe();
  89. $(".seach").click(function(){
  90. IndexCategoryGe();
  91. })
  92. //$('#ReIndex').click(function(){
  93. //top.home_index();
  94. //})
  95. })
  96. //问卷列表
  97. function IndexCategoryGe() {
  98. $.ajax({
  99. url: huayi.config.callcenter_url + '/Questionnaire/GetUnsafeRate',
  100. type: 'get',
  101. data: {
  102. startdate: $("#ss_kssj").val(),
  103. enddate: $("#ss_jssj").val(),
  104. token: $.cookie("token")
  105. },
  106. dataType: "json",
  107. async: true,
  108. success: function (returnValue) {
  109. //异步获取数据
  110. //console.log(returnValue);
  111. var resultData1 = returnValue.data;
  112. //console.log(resultData1);
  113. $('#Task').bootstrapTable('load',resultData1);
  114. }
  115. });
  116. $('#Task').bootstrapTable('destroy').bootstrapTable({striped: true});
  117. }
  118. //导出功能
  119. $('.export').click(function() {
  120. dcexcel(this);
  121. })
  122. function dcexcel(obj) {
  123. var url = huayi.config.callcenter_url + "/Questionnaire/GetUnsafeRateExpt?token=" + $.cookie("token");
  124. url += "&startdate=" + $("#ss_kssj").val()+"&enddate="+$("#ss_jssj").val();
  125. obj.href = url;
  126. console.log(url);
  127. }
  128. function getNowDate() {
  129. var NowDate;
  130. var myDate = new Date();
  131. myDate.getYear(); //获取当前年份(2位)
  132. var YY = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
  133. var MM = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
  134. var DD = myDate.getDate(); //获取当前日(1-31)
  135. myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
  136. myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数)
  137. myDate.getHours(); //获取当前小时数(0-23)
  138. myDate.getMinutes(); //获取当前分钟数(0-59)
  139. myDate.getSeconds(); //获取当前秒数(0-59)
  140. myDate.getMilliseconds(); //获取当前毫秒数(0-999)
  141. myDate.toLocaleDateString(); //获取当前日期
  142. var mytime = myDate.toLocaleTimeString(); //获取当前时间
  143. myDate.toLocaleString(); //获取日期与时间
  144. NowDate = YY + "-" + MM + "-" + DD;
  145. return NowDate;
  146. }
  147. </script>
  148. </body>
  149. </html>