Aucune description

detailReportForm.html 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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: #00479D;
  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" 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: '#00479D',
  124. });
  125. // getDataLists();
  126. $(".seach").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($('#questionList').val())) {
  142. layer.msg('请选择任务');
  143. return;
  144. }
  145. dcexcels(this);
  146. })
  147. });
  148. //获取表头 和 数据
  149. function getDataLists() {
  150. $.ajax({
  151. type: "get",
  152. url: huayi.config.callcenter_url + "CallOutReport/GetColoumnBMY",
  153. dataType: 'json',
  154. data: {
  155. TaskID: $("#taskList").val(), //任务id(必选)
  156. quesid: $("#questionList").val(), //问题id(必选)
  157. token: $.cookie("token")
  158. },
  159. success: function(data) {
  160. $("#Task thead").empty();
  161. if(data.state.toLowerCase() == "success") {
  162. data = data.data;
  163. if(data && data.length > 0) {
  164. var $tr = $('<tr></tr>');
  165. for(var i = 0; i < data.length; i++) {
  166. $tr.append('<td>' + data[i] + '</td>');
  167. $("#Task thead").append($tr);
  168. }
  169. }
  170. }
  171. }
  172. })
  173. .then(function() {
  174. $.ajax({
  175. type: "get",
  176. url: huayi.config.callcenter_url + "CallOutReport/GetReportBMY",
  177. dataType: 'json',
  178. data: {
  179. TaskID: $("#taskList").val(), //任务id(必选)
  180. quesid: $("#questionList").val(), //问题id(必选)
  181. ansids: $("#optionsList").val() && $("#optionsList").val().join(','), //选项id(多选,默认可以不选,随着选中的问题id做联动)
  182. sdate: $("#stime").val() && $("#stime").val().split(' ~ ')[0], // 开始时间
  183. edate: $("#stime").val() && $("#stime").val().split(' ~ ')[1], // 结束时间
  184. token: $.cookie("token")
  185. },
  186. success: function(data) {
  187. $(".thTable tbody").empty();
  188. if(data.state.toLowerCase() == "success") {
  189. data = data.data;
  190. if(data && data.length > 0) {
  191. for(var i = 0; i < data.length; i++) {
  192. $('<tr><td>' + data[i].name + ' </td>' +
  193. '<td> ' + data[i].phone + ' </td>' +
  194. '<td> ' + data[i].answer + ' </td>' +
  195. '</tr>').appendTo(".hwbb tbody");
  196. }
  197. } else {
  198. $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
  199. }
  200. } else {
  201. $(".thTable tbody").html('<p class="text-center">没有找到您想要的记录呢!我会努力的...</p>');
  202. }
  203. }
  204. });
  205. });
  206. }
  207. function dcexcels(obj) {
  208. var url = huayi.config.callcenter_url + "CallOutReport/GetReportBMYExpt?token=" + $.cookie("token");
  209. url += "&TaskID=" + $("#taskList").val();
  210. url += "&quesid=" + $("#questionList").val();
  211. url += "&ansids=" + ($("#optionsList").val() && $("#optionsList").val().join(','));
  212. url += "&sdate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[0]); // string 否 开始时间
  213. url += "&edate=" + ($("#stime").val() && $("#stime").val().split(' ~ ')[1]); // string 否 开始时间
  214. obj.href = url;
  215. }
  216. //任务列表 问题列表 问题选项 三级联动
  217. function getProLocations(obj, obj1, obj2) {
  218. obj.empty();
  219. obj1.empty();
  220. obj2.empty();
  221. obj.append('<option selected="selected" value="">全部</option>');
  222. obj1.append('<option selected="selected" value="0">请选择问题</option>');
  223. obj2.append('<option selected="selected" value="">请选择选项</option>');
  224. $.ajax({
  225. type: "get",
  226. url: huayi.config.callcenter_url + "CallOutReport/GetTaskDDL",
  227. dataType: 'json',
  228. data: {
  229. token: $.cookie('token')
  230. },
  231. success: function(data) {
  232. var content = data.data; //任务列表
  233. //初始化 任务列表
  234. if(content && content.length > 0) {
  235. $(content).each(function(i, n) {
  236. $("<option value='" + n.F_TaskID + "'>" + n.F_TaskName + "</option>").appendTo(obj);
  237. });
  238. obj.selectpicker('refresh');
  239. }
  240. //问题列表
  241. obj.change(function() {
  242. obj1.empty();
  243. //获取问题列表
  244. $.ajax({
  245. type: "get",
  246. url: huayi.config.callcenter_url + "CallOutReport/GetQuesDDL",
  247. dataType: 'json',
  248. data: {
  249. taskid: obj.val(), //任务id(默认显示全部)
  250. token: $.cookie("token")
  251. },
  252. success: function(data) {
  253. if(data.state.toLowerCase() == "success") {
  254. var Count = data.data;
  255. if(Count && Count.length > 0) {
  256. for(var i = 0; i < Count.length; i++) {
  257. $(Count[i]).each(function(j, v) {
  258. $("<option value='" + v.F_QuestionId + "'>" + v.F_Title + "</option>").appendTo(obj1);
  259. });
  260. }
  261. }
  262. obj1.selectpicker('refresh');
  263. obj1.trigger('change');
  264. }
  265. }
  266. });
  267. });
  268. //选项
  269. obj1.change(function() {
  270. obj2.empty();
  271. //获取选项列表
  272. $.ajax({
  273. type: "get",
  274. url: huayi.config.callcenter_url + "CallOutReport/GetQuesItemDDL",
  275. dataType: 'json',
  276. data: {
  277. quesid: obj1.val(), //问题id(需选中问题后显示)
  278. token: $.cookie("token")
  279. },
  280. success: function(data) {
  281. if(data.state.toLowerCase() == "success") {
  282. var Count = data.data;
  283. if(Count && Count.length > 0) {
  284. for(var i = 0; i < Count.length; i++) {
  285. $(Count[i]).each(function(j, v) {
  286. $("<option value='" + v.F_ItemId + "'>" + v.F_ItemName + "</option>").appendTo(obj2);
  287. });
  288. }
  289. obj2.selectpicker('refresh');
  290. }
  291. }
  292. }
  293. });
  294. });
  295. },
  296. });
  297. }
  298. </script>
  299. </body>
  300. </html>