封丘民意调查

addTasks.html 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. <table id="Task" class="thTable hwbb table table-hover table-striped table-bordered table-condensed">
  91. <thead>
  92. <tr>
  93. </tr>
  94. </thead>
  95. <tbody class="body">
  96. </tbody>
  97. </table>
  98. </div>
  99. </div>
  100. <script src="../../js/laydate/laydate.js"></script>
  101. <script>
  102. $(document).ready(function() {
  103. taskSelect();
  104. getCountry();
  105. // getTableColumn();
  106. // getDataList();
  107. laydate.render({
  108. elem: '#ss_kssj',
  109. range: '~',
  110. calendar: true,
  111. theme: '#1ab394',
  112. });
  113. $(".seach").click(function() {
  114. getTableColumn();
  115. getDataList();
  116. })
  117. //导出功能
  118. $('.export').click(function() {
  119. dcexcel(this);
  120. })
  121. });
  122. //获取表头
  123. function getTableColumn() {
  124. $.ajax({
  125. type: "get",
  126. url: huayi.config.callcenter_url + "CallOutReport/GetColumnQu",
  127. dataType: 'json',
  128. data: {
  129. quesid: $('#Wt').val(), // string 是 问题id
  130. // countryid: $('#country').val(),
  131. token: $.cookie("token")
  132. },
  133. async: true,
  134. success: function(data) {
  135. $("#Task thead tr").empty();
  136. if(data.state.toLowerCase() == "success") {
  137. var columndata = data.data
  138. for(var i = 0; i < columndata.length; i++) {
  139. $('<th style="text-align: center;">' + columndata[i] + '</th>').appendTo("#Task thead tr");
  140. }
  141. }
  142. }
  143. })
  144. }
  145. //查询条件中获取任务列表
  146. function taskSelect() {
  147. $.ajax({
  148. type: "get",
  149. url: huayi.config.callcenter_url + "Questionnaire/GetTaskList",
  150. dataType: 'json',
  151. data: {
  152. token: $.cookie("token")
  153. },
  154. async: true,
  155. success: function(data) {
  156. if(data.state.toLowerCase() == "success") {
  157. var Count = data.data;
  158. if(Count.length > 0) {
  159. //$("<option value=''>--全部--</option>").appendTo($("#cljg"));
  160. for(var i = 0; i < Count.length; i++) {
  161. $("<option value='" + Count[i].F_TaskID + ',' + Count[i].F_PagerID + "'>" + Count[i].F_TaskName + "</option>").appendTo($("#cljg"));
  162. }
  163. } else {
  164. $("<option value=''>--暂无数据--</option>").appendTo($("#cljg"));
  165. }
  166. questionnaireSelect();
  167. }
  168. }
  169. });
  170. }
  171. ///查询条件问题任务列表
  172. function questionnaireSelect() {
  173. $.ajax({
  174. type: "get",
  175. // url: huayi.config.callcenter_url + "Questionnaire/GetQList",
  176. url: huayi.config.callcenter_url + "Questionnaire/GetQuestionsByPageId",
  177. dataType: 'json',
  178. data: {
  179. pageid: $("#cljg").val().split(',')[1],
  180. token: $.cookie("token")
  181. },
  182. async: true,
  183. success: function(data) {
  184. if(data.state.toLowerCase() == "success") {
  185. var Count = data.data;
  186. // $("<option value=''>--全部--</option>").appendTo($("#Wt"));
  187. for(var i = 0; i < Count.length; i++) {
  188. $("<option value='" + Count[i].F_QuestionId + "' >" + Count[i].F_Title + "</option>").appendTo($("#Wt"));
  189. }
  190. } else {
  191. $("<option value=''>--暂无数据--</option>").appendTo($("#Wt"));
  192. }
  193. }
  194. })
  195. .then(function() {
  196. getTableColumn();
  197. getDataList();
  198. });
  199. }
  200. //获取乡镇或单位下拉
  201. function getCountry() {
  202. $.ajax({
  203. type: "get",
  204. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  205. dataType: 'json',
  206. data: {
  207. flag: 'JBDW',
  208. token: $.cookie("token")
  209. },
  210. async: true,
  211. success: function(data) {
  212. if(data.state.toLowerCase() == "success") {
  213. var res = data.data;
  214. for(var i = 0; i < res.length; i++) {
  215. $('<option value="' + res[i].F_Name + '">' + res[i].F_Name + '</option>').appendTo($("#country"));
  216. }
  217. } else {
  218. $("<option value=''>--暂无数据--</option>").appendTo($("#country"));
  219. }
  220. }
  221. });
  222. }
  223. //获取数据
  224. function getDataList() {
  225. $.ajax({
  226. type: "get",
  227. url: huayi.config.callcenter_url + "CallOutReport/GetDataQItem",
  228. dataType: 'json',
  229. data: {
  230. quesid: $('#Wt').val(), // string 是 问题id
  231. searchaddress: $('#country').val(),
  232. sdate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[0], // string 否 开始时间
  233. edate: $("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[1], //string 否 结束时间
  234. token: $.cookie("token")
  235. },
  236. async: true,
  237. success: function(data) {
  238. $("#Task tbody").empty();
  239. if(data.state.toLowerCase() == "success") {
  240. var tbodyCon = data.data;
  241. var html = ""
  242. for(var i = 0; i < tbodyCon.length; i++) {
  243. html += "<tr>"
  244. for(var key in tbodyCon[i]) {
  245. // delete tbodyCon[i].AllScore
  246. html += '<td>' + tbodyCon[i][key] + '</td>'
  247. }
  248. html += "</tr>"
  249. }
  250. $(html).appendTo('#Task tbody')
  251. if(tbodyCon.length == 0){
  252. html = '<p style="text-align: center;margin:5px 0">暂无数据</p>'
  253. $(html).appendTo('#Task tbody')
  254. }
  255. }
  256. }
  257. });
  258. }
  259. function dcexcel(obj) {
  260. var url = huayi.config.callcenter_url + "CallOutReport/GetDataQItem?token=" + $.cookie("token");
  261. url += "&quesid=" + $("#Wt").val();
  262. url += "&searchaddress=" + $("#country").val();
  263. url += "&sdate=" + ($("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[0]); // string 否 开始时间
  264. url += "&edate=" + ($("#ss_kssj").val() && $("#ss_kssj").val().split(' ~ ')[1]); // string 否 开始时间
  265. url += "&isexport=1";
  266. obj.href = url;
  267. }
  268. </script>
  269. </body>
  270. </html>