Нет описания

detailReportForm.html 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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 id="" multiple class="x-color select"></select>-->
  75. <select class="form-control selectpicker" id="optionsList" multiple data-live-search="true"></select>
  76. </li>
  77. <li>
  78. <input type="text" id="stime" class="photo size-14 laydate-icon" placeholder="请选择开始时间和结束时间" />
  79. </li>
  80. <li>
  81. <a class="sc_btn seach">搜索</a>
  82. </li>
  83. <li>
  84. <a class="sc_btn export">导出</a>
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. </div>
  90. <div style="width: 100%;padding: 10px;">
  91. <div class="table-head">
  92. <table id="Task" class="table table-hover table-striped table-bordered table-condensed">
  93. <colgroup>
  94. <col style="width: 80px;" />
  95. <col/>
  96. </colgroup>
  97. <thead>
  98. </thead>
  99. </table>
  100. </div>
  101. <div class="table-body">
  102. <table class="thTable hwbb table table-hover table-striped table-bordered table-condensed">
  103. <colgroup>
  104. <col style="width: 80px;" />
  105. <col/>
  106. </colgroup>
  107. <tbody>
  108. </tbody>
  109. </table>
  110. </div>
  111. </div>
  112. </div>
  113. <script src="../js/laydate/laydate.js"></script>
  114. <script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
  115. <script src="../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
  116. <script>
  117. $(document).ready(function() {
  118. getProLocations($('#taskList'), $('#questionList'), $('#optionsList'));
  119. laydate.render({
  120. elem: '#stime',
  121. range: '~',
  122. calendar: true,
  123. theme: '#1ab394',
  124. });
  125. // getDataLists();
  126. $(".sc_btn").click(function() {
  127. //if(!$.trim($('#taskList').val())) {
  128. // layer.msg('请选择任务');
  129. // return;
  130. //}
  131. if(!$.trim($('#questionList').val())) {
  132. layer.msg('请选择问题');
  133. return;
  134. }
  135. $("#Task thead").empty();
  136. $(".thTable tbody").empty();
  137. getDataLists();
  138. })
  139. //导出功能
  140. $('.export').click(function() {
  141. if(!$.trim($('#taskList').val())) {
  142. layer.msg('请选择任务');
  143. return;
  144. }
  145. if(!$.trim($('#questionList').val())) {
  146. layer.msg('请选择任务');
  147. return;
  148. }
  149. dcexcel(this);
  150. })
  151. });
  152. //获取表头 和 数据
  153. function getDataLists() {
  154. $.ajax({
  155. type: "get",
  156. url: huayi.config.callcenter_url + "CallOutReport/GetColoumnBMY",
  157. dataType: 'json',
  158. data: {
  159. TaskID: $("#taskList").val(), //任务id(必选)
  160. quesid: $("#questionList").val(), //问题id(必选)
  161. token: $.cookie("token")
  162. },
  163. success: function(data) {
  164. $("#Task thead").empty();
  165. if(data.state.toLowerCase() == "success") {
  166. data = data.data;
  167. if(data && data.length > 0) {
  168. var $tr = $('<tr></tr>');
  169. for(var i = 0; i < data.length; i++) {
  170. $tr.append('<td>' + data[i] + '</td>');
  171. $("#Task thead").append($tr);
  172. }
  173. }
  174. }
  175. }
  176. })
  177. .then(function() {
  178. $.ajax({
  179. type: "get",
  180. url: huayi.config.callcenter_url + "CallOutReport/GetReportBMY",
  181. dataType: 'json',
  182. data: {
  183. TaskID: $("#taskList").val(), //任务id(必选)
  184. quesid: $("#questionList").val(), //问题id(必选)
  185. ansids: $("#optionsList").val() && $("#optionsList").val().join(','), //选项id(多选,默认可以不选,随着选中的问题id做联动)
  186. sdate: $("#stime").val() && $("#stime").val().split(' ~ ')[0], // 开始时间
  187. edate: $("#stime").val() && $("#stime").val().split(' ~ ')[1], // 结束时间
  188. token: $.cookie("token")
  189. },
  190. success: function(data) {
  191. $(".thTable tbody").empty();
  192. if(data.state.toLowerCase() == "success") {
  193. data = data.data;
  194. if(data && data.length > 0) {
  195. for(var i = 0; i < data.length; i++) {
  196. $('<tr><td>' + data[i].name + ' </td>' +
  197. '<td> ' + data[i].phone + ' </td>' +
  198. '<td> ' + data[i].answer + ' </td>' +
  199. '</tr>').appendTo(".hwbb tbody");
  200. }
  201. } else {
  202. $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
  203. }
  204. } else {
  205. $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
  206. }
  207. }
  208. });
  209. });
  210. }
  211. function dcexcel(obj) {
  212. var url = huayi.config.callcenter_url + "CallOutReport/GetReportBMYExpt?token=" + $.cookie("token");
  213. url += "&TaskID=" + $("#taskList").val();
  214. url += "&quesid=" + $("#questionList").val();
  215. url += "&ansids=" + ($("#optionsList").val() && $("#optionsList").val().join(','));
  216. url += "&sdate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[0]); // string 否 开始时间
  217. url += "&edate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[1]); // string 否 开始时间
  218. obj.href = url;
  219. }
  220. //任务列表 问题列表 问题选项 三级联动
  221. function getProLocations(obj, obj1, obj2) {
  222. obj.empty();
  223. obj1.empty();
  224. obj2.empty();
  225. obj.append('<option selected="selected" value="">全部</option>');
  226. obj1.append('<option selected="selected" value="0">请选择问题</option>');
  227. obj2.append('<option selected="selected" value="">请选择选项</option>');
  228. $.ajax({
  229. type: "get",
  230. url: huayi.config.callcenter_url + "CallOutReport/GetTaskDDL",
  231. dataType: 'json',
  232. data: {
  233. token: $.cookie('token')
  234. },
  235. success: function(data) {
  236. var content = data.data; //任务列表
  237. //初始化 任务列表
  238. if(content && content.length > 0) {
  239. $(content).each(function(i, n) {
  240. $("<option value='" + n.F_TaskID + "'>" + n.F_TaskName + "</option>").appendTo(obj);
  241. });
  242. obj.selectpicker('refresh');
  243. }
  244. //问题列表
  245. obj.change(function() {
  246. obj1.empty();
  247. //获取问题列表
  248. $.ajax({
  249. type: "get",
  250. url: huayi.config.callcenter_url + "CallOutReport/GetQuesDDL",
  251. dataType: 'json',
  252. data: {
  253. taskid: obj.val(), //任务id(默认显示全部)
  254. token: $.cookie("token")
  255. },
  256. success: function(data) {
  257. if(data.state.toLowerCase() == "success") {
  258. var Count = data.data;
  259. if(Count && Count.length > 0) {
  260. for(var i = 0; i < Count.length; i++) {
  261. $(Count[i]).each(function(j, v) {
  262. $("<option value='" + v.F_QuestionId + "'>" + v.F_Title + "</option>").appendTo(obj1);
  263. });
  264. }
  265. }
  266. obj1.selectpicker('refresh');
  267. obj1.trigger('change');
  268. }
  269. }
  270. });
  271. });
  272. //选项
  273. obj1.change(function() {
  274. obj2.empty();
  275. //获取选项列表
  276. $.ajax({
  277. type: "get",
  278. url: huayi.config.callcenter_url + "CallOutReport/GetQuesItemDDL",
  279. dataType: 'json',
  280. data: {
  281. quesid: obj1.val(), //问题id(需选中问题后显示)
  282. token: $.cookie("token")
  283. },
  284. success: function(data) {
  285. if(data.state.toLowerCase() == "success") {
  286. var Count = data.data;
  287. if(Count && Count.length > 0) {
  288. for(var i = 0; i < Count.length; i++) {
  289. $(Count[i]).each(function(j, v) {
  290. $("<option value='" + v.F_ItemId + "'>" + v.F_ItemName + "</option>").appendTo(obj2);
  291. });
  292. }
  293. obj2.selectpicker('refresh');
  294. }
  295. }
  296. }
  297. });
  298. });
  299. },
  300. });
  301. }
  302. </script>
  303. </body>
  304. </html>