Nenhuma Descrição

Table.html 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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="../css/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. <select name="" id="cljg" class="x-color select">
  61. </select>
  62. </li>
  63. <li>问题列表:
  64. <select name="" id="Wt" class="x-color select">
  65. </select>
  66. </li>
  67. <li>
  68. <a class="sc_btn seach">搜索</a>
  69. </li>
  70. <li>
  71. <a class=" sc_btn export ">导出</a>
  72. </li>
  73. </ul>
  74. </div>
  75. </div>
  76. </div>
  77. <div style="width: 100%;padding: 10px;">
  78. <div class="table-body">
  79. <table class="thTable hwbb table table-hover table-striped table-bordered table-condensed">
  80. <thead>
  81. <tr>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. </tbody>
  86. </table>
  87. </div>
  88. </div>
  89. </div>
  90. <script>
  91. $(document).ready(function() {
  92. Task();
  93. Questionnaire();
  94. $(".sc_btn").click(function() {
  95. GetColumnList();
  96. Number()
  97. }) ///查询条件中获取任务列表
  98. function Task() {
  99. $.ajax({
  100. type: "get",
  101. url: huayi.config.callcenter_url + "Questionnaire/GetTaskList",
  102. dataType: 'json',
  103. data: {
  104. token: $.cookie("token")
  105. },
  106. async: true,
  107. success: function(data) {
  108. var Count = data.data;
  109. $("<option value=''>--全部--</option>").appendTo($("#cljg"));
  110. for(var i = 0; i < Count.length; i++) {
  111. console.log(Count[i].F_UserName);
  112. $("<option value='" + Count[i].F_TaskName + "'>" + Count[i].F_TaskName + "</option>").appendTo($("#cljg"));
  113. }
  114. }
  115. });
  116. }
  117. ///查询条件问题任务列表
  118. function Questionnaire() {
  119. $.ajax({
  120. type: "get",
  121. url: huayi.config.callcenter_url + "Questionnaire/GetQList",
  122. dataType: 'json',
  123. data: {
  124. token: $.cookie("token")
  125. },
  126. async: true,
  127. success: function(data) {
  128. var Count = data.data;
  129. $("<option value=''>--全部--</option>").appendTo($("#Wt"));
  130. for(var i = 0; i < Count.length; i++) {
  131. console.log(Count[i].F_UserName);
  132. $("<option value='" + Count[i].F_Title + "'>" + Count[i].F_Title + "</option>").appendTo($("#Wt"));
  133. }
  134. }
  135. });
  136. }
  137. //任务查询获取表头
  138. function GetColumnList() {
  139. $(".hwbb thead tr").empty();
  140. $.ajax({
  141. type: "get",
  142. url: huayi.config.callcenter_url + "Questionnaire/GetColumnList",
  143. dataType: 'json',
  144. data: {
  145. taskname: $("#cljg").val(),
  146. question: $("#Wt").val(),
  147. token: $.cookie("token")
  148. },
  149. async: true,
  150. success: function(data) {
  151. var Count = data.data;
  152. $(".hwbb thead tr").empty();
  153. if(Count.length > 0) {
  154. $('<td class="tds"> </td>').appendTo(".hwbb thead tr");
  155. for(var i = 0; i < Count.length; i++) {
  156. $('<td class="tds" colspan="' + Count[i].fenxiangshu + '">' + Count[i].wenti + ' </td>').appendTo(".hwbb thead tr");
  157. }
  158. }
  159. console.log(Count)
  160. }
  161. });
  162. }
  163. function Number() {
  164. $(".hwbb tbody ").empty()
  165. $.ajax({
  166. type: "get",
  167. url: huayi.config.callcenter_url + "Questionnaire/GetDataList",
  168. dataType: 'json',
  169. data: {
  170. taskname: $("#cljg").val(),
  171. question: $("#Wt").val(),
  172. token: $.cookie("token")
  173. },
  174. async: true,
  175. success: function(data) {
  176. var Count = data.data;
  177. if(Count.length > 1) {
  178. var html = "";
  179. $(Count).each(function(i, n) {
  180. html += '<tr>';
  181. $(n).each(function(j, k) {
  182. html += '<td colspan="" class="td">' + k + ' </td>';
  183. })
  184. html += '</tr>';
  185. })
  186. $(html).appendTo(".hwbb tbody");
  187. }
  188. console.log(Count)
  189. }
  190. });
  191. }
  192. function LimitNumber(txt, idName) {
  193. var str = txt;
  194. console.log(str);
  195. str = str.substr(0, 20) + '...';
  196. var id = document.getElementsByClassName('td');
  197. id.innerText = str;
  198. }
  199. //导出功能
  200. $('.export').click(function() {
  201. dcexcel(this);
  202. })
  203. function dcexcel(obj) {
  204. var url = huayi.config.callcenter_url + "Questionnaire/GetDataListExpt?token=" + $.cookie("token");
  205. url += "&taskname=" + $("#cljg").val() + "&question=" + $("#Wt").val();
  206. obj.href = url;
  207. }
  208. }
  209. )
  210. </script>
  211. </body>
  212. </html>