安图前端代码

zuoXiTable.html 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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 rel="stylesheet" href="js/select2/css/select2.min.css" />
  13. <link rel="stylesheet" href="./js/layui/css/layui.css" />
  14. <link rel="stylesheet" href="./css/init.css" />
  15. <style>
  16. .zxt-top {
  17. background: #f3f3f4;
  18. height: 60px;
  19. padding: 10px 20px;
  20. }
  21. .topCon {
  22. float: right;
  23. margin-right: 45px;
  24. }
  25. .zxt-content {
  26. width: 95%;
  27. margin: 0 auto;
  28. }
  29. .select2-container--default .select2-selection--single{
  30. border-color: #e5e6e7;
  31. }
  32. </style>
  33. </head>
  34. <body class="gray-bg" style="background: #fefefe;">
  35. <div class="zxtable">
  36. <div class="daoHang clearfix">
  37. <div class="dhLeft">
  38. <sapn><i class="syIcon"></i>位置:
  39. <a id="ReIndex" href="javaScript:;">首页</a>&gt;
  40. <a href="javaScript:;">报表分析</a>&gt;
  41. <a href="javaScript:;">员工考核分析</a>&gt;
  42. <a href="" class="nowPosition">坐席工作报表</a>
  43. </sapn>
  44. </div>
  45. <div class="dhRight">
  46. <a href="#" title="刷新"><i class="fa fa-refresh"></i></a>
  47. </div>
  48. </div>
  49. <div class="zxt-top clearfix">
  50. <div class="topCon">
  51. <div class="form-inline th-bar clearfix">
  52. <div class="time-box form-group">
  53. <i class="tub fa fa-calendar"></i>
  54. <input class="form-control" type="text" id="startTime" placeholder="请选择起止时间" style="width: 228px;">
  55. </div>
  56. <div class="time-box form-group">
  57. 部门:
  58. <select id="bumen">
  59. <option value="">请选择</option>
  60. </select>
  61. </div>
  62. <div class="time-box form-group">
  63. 月工作天数:
  64. <input type="text" id="dayss" class="form-control" style="width:50px; height: 28px;" />
  65. </div>
  66. <div class="form-group tool_bars pull-right">
  67. <button class="btns sear">搜索</button>
  68. <a class="btns export">导出</a>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="zxt-content">
  74. <table class="layui-hide" id="t_callTotal"></table>
  75. </div>
  76. </div>
  77. <script src="js/layui/layui.js"></script>
  78. <script src="./js/select2/js/select2.min.js"></script>
  79. <script>
  80. var token = $.cookie("token");
  81. var stime = ''; //开始时间
  82. var endtime = ''; //结束时间
  83. var dpt = ''; //部门
  84. $(function() {
  85. var regNum = /^[0-9]+$/;
  86. layui.use('laydate', function() {
  87. var laydate = layui.laydate;
  88. //日期
  89. laydate.render({
  90. elem: '#startTime',
  91. range: '~',
  92. theme: '#1ab394',
  93. calendar: 'true'
  94. });
  95. });
  96. getDept(); //获取部门下拉
  97. getTableDataList(); //获取表格数据
  98. //搜索事件
  99. $(".sear").click(function() {
  100. dpt = $('#bumen').val();
  101. dpt = dpt === null ? '' : dpt;
  102. stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
  103. endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
  104. if($.trim($('#dayss').val())) {
  105. if(!regNum.test($.trim($('#dayss').val()))) {
  106. layer.confirm('请在月工作天数内输入正确的数字', {
  107. icon: 2,
  108. btn: ['确定']
  109. });
  110. return;
  111. }
  112. }
  113. getTableDataList(); //获取表格数据
  114. });
  115. //导出
  116. $('.export').click(function() {
  117. dpt = $('#bumen').val();
  118. dpt = dpt === null ? '' : dpt;
  119. stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0];
  120. endtime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1];
  121. if($.trim($('#dayss').val())) {
  122. if(!regNum.test($.trim($('#dayss').val()))) {
  123. layer.confirm('请在月工作天数内输入正确的数字', {
  124. icon: 2,
  125. btn: ['确定']
  126. });
  127. return;
  128. }
  129. }
  130. dcexcel(this);
  131. });
  132. });
  133. function dcexcel(obj) {
  134. var url = huayi.config.callcenter_url + "ZuoXiWorkTotal/ExptList?token=" + token;
  135. url += "&stime=" + stime + "&endtime=" + endtime + "&dpt=" + dpt + "&dayss=" + $("#dayss").val();
  136. obj.href = url;
  137. }
  138. //加载表格
  139. function getTableDataList() {
  140. layui.use('table', function() {
  141. var table = layui.table;
  142. //方法级渲染
  143. table.render({
  144. elem: '#t_callTotal',
  145. url: huayi.config.callcenter_url + "ZuoXiWorkTotal/GetDataList",
  146. method: 'get', //如果无需自定义HTTP类型,可不加该参数
  147. skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
  148. even: true, //开启隔行背景
  149. size: 'lg', //sm,lg尺寸的表格
  150. cellMinWidth: 160,
  151. where: {
  152. stime: stime,
  153. endtime: endtime,
  154. dpt: dpt,
  155. dayss: $("#dayss").val(),
  156. token: token
  157. }, //如果无需传递额外参数,可不加该参数
  158. //request: {}, //如果无需自定义请求参数,可不加该参数
  159. response: {
  160. statusName: 'state', //数据状态的字段名称,默认:code
  161. statusCode: 'success', //成功的状态码,默认:0
  162. msgName: 'message', //状态信息的字段名称,默认:msg
  163. //countName: 'total', //数据总数的字段名称,默认:count
  164. //dataName: 'rows', //数据列表的字段名称,默认:data
  165. }, //如果无需自定义数据响应名称,可不加该参数
  166. cols: [
  167. [{
  168. field: '部门',
  169. title: '部门',
  170. align: 'center',
  171. fixed: true,
  172. //sort: true,
  173. width: 150,
  174. }, {
  175. field: '坐席',
  176. title: '坐席',
  177. align: 'center',
  178. width: '',
  179. },
  180. {
  181. field: '坐席工号',
  182. title: '坐席工号',
  183. align: 'center',
  184. width: '',
  185. },
  186. {
  187. field: '呼入电话数',
  188. title: '呼入电话数',
  189. align: 'center',
  190. width: '',
  191. },
  192. {
  193. field: '坐席接通量',
  194. title: '坐席接通量',
  195. align: 'center',
  196. width: '',
  197. },
  198. {
  199. field: '呼损量',
  200. title: '呼损量',
  201. align: 'center',
  202. width: '',
  203. },
  204. {
  205. field: '接通率',
  206. title: '接通率',
  207. align: 'center',
  208. width: '',
  209. },
  210. {
  211. field: '呼损率',
  212. title: '呼损率',
  213. align: 'center',
  214. width: '',
  215. },
  216. {
  217. field: '平均排队时间',
  218. title: '平均排队时间',
  219. align: 'center',
  220. width: '',
  221. },
  222. {
  223. field: '通话分钟数',
  224. title: '通话分钟数',
  225. align: 'center',
  226. width: '',
  227. },
  228. {
  229. field: '通话秒数',
  230. title: '通话秒数',
  231. align: 'center',
  232. width: '',
  233. },
  234. {
  235. field: '平均接听通话秒数',
  236. title: '平均接听通话秒数',
  237. align: 'center',
  238. width: '',
  239. },
  240. {
  241. field: '平均振铃秒数',
  242. title: '平均振铃秒数',
  243. align: 'center',
  244. width: '',
  245. },
  246. {
  247. field: '呼入占有率',
  248. title: '呼入占有率',
  249. align: 'center',
  250. width: '',
  251. },
  252. {
  253. field: '用户评价',
  254. title: '用户评价',
  255. align: 'center',
  256. width: '',
  257. },
  258. {
  259. field: '坐席登录次数',
  260. title: '坐席登录次数',
  261. align: 'center',
  262. width: '',
  263. },
  264. {
  265. field: '登录时长分钟数',
  266. title: '登录时长分钟数',
  267. align: 'center',
  268. width: '',
  269. },
  270. {
  271. field: '工作时长分钟数',
  272. title: '工作时长分钟数',
  273. align: 'center',
  274. width: '',
  275. },
  276. {
  277. field: '平均每天工作时长',
  278. title: '平均每天工作时长',
  279. align: 'center',
  280. width: '',
  281. },
  282. {
  283. field: '平均操作分钟数',
  284. title: '平均操作分钟数',
  285. align: 'center',
  286. width: '',
  287. },
  288. {
  289. field: '置忙次数',
  290. title: '置忙次数',
  291. align: 'center',
  292. width: '',
  293. },
  294. {
  295. field: '休息时长分钟数',
  296. title: '休息时长分钟数',
  297. align: 'center',
  298. width: '',
  299. },
  300. {
  301. field: '平均每天休息时长',
  302. title: '平均每天休息时长',
  303. align: 'center',
  304. width: '',
  305. },
  306. {
  307. field: '置忙平均休息分钟数',
  308. title: '置忙平均休息分钟数',
  309. align: 'center',
  310. width: '',
  311. },
  312. {
  313. field: '质检平均成绩',
  314. title: '质检平均成绩',
  315. align: 'center',
  316. width: '',
  317. },
  318. // {
  319. // field: '平均通话总时长',
  320. // title: '平均通话总时长',
  321. // align: 'center',
  322. // templet: '<div><span class="color_73926">{{d.平均通话总时长}}</span></div>',
  323. // width: '',
  324. // },
  325. ]
  326. ],
  327. height: 'full-150'
  328. });
  329. });
  330. }
  331. function getDept() {
  332. //部门下拉数据
  333. $("#bumen").select2({
  334. width: 'resolve',
  335. minimumResultsForSearch: -1,
  336. ajax: {
  337. type: "get",
  338. url: huayi.config.callcenter_url + "Department/GetDeptList",
  339. async: true,
  340. dataType: "json",
  341. data: function(params) {
  342. return {
  343. token: token,
  344. pid: params.id
  345. }
  346. },
  347. processResults: function(data) {
  348. return {
  349. results: data.data
  350. }
  351. },
  352. cache: true
  353. },
  354. placeholder: "请选择",
  355. });
  356. }
  357. </script>
  358. </body>
  359. </html>