Bez popisu

Table.html 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>外呼任务报表</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="../css/init.css" rel="stylesheet" />
  8. <script src="../Script/Common/huayi.load.js"></script>
  9. <script src="../Script/Common/huayi.config.js"></script>
  10. <link href="../css/Table/table1.css" rel="stylesheet" />
  11. <script src="../js/laydate/laydate.js"></script>
  12. <style>
  13. .LY:hover {
  14. color: #fff;
  15. }
  16. .LY:active {
  17. color: #fff!important;
  18. }
  19. .table {
  20. margin-bottom: 0;
  21. }
  22. .table-body {
  23. width: 100%;
  24. /*height: 300px;
  25. overflow-y: scroll;*/
  26. overflow-x: scroll;
  27. }
  28. .tds {
  29. background-color: #1ab394!important;
  30. color: #fff;
  31. padding: ;
  32. }
  33. .hwbb tbody td {
  34. min-width: 100px;
  35. overflow: hidden;
  36. text-overflow: ellipsis;
  37. white-space: nowrap;
  38. }
  39. .hwbb td {
  40. text-align: center;
  41. }
  42. </style>
  43. </head>
  44. <body class="gray-bg">
  45. <div class="wrapper wrapper-content animated fadeInRight">
  46. <div class="daoHang clearfix">
  47. <div class="dhLeft">
  48. <sapn><i class="syIcon"></i>位置:
  49. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  50. <a href="javaScript:;">外呼管理</a>&gt;
  51. <a href="" style="color: #000;">外呼问题查询报表</a>
  52. </sapn>
  53. </div>
  54. </div>
  55. <div class="th-box">
  56. <div class="th-bar">
  57. <div class="seach-box fr">
  58. <ul>
  59. <li>
  60. 起止时间:
  61. <input type="text" id="ss_kssj" class="photo laydate-icon" />
  62. </li>
  63. <li>任务列表:
  64. <select name="" id="cljg" class="x-color select">
  65. </select>
  66. </li>
  67. <li>问题列表:
  68. <select name="" id="Wt" class="x-color select">
  69. </select>
  70. </li>
  71. <li>
  72. <a class="sc_btn seach">搜索</a>
  73. </li>
  74. <li>
  75. <a class=" sc_btn export ">导出</a>
  76. </li>
  77. </ul>
  78. </div>
  79. </div>
  80. </div>
  81. <div style="width: 100%;padding: 10px;">
  82. <div class="table-body">
  83. <table class="thTable hwbb table table-hover table-striped table-bordered table-condensed">
  84. <thead>
  85. <tr>
  86. </tr>
  87. </thead>
  88. <tbody>
  89. </tbody>
  90. </table>
  91. </div>
  92. </div>
  93. </div>
  94. <script>
  95. $(document).ready(function() {
  96. Task();
  97. laydate.render({
  98. elem: '#ss_kssj',
  99. range: '~',
  100. value: helper.DateFormat.getNowDate() + ' ~ ' + helper.DateFormat.getNowDate(),
  101. calendar: true,
  102. theme: '#1ab394',
  103. });
  104. Questionnaire();
  105. $(".sc_btn").click(function() {
  106. GetColumnList();
  107. Number()
  108. }) ///查询条件中获取任务列表
  109. //导出功能
  110. $('.export').click(function() {
  111. dcexcel(this);
  112. })
  113. });
  114. function Task() {
  115. $.ajax({
  116. type: "get",
  117. url: huayi.config.callcenter_url + "Questionnaire/GetTaskList",
  118. dataType: 'json',
  119. data: {
  120. token: $.cookie("token")
  121. },
  122. async: true,
  123. success: function(data) {
  124. var Count = data.data;
  125. $("<option value=''>--全部--</option>").appendTo($("#cljg"));
  126. for(var i = 0; i < Count.length; i++) {
  127. console.log(Count[i].F_UserName);
  128. $("<option value='" + Count[i].F_TaskName + "'>" + Count[i].F_TaskName + "</option>").appendTo($("#cljg"));
  129. }
  130. }
  131. });
  132. }
  133. ///查询条件问题任务列表
  134. function Questionnaire() {
  135. $.ajax({
  136. type: "get",
  137. url: huayi.config.callcenter_url + "Questionnaire/GetQList",
  138. dataType: 'json',
  139. data: {
  140. token: $.cookie("token")
  141. },
  142. async: true,
  143. success: function(data) {
  144. var Count = data.data;
  145. $("<option value=''>--全部--</option>").appendTo($("#Wt"));
  146. for(var i = 0; i < Count.length; i++) {
  147. console.log(Count[i].F_UserName);
  148. $("<option value='" + Count[i].F_Title + "'>" + Count[i].F_Title + "</option>").appendTo($("#Wt"));
  149. }
  150. }
  151. });
  152. }
  153. //任务查询获取表头
  154. function GetColumnList() {
  155. $(".hwbb thead tr").empty();
  156. $.ajax({
  157. type: "get",
  158. url: huayi.config.callcenter_url + "Questionnaire/GetColumnList",
  159. dataType: 'json',
  160. data: {
  161. startdate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[0],
  162. enddate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[1],
  163. taskname: $("#cljg").val(),
  164. question: $("#Wt").val(),
  165. token: $.cookie("token")
  166. },
  167. async: true,
  168. success: function(data) {
  169. var Count = data.data;
  170. if(Count.length > 0) {
  171. $(".hwbb thead tr").empty();
  172. $('<td class="tds"> </td>').appendTo(".hwbb thead tr");
  173. for(var i = 0; i < Count.length; i++) {
  174. $('<td class="tds" colspan="' + Count[i].fenxiangshu + '">' + Count[i].wenti + ' </td>').appendTo(".hwbb thead tr");
  175. }
  176. }
  177. console.log(Count)
  178. }
  179. });
  180. }
  181. function Number() {
  182. $(".hwbb tbody ").empty()
  183. $.ajax({
  184. type: "get",
  185. url: huayi.config.callcenter_url + "Questionnaire/GetDataList",
  186. dataType: 'json',
  187. data: {
  188. startdate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[0],
  189. enddate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[1],
  190. taskname: $("#cljg").val(),
  191. question: $("#Wt").val(),
  192. token: $.cookie("token")
  193. },
  194. async: true,
  195. success: function(data) {
  196. var Count = data.data;
  197. if(Count.length > 1) {
  198. var html = "";
  199. $(Count).each(function(i, n) {
  200. html += '<tr>';
  201. $(n).each(function(j, k) {
  202. html += '<td colspan="" class="td">' + k + ' </td>';
  203. })
  204. html += '</tr>';
  205. })
  206. $(html).appendTo(".hwbb tbody");
  207. }
  208. console.log(Count)
  209. }
  210. });
  211. }
  212. function dcexcel(obj) {
  213. var url = huayi.config.callcenter_url + "Questionnaire/GetDataListExpt?token=" + $.cookie("token");
  214. url += "&taskname=" + $("#cljg").val() + "&question=" + $("#Wt").val();
  215. url += "&startdate=" + ($("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[0]) + "&enddate=" + ($("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[1]);
  216. obj.href = url;
  217. }
  218. </script>
  219. </body>
  220. </html>