PingAnYeXianSZCG_Web 前端代码

zhiJian.html 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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="" style="color: #000;">质检数据报表</a></sapn>
  78. </div>
  79. </div>
  80. <div class="zxt-top clearfix">
  81. <div class="topCon">
  82. 部门:
  83. <select name="" id="bumen">
  84. </select>
  85. 开始时间:
  86. <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
  87. <input type="text" class="laydate-icon" id="endTime" />
  88. <button class="btns sear">搜索</button>
  89. <!--<button class="btn daochu ">导出Excel</button>-->
  90. </div>
  91. </div>
  92. <div class="zxt-content">
  93. <div class="zxt-table">
  94. <table class="table table-bordered text-center table-hover zjTable">
  95. <thead>
  96. <tr class="one"></tr>
  97. <tr class="two"></tr>
  98. <tr class="three"></tr>
  99. <tr class="four"></tr>
  100. </thead>
  101. <tbody class="tbody">
  102. </table>
  103. </div>
  104. </div>
  105. </div>
  106. <script src="./js/jquery.min.js?v=2.1.4"></script>
  107. <script src="./js/bootstrap.min.js?v=3.3.6"></script>
  108. <script src="./js/jquery.cookie.js"></script>
  109. <script src="./css/laydate/laydate.js"></script>
  110. <script src="./js/select2/js/select2.min.js"></script>
  111. <script>
  112. $(function() {
  113. var token = $.cookie("token");
  114. laydate.skin('molv');
  115. //开始时间
  116. laydate({
  117. elem: '#startTime',
  118. event: 'focus',
  119. istoday: true,
  120. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  121. });
  122. //结束时间
  123. laydate({
  124. elem: '#endTime',
  125. event: 'focus',
  126. istoday: true,
  127. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  128. });
  129. var stime, //开始时间
  130. endtime, //结束时间
  131. bumen,
  132. 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(stime, endtime, bumen);
  142. }else{
  143. tbodyAjax();
  144. if(stime==''){
  145. alert('请选择开始时间!');
  146. }else if(endtime ==''){
  147. alert('请选择结束时间!');
  148. }
  149. }
  150. })
  151. //表头
  152. $.ajax({
  153. type: "get",
  154. dataType: "json",
  155. url: huayi.config.callcenter_url+"QCResult/GetColumnList?expor",
  156. async: true,
  157. data: {
  158. token:token,
  159. // stime: stime,
  160. // endtime: endtime,
  161. isext:expor
  162. },
  163. success: function(data) {
  164. var content = data.data;
  165. for(var i = 0; i < content.length; i++) {
  166. $('<td rowspan="' + content[i].Rowspan + '" colspan="' + content[i].Colspan + '">' + content[i].Qcname + '</td>').appendTo('.zjTable thead tr.one')
  167. if(content[i].Qcscore !== null) {
  168. $('<td>' + content[i].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  169. }
  170. if(content[i].Qclist !== null) {
  171. var twoCon = content[i].Qclist;
  172. //console.log(twoCon)
  173. for(var j = 0; j < twoCon.length; j++) {
  174. //console.log(twoCon[j].Qcname)
  175. $('<td rowspan="' + twoCon[j].Rowspan + '" colspan="' + twoCon[j].Colspan + '">' + twoCon[j].Qcname + '</td>').appendTo('.zjTable thead tr.two')
  176. if(twoCon[j].Qclist !== null) {
  177. var threeCon = twoCon[j].Qclist;
  178. //console.log(threeCon);
  179. for(var g = 0; g < threeCon.length; g++) {
  180. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcname + '</td>').appendTo('.zjTable thead tr.three')
  181. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. });
  189. //表格数据
  190. function tbodyAjax(stime, endtime,bumen) {
  191. $.ajax({
  192. type: "get",
  193. dataType: "json",
  194. url: huayi.config.callcenter_url+"QCResult/GetDataList?expor",
  195. async: true,
  196. data: {
  197. token:token,
  198. stime: stime,
  199. endtime: endtime,
  200. dpt:bumen,
  201. isext: expor
  202. },
  203. success: function(result) {
  204. var tbodyCon = result.data;
  205. console.log(tbodyCon);
  206. for(var i = 0; i < tbodyCon.length; i++) {
  207. $('<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')
  208. }
  209. }
  210. });
  211. }
  212. //部门下拉框
  213. $("#bumen").select2({
  214. width: 'resolve' ,
  215. minimumResultsForSearch: -1,
  216. ajax:{
  217. type:"get",
  218. url:huayi.config.callcenter_url+"Department/GetDeptList",
  219. async:true,
  220. dataType: "json",
  221. data:function(params){
  222. return{
  223. token:token,
  224. pid:params.id
  225. }
  226. },
  227. processResults:function(data){
  228. return{
  229. results:data.data
  230. }
  231. },
  232. cache: true
  233. },
  234. placeholder: "请选择",
  235. });
  236. })
  237. </script>
  238. </body>
  239. </html>