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

Tasks.html 7.5KB

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