新乡民调(来自息县民调) - 主标

Table.html 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. <style>
  12. .LY:hover {
  13. color: #fff;
  14. }
  15. .LY:active {
  16. color: #fff!important;
  17. }
  18. .table {
  19. margin-bottom: 0;
  20. }
  21. .table-body {
  22. width: 100%;
  23. /*height: 300px;
  24. overflow-y: scroll;*/
  25. overflow-x: scroll;
  26. }
  27. .tds {
  28. background-color: #1ab394!important;
  29. color: #fff;
  30. padding: ;
  31. }
  32. .hwbb tbody td {
  33. min-width: 100px;
  34. overflow: hidden;
  35. text-overflow: ellipsis;
  36. white-space: nowrap;
  37. }
  38. .hwbb td {
  39. text-align: center;
  40. }
  41. </style>
  42. </head>
  43. <body class="gray-bg">
  44. <div class="wrapper wrapper-content animated fadeInRight">
  45. <div class="daoHang clearfix">
  46. <div class="dhLeft">
  47. <sapn><i class="syIcon"></i>位置:
  48. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  49. <a href="javaScript:;">外呼管理</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 clearfix">
  56. <div class="th-bar">
  57. <div class="seach-box fr">
  58. <ul>
  59. <li>任务列表:
  60. <select name="" id="cljg" class="x-color select"></select>
  61. </li>
  62. <li>问题列表:
  63. <select name="" id="Wt" class="x-color select"></select>
  64. </li>
  65. <li>乡镇或单位:
  66. <select name="" id="country" class="x-color select">
  67. <option value="">--全部--</option>
  68. </select>
  69. </li>
  70. <li>
  71. 时间:
  72. <input type="text" id="ss_kssj" class="photo size-14 laydate-icon" placeholder="请选择开始时间和结束时间" />
  73. </li>
  74. <li>
  75. <a class="sc_btn seach">搜索</a>
  76. </li>
  77. <li>
  78. <a class=" sc_btn export ">导出</a>
  79. </li>
  80. </ul>
  81. </div>
  82. </div>
  83. </div>
  84. <div style="width: 100%;padding: 10px;">
  85. <div class="table-body">
  86. <table class="thTable hwbb table table-hover table-striped table-bordered table-condensed">
  87. <thead>
  88. <tr>
  89. </tr>
  90. </thead>
  91. <tbody>
  92. </tbody>
  93. </table>
  94. </div>
  95. </div>
  96. </div>
  97. <script src="../js/laydate/laydate.js"></script>
  98. <script>
  99. $(document).ready(function() {
  100. taskSelect(); //查询条件中获取任务列表
  101. questionnaireSelect(); //查询条件问题任务列表
  102. getCountry();
  103. laydate.render({
  104. elem: '#ss_kssj',
  105. range: '~',
  106. //value: st,
  107. calendar: true,
  108. theme: '#1ab394',
  109. });
  110. $(".sc_btn").click(function() {
  111. getColumnList()
  112. .then(function() {
  113. getDataList();
  114. });
  115. })
  116. //导出功能
  117. $('.export').click(function() {
  118. dcexcel(this);
  119. })
  120. });
  121. //获取表头
  122. function getColumnList() {
  123. var dtd = $.Deferred(); //在函数内部,新建一个Deferred对象
  124. $.ajax({
  125. type: "get",
  126. url: huayi.config.callcenter_url + "CallOutReport/GetColumnList",
  127. dataType: 'json',
  128. data: {
  129. taskID: $("#cljg").val(), //string 是 任务id
  130. quesid: $("#Wt").val(), //string 是 问题id
  131. token: $.cookie("token")
  132. },
  133. async: true,
  134. success: function(data) {
  135. $(".hwbb thead tr").empty();
  136. if(data.state.toLowerCase() == "success") {
  137. var Count = data.data;
  138. if(Count.length > 0) {
  139. $('<td class="tds"> </td>').appendTo(".hwbb thead tr");
  140. for(var i = 0; i < Count.length; i++) {
  141. $('<td class="tds" colspan="' + Count[i].fenxiangshu + '">' + Count[i].wenti + ' </td>').appendTo(".hwbb thead tr");
  142. }
  143. dtd.resolve(); // 改变Deferred对象的执行状态
  144. }
  145. }
  146. }
  147. });
  148. return dtd.promise(); // 返回promise对象
  149. }
  150. function getDataList() {
  151. $.ajax({
  152. type: "get",
  153. url: huayi.config.callcenter_url + "CallOutReport/GetDataList",
  154. dataType: 'json',
  155. data: {
  156. TaskID: $("#cljg").val(), //string 是 任务id
  157. quesid: $('#Wt').val(), // string 是 问题id
  158. countryid: $('#country').val(), // string 否 乡镇或单位id
  159. sdate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[0],// string 否 开始时间
  160. edate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[1],//string 否 结束时间
  161. token: $.cookie("token")
  162. },
  163. async: true,
  164. success: function(data) {
  165. $(".hwbb tbody ").empty();
  166. if(data.state.toLowerCase() == "success") {
  167. var dataList = data.data;
  168. for(var i = 0, dataListLength = dataList.length; i < dataListLength; i++){
  169. var $tr = $('<tr></tr>');
  170. var dataTd = dataList[i];
  171. for(var j = 0, dataTdLength = dataTd.length; j < dataTdLength; j++){
  172. $('<td class="td">' + dataTd[j] + ' </td>').appendTo($tr);
  173. }
  174. $tr.appendTo(".hwbb tbody");
  175. }
  176. }
  177. }
  178. });
  179. }
  180. //导出
  181. function dcexcel(obj) {
  182. var url = huayi.config.callcenter_url + "Questionnaire/GetDataListExpt?token=" + $.cookie("token");
  183. url += "&taskname=" + $("#cljg").val() + "&question=" + $("#Wt").val();
  184. obj.href = url;
  185. }
  186. //查询条件中获取任务列表
  187. function taskSelect() {
  188. $.ajax({
  189. type: "get",
  190. url: huayi.config.callcenter_url + "Questionnaire/GetTaskList",
  191. dataType: 'json',
  192. data: {
  193. token: $.cookie("token")
  194. },
  195. async: true,
  196. success: function(data) {
  197. if(data.state.toLowerCase() == "success") {
  198. var Count = data.data;
  199. if(Count.length > 0) {
  200. $("<option value=''>--全部--</option>").appendTo($("#cljg"));
  201. for(var i = 0; i < Count.length; i++) {
  202. $("<option value='" + Count[i].F_TaskID + "'>" + Count[i].F_TaskName + "</option>").appendTo($("#cljg"));
  203. }
  204. } else {
  205. $("<option value=''>--暂无数据--</option>").appendTo($("#cljg"));
  206. }
  207. }
  208. }
  209. });
  210. }
  211. ///查询条件问题任务列表
  212. function questionnaireSelect() {
  213. $.ajax({
  214. type: "get",
  215. url: huayi.config.callcenter_url + "Questionnaire/GetQList",
  216. dataType: 'json',
  217. data: {
  218. token: $.cookie("token")
  219. },
  220. async: true,
  221. success: function(data) {
  222. if(data.state.toLowerCase() == "success") {
  223. var Count = data.data;
  224. //$("<option value=''>--全部--</option>").appendTo($("#Wt"));
  225. for(var i = 0; i < Count.length; i++) {
  226. $("<option value='" + Count[i].F_CategoryId + "'>" + Count[i].F_Title + "</option>").appendTo($("#Wt"));
  227. }
  228. } else {
  229. $("<option value=''>--暂无数据--</option>").appendTo($("#Wt"));
  230. }
  231. }
  232. });
  233. }
  234. //获取乡镇或单位下拉
  235. function getCountry() {
  236. $.ajax({
  237. type: "get",
  238. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  239. dataType: 'json',
  240. data: {
  241. flag: 'JBDW',
  242. token: $.cookie("token")
  243. },
  244. async: true,
  245. success: function(data) {
  246. if(data.state.toLowerCase() == "success") {
  247. var res = data.data;
  248. for(var i = 0; i < res.length; i++) {
  249. $('<option value="' + res[i].F_DictionaryValueId + '">' + res[i].F_Name + '</option>').appendTo($("#country"));
  250. }
  251. } else {
  252. $("<option value=''>--暂无数据--</option>").appendTo($("#country"));
  253. }
  254. }
  255. });
  256. }
  257. </script>
  258. </body>
  259. </html>