封丘民意调查

detailReportForm.html 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. <link href="../../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
  12. <style>
  13. .LY:hover {
  14. color: #fff;
  15. }
  16. .LY:active {
  17. color: #fff!important;
  18. }
  19. #Task thead td {
  20. color: #fff;
  21. background-color: #1ab394;
  22. text-align: center;
  23. }
  24. .table-head table thead {
  25. width: calc( 100% - 5px);
  26. }
  27. table thead,
  28. tbody tr {
  29. display: table;
  30. width: 100%;
  31. table-layout: fixed;
  32. text-align: center;
  33. }
  34. .table {
  35. margin-bottom: 0;
  36. }
  37. .table-body {
  38. width: 100%;
  39. height: 515px;
  40. overflow-y: scroll;
  41. overflow-x: scroll;
  42. }
  43. .seach-box ul {
  44. overflow: inherit;
  45. }
  46. .dropdown-menu li {
  47. float: none;
  48. }
  49. </style>
  50. </head>
  51. <body class="gray-bg">
  52. <div class="wrapper wrapper-content animated fadeInRight">
  53. <div class="daoHang clearfix">
  54. <div class="dhLeft">
  55. <sapn><i class="syIcon"></i>位置:
  56. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  57. <a href="javaScript:;">外呼管理</a>&gt;
  58. <a href="javaScript:;">外呼报表</a>&gt;
  59. <a href="" style="color: #000;">详情报表</a>
  60. </sapn>
  61. </div>
  62. </div>
  63. <div class="th-box">
  64. <div class="th-bar">
  65. <div class="seach-box">
  66. <ul class="clearfix">
  67. <li>
  68. <select class="form-control selectpicker" id="taskList" data-live-search="true"></select>
  69. </li>
  70. <li>
  71. <select class="form-control selectpicker" id="questionList" data-live-search="true"></select>
  72. </li>
  73. <li>
  74. <select class="form-control selectpicker" id="optionsList" multiple data-live-search="true"></select>
  75. </li>
  76. <li>
  77. <input type="text" id="stime" class="photo size-14 laydate-icon" placeholder="请选择开始时间和结束时间" />
  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. </thead>
  98. </table>
  99. </div>
  100. <div class="table-body">
  101. <table class="thTable hwbb table table-hover table-striped table-bordered table-condensed">
  102. <colgroup>
  103. <col style="width: 80px;" />
  104. <col/>
  105. </colgroup>
  106. <tbody>
  107. </tbody>
  108. </table>
  109. </div>
  110. </div>
  111. </div>
  112. <script src="../../js/laydate/laydate.js"></script>
  113. <script src="../../js/bootstrap-select/js/bootstrap-select.js"></script>
  114. <script src="../../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
  115. <script>
  116. $(document).ready(function() {
  117. getProLocations($('#taskList'), $('#questionList'));
  118. laydate.render({
  119. elem: '#stime',
  120. range: '~',
  121. calendar: true,
  122. theme: '#1ab394',
  123. });
  124. $(".seach").click(function() {
  125. if(!$.trim($('#questionList').val())) {
  126. layer.msg('请选择问题');
  127. return;
  128. }
  129. $("#Task thead").empty();
  130. $(".thTable tbody").empty();
  131. getDataLists();
  132. })
  133. //导出功能
  134. $('.export').click(function() {
  135. if(!$.trim($('#questionList').val())) {
  136. layer.msg('请选择任务');
  137. return;
  138. }
  139. dcexcels(this);
  140. })
  141. });
  142. $('#questionList').change(function() {
  143. getQuesItem($("#optionsList"),$('#questionList').val())
  144. });
  145. //获取表头 和 数据
  146. function getDataLists() {
  147. console.log($("#questionList").val())
  148. $.ajax({
  149. type: "get",
  150. url: huayi.config.callcenter_url + "CallOutReport/GetColoumnBMY",
  151. dataType: 'json',
  152. data: {
  153. TaskID: $("#taskList").val(), //任务id(必选)
  154. quesid: $("#questionList").val(), //问题id(必选)
  155. token: $.cookie("token")
  156. },
  157. success: function(data) {
  158. $("#Task thead").empty();
  159. if(data.state.toLowerCase() == "success") {
  160. data = data.data;
  161. if(data && data.length > 0) {
  162. var $tr = $('<tr></tr>');
  163. for(var i = 0; i < data.length; i++) {
  164. $tr.append('<td>' + data[i] + '</td>');
  165. $("#Task thead").append($tr);
  166. }
  167. }
  168. }
  169. }
  170. })
  171. .then(function() {
  172. $.ajax({
  173. type: "get",
  174. url: huayi.config.callcenter_url + "CallOutReport/GetReportBMY",
  175. dataType: 'json',
  176. data: {
  177. TaskID: $("#taskList").val(), //任务id(必选)
  178. quesid: $("#questionList").val(), //问题id(必选)
  179. ansids: $("#optionsList").val() && $("#optionsList").val().join(','), //选项id(多选,默认可以不选,随着选中的问题id做联动)
  180. sdate: $("#stime").val() && $("#stime").val().split(' ~ ')[0], // 开始时间
  181. edate: $("#stime").val() && $("#stime").val().split(' ~ ')[1], // 结束时间
  182. token: $.cookie("token")
  183. },
  184. success: function(data) {
  185. $(".thTable tbody").empty();
  186. if(data.state.toLowerCase() == "success") {
  187. data = data.data;
  188. if(data && data.length > 0) {
  189. for(var i = 0; i < data.length; i++) {
  190. $('<tr><td>' + data[i].name + ' </td>' +
  191. '<td> ' + data[i].phone + ' </td>' +
  192. '<td> ' + data[i].answer + ' </td>' +
  193. '</tr>').appendTo(".hwbb tbody");
  194. }
  195. } else {
  196. $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
  197. }
  198. } else {
  199. $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
  200. }
  201. }
  202. });
  203. });
  204. }
  205. function dcexcels(obj) {
  206. var url = huayi.config.callcenter_url + "CallOutReport/GetReportBMYExpt?token=" + $.cookie("token");
  207. url += "&TaskID=" + $("#taskList").val();
  208. url += "&quesid=" + $("#questionList").val();
  209. url += "&ansids=" + ($("#optionsList").val() && $("#optionsList").val().join(','));
  210. url += "&sdate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[0]); // string 否 开始时间
  211. url += "&edate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[1]); // string 否 开始时间
  212. obj.href = url;
  213. }
  214. //任务列表 问题列表 问题选项 三级联动
  215. function GetQues(obj,id) {
  216. obj.empty();
  217. $.ajax({
  218. type: "get",
  219. url: huayi.config.callcenter_url + "CallOutReport/GetQuesDDL",
  220. dataType: 'json',
  221. data: {
  222. taskid: id, //任务id(默认显示全部)
  223. token: $.cookie("token")
  224. },
  225. success: function(data) {
  226. if(data.state.toLowerCase() == "success") {
  227. var Count = data.data;
  228. if(Count && Count.length > 0) {
  229. for(var i = 0; i < Count.length; i++) {
  230. $(Count[i]).each(function(j, v) {
  231. $("<option value='" + v.F_QuestionId + "'>" + v.F_Title + "</option>").appendTo(obj);
  232. });
  233. }
  234. }
  235. obj.selectpicker('refresh');
  236. if(obj.val()) {
  237. getQuesItem($("#optionsList"),obj.val())
  238. }
  239. }
  240. }
  241. });
  242. }
  243. function getQuesItem(obj,id) {
  244. obj.empty();
  245. $.ajax({
  246. type: "get",
  247. url: huayi.config.callcenter_url + "CallOutReport/GetQuesItemDDL",
  248. dataType: 'json',
  249. data: {
  250. quesid: id, //问题id(需选中问题后显示)
  251. token: $.cookie("token")
  252. },
  253. success: function(data) {
  254. if(data.state.toLowerCase() == "success") {
  255. var Count = data.data;
  256. if(Count && Count.length > 0) {
  257. let str = ''
  258. Count.forEach(function(v){
  259. str += "<option value='" + v.F_ItemId + "'>" + v.F_ItemName + "</option>"
  260. })
  261. obj.html(str)
  262. obj.selectpicker('refresh');
  263. console.log(obj.val())
  264. getDataLists()
  265. }
  266. }
  267. }
  268. });
  269. }
  270. function getProLocations(obj,obj2) {
  271. obj.empty();
  272. $.ajax({
  273. type: "get",
  274. url: huayi.config.callcenter_url + "CallOutReport/GetTaskDDL",
  275. dataType: 'json',
  276. data: {
  277. token: $.cookie('token')
  278. },
  279. success: function(data) {
  280. var content = data.data; //任务列表
  281. //初始化 任务列表
  282. if(content && content.length > 0) {
  283. $(content).each(function(i, n) {
  284. $("<option value='" + n.F_TaskID + "'>" + n.F_TaskName + "</option>").appendTo(obj);
  285. });
  286. obj.selectpicker('refresh');
  287. }
  288. if(obj.val()) {
  289. GetQues(obj2,obj.val())
  290. }
  291. //问题列表
  292. obj.change(function() {
  293. GetQues(obj2,obj.val())
  294. });
  295. },
  296. });
  297. }
  298. </script>
  299. </body>
  300. </html>