Ei kuvausta

zhiJian.html 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. outline: none;
  42. vertical-align: middle;
  43. }
  44. .topCon input {
  45. width: 128px;
  46. padding: 2px 2PX 2PX 10PX;
  47. height: 28px;
  48. border: 1px solid #ebebeb;
  49. outline: none;
  50. vertical-align: middle;
  51. }
  52. .zxt-content {
  53. width: 95%;
  54. margin: 0 auto;
  55. }
  56. .zxt-table {
  57. overflow-x: auto;
  58. }
  59. .zxt-table table {
  60. font-size: 12px;
  61. margin-top: 20px;
  62. width: 100%;
  63. max-width: 100%;
  64. }
  65. .zxt-table table thead tr td {
  66. background: #1ab394;
  67. color: #fff;
  68. }
  69. </style>
  70. </head>
  71. <body class="gray-bg" style="background: #fefefe;">
  72. <div class="zxtable">
  73. <div class="daoHang clearfix">
  74. <div class="dhLeft">
  75. <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>
  76. </div>
  77. </div>
  78. <div class="zxt-top clearfix">
  79. <div class="topCon">
  80. 部门:
  81. <select name="" id="bumen">
  82. </select>
  83. 开始时间:
  84. <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
  85. <input type="text" class="laydate-icon" id="endTime" />
  86. <button class="btns sear">搜索</button>
  87. <!--<button class="btn daochu ">导出Excel</button>-->
  88. </div>
  89. </div>
  90. <div class="zxt-content">
  91. <div class="zxt-table">
  92. <table class="table table-bordered text-center table-hover zjTable">
  93. <thead>
  94. <tr class="one"></tr>
  95. <tr class="two"></tr>
  96. <tr class="three"></tr>
  97. <tr class="four"></tr>
  98. </thead>
  99. <tbody class="tbody">
  100. </table>
  101. </div>
  102. </div>
  103. </div>
  104. <script src="../js/jquery.min.js?v=2.1.4"></script>
  105. <script src="../js/bootstrap.min.js?v=3.3.6"></script>
  106. <script src="../js/jquery.cookie.js"></script>
  107. <script src="../css/laydate/laydate.js"></script>
  108. <script src="../js/select2/js/select2.min.js"></script>
  109. <script>
  110. $(function() {
  111. var token = $.cookie("token");
  112. laydate.skin('blue');
  113. //开始时间
  114. laydate({
  115. elem: '#startTime',
  116. event: 'focus',
  117. istoday: true,
  118. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  119. });
  120. //结束时间
  121. laydate({
  122. elem: '#endTime',
  123. event: 'focus',
  124. istoday: true,
  125. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  126. });
  127. var stime, //开始时间
  128. endtime, //结束时间
  129. bumen,
  130. expor;
  131. tbodyAjax();
  132. //点击搜索事件
  133. $('.sear').click(function() {
  134. $('.zjTable tbody').html('');
  135. stime = $('#startTime').val(); //开始时间
  136. endtime = $('#endTime').val(); //结束时间
  137. bumen = $('#bumen').val(); //部门
  138. if(stime != '' && endtime != '') {
  139. tbodyAjax(stime, endtime, bumen);
  140. }else{
  141. tbodyAjax();
  142. if(stime==''){
  143. alert('请选择开始时间!');
  144. }else if(endtime ==''){
  145. alert('请选择结束时间!');
  146. }
  147. }
  148. })
  149. //表头
  150. $.ajax({
  151. type: "get",
  152. dataType: "json",
  153. url: huayi.config.callcenter_url+"QCResult/GetColumnList",
  154. async: true,
  155. data: {
  156. token:token,
  157. // stime: stime,
  158. // endtime: endtime,
  159. isext:expor
  160. },
  161. success: function(data) {
  162. var content = data.data;
  163. for(var i = 0; i < content.length; i++) {
  164. $('<td rowspan="' + content[i].Rowspan + '" colspan="' + content[i].Colspan + '">' + content[i].Qcname + '</td>').appendTo('.zjTable thead tr.one')
  165. if(content[i].Qcscore !== null) {
  166. $('<td>' + content[i].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  167. }
  168. if(content[i].Qclist !== null) {
  169. var twoCon = content[i].Qclist;
  170. //console.log(twoCon)
  171. for(var j = 0; j < twoCon.length; j++) {
  172. //console.log(twoCon[j].Qcname)
  173. $('<td rowspan="' + twoCon[j].Rowspan + '" colspan="' + twoCon[j].Colspan + '">' + twoCon[j].Qcname + '</td>').appendTo('.zjTable thead tr.two')
  174. if(twoCon[j].Qclist !== null) {
  175. var threeCon = twoCon[j].Qclist;
  176. //console.log(threeCon);
  177. for(var g = 0; g < threeCon.length; g++) {
  178. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcname + '</td>').appendTo('.zjTable thead tr.three')
  179. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  180. }
  181. }
  182. }
  183. }
  184. }
  185. }
  186. });
  187. //表格数据
  188. function tbodyAjax(stime, endtime,bumen) {
  189. $.ajax({
  190. type: "get",
  191. dataType: "json",
  192. url: huayi.config.callcenter_url+"QCResult/GetDataList",
  193. async: true,
  194. data: {
  195. token:token,
  196. stime: stime,
  197. endtime: endtime,
  198. dpt:bumen,
  199. isext: expor
  200. },
  201. success: function(result) {
  202. var tbodyCon = result.data;
  203. console.log(tbodyCon);
  204. for(var i = 0; i < tbodyCon.length; i++) {
  205. $('<tr><td>' + tbodyCon[i].QCName + '</td><td>' + tbodyCon[i].UserName + '</td><td>' + tbodyCon[i].UserCode + '</td><td>' + tbodyCon[i].ZJCount + '</td><td>' + tbodyCon[i].Q1 + '</td><td>' + tbodyCon[i].Q2 + '</td><td>' + tbodyCon[i].Q4 + '</td><td>' + tbodyCon[i].Q5 + '</td><td>' + tbodyCon[i].Q6 + '</td><td>' + tbodyCon[i].Q7 + '</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')
  206. }
  207. }
  208. });
  209. }
  210. //部门下拉框
  211. $("#bumen").select2({
  212. width: 'resolve' ,
  213. minimumResultsForSearch: -1,
  214. ajax:{
  215. type:"get",
  216. url: huayi.config.callcenter_url + "Department/GetDeptListtree",
  217. async:true,
  218. dataType: "json",
  219. data:function(params){
  220. return{
  221. token:token,
  222. pid:params.id
  223. }
  224. },
  225. processResults:function(data){
  226. return{
  227. results:data.data
  228. }
  229. },
  230. cache: true
  231. },
  232. placeholder: "请选择",
  233. });
  234. })
  235. </script>
  236. </body>
  237. </html>