Bez popisu

zuoXiTable.html 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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="./css/init.css" />
  18. <link rel="stylesheet" type="text/css" href="./js/bootstrap-treeview/bootstrap-treeview.min.css" />
  19. <style>
  20. .clearfix:after {
  21. content: "";
  22. display: block;
  23. clear: both;
  24. }
  25. .zxt-top {
  26. background: #f3f3f4;
  27. height: 60px;
  28. padding: 10px 20px;
  29. }
  30. .topCon {
  31. float: right;
  32. margin-right: 45px;
  33. }
  34. .topCon select {
  35. padding: 2px;
  36. height: 28px;
  37. border: 1px solid #ebebeb;
  38. color: #1ab394;
  39. outline: none;
  40. vertical-align: middle;
  41. }
  42. .topCon input {
  43. width: 128px;
  44. padding: 2px 2PX 2PX 10PX;
  45. height: 28px;
  46. border: 1px solid #ebebeb;
  47. color: #1ab394;
  48. outline: none;
  49. vertical-align: middle;
  50. }
  51. .zxt-content {
  52. width: 95%;
  53. margin: 0 auto;
  54. }
  55. .zxt-table table {
  56. font-size: 12px;
  57. margin-top: 20px;
  58. }
  59. .zxt-table table thead tr td {
  60. background: #1ab394;
  61. color: #fff;
  62. }
  63. .drop_down {
  64. position: relative;
  65. display: inline-block;
  66. }
  67. .caret {
  68. margin: 0 7px 0 -23px;
  69. }
  70. #deptTreeView {
  71. width: 280px;
  72. max-height: 256px;
  73. overflow-y: auto;
  74. position: absolute;
  75. z-index: 2;
  76. top: 28px;
  77. left: 0px;
  78. background-color: #fff;
  79. }
  80. </style>
  81. </head>
  82. <body class="gray-bg" style="background: #fefefe;">
  83. <div class="zxtable">
  84. <div class="daoHang clearfix">
  85. <div class="dhLeft">
  86. <sapn><i class="syIcon"></i>位置:
  87. <a id="ReIndex" href="javaScript:;">首页</a>&gt;
  88. <a href="javaScript:;">报表分析</a>&gt;
  89. <a href="javaScript:;">员工考核分析</a>&gt;
  90. <a href="" style="color: #000;">坐席工作报表</a>
  91. </sapn>
  92. </div>
  93. </div>
  94. <div class="zxt-top clearfix">
  95. <div class="topCon">
  96. 部门:
  97. <div class="drop_down">
  98. <input type="text" class="" id="department" data-id="-1" placeholder="请选择部门" />
  99. <span class="caret"></span>
  100. <div id="deptTreeView" class="hidden"></div>
  101. </div>
  102. 工号:
  103. <input type="text" id="usercode" /> 固话号码:
  104. <input type="text" id="extensionnumber" /> 开始时间:
  105. <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
  106. <input type="text" class="laydate-icon" id="endTime" /> 月工作天数:
  107. <input type="text" id="dayss" style="width:50px;" />
  108. <button class="btns sear">搜索</button>
  109. <a class="btns export">导出</a>
  110. </div>
  111. </div>
  112. <div class="zxt-content">
  113. <div class="zxt-table">
  114. <table class="table table-bordered text-center thTable table-hover" style="width: 100%;">
  115. <thead>
  116. <tr></tr>
  117. </thead>
  118. <tbody class="tbody"></tbody>
  119. </table>
  120. </div>
  121. </div>
  122. </div>
  123. <script src="./js/jquery.min.js?v=2.1.4"></script>
  124. <script src="./js/bootstrap.min.js?v=3.3.6"></script>
  125. <script src="./js/jquery.cookie.js"></script>
  126. <script src="./css/laydate/laydate.js"></script>
  127. <script src="./js/bootstrap-treeview/bootstrap-treeview.min.js"></script>
  128. <script>
  129. $(function() {
  130. var token = $.cookie("token");
  131. laydate.skin('molv');
  132. laydate({
  133. elem: '#startTime',
  134. event: 'focus',
  135. format: 'YYYY-MM-DD' // 分隔符可以任意定义,该例子表示只显示年月
  136. });
  137. laydate({
  138. elem: '#endTime',
  139. event: 'focus',
  140. format: 'YYYY-MM-DD', // 分隔符可以任意定义,该例子表示只显示年月
  141. });
  142. var stime, //开始时间
  143. endtime, //结束时间
  144. dpt; //部门
  145. //部门下拉数据
  146. getDeptLists();
  147. $('#department').on('focus click', function() {
  148. $('#deptTreeView').removeClass('hidden').addClass('show');
  149. });
  150. $('#department').on('keyup', function() {
  151. if($(this).val() == '') {
  152. $('deptTreeView').treeview('uncheckAll', {
  153. silent: true
  154. });
  155. $(this).attr('data-id', '-1');
  156. }
  157. });
  158. $('#department + .caret').on('click', function() {
  159. $('#deptTreeView').removeClass('hidden').addClass('show');
  160. });
  161. $('#deptTreeView').mouseleave(function() {
  162. $(this).removeClass('show').addClass('hidden');
  163. });
  164. Ajax();
  165. //搜索事件
  166. $(".sear").click(function() {
  167. $('.thTable tbody').html('');
  168. stime = $('#startTime').val(); //开始时间
  169. endtime = $('#endTime').val(); //结束时间
  170. dpt = $("#department").attr('data-id'); //部门
  171. if(stime == '') {
  172. layer.confirm('请选择开始时间!', {
  173. btn: ['确定']
  174. });
  175. return;
  176. } else if(endtime == '') {
  177. layer.confirm('请选择结束时间!', {
  178. btn: ['确定']
  179. });
  180. return;
  181. } else {
  182. Ajax(stime, endtime, dpt);
  183. }
  184. });
  185. //导出
  186. $('.export').click(function() {
  187. stime = $('#startTime').val(); //开始时间
  188. endtime = $('#endTime').val(); //结束时间
  189. dpt = $("#department").attr('data-id'); //部门
  190. if(dpt == null) {
  191. layer.confirm('请选择部门!', {
  192. btn: ['确定']
  193. });
  194. return;
  195. } else if(stime == '') {
  196. layer.confirm('请选择开始时间!', {
  197. btn: ['确定']
  198. });
  199. return;
  200. } else if(endtime == '') {
  201. layer.confirm('请选择结束时间!', {
  202. btn: ['确定']
  203. });
  204. return;
  205. } else {
  206. dcexcel(this);
  207. }
  208. })
  209. function dcexcel(obj) {
  210. var url = huayi.config.callcenter_url + "ZuoXiWorkTotal/ExptList?token=" + $.cookie("token");
  211. url += "&stime=" + $("#startTime").val() + "&endtime=" + $("#endTime").val() + "&dpt=" + $("#department").attr('data-id') + "&dayss=" + $("#dayss").val();
  212. obj.href = url;
  213. }
  214. //表头
  215. $.ajax({
  216. type: 'get',
  217. url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetColumnList",
  218. async: true,
  219. dataType: 'json',
  220. data: {
  221. token: token
  222. },
  223. success: function(res) {
  224. var con = res.data;
  225. // console.log(con);
  226. for(var i = 0; i < con.length; i++) {
  227. $('<td>' + con[i] + '</td>').appendTo('.thTable thead tr')
  228. }
  229. }
  230. })
  231. //表内数据
  232. function Ajax(stime, endtime, dpt, dayss) {
  233. $.ajax({
  234. type: "get",
  235. url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetDataList",
  236. async: true,
  237. dataType: 'json',
  238. data: {
  239. stime: stime,
  240. endtime: endtime,
  241. dpt: dpt,
  242. dayss: dayss,
  243. usercode: $('#usercode').val(),
  244. extensionnumber: $("#extensionnumber").val(),
  245. token: token
  246. },
  247. success: function(res) {
  248. var result = res.data;
  249. for(var i = 0; i < result.length; i++) {
  250. $('<tr><td>' + result[i].公司 + '</td><td>' + result[i].部门 + '</td><td>' + result[i].坐席工号 + '</td><td>' + result[i].坐席姓名 + '</td><td>' + result[i].角色 + '</td><td>' + result[i].固话号码 + '</td><td>' + result[i].呼入电话数 + '</td><td>' + result[i].接通量 + '</td><td>' + result[i].接通率 + '</td><td>' + result[i].呼入通话分钟数 + '</td><td>' + result[i].呼出电话数 + '</td><td>' + result[i].呼通量 + '</td><td>' + result[i].呼通率 + '</td><td>' + result[i].呼出通话分钟数 + '</td><td>' + result[i].坐席登录次数 + '</td><td>' + result[i].登录时长分钟数 + '</td><td>' + result[i].工作时长分钟数 + '</td><td>' + result[i].平均每天工作小时数 + '</td><td>' + result[i].休息时长分钟数 + '</td><td>' + result[i].质检平均成绩 + '</td></tr>').appendTo('.thTable tbody')
  251. }
  252. }
  253. });
  254. }
  255. })
  256. //获取部门
  257. function getDeptLists() {
  258. $.getJSON(huayi.config.callcenter_url + 'Department/GetDeptListForReport', {
  259. token: $.cookie("token")
  260. }, function(result) {
  261. //debugger;
  262. if(result.state.toLowerCase() == "success") {
  263. var defaultDatas = result.data;
  264. var $sTree = $('#deptTreeView').treeview({
  265. color: "#428bca",
  266. expandIcon: 'glyphicon glyphicon-chevron-right',
  267. collapseIcon: 'glyphicon glyphicon-chevron-down',
  268. nodeIcon: 'glyphicon glyphicon-bookmark',
  269. data: defaultDatas,
  270. onNodeSelected: function(event, node) {
  271. $sTree.treeview('clearSearch');
  272. $('#department').val(node.text);
  273. $('#department').attr('data-id', node.id);
  274. $('#deptTreeView').removeClass('show').addClass('hidden');
  275. },
  276. onNodeUnselected: function(event, node) {
  277. $('#department').val('');
  278. $('#department').attr('data-id', '-1');
  279. }
  280. });
  281. var findSNodes = function() {
  282. return $sTree.treeview('search', [$('#department').val(), {
  283. ignoreCase: false,
  284. exactMatch: false
  285. }]);
  286. };
  287. $('#department').on('keyup', function(e) {
  288. var selectableNodes = findSNodes();
  289. });
  290. }
  291. })
  292. }
  293. </script>
  294. </body>
  295. </html>