安图前端代码

zhiJian.html 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>质检数据报表</title>
  7. <!--[if lt IE 9]>
  8. <meta http-equiv="refresh" content="0;ie.html" />
  9. <![endif]-->
  10. <script src="Script/Common/huayi.load.js"></script>
  11. <script src="Script/Common/huayi.config.js"></script>
  12. <link href="./css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
  13. <link href="./css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  14. <link href="./css/animate.min.css" rel="stylesheet">
  15. <link href="./css/style.min862f.css?v=4.1.0" rel="stylesheet">
  16. <link rel="stylesheet" href="./css/laydate/need/laydate.css" />
  17. <link rel="stylesheet" href="js/select2/css/select2.min.css" />
  18. <link rel="stylesheet" href="./css/init.css" />
  19. <style>
  20. .clearfix:after {
  21. content: "";
  22. display: block;
  23. clear: both;
  24. }
  25. .zxtable {
  26. font-size: 12px;
  27. }
  28. .zxt-top {
  29. background: #f3f3f4;
  30. height: 60px;
  31. padding: 10px 20px;
  32. }
  33. .topCon {
  34. float: right;
  35. margin-right: 45px;
  36. }
  37. .topCon select {
  38. padding: 2px;
  39. height: 28px;
  40. border: 1px solid #ebebeb;
  41. color: #1ab394;
  42. outline: none;
  43. vertical-align: middle;
  44. }
  45. .topCon input {
  46. width: 128px;
  47. padding: 2px 2PX 2PX 10PX;
  48. height: 28px;
  49. border: 1px solid #ebebeb;
  50. color: #1ab394;
  51. outline: none;
  52. vertical-align: middle;
  53. }
  54. .zxt-content {
  55. width: 95%;
  56. margin: 0 auto;
  57. }
  58. .zxt-table {
  59. overflow-x: auto;
  60. }
  61. .zxt-table table {
  62. font-size: 12px;
  63. margin-top: 20px;
  64. width: 100%;
  65. max-width: 100%;
  66. }
  67. .zxt-table table thead tr td {
  68. background: #1ab394;
  69. color: #fff;
  70. }
  71. </style>
  72. </head>
  73. <body class="gray-bg" style="background: #fefefe;">
  74. <div class="zxtable">
  75. <div class="daoHang clearfix">
  76. <div class="dhLeft">
  77. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表分析</a>&gt;<a href="javaScript:;">员工考核分析</a>&gt;<a href="" class="nowPosition">质检数据报表</a></sapn>
  78. </div>
  79. <div class="dhRight">
  80. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  81. </div>
  82. </div>
  83. <div class="zxt-top clearfix">
  84. <div class="topCon">
  85. 部门:
  86. <select name="" id="bumen">
  87. </select>
  88. 开始时间:
  89. <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
  90. <input type="text" class="laydate-icon" id="endTime" />
  91. <button class="btns sear">搜索</button>
  92. <!--<button class="btn daochu ">导出Excel</button>-->
  93. </div>
  94. </div>
  95. <div class="zxt-content">
  96. <div class="zxt-table">
  97. <table class="table table-bordered text-center table-hover zjTable">
  98. <thead>
  99. <tr class="one"></tr>
  100. <tr class="two"></tr>
  101. <tr class="three"></tr>
  102. <tr class="four"></tr>
  103. </thead>
  104. <tbody class="tbody">
  105. </table>
  106. </div>
  107. </div>
  108. </div>
  109. <script src="./js/jquery.min.js?v=2.1.4"></script>
  110. <script src="./js/bootstrap.min.js?v=3.3.6"></script>
  111. <script src="./js/jquery.cookie.js"></script>
  112. <script src="./css/laydate/laydate.js"></script>
  113. <script src="./js/select2/js/select2.min.js"></script>
  114. <script>
  115. $(function() {
  116. var token = $.cookie("token");
  117. laydate.skin('molv');
  118. //开始时间
  119. laydate({
  120. elem: '#startTime',
  121. event: 'focus',
  122. istoday: true,
  123. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  124. });
  125. //结束时间
  126. laydate({
  127. elem: '#endTime',
  128. event: 'focus',
  129. istoday: true,
  130. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  131. });
  132. var expor;
  133. tbodyAjax();
  134. //点击搜索事件
  135. $('.sear').click(function() {
  136. $('.zjTable tbody').html('');
  137. // stime = $('#startTime').val(); //开始时间
  138. // endtime = $('#endTime').val(); //结束时间
  139. // bumen = $('#bumen').val(); //部门
  140. // if(stime != '' && endtime != '') {
  141. tbodyAjax();
  142. // }else{
  143. // tbodyAjax();
  144. // if(stime==''){
  145. // layer.confirm('请选择开始时间!', {
  146. // btn: ['确定']
  147. // });
  148. // }else if(endtime ==''){
  149. // layer.confirm('请选择结束时间!', {
  150. // btn: ['确定']
  151. // });
  152. // }
  153. // }
  154. })
  155. //表头
  156. $.ajax({
  157. type: "get",
  158. dataType: "json",
  159. url: huayi.config.callcenter_url+"QCResult/GetColumnList?expor",
  160. async: true,
  161. data: {
  162. token:token,
  163. // stime: stime,
  164. // endtime: endtime,
  165. isext:expor
  166. },
  167. success: function(data) {
  168. var content = data.data;
  169. for(var i = 0; i < content.length; i++) {
  170. $('<td rowspan="' + content[i].Rowspan + '" colspan="' + content[i].Colspan + '">' + content[i].Qcname + '</td>').appendTo('.zjTable thead tr.one')
  171. if(content[i].Qcscore !== null) {
  172. $('<td>' + content[i].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  173. }
  174. if(content[i].Qclist !== null) {
  175. var twoCon = content[i].Qclist;
  176. //console.log(twoCon)
  177. for(var j = 0; j < twoCon.length; j++) {
  178. //console.log(twoCon[j].Qcname)
  179. $('<td rowspan="' + twoCon[j].Rowspan + '" colspan="' + twoCon[j].Colspan + '">' + twoCon[j].Qcname + '</td>').appendTo('.zjTable thead tr.two')
  180. if(twoCon[j].Qclist !== null) {
  181. var threeCon = twoCon[j].Qclist;
  182. //console.log(threeCon);
  183. for(var g = 0; g < threeCon.length; g++) {
  184. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcname + '</td>').appendTo('.zjTable thead tr.three')
  185. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  186. }
  187. }
  188. }
  189. }
  190. }
  191. }
  192. });
  193. //表格数据
  194. function tbodyAjax() {
  195. $.ajax({
  196. type: "get",
  197. dataType: "json",
  198. url: huayi.config.callcenter_url+"QCResult/GetDataList?expor",
  199. async: true,
  200. data: {
  201. token:token,
  202. stime: $('#startTime').val(),
  203. endtime: $('#endTime').val(),
  204. dpt:$('#bumen').val(),
  205. isext: expor
  206. },
  207. success: function(result) {
  208. var tbodyCon = result.data;
  209. console.log(tbodyCon);
  210. for(var i = 0; i < tbodyCon.length; i++) {
  211. $('<tr><td>' + tbodyCon[i].QCName + '</td><td>' + tbodyCon[i].UserName + '</td><td>' + tbodyCon[i].UserCode + '</td><td>' + tbodyCon[i].ZJCount + '</td><td>' + tbodyCon[i].Q2 + '</td><td>' + tbodyCon[i].Q4 + '</td><td>' + tbodyCon[i].Q5 + '</td><td>' + tbodyCon[i].Q6 + '</td><td>' + tbodyCon[i].Q8 + '</td><td>' + tbodyCon[i].Q9 + '</td><td>' + tbodyCon[i].Q10 + '</td><td>' + tbodyCon[i].df0 + '</td><td>' + tbodyCon[i].Q12 + '</td><td>' + tbodyCon[i].Q13 + '</td><td>' + tbodyCon[i].Q14 + '</td><td>' + tbodyCon[i].Q15 + '</td><td>' + tbodyCon[i].Q16 + '</td><td>' + tbodyCon[i].Q17 + '</td><td>' + tbodyCon[i].Q18 + '</td><td>' + tbodyCon[i].df1 + '</td><td>' + tbodyCon[i].Q19 + '</td><td>' + tbodyCon[i].Q20 + '</td><td>' + tbodyCon[i].Q21 + '</td><td>' + tbodyCon[i].Q22 + '</td><td>' + tbodyCon[i].Q23 + '</td><td>' + tbodyCon[i].Q24 + '</td><td>' + tbodyCon[i].Q25 + '</td><td>' + tbodyCon[i].Q26 + '</td><td>' + tbodyCon[i].df2 + '</td><td>' + tbodyCon[i].AllScore + '</td></tr>').appendTo('.zjTable tbody')
  212. }
  213. }
  214. });
  215. }
  216. //部门下拉框
  217. $("#bumen").select2({
  218. width: 'resolve' ,
  219. minimumResultsForSearch: -1,
  220. ajax:{
  221. type:"get",
  222. url:huayi.config.callcenter_url+"Department/GetDeptList",
  223. async:true,
  224. dataType: "json",
  225. data:function(params){
  226. return{
  227. token:token,
  228. pid:params.id
  229. }
  230. },
  231. processResults:function(data){
  232. return{
  233. results:data.data
  234. }
  235. },
  236. cache: true
  237. },
  238. placeholder: "请选择",
  239. });
  240. })
  241. </script>
  242. </body>
  243. </html>