Bez popisu

zhiJian.html 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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" type="text/css" href="./js/bootstrap-treeview/bootstrap-treeview.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. .drop_down {
  72. position: relative;
  73. display: inline-block;
  74. }
  75. .caret {
  76. margin: 0 7px 0 -23px;
  77. }
  78. #deptTreeView {
  79. width: 280px;
  80. max-height: 256px;
  81. overflow-y: auto;
  82. position: absolute;
  83. z-index: 2;
  84. top: 28px;
  85. left: 0px;
  86. background-color: #fff;
  87. }
  88. </style>
  89. </head>
  90. <body class="gray-bg" style="background: #fefefe;">
  91. <div class="zxtable">
  92. <div class="daoHang clearfix">
  93. <div class="dhLeft">
  94. <sapn><i class="syIcon"></i>位置:
  95. <a id="ReIndex" href="javaScript:;">首页</a>&gt;
  96. <a href="javaScript:;">报表分析</a>&gt;
  97. <a href="javaScript:;">员工考核分析</a>&gt;
  98. <a href="" style="color: #000;">质检数据报表</a>
  99. </sapn>
  100. </div>
  101. </div>
  102. <div class="zxt-top clearfix">
  103. <div class="topCon">
  104. 部门:
  105. <div class="drop_down">
  106. <input type="text" class="" id="department" data-id="-1" placeholder="请选择部门" />
  107. <span class="caret"></span>
  108. <div id="deptTreeView" class="hidden"></div>
  109. </div>
  110. 开始时间:
  111. <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
  112. <input type="text" class="laydate-icon" id="endTime" />
  113. <button class="btns sear">搜索</button>
  114. <!--<button class="btn daochu ">导出Excel</button>-->
  115. </div>
  116. </div>
  117. <div class="zxt-content">
  118. <div class="zxt-table">
  119. <table class="table table-bordered text-center table-hover zjTable">
  120. <thead>
  121. <tr class="one"></tr>
  122. <tr class="two"></tr>
  123. <tr class="three"></tr>
  124. <tr class="four"></tr>
  125. </thead>
  126. <tbody class="tbody">
  127. </table>
  128. </div>
  129. </div>
  130. </div>
  131. <script src="./js/jquery.min.js?v=2.1.4"></script>
  132. <script src="./js/bootstrap.min.js?v=3.3.6"></script>
  133. <script src="./js/jquery.cookie.js"></script>
  134. <script src="./css/laydate/laydate.js"></script>
  135. <script src="./js/bootstrap-treeview/bootstrap-treeview.min.js"></script>
  136. <script>
  137. $(function() {
  138. var token = $.cookie("token");
  139. laydate.skin('molv');
  140. //开始时间
  141. laydate({
  142. elem: '#startTime',
  143. event: 'focus',
  144. istoday: true,
  145. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  146. });
  147. //结束时间
  148. laydate({
  149. elem: '#endTime',
  150. event: 'focus',
  151. istoday: true,
  152. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  153. });
  154. var stime, //开始时间
  155. endtime, //结束时间
  156. bumen,
  157. expor;
  158. //部门下拉数据
  159. getDeptLists();
  160. $('#department').on('focus click', function() {
  161. $('#deptTreeView').removeClass('hidden').addClass('show');
  162. });
  163. $('#department').on('keyup', function() {
  164. if($(this).val() == '') {
  165. $('deptTreeView').treeview('uncheckAll', {
  166. silent: true
  167. });
  168. $(this).attr('data-id', '-1');
  169. }
  170. });
  171. $('#department + .caret').on('click', function() {
  172. $('#deptTreeView').removeClass('hidden').addClass('show');
  173. });
  174. $('#deptTreeView').mouseleave(function() {
  175. $(this).removeClass('show').addClass('hidden');
  176. });
  177. tbodyAjax();
  178. //点击搜索事件
  179. $('.sear').click(function() {
  180. $('.zjTable tbody').html('');
  181. stime = $('#startTime').val(); //开始时间
  182. endtime = $('#endTime').val(); //结束时间
  183. bumen = $("#department").attr('data-id'); //部门
  184. if(stime == '') {
  185. layer.confirm('请选择开始时间!', {
  186. btn: ['确定']
  187. });
  188. return;
  189. } else if(endtime == '') {
  190. layer.confirm('请选择结束时间!', {
  191. btn: ['确定']
  192. });
  193. return;
  194. } else {
  195. tbodyAjax(stime, endtime, bumen);
  196. }
  197. })
  198. //表头
  199. $.ajax({
  200. type: "get",
  201. dataType: "json",
  202. url: huayi.config.callcenter_url + "QCResult/GetColumnList?expor",
  203. async: true,
  204. data: {
  205. token: token,
  206. // stime: stime,
  207. // endtime: endtime,
  208. isext: expor
  209. },
  210. success: function(data) {
  211. var content = data.data;
  212. for(var i = 0; i < content.length; i++) {
  213. $('<td rowspan="' + content[i].Rowspan + '" colspan="' + content[i].Colspan + '">' + content[i].Qcname + '</td>').appendTo('.zjTable thead tr.one')
  214. if(content[i].Qcscore !== null) {
  215. $('<td>' + content[i].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  216. }
  217. if(content[i].Qclist !== null) {
  218. var twoCon = content[i].Qclist;
  219. //console.log(twoCon)
  220. for(var j = 0; j < twoCon.length; j++) {
  221. //console.log(twoCon[j].Qcname)
  222. $('<td rowspan="' + twoCon[j].Rowspan + '" colspan="' + twoCon[j].Colspan + '">' + twoCon[j].Qcname + '</td>').appendTo('.zjTable thead tr.two')
  223. if(twoCon[j].Qclist !== null) {
  224. var threeCon = twoCon[j].Qclist;
  225. //console.log(threeCon);
  226. for(var g = 0; g < threeCon.length; g++) {
  227. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcname + '</td>').appendTo('.zjTable thead tr.three')
  228. $('<td rowspan="' + threeCon[g].Rowspan + '" colspan="' + threeCon[g].Colspan + '">' + threeCon[g].Qcscore + '</td>').appendTo('.zjTable thead tr.four')
  229. }
  230. }
  231. }
  232. }
  233. }
  234. }
  235. });
  236. //表格数据
  237. function tbodyAjax(stime, endtime, bumen) {
  238. $.ajax({
  239. type: "get",
  240. dataType: "json",
  241. url: huayi.config.callcenter_url + "QCResult/GetDataList?expor",
  242. async: true,
  243. data: {
  244. token: token,
  245. stime: stime,
  246. endtime: endtime,
  247. dpt: bumen,
  248. isext: expor
  249. },
  250. success: function(result) {
  251. var tbodyCon = result.data;
  252. console.log(tbodyCon);
  253. for(var i = 0; i < tbodyCon.length; i++) {
  254. $('<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')
  255. }
  256. }
  257. });
  258. }
  259. })
  260. //获取部门
  261. function getDeptLists() {
  262. $.getJSON(huayi.config.callcenter_url + 'Department/GetDeptListForReport', {
  263. token: $.cookie("token")
  264. }, function(result) {
  265. //debugger;
  266. if(result.state.toLowerCase() == "success") {
  267. var defaultDatas = result.data;
  268. var $sTree = $('#deptTreeView').treeview({
  269. color: "#428bca",
  270. expandIcon: 'glyphicon glyphicon-chevron-right',
  271. collapseIcon: 'glyphicon glyphicon-chevron-down',
  272. nodeIcon: 'glyphicon glyphicon-bookmark',
  273. data: defaultDatas,
  274. onNodeSelected: function(event, node) {
  275. $sTree.treeview('clearSearch');
  276. $('#department').val(node.text);
  277. $('#department').attr('data-id', node.id);
  278. $('#deptTreeView').removeClass('show').addClass('hidden');
  279. },
  280. onNodeUnselected: function(event, node) {
  281. $('#department').val('');
  282. $('#department').attr('data-id', '-1');
  283. }
  284. });
  285. var findSNodes = function() {
  286. return $sTree.treeview('search', [$('#department').val(), {
  287. ignoreCase: false,
  288. exactMatch: false
  289. }]);
  290. };
  291. $('#department').on('keyup', function(e) {
  292. var selectableNodes = findSNodes();
  293. });
  294. }
  295. })
  296. }
  297. </script>
  298. </body>
  299. </html>