周口人民医院呼叫中心前端

detailReportForm.html 9.3KB

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